[symfony-users] Re: sfConfig::get('sf_app_module_dir') inside a pake task

2007-08-22 Thread Fabien POTENCIER

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 symfony-users@googlegroups.com
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
-~--~~~~--~~--~--~---



[symfony-users] Re: sfConfig::get('sf_app_module_dir') inside a pake task

2007-08-22 Thread Olivier Revollat
OK it works !!
Merci Fabien.

Je profite de l'occasion pour te dire que j'apprécie énormément ton
framework ... un travaille colossale qui à été extrêmement bien pensé. Bravo
;)


2007/8/22, Fabien POTENCIER [EMAIL PROTECTED]:


 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 symfony-users@googlegroups.com
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
-~--~~~~--~~--~--~---