当前位置: 首页>>代码示例>>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;未经允许,请勿转载。