In your batch, before initializing the database, you need to load th
symfony configuration:
define('SF_ROOT_DIR', realpath(dirname(__file__).'/..'));
define('SF_APP', 'frontend');
define('SF_ENVIRONMENT', 'dev');
define('SF_DEBUG', true);
require_once(SF_ROOT_DIR.DIRECTORY_SEPARATOR.'apps'.DIRECTORY_SEPARATOR.SF_APP.DIRECTORY_SEPARATOR.'config'.DIRECTORY_SEPARATOR.'config.php');
Fabien
Olivier Revollat wrote:
> When I try to initialize the database connexion inside a pake task, I do
> this :
>
>
> pake_task('tirage','app_exists');
> function run_tirage($task, $args)
> {
> $app = $args[0];
> $databaseManager = new sfDatabaseManager();
> $databaseManager->initialize();
> }
>
> Then I call "symfony.bat tirage admin" But I get this error :
>
>
> [sfConfigurationException]
>
>
> Module directory "C:\[...]\symfony_private\apps\\modules" does not
> exist or is not readable
> (notice the double '\', it's like my task doesn't know the application
> name ...)
>
> The problem occure during the call of
>
> sfConfig::get('sf_app_module_dir')
>
> And I don't know why the previous code returns :
> "C:\[...]\symfony_private\apps\\modules"
> instead of :
> "C:\[...]\symfony_private\apps\admin\modules"
>
> ??? any ideas ?? thanks ;)
>
>
> >
--~--~---------~--~----~------------~-------~--~----~
You received this message because you are subscribed to the Google Groups
"symfony users" group.
To post to this group, send email to [email protected]
To unsubscribe from this group, send email to [EMAIL PROTECTED]
For more options, visit this group at
http://groups.google.com/group/symfony-users?hl=en
-~----------~----~----~----~------~----~------~--~---