当前位置: 首页>>代码示例>>PHP>>正文


PHP Plugin::loadAll方法代码示例

本文整理汇总了PHP中Cake\Core\Plugin::loadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP Plugin::loadAll方法的具体用法?PHP Plugin::loadAll怎么用?PHP Plugin::loadAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在Cake\Core\Plugin的用法示例。


在下文中一共展示了Plugin::loadAll方法的11个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。

示例1:

 *
 * Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']);
 * Inflector::rules('irregular', ['red' => 'redlings']);
 * Inflector::rules('uninflected', ['dontinflectme']);
 * Inflector::rules('transliteration', ['/å/' => 'aa']);
 */
/**
 * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
 * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
 * advanced ways of loading plugins
 *
 * Plugin::loadAll(); // Loads all plugins at once
 * Plugin::load('Migrations'); //Loads a single plugin named Migrations
 *
 */
Plugin::loadAll();
// Only try to load DebugKit in development mode
// Debug Kit should not be installed on a production system
if (Configure::read('debug')) {
    Plugin::load('DebugKit', ['bootstrap' => true]);
}
/**
 * Connect middleware/dispatcher filters.
 */
DispatcherFactory::add('Asset');
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
/**
 * Enable default locale format parsing.
 * This is needed for matching the auto-localized string output of Time() class when parsing dates.
 */
开发者ID:sebbdk,项目名称:botcraft,代码行数:31,代码来源:bootstrap.php

示例2: finder_access

<?php

use Cake\Core\Plugin;
use Cake\Core\Configure;
use Cake\Routing\Router;
Plugin::loadAll([['ignoreMissing' => true, 'bootstrap' => true], 'Editorial/Core' => ['routes' => true]]);
Configure::write('Summernote.elFinder', ['debug' => false, 'roots' => [['primary' => true, 'driver' => 'LocalFileSystem', 'alias' => __('Uploads folder'), 'path' => ROOT . DS . Configure::read('App.webroot') . DS . 'files' . DS, 'URL' => Router::url('/', true) . 'files/', 'uploadDeny' => array('all'), 'uploadAllow' => array('image', 'text/plain'), 'uploadOrder' => array('deny', 'allow'), 'accessControl' => 'finder_access']]]);
function finder_access($attr, $path, $data, $volume)
{
    return strpos(basename($path), '.') === 0 ? !($attr == 'read' || $attr == 'write') : null;
    // else elFinder decide it itself
}
开发者ID:mindforce,项目名称:cakephp-editorial-summernote,代码行数:12,代码来源:bootstrap.php

示例3: testLoadAllWithDefaultsAndOverride

 /**
  * Tests that Plugin::loadAll() will load all plgins in the configured folder wit defaults
  * and overrides for a plugin
  *
  * @return void
  */
 public function testLoadAllWithDefaultsAndOverride()
 {
     Plugin::loadAll(array(array('bootstrap' => true, 'ignoreMissing' => true), 'TestPlugin' => array('routes' => true)));
     Plugin::routes();
     $expected = ['Company', 'PluginJs', 'TestPlugin', 'TestPluginTwo'];
     $this->assertEquals($expected, Plugin::loaded());
     $this->assertEquals('loaded js plugin bootstrap', Configure::read('PluginTest.js_plugin.bootstrap'));
     $this->assertEquals('loaded plugin routes', Configure::read('PluginTest.test_plugin.routes'));
     $this->assertEquals(null, Configure::read('PluginTest.test_plugin.bootstrap'));
     $this->assertEquals('loaded plugin two bootstrap', Configure::read('PluginTest.test_plugin_two.bootstrap'));
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:17,代码来源:PluginTest.php

示例4:

<?php

/**
 * Licensed under The MIT License
 * For full copyright and license information, please see the LICENSE.txt
 * Redistributions of files must retain the above copyright notice.
 *
 * @copyright     Copyright (c) MindForce Team (http://mindforce.me)
 * @link          http://mindforce.me Garderobe Jquery Plugin
 * @since         0.0.1
 * @license       http://www.opensource.org/licenses/mit-license.php MIT License
 */
use Cake\Core\Configure;
use Cake\Core\Plugin;
Plugin::loadAll([['ignoreMissing' => true, 'bootstrap' => true, 'routes' => true], 'Garderobe/Core']);
Configure::write('Garderobe.Plugin.Jquery', ['name' => 'Garderobe/Jquery']);
开发者ID:mindforce,项目名称:cakephp-garderobe-jquery,代码行数:16,代码来源:bootstrap.php

示例5: testThatHelperHelpersAreNotAttached

 /**
  * test that a helpers Helper is not 'attached' to the collection
  *
  * @return void
  */
 public function testThatHelperHelpersAreNotAttached()
 {
     Plugin::loadAll();
     $events = $this->getMock('\\Cake\\Event\\EventManager');
     $this->View->setEventManager($events);
     $events->expects($this->never())->method('attach');
     $Helper = new TestHelper($this->View);
     $Helper->OtherHelper;
 }
开发者ID:ripzappa0924,项目名称:carte0.0.1,代码行数:14,代码来源:HelperTest.php

示例6:

<?php

/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright     Copyright (c) Mindforce Team (http://mindforce.me)
* @link          http://mindforce.me RearEngine CakePHP 3 Plugin
* @since         0.0.1
* @license       http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Cake\Core\Configure;
use Cake\Database\Type;
use Cake\Core\App;
use Cake\Event\EventManager;
use Cake\Core\Plugin;
Plugin::loadAll([['ignoreMissing' => true, 'bootstrap' => true, 'routes' => true], 'Platform', 'Garderobe/Bootstrap3', 'Garderobe/BootstrapKit', 'PlumSearch', 'Search']);
// Setup RearEngine as theme does not provide layout and view overriding
// so we just add it as additional templates path
Configure::write('App.paths.templates', array_merge([APP . 'Template' . DS . 'Plugin' . DS . 'RearEngine' . DS], App::path('Template', 'RearEngine'), App::path('Template')));
Configure::write('Routing.prefixes', ['admin']);
EventManager::instance()->attach(new RearEngine\Event\CoreEvent(), null, ['priority' => 2]);
开发者ID:mindforce,项目名称:cakephp-rear-engine,代码行数:23,代码来源:bootstrap.php

示例7:

 *
 * Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']);
 * Inflector::rules('irregular', ['red' => 'redlings']);
 * Inflector::rules('uninflected', ['dontinflectme']);
 * Inflector::rules('transliteration', ['/å/' => 'aa']);
 */
/**
 * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
 * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
 * advanced ways of loading plugins
 *
 * Plugin::loadAll(); // Loads all plugins at once
 * Plugin::load('Migrations'); //Loads a single plugin named Migrations
 *
 */
Plugin::loadAll(['Admin' => ['bootstrap' => false, 'routes' => true, 'ignoreMissing' => true], 'System' => ['bootstrap' => false, 'routes' => true, 'ignoreMissing' => true], 'Api' => ['bootstrap' => false, 'routes' => true, 'ignoreMissing' => true], 'Page' => ['bootstrap' => false, 'routes' => true, 'ignoreMissing' => true], 'Social' => ['bootstrap' => false, 'routes' => true, 'ignoreMissing' => true], 'Setting' => ['bootstrap' => false, 'routes' => true, 'ignoreMissing' => true]]);
Plugin::load('Migrations');
// Only try to load DebugKit in development mode
// Debug Kit should not be installed on a production system
if (Configure::read('debug')) {
    Plugin::load('DebugKit', ['bootstrap' => true]);
}
/**
 * Connect middleware/dispatcher filters.
 */
DispatcherFactory::add('Asset');
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
/**
 * Enable default locale format parsing.
 * This is needed for matching the auto-localized string output of Time() class when parsing dates.
开发者ID:nguyennghiem1205,项目名称:Wss,代码行数:31,代码来源:bootstrap.php

示例8: testLoadAllWithDefaultsAndOverride

 /**
  * Tests that Plugin::loadAll() will load all plugins in the configured folder wit defaults
  * and overrides for a plugin
  *
  * @return void
  */
 public function testLoadAllWithDefaultsAndOverride()
 {
     Plugin::loadAll([['bootstrap' => true, 'ignoreMissing' => true], 'TestPlugin' => ['routes' => true], 'TestPluginFour' => ['bootstrap' => true, 'classBase' => '']]);
     Plugin::routes();
     $expected = ['Company', 'PluginJs', 'TestPlugin', 'TestPluginFour', 'TestPluginTwo', 'TestTheme'];
     $this->assertEquals($expected, Plugin::loaded());
     $this->assertEquals('loaded js plugin bootstrap', Configure::read('PluginTest.js_plugin.bootstrap'));
     $this->assertEquals('loaded plugin routes', Configure::read('PluginTest.test_plugin.routes'));
     $this->assertEquals(null, Configure::read('PluginTest.test_plugin.bootstrap'));
     $this->assertEquals('loaded plugin two bootstrap', Configure::read('PluginTest.test_plugin_two.bootstrap'));
     $this->assertEquals('loaded plugin four bootstrap', Configure::read('PluginTest.test_plugin_four.bootstrap'));
     // TestPluginThree won't get loaded by loadAll() since it's in a sub directory.
     $this->assertEquals(null, Configure::read('PluginTest.test_plugin_three.bootstrap'));
 }
开发者ID:rashmi,项目名称:newrepo,代码行数:20,代码来源:PluginTest.php

示例9:

<?php

/**
* Licensed under The MIT License
* For full copyright and license information, please see the LICENSE.txt
* Redistributions of files must retain the above copyright notice.
*
* @copyright     Copyright (c) Mindforce Team (http://mindforce.me)
* @link          http://mindforce.me FrontEngine CakePHP 3 Plugin
* @since         0.0.1
* @license       http://www.opensource.org/licenses/mit-license.php MIT License
*/
use Cake\Event\EventManager;
use Cake\Core\Plugin;
Plugin::loadAll([['ignoreMissing' => true, 'bootstrap' => true, 'routes' => true], 'Garderobe/Bootstrap3', 'RearEngine']);
EventManager::instance()->attach(new FrontEngine\Event\CoreEvent(), null, ['priority' => 2]);
开发者ID:mindforce,项目名称:cakephp-front-engine,代码行数:16,代码来源:bootstrap.php

示例10:

 * Inflector::rules('uninflected', ['dontinflectme']);
 * Inflector::rules('transliteration', ['/å/' => 'aa']);
 */
/**
 * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
 * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
 * advanced ways of loading plugins
 *
 * Plugin::loadAll(); // Loads all plugins at once
 * Plugin::load('Migrations'); //Loads a single plugin named Migrations
 *
 */
Plugin::load('Migrations');
// Only try to load DebugKit in development mode
// Debug Kit should not be installed on a production system
if (Configure::read('debug')) {
    Plugin::load('DebugKit', ['bootstrap' => true]);
}
/**
 * Connect middleware/dispatcher filters.
 */
DispatcherFactory::add('Asset');
DispatcherFactory::add('Routing');
DispatcherFactory::add('ControllerFactory');
/**
 * Enable default locale format parsing.
 * This is needed for matching the auto-localized string output of Time() class when parsing dates.
 */
Type::build('datetime')->useLocaleParser();
Plugin::loadAll(['Block' => ['bootstrap' => true, 'routes' => false], 'CMS' => ['bootstrap' => true], 'Menu' => ['bootstrap' => true, 'routes' => false]]);
开发者ID:TranBinhLuan,项目名称:junzeron,代码行数:30,代码来源:bootstrap.php

示例11:

 */
Type::build('time')->useImmutable();
Type::build('date')->useImmutable();
Type::build('datetime')->useImmutable();
/*
 * Custom Inflector rules, can be set to correctly pluralize or singularize
 * table, model, controller names or whatever other string is passed to the
 * inflection functions.
 */
//Inflector::rules('plural', ['/^(inflect)or$/i' => '\1ables']);
//Inflector::rules('irregular', ['red' => 'redlings']);
//Inflector::rules('uninflected', ['dontinflectme']);
//Inflector::rules('transliteration', ['/å/' => 'aa']);
/*
 * Plugins need to be loaded manually, you can either load them one by one or all of them in a single call
 * Uncomment one of the lines below, as you need. make sure you read the documentation on Plugin to use more
 * advanced ways of loading plugins
 *
 * Plugin::loadAll(); // Loads all plugins at once
 * Plugin::load('Migrations'); //Loads a single plugin named Migrations
 *
 */
/*
 * Only try to load DebugKit in development mode
 * Debug Kit should not be installed on a production system
 */
if (Configure::read('debug')) {
    Plugin::load('DebugKit', ['bootstrap' => true]);
}
Plugin::loadAll(['routes' => true]);
include "cakeblog-config.php";
开发者ID:gwhitcher,项目名称:cakeblog,代码行数:31,代码来源:bootstrap.php


注:本文中的Cake\Core\Plugin::loadAll方法示例由纯净天空整理自Github/MSDocs等开源代码及文档管理平台,相关代码片段筛选自各路编程大神贡献的开源项目,源码版权归原作者所有,传播和使用请参考对应项目的License;未经允许,请勿转载。