Yawd website

Articles Tagged php

  1. Use of classes and static variables with the Drupal 6 Batch API

    Drupal provides a nice API for anyone that needs to process a massive amount of data: the Batch API. This allows for running heavy scripts split into multiple operations while providing a progress bar to monitor the process' progress. However this API is not adequately documented and I had a hard time trying to resolve some issues I come across. I thought of sharing my findings in case someone else needs this.

    Posted on July 13th, 2011 by Pantelis Petridis
  2. How to automatically add taxonomy term relations when adding content in Drupal 7

    Let's suppose we want our Drupal article content type to have a parent category and a sub-category. We have defined a 'categories' vocabulary and we are also able to add new terms and set their parent elements. When using the administration UI to add a new article we can create a new category, set a new sub-category and both taxonomy terms will be saved along with the article. However, the sub-category won't be connected with its parent category automatically. We need to manually visit the taxonomy terms list and set the sub-category's parent category term.

    This is a problem I came across when working on a yawd project and to solve it I had to create a simple module that programmatically correlates the sub-category with its parent category field...

    Posted on June 29th, 2011 by Pantelis Petridis
  3. Keystone TKL framework for Digital Libraries now supports PHP5

    The past few years IndexData's Keystone Library framework has not been actively developed. When PHP5 was introduced back in 2004 it featured a completely redesigned Document Object Model (DOM) implementation that lacked backward-compatibility. At the same time, Keystone was heavily relying on XML manipulation, so it was not possible for these two to work together and Keystone users were forced to use PHP 4. IndexData at the time focused on other projects and officially stopped...
    Posted on June 24th, 2011 by Pantelis Petridis
  4. Scan additional PHP 5 .ini files in Eclipse PDT

    Although Windows systems seem to load all PHP 5 variables & extensions from a single php.ini file, there might be system configurations -especially Linux systems (Ubuntu in my case)- that use multiple .ini files. In such systems, PHP configuration is usually located inside the /etc/php5 directory: When running in cli mode, /etc/php5/cli/php.ini gets loaded along with all .ini files located in the /var/php5/cli/conf.d directory.. When using Apache, /etc/php5/apache2/php.ini and /etc/php5/apache2/conf.d/*.ini files are all loaded. The same is true for php-cgi. To load the additional .ini files, either a PHP_INI_SCAN_DIR environmental variable or the --with-config-file-path option can be used. So far so good.

    When it comes to Eclipse PDT, it seems that the additional .ini files are not loaded when PHP runs as script...

    Posted on June 16th, 2011 by Pantelis Petridis