• 17Dec

    In Symfony Framework, there is a pagination class written for Propel Database Abstraction Library: sfPropelPager.

    Generally, that class works fine but unfortunately, there will be a serious problem when you call addGroupByColumn method by the Criteria which is passed to sfPropelPager class. As you can see, there won’t be Group By part in count statement anyway. Thus, results and pages will never be matched.

  • 03Dec

    A good friend of mine just told me that it’s really hard to find useful documentation about batch processing with Symfony Framework. You can find here everything you need! Please follow the instructions below:

    symfony init-batch default [MyBatch] [MyApplication]

    init-batch command will create a batch file into batch folder which is located in your Symfony project folder. When you open the file with a text editor, you’ll see something like that:

    <?php

    /**
    * test batch script
    *
    * Here goes a brief description of the purpose of the batch script
    *
    * @package    project
    * @subpackage batch
    * @version    $Id$
    */

    define(’SF_ROOT_DIR’,    realpath(dirname(__file__).’/..’));
    define(’SF_APP’,         ‘app’);
    define(’SF_ENVIRONMENT’, ‘dev’);
    define(’SF_DEBUG’,       1);

    require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.’apps’.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.’config’.DIRECTORY_SEPARATOR.’config.php’);

    // initialize database manager
    //$databaseManager = new sfDatabaseManager();
    //$databaseManager->initialize();

    // batch process here

    Now, you can put your own codes after the line which is containing ‘batch process here’. Eventually, you can run your script on CLI.

  • 20Nov

    There are two different stable package for Symfony

    If you want to install 1.0 please follow these instructions:

    • $ pear channel-discover pear.symfony-project.com
    • $ pear install symfony/symfony-1.0.18

    For new version, these instructions will help:

    • $ pear channel-discover pear.symfony-project.com
    • $ pear install symfony/symfony-1.1.5

    Please, be sure you already installed php-pear library.

    Updated: Symfony 1.2.0 is stable now!

    • $ pear channel-discover pear.symfony-project.com
    • $ pear install symfony/symfony-1.2.0