Op Tuesday 26 May 2009 11:21:45 schreef umpirsky: > Hi to all. > > I have Zend framework app created by Zend Tool, with default project > structure (1.8). I use models, and my library, everithing is set up, > autoload.. My bootstrap file: > > class Bootstrap extends Zend_Application_Bootstrap_Bootstrap { > protected function _initAutoload() { > return new Zend_Application_Module_Autoloader(array( > 'namespace' => 'Default_', > 'basePath' => dirname(__FILE__), > )); > } > protected function _initDb() { > $db = $this->getPluginResource('db'); > > // Debug SQL > if ('testing' == APPLICATION_ENV || 'development' == > APPLICATION_ENV) { > $profiler = new Zend_Db_Profiler_Firebug('All Database > Queries:'); > $profiler->setEnabled(true); > $db->getDbAdapter()->setProfiler($profiler); > } > > Zend_Db_Table_Abstract::setDefaultAdapter($db->getDbAdapter()); > return $db; > } > } > > index.php is more or less default.. > > The question is: is there any way to use Zend_Application_Bootstrap and all > this classes to easily setup autoload, db, models for command line > interface so I can run cronjob easily? > > Regards, > Saša Stamenković
What about a cron.php which instantiates the Zend_Application like index.php. You boostrap the application, but before running you configure the router to execute only a specific module/controller/action. This configuration could be a variety of options (directly, through an additional controller plugin, or maybe an application resource). Regards, Jurian -- Jurian Sluiman Soflomo.com