當前位置: 首頁>>代碼示例>>PHP>>正文


PHP PluginManager::noInit方法代碼示例

本文整理匯總了PHP中System\Classes\PluginManager::noInit方法的典型用法代碼示例。如果您正苦於以下問題:PHP PluginManager::noInit方法的具體用法?PHP PluginManager::noInit怎麽用?PHP PluginManager::noInit使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在System\Classes\PluginManager的用法示例。


在下文中一共展示了PluginManager::noInit方法的2個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。

示例1: registerPrivilegedActions

 /**
  * Check for CLI or system/updates route and disable any plugin initialization
  */
 protected function registerPrivilegedActions()
 {
     $requests = ['/combine', '@/system/updates', '@/system/install', '@/backend/auth'];
     $commands = ['october:up', 'october:update'];
     /*
      * Requests
      */
     $path = RouterHelper::normalizeUrl(Request::path());
     $backendUri = RouterHelper::normalizeUrl(Config::get('cms.backendUri', 'backend'));
     foreach ($requests as $request) {
         if (substr($request, 0, 1) == '@') {
             $request = $backendUri . substr($request, 1);
         }
         if (stripos($path, $request) === 0) {
             PluginManager::$noInit = true;
         }
     }
     /*
      * CLI
      */
     if (App::runningInConsole() && count(array_intersect($commands, Request::server('argv'))) > 0) {
         PluginManager::$noInit = true;
     }
 }
開發者ID:GeGeek,項目名稱:october,代碼行數:27,代碼來源:ServiceProvider.php

示例2: register

 /**
  * Register the service provider.
  *
  * @return void
  */
 public function register()
 {
     /*
      * Register self
      */
     parent::register('system');
     /*
      * Register core providers
      */
     App::register('October\\Rain\\Config\\ConfigServiceProvider');
     App::register('October\\Rain\\Translation\\TranslationServiceProvider');
     /*
      * Define path constants
      */
     if (!defined('PATH_APP')) {
         define('PATH_APP', app_path());
     }
     if (!defined('PATH_BASE')) {
         define('PATH_BASE', base_path());
     }
     if (!defined('PATH_PUBLIC')) {
         define('PATH_PUBLIC', public_path());
     }
     if (!defined('PATH_STORAGE')) {
         define('PATH_STORAGE', storage_path());
     }
     if (!defined('PATH_PLUGINS')) {
         define('PATH_PLUGINS', base_path() . Config::get('cms.pluginsDir', '/plugins'));
     }
     /*
      * Register singletons
      */
     App::singleton('string', function () {
         return new \October\Rain\Support\Str();
     });
     App::singleton('backend.helper', function () {
         return new \Backend\Classes\BackendHelper();
     });
     App::singleton('backend.menu', function () {
         return \Backend\Classes\NavigationManager::instance();
     });
     App::singleton('backend.auth', function () {
         return \Backend\Classes\AuthManager::instance();
     });
     /*
      * Check for CLI or system/updates route and disable any plugin initialization
      * @todo This should be moved to middleware
      */
     $requestPath = \October\Rain\Router\Helper::normalizeUrl(\Request::path());
     $systemPath = \October\Rain\Router\Helper::normalizeUrl(Config::get('cms.backendUri') . '/system/updates');
     if (stripos($requestPath, $systemPath) === 0) {
         PluginManager::$noInit = true;
     }
     $updateCommands = ['october:up', 'october:update'];
     if (App::runningInConsole() && count(array_intersect($updateCommands, Request::server('argv'))) > 0) {
         PluginManager::$noInit = true;
     }
     /*
      * Register all plugins
      */
     $pluginManager = PluginManager::instance();
     $pluginManager->registerAll();
     /*
      * Error handling for uncaught Exceptions
      */
     App::error(function (\Exception $exception, $httpCode) {
         $handler = new ErrorHandler();
         return $handler->handleException($exception, $httpCode);
     });
     /*
      * Write all log events to the database
      */
     Event::listen('illuminate.log', function ($level, $message, $context) {
         if (!DbDongle::hasDatabase()) {
             return;
         }
         EventLog::add($message, $level);
     });
     /*
      * Register basic Twig
      */
     App::bindShared('twig', function ($app) {
         $twig = new Twig_Environment(new TwigLoader(), ['auto_reload' => true]);
         $twig->addExtension(new TwigExtension());
         return $twig;
     });
     /*
      * Register .htm extension for Twig views
      */
     App::make('view')->addExtension('htm', 'twig', function () {
         return new TwigEngine(App::make('twig'));
     });
     /*
      * Register Twig that will parse strings
      */
//.........這裏部分代碼省略.........
開發者ID:janusnic,項目名稱:OctoberCMS,代碼行數:101,代碼來源:ServiceProvider.php


注:本文中的System\Classes\PluginManager::noInit方法示例由純淨天空整理自Github/MSDocs等開源代碼及文檔管理平台,相關代碼片段篩選自各路編程大神貢獻的開源項目,源碼版權歸原作者所有,傳播和使用請參考對應項目的License;未經允許,請勿轉載。