From: <pan...@us...> - 2008-09-25 11:08:31
|
Revision: 380 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=380&view=rev Author: panzaboi Date: 2008-09-25 11:08:26 +0000 (Thu, 25 Sep 2008) Log Message: ----------- small fix (enviroment => environment) register ErrorHandler enable Dojo register Router at index -1 Modified Paths: -------------- website/library/Application.php Modified: website/library/Application.php =================================================================== --- website/library/Application.php 2008-09-25 11:06:47 UTC (rev 379) +++ website/library/Application.php 2008-09-25 11:08:26 UTC (rev 380) @@ -2,7 +2,7 @@ class Application { - protected $_enviroment; + protected $_environment; protected static $_approot; protected $_docroot; @@ -78,7 +78,7 @@ $frontController = $this->_setupFrontController(); // Setup Error Handler - $frontController->registerPlugin(new Zend_Controller_Plugin_ErrorHandler(array( + $frontController->registerPlugin(new Ostacium_Controller_Plugin_ErrorHandler(array( 'module' => $_config->auth->noacl->module, 'controller' => $_config->auth->noacl->controller, 'action' => $_config->auth->noacl->action @@ -101,7 +101,7 @@ Zend_Mail::setDefaultTransport($mail); $routerPlugin = new Ostacium_Controller_Plugin_Router($acl, $_config->auth->noauth->toArray(), $_config->auth->noacl->toArray()); - $frontController->registerPlugin($routerPlugin); + $frontController->registerPlugin($routerPlugin, -1); return $frontController; } @@ -152,6 +152,7 @@ $frontController = Zend_Controller_Front::getInstance(); $frontController->throwExceptions((bool) $_config->error->throw); + $frontController->setParam('environment', $this->_environment); $frontController->setControllerDirectory(array( 'default' => $this->_docroot . '/application/default/controllers', 'admin' => $this->_docroot . '/application/admin/controllers', @@ -176,6 +177,9 @@ // Setup Title //$view->placeholder('title')->set($_config->title); $view->headTitle($_config->title)->setSeparator($_config->titlesep); + // Setup Dojo + Zend_Dojo::enableView($view); + $viewRenderer = new Zend_Controller_Action_Helper_ViewRenderer($view); Zend_Controller_Action_HelperBroker::addHelper($viewRenderer); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2009-03-02 19:21:09
|
Revision: 519 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=519&view=rev Author: panzaboi Date: 2009-03-02 19:21:05 +0000 (Mon, 02 Mar 2009) Log Message: ----------- speed increase Modified Paths: -------------- website/library/Application.php Modified: website/library/Application.php =================================================================== --- website/library/Application.php 2009-03-02 18:45:44 UTC (rev 518) +++ website/library/Application.php 2009-03-02 19:21:05 UTC (rev 519) @@ -72,6 +72,9 @@ //Zend_Loader::registerAutoload(); spl_autoload_register(array('Application', 'autoload')); + // Use Cache + $this->_usePageCache(); + // Setup Session Zend_Session::start(); @@ -292,6 +295,32 @@ Zend_Registry::set('Zend_Log', $log); } + + protected function _usePageCache() + { + $frontendOptions = array( + 'lifetime' => 3600, + 'default_options' => array( + // disable default caching for all requests + 'cache' => true + ), + + // cache routes to Index and News controllers + /*'regexps' => array( + '^/$' => array('cache' => true), + '^/news/' => array('cache' => true) + )*/ + ); + + $cache = Zend_Cache::factory( + 'Page', + 'Apc', + $frontendOptions + ); + + // serve cached page (if it exists) and exit + $cache->start(); + } }; /*function br2nl($text) This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |
From: <pan...@us...> - 2009-03-02 18:45:49
|
Revision: 518 http://acmcontester.svn.sourceforge.net/acmcontester/?rev=518&view=rev Author: panzaboi Date: 2009-03-02 18:45:44 +0000 (Mon, 02 Mar 2009) Log Message: ----------- speed increase Modified Paths: -------------- website/library/Application.php Modified: website/library/Application.php =================================================================== --- website/library/Application.php 2009-03-01 19:43:32 UTC (rev 517) +++ website/library/Application.php 2009-03-02 18:45:44 UTC (rev 518) @@ -28,6 +28,12 @@ { return (microtime(true) - self::$_start); } + + public static function autoload($path) + { + include str_replace('_','/',$path) . '.php'; + return $path; + } public function setEnvironment($environment) { @@ -62,8 +68,9 @@ protected function _initialize() { // Auto-loader - require_once 'Zend/Loader.php'; - Zend_Loader::registerAutoload(); + //require_once 'Zend/Loader.php'; + //Zend_Loader::registerAutoload(); + spl_autoload_register(array('Application', 'autoload')); // Setup Session Zend_Session::start(); This was sent by the SourceForge.net collaborative development platform, the world's largest Open Source development site. |