本文整理汇总了PHP中Pimcore\Model\Cache::init方法的典型用法代码示例。如果您正苦于以下问题:PHP Cache::init方法的具体用法?PHP Cache::init怎么用?PHP Cache::init使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Pimcore\Model\Cache
的用法示例。
在下文中一共展示了Cache::init方法的1个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: run
/**
* @static
* @throws Exception|\Zend_Controller_Router_Exception
*/
public static function run()
{
self::setSystemRequirements();
// detect frontend (website)
$frontend = Tool::isFrontend();
// enable the output-buffer, why? see in self::outputBufferStart()
//if($frontend) {
self::outputBufferStart();
//}
self::initAutoloader();
self::initConfiguration();
self::setupFramework();
// config is loaded now init the real logger
self::initLogger();
// initialize cache
Cache::init();
// load plugins and modules (=core plugins)
self::initModules();
self::initPlugins();
// init front controller
$front = \Zend_Controller_Front::getInstance();
$conf = Config::getSystemConfig();
if (!$conf) {
// redirect to installer if configuration isn't present
if (!preg_match("/^\\/install.*/", $_SERVER["REQUEST_URI"])) {
header("Location: /install/");
exit;
}
}
if (self::inDebugMode() && $frontend && !$conf->general->disable_whoops && !defined("HHVM_VERSION")) {
$whoops = new \Whoops\Run();
$whoops->pushHandler(new \Whoops\Handler\PrettyPageHandler());
$jsonErrorHandler = new \Whoops\Handler\JsonResponseHandler();
$jsonErrorHandler->onlyForAjaxRequests(true);
$whoops->pushHandler($jsonErrorHandler);
$whoops->register();
// add event handler before Pimcore::shutdown() to ensure fatal errors are handled by Whoops
self::getEventManager()->attach("system.shutdown", array($whoops, "handleShutdown"), 10000);
}
$front->registerPlugin(new Controller\Plugin\ErrorHandler(), 1);
$front->registerPlugin(new Controller\Plugin\Maintenance(), 2);
// register general pimcore plugins for frontend
if ($frontend) {
$front->registerPlugin(new Controller\Plugin\Thumbnail(), 795);
$front->registerPlugin(new Controller\Plugin\Less(), 799);
$front->registerPlugin(new Controller\Plugin\AdminButton(), 806);
}
if (Tool::useFrontendOutputFilters(new \Zend_Controller_Request_Http())) {
$front->registerPlugin(new Controller\Plugin\HybridAuth(), 792);
$front->registerPlugin(new Controller\Plugin\QrCode(), 793);
$front->registerPlugin(new Controller\Plugin\CommonFilesFilter(), 794);
$front->registerPlugin(new Controller\Plugin\WysiwygAttributes(), 796);
$front->registerPlugin(new Controller\Plugin\Webmastertools(), 797);
$front->registerPlugin(new Controller\Plugin\Analytics(), 798);
$front->registerPlugin(new Controller\Plugin\TagManagement(), 804);
$front->registerPlugin(new Controller\Plugin\Targeting(), 805);
$front->registerPlugin(new Controller\Plugin\EuCookieLawNotice(), 807);
$front->registerPlugin(new Controller\Plugin\HttpErrorLog(), 850);
$front->registerPlugin(new Controller\Plugin\Cache(), 901);
// for caching
}
self::initControllerFront($front);
// set router
$router = $front->getRouter();
$routeAdmin = new \Zend_Controller_Router_Route('admin/:controller/:action/*', array('module' => 'admin', "controller" => "index", "action" => "index"));
$routeInstall = new \Zend_Controller_Router_Route('install/:controller/:action/*', array('module' => 'install', "controller" => "index", "action" => "index"));
$routeUpdate = new \Zend_Controller_Router_Route('admin/update/:controller/:action/*', array('module' => 'update', "controller" => "index", "action" => "index"));
$routePlugins = new \Zend_Controller_Router_Route('admin/plugin/:controller/:action/*', array('module' => 'pluginadmin', "controller" => "index", "action" => "index"));
$routeExtensions = new \Zend_Controller_Router_Route('admin/extensionmanager/:controller/:action/*', array('module' => 'extensionmanager', "controller" => "index", "action" => "index"));
$routeReports = new \Zend_Controller_Router_Route('admin/reports/:controller/:action/*', array('module' => 'reports', "controller" => "index", "action" => "index"));
$routePlugin = new \Zend_Controller_Router_Route('plugin/:module/:controller/:action/*', array("controller" => "index", "action" => "index"));
$routeWebservice = new \Zend_Controller_Router_Route('webservice/:controller/:action/*', array("module" => "webservice", "controller" => "index", "action" => "index"));
$routeSearchAdmin = new \Zend_Controller_Router_Route('admin/search/:controller/:action/*', array("module" => "searchadmin", "controller" => "index", "action" => "index"));
// website route => custom router which check for a suitable document
$routeFrontend = new Controller\Router\Route\Frontend();
$router->addRoute('default', $routeFrontend);
// only do this if not frontend => performance issue
if (!$frontend) {
$router->addRoute("install", $routeInstall);
$router->addRoute('plugin', $routePlugin);
$router->addRoute('admin', $routeAdmin);
$router->addRoute('update', $routeUpdate);
$router->addRoute('plugins', $routePlugins);
$router->addRoute('extensionmanager', $routeExtensions);
$router->addRoute('reports', $routeReports);
$router->addRoute('searchadmin', $routeSearchAdmin);
if ($conf instanceof \Zend_Config and $conf->webservice and $conf->webservice->enabled) {
$router->addRoute('webservice', $routeWebservice);
}
// check if this request routes into a plugin, if so check if the plugin is enabled
if (preg_match("@^/plugin/([^/]+)/.*@", $_SERVER["REQUEST_URI"], $matches)) {
$pluginName = $matches[1];
if (!Pimcore\ExtensionManager::isEnabled("plugin", $pluginName)) {
\Pimcore\Tool::exitWithError("Plugin is disabled. To use this plugin please enable it in the extension manager!");
}
}
//.........这里部分代码省略.........