I have cron scripts, which are runned from CLI. I bootstrapped crons like
this:

class CliBootstrap {
        /**
         * Bootstrap.
         *
         */
        public static function bootstrap() {
                define('APPLICATION_PATH', realpath(dirname(__FILE__) .
'/../application'));

                // Ensure library/ is on include_path
                set_include_path(implode(PATH_SEPARATOR, array(
                    realpath(APPLICATION_PATH . '/../library'),
                    get_include_path(),
                )));

                // Bootstrap
                require_once 'Zend/Application.php';
                $application = new Zend_Application(
                    'testing',
                    APPLICATION_PATH . '/configs/application.ini'
                );
                $application->bootstrap();
        }
}

Problem is, that 

Zend_Controller_Front::getInstance()->getParam('bootstrap')

is null in my crons, but not in my controllers. I need bootstrap to access
application config with

Zend_Controller_Front::getInstance()->getParam('bootstrap')->getOption('resources');

but it's not working in CLI mode.

How can I get config, or fix my CLI bootstrap to have it as expected?
-- 
View this message in context: 
http://zend-framework-community.634137.n4.nabble.com/Accessing-config-from-CLI-crons-tp3028218p3028218.html
Sent from the Zend Framework mailing list archive at Nabble.com.

Reply via email to