I have set up some custom symfony project-level settings in the file config/project.yml
following the suggestion in How to manage your own cross-apps/global configuration values. Following these instructions I added the line
require_once sfConfigCache::getInstance()->checkConfig('config/project.yml');
to the configure
method of my client
application's clientConfiguration.class.php
file.
I then created a new symfony task using php symfony generate:task
. In this new task I want to access the settings in the config/project.yml
file. Here is the execute portion of the task:
protected function execute($arguments = array(), $options = array()){
// initialize the database connection
$databaseManager = new sfDatabaseManager($this->configuration);
$connection = $databaseManager->getDatabase($options['connection'])->getConnection();
$configuration = ProjectConfiguration::getApplicationConfiguration('client', 'test', true);
echo sfConfig::get('project_mail_webmaster') . "\n" ;
}
However, when I run the task I get this error:
PHP Fatal error: Call to undefined method sfConfigCache::getInstance() in /opt/sfproject/apps/client/config/clientConfiguration.class.php on line 7
http://trac.symfony-project.org/wiki/HowToHandleCrossAppsConfigurationFiles