public function run() { // Lade Konfig $config = new Zend_Config_Ini(APPLICATION_PATH . '/configs/application.ini', APPLICATION_ENV); Zend_Registry::set('config', $config); // Erstelle DB Adapter $db = Zend_Db::factory($config->db); Zend_Registry::set('db', $db); Zend_Db_Table_Abstract::setDefaultAdapter(Zend_Registry::get('db')); if (APPLICATION_ENV !== 'production') { $profiler = new Zend_Db_Profiler_Firebug('All Database Queries:'); $profiler->setEnabled(true); $db->setProfiler($profiler); } $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH, 'namespace' => '')); $resourceLoader->addResourceType('plugins', 'plugins', 'Plugins'); if (PHP_SAPI != 'cli') { $front = Zend_Controller_Front::getInstance(); $front->registerPlugin(new Plugins_Stats()); if (APPLICATION_ENV == 'production') { $front->registerPlugin(new Plugins_Cache()); } } Zend_View_Helper_PaginationControl::setDefaultViewPartial('_partials/controls.phtml'); parent::run(); }
public function run() { // Cela permet d'avoir le fichier de configuration disponible depuis n'importe ou dans l'application. Zend_Registry::set('config', new Zend_Config($this->getOptions())); exit; parent::run(); }
public function run() { Zend_Registry::set("contentdir", $this->getOption('contentdir')); Zend_Registry::set("repodir", $this->getOption('repodir')); Zend_Registry::set("datadir", $this->getOption('datadir')); Zend_Registry::set("defaultbranch", $this->getOption('defaultbranch')); Zend_Registry::set("pipelinestages", $this->getOption('pipelinestages')); parent::run(); }
/** * Load controllers into service container and cache if necessary. * {@inheritdoc} */ public function run() { // Load service container if not cached or if we want to cache and cache doesn't esist if (!$this->_doCache() || $this->_doCache() && !$this->_cacheExists()) { $this->_loadControllersInContainer(); } // Cache loaded service container if we want to cache and cache doesn't already exist if ($this->_doCache() && !$this->_cacheExists()) { $this->_cacheContainer(); } parent::run(); }
public function run() { //Autoload Library classes $autoloader = Zend_Loader_Autoloader::getInstance(); $autoloader->registerNamespace('EasyCMS_'); $resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/modules/default', 'namespace' => 'App', 'resourceTypes' => array('form' => array('path' => 'forms/', 'namespace' => 'Form'), 'model' => array('path' => 'models/', 'namespace' => 'Model')))); $admin_resourceLoader = new Zend_Loader_Autoloader_Resource(array('basePath' => APPLICATION_PATH . '/modules/admin', 'namespace' => 'Admin', 'resourceTypes' => array('form' => array('path' => 'forms/', 'namespace' => 'Form')))); //Setup modules $front = $this->getResource('FrontController'); $front->addModuleDirectory(APPLICATION_PATH . '/modules'); $this->setupRoutes($front); //Load Doctrine $db_config = $this->getApplication()->getOption('database'); $db_params = $db_config['params']; $this->loadDoctrine($db_params['database_name'], $db_params['host'], $db_params['username'], $db_params['password']); //Sort out view $this->initView(); Zend_Registry::set('media_path', $this->getApplication()->getOption('media_path')); parent::run(); }
/** * Add graceful error handling to the dispatch, this will handle * errors during Front Controller dispatch. */ public function Xrun() { $errorHandling = $this->getOption('errorhandling'); try { parent::run(); } catch (Exception $exp) { if (true == (bool) $errorHandling['graceful']) { $this->__handleErrors($exp, $errorHandling['email']); } else { throw $exp; } } }
public function run() { $this->resourcesTuneup(); $this->profiler(); $this->formsTracker(); $this->setupLogicCustomer(); parent::run(); }
public function run() { Zend_Controller_Action_HelperBroker::getStaticHelper('ViewRenderer')->initView(APPLICATION_PATH . '/views/', 'Syj_View'); parent::run(); }
/** * No hook. Run the application. * * Registers the bootstrap as a FrontController Plugin and calls * beforeRun() and the parent::run(). Final as these actions are * crucial to the workings of this class. * * As long as $stackIndex is < 99 then postDispatch() becalled before the * $layout is rendered. If $stackIndex is < -80 then the controllerAfterAction() * event will be called before the $view is rendered as well. * By default the layout is called after postDispatch() while * controllerAfterAction() will be called after the rendering of the view. * * @param int $stackIndex Optional; stack index for plugins * @return void * @throws \Zend_Application_Bootstrap_Exception */ public final function run($stackIndex = null) { \MUtil_Application_EscortPlugin::register($this, $stackIndex); \MUtil_Application_EscortControllerHelper::register($this, $stackIndex); $this->beforeRun(); parent::run(); $this->responseSend(); }
/** * Override of run method to provide JSON server interface * * @return void */ public function run() { if (isset($_SERVER['HTTP_X_REQUESTED_WITH']) && $_SERVER['HTTP_X_REQUESTED_WITH'] == 'XMLHttpRequest') { // run Zend_Json_Server instead of the MVC stack $request = new Zend_Controller_Request_Http(); $info = explode('/', trim($request->getPathInfo(), '/')); $module = $info[0]; $service = $info[1]; // attach the service to the JSON-RPC server $service = $this->_loadService($module, $service); $server = new Zend_Json_Server(); $server->setClass($service); if ('GET' == $_SERVER['REQUEST_METHOD']) { // return the service map $server->setEnvelope(Zend_Json_Server_Smd::ENV_JSONRPC_2); $smd = $server->getServiceMap(); header('Content-Type: application/json'); echo $smd; return; } $server->handle(); } else { parent::run(); } }
public function run() { $resource = $this->getPluginResource('multidb'); $resource->init(); Zend_Registry::set('repository', $resource->getDb('repository')); $db = $this->getPluginResource('db'); $db->init(); $db = $db->getDbAdapter(); Zend_Registry::set("db", $db); parent::run(); }
public function run() { parent::run(); }
/** * */ public function run() { $this->init(); parent::run(); }