本文整理汇总了PHP中CakePlugin::loadAll方法的典型用法代码示例。如果您正苦于以下问题:PHP CakePlugin::loadAll方法的具体用法?PHP CakePlugin::loadAll怎么用?PHP CakePlugin::loadAll使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakePlugin
的用法示例。
在下文中一共展示了CakePlugin::loadAll方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: setUp
/**
* start test
*
* @return void
**/
public function setUp()
{
$this->Version = new MigrationVersion(array('connection' => 'test'));
$plugins = $this->plugins = App::path('plugins');
$plugins[] = dirname(dirname(dirname(__FILE__))) . DS . 'test_app' . DS . 'Plugin' . DS;
App::build(array('plugins' => $plugins), true);
CakePlugin::loadAll();
}
示例2: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'Console/Command' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS)), true);
CakePlugin::loadAll();
$out = new TestStringOutput();
$in = $this->getMock('ConsoleInput', array(), array(), '', false);
$this->Shell = $this->getMock('CommandListShell', array('in', '_stop', 'clear'), array($out, $out, $in));
}
示例3: setUp
/**
* setup
*
* @return void
*/
public function setUp()
{
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
CakePlugin::loadAll();
$reporter = new CakeBaseReporter();
$reporter->params = array('app' => false, 'plugin' => false, 'group' => false);
$coverage = array();
$this->Coverage = new HtmlCoverageReport($coverage, $reporter);
}
示例4: listFiles
public function listFiles()
{
$paths = array('app' => APP . 'Config' . DS . 'Schema' . DS);
$plugins = App::objects('plugin');
CakePlugin::loadAll();
foreach ($plugins as $plugin) {
$paths[$plugin] = App::pluginPath($plugin) . 'Config' . DS . 'Schema' . DS;
}
$fileList = array();
$folder = new Folder();
foreach ($paths as $plugin => $path) {
if ($folder->cd($path)) {
$files = $folder->find('.*\\.mwb');
if (!empty($files)) {
foreach ($files as $file) {
$pathinfo = pathinfo($file);
$fileList[] = array('name' => $plugin . '/' . $pathinfo['filename']);
}
}
}
}
return $fileList;
}
示例5: array
<?php
/* 注意这里的插件加载必须在DbLog配置前调用, 否则会出现错误 */
CakePlugin::loadAll(array('Media' => array('bootstrap' => true)));
/* 配置LogStream Writer */
App::uses('CakeLog', 'Log');
CakeLog::config('DbLog', array('engine' => 'DbLog', 'model' => 'Log'));
示例6: testRequestActionArray
/**
* test requestAction() with arrays.
*
* @return void
*/
public function testRequestActionArray()
{
App::build(array('models' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS), 'views' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS), 'controllers' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS), 'plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), true);
CakePlugin::loadAll();
$result = $this->object->requestAction(array('controller' => 'request_action', 'action' => 'test_request_action'));
$expected = 'This is a test';
$this->assertEqual($expected, $result);
$result = $this->object->requestAction(array('controller' => 'request_action', 'action' => 'another_ra_test'), array('pass' => array('5', '7')));
$expected = 12;
$this->assertEqual($expected, $result);
$result = $this->object->requestAction(array('controller' => 'tests_apps', 'action' => 'index'), array('return'));
$expected = 'This is the TestsAppsController index view ';
$this->assertEqual($expected, $result);
$result = $this->object->requestAction(array('controller' => 'tests_apps', 'action' => 'some_method'));
$expected = 5;
$this->assertEqual($expected, $result);
$result = $this->object->requestAction(array('controller' => 'request_action', 'action' => 'normal_request_action'));
$expected = 'Hello World';
$this->assertEqual($expected, $result);
$result = $this->object->requestAction(array('controller' => 'request_action', 'action' => 'paginate_request_action'));
$this->assertTrue($result);
$result = $this->object->requestAction(array('controller' => 'request_action', 'action' => 'paginate_request_action'), array('pass' => array(5), 'named' => array('param' => 'value')));
$this->assertTrue($result);
}
示例7: _setupPaths
/**
* Setup paths to test_app
*/
protected function _setupPaths()
{
App::build(array('Model' => App::pluginPath('Oven') . 'Test' . DS . 'test_app' . DS . 'Model' . DS, 'Controller' => App::pluginPath('Oven') . 'Test' . DS . 'test_app' . DS . 'Controller' . DS, 'View' => App::pluginPath('Oven') . 'Test' . DS . 'test_app' . DS . 'View' . DS), App::RESET);
CakePlugin::loadAll();
}
示例8: testConnectDefaultRoutes
/**
* test that the required default routes are connected.
*
* @return void
*/
public function testConnectDefaultRoutes()
{
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), true);
CakePlugin::loadAll();
Router::reload();
require CAKE . 'Config' . DS . 'routes.php';
$result = Router::url(array('plugin' => 'plugin_js', 'controller' => 'js_file', 'action' => 'index'));
$this->assertEquals($result, '/plugin_js/js_file');
$result = Router::parse('/plugin_js/js_file');
$expected = array('plugin' => 'plugin_js', 'controller' => 'js_file', 'action' => 'index', 'named' => array(), 'pass' => array());
$this->assertEquals($expected, $result);
$result = Router::url(array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index'));
$this->assertEquals($result, '/test_plugin');
$result = Router::parse('/test_plugin');
$expected = array('plugin' => 'test_plugin', 'controller' => 'test_plugin', 'action' => 'index', 'named' => array(), 'pass' => array());
$this->assertEquals($expected, $result, 'Plugin shortcut route broken. %s');
}
示例9: testConnectionData
/**
* testConnectionData method
*
* @return void
*/
public function testConnectionData()
{
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'Model/Datasource' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS . 'Datasource' . DS)), App::RESET);
CakePlugin::loadAll();
$expected = array('datasource' => 'Test2Source');
ConnectionManager::create('connection1', array('datasource' => 'Test2Source'));
$connections = ConnectionManager::enumConnectionObjects();
$this->assertEqual($expected, $connections['connection1']);
ConnectionManager::drop('connection1');
ConnectionManager::create('connection2', array('datasource' => 'Test2Source'));
$connections = ConnectionManager::enumConnectionObjects();
$this->assertEqual($expected, $connections['connection2']);
ConnectionManager::drop('connection2');
ConnectionManager::create('connection3', array('datasource' => 'TestPlugin.TestSource'));
$connections = ConnectionManager::enumConnectionObjects();
$expected['datasource'] = 'TestPlugin.TestSource';
$this->assertEqual($expected, $connections['connection3']);
ConnectionManager::drop('connection3');
ConnectionManager::create('connection4', array('datasource' => 'TestPlugin.TestSource'));
$connections = ConnectionManager::enumConnectionObjects();
$this->assertEqual($expected, $connections['connection4']);
ConnectionManager::drop('connection4');
ConnectionManager::create('connection5', array('datasource' => 'Test2OtherSource'));
$connections = ConnectionManager::enumConnectionObjects();
$expected['datasource'] = 'Test2OtherSource';
$this->assertEqual($expected, $connections['connection5']);
ConnectionManager::drop('connection5');
ConnectionManager::create('connection6', array('datasource' => 'Test2OtherSource'));
$connections = ConnectionManager::enumConnectionObjects();
$this->assertEqual($expected, $connections['connection6']);
ConnectionManager::drop('connection6');
ConnectionManager::create('connection7', array('datasource' => 'TestPlugin.TestOtherSource'));
$connections = ConnectionManager::enumConnectionObjects();
$expected['datasource'] = 'TestPlugin.TestOtherSource';
$this->assertEqual($expected, $connections['connection7']);
ConnectionManager::drop('connection7');
ConnectionManager::create('connection8', array('datasource' => 'TestPlugin.TestOtherSource'));
$connections = ConnectionManager::enumConnectionObjects();
$this->assertEqual($expected, $connections['connection8']);
ConnectionManager::drop('connection8');
}
示例10: setUp
/**
* reset environment.
*
* @return void
*/
public function setUp()
{
parent::setUp();
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'Controller' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Controller' . DS), 'Model' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Model' . DS), 'View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS)), App::RESET);
CakePlugin::loadAll();
$this->Case = $this->getMockForAbstractClass('ControllerTestCase');
Router::reload();
}
示例11: array
CakePlugin::load('UrlCache');
/**
* Uncomment the following line to enable client SSL certificate authentication.
* It's also necessary to configure the plugin — for more information, please read app/Plugin/CertAuth/reame.md
*/
// CakePlugin::load('CertAuth');
/**
* You can attach event listeners to the request lifecyle as Dispatcher Filter . By Default CakePHP bundles two filters:
*
* - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
* - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
*
* Feel free to remove or add filters as you see fit for your application. A few examples:
*
* Configure::write('Dispatcher.filters', array(
* 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app.
* 'MyPlugin.MyFilter', // will use MyFilter class from the Routing/Filter package in MyPlugin plugin.
* array('callable' => $aFunction, 'on' => 'before', 'priority' => 9), // A valid PHP callback type to be called on beforeDispatch
* array('callable' => $anotherMethod, 'on' => 'after'), // A valid PHP callback type to be called on afterDispatch
*
* ));
*/
Configure::write('Dispatcher.filters', array('AssetDispatcher', 'CacheDispatcher'));
/**
* Configures default file logging options
*/
App::uses('CakeLog', 'Log');
CakeLog::config('debug', array('engine' => 'FileLog', 'types' => array('notice', 'info', 'debug'), 'file' => 'debug'));
CakeLog::config('error', array('engine' => 'FileLog', 'types' => array('warning', 'error', 'critical', 'alert', 'emergency'), 'file' => 'error'));
CakePlugin::loadAll(array('CakeResque' => array('bootstrap' => true)));
示例12: install
public function install($id)
{
$entry = $this->getEntry($id);
if ($entry && !empty($entry['url'])) {
App::uses('File', 'Utility');
copy($entry['url'], TMP . DS . $id);
App::import('Vendor', 'PclZip', array('file' => 'pclzip-2-8-2/pclzip.lib.php'));
$zip = new PclZip(TMP . DS . $id);
$list = $zip->listContent();
$zip->extract(TMP);
unlink(TMP . DS . $id);
rename(TMP . DS . $list[0]['filename'], APP . 'Plugin' . DS . Inflector::camelize($id));
Cache::clear(false, '_cake_core_');
CakePlugin::loadAll();
return true;
}
return false;
}
示例13: array
/**
* 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('singular', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
* Inflector::rules('plural', array('rules' => array(), 'irregular' => array(), 'uninflected' => array()));
*/
/**
* 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 CakePlugin to use more
* advanced ways of loading plugins
*
* CakePlugin::loadAll(); // Loads all plugins at once
* CakePlugin::load('DebugKit'); // Loads a single plugin named DebugKit
*/
CakePlugin::loadAll(array('Users' => array('routes' => true)));
/**
* To prefer app translation over plugin translation, you can set
*
* Configure::write('I18n.preferApp', true);
*/
/**
* You can attach event listeners to the request lifecycle as Dispatcher Filter. By default CakePHP bundles two filters:
*
* - AssetDispatcher filter will serve your asset files (css, images, js, etc) from your themes and plugins
* - CacheDispatcher filter will read the Cache.check configure variable and try to serve cached content generated from controllers
*
* Feel free to remove or add filters as you see fit for your application. A few examples:
*
* Configure::write('Dispatcher.filters', array(
* 'MyCacheFilter', // will use MyCacheFilter class from the Routing/Filter package in your app.
示例14: testConnectDefaultRoutes
/**
* Test connecting the default routes with i18n
*
* @return false
* @access public
*/
public function testConnectDefaultRoutes()
{
App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), APP::RESET);
CakePlugin::loadAll();
Configure::write('Routing.prefixes', array('admin'));
Router::reload();
include CakePlugin::path('I18n') . 'Config' . DS . 'routes.php';
$result = Router::url(array('plugin' => 'plugin_js', 'controller' => 'js_file', 'action' => 'index'));
$this->assertEquals($result, '/spa/plugin_js/js_file');
$result = Router::url(array('plugin' => 'plugin_js', 'controller' => 'js_file', 'action' => 'index', 'admin' => true));
$this->assertEquals($result, '/spa/admin/plugin_js/js_file');
$result = Router::parse('/plugin_js/js_file');
$expected = array('plugin' => 'plugin_js', 'controller' => 'js_file', 'action' => 'index', 'named' => array(), 'pass' => array(), 'lang' => $this->__defaultLang);
$this->assertEquals($result, $expected);
$result = Router::parse('/admin/plugin_js/js_file');
$expected['prefix'] = 'admin';
$expected['admin'] = true;
$expected['action'] = 'admin_index';
$this->assertEquals($result, $expected);
$result = Router::parse('/spa/admin/plugin_js/js_file');
$expected['lang'] = 'spa';
$this->assertEquals($result, $expected);
$result = Router::parse('/spa/plugin_js/js_file');
unset($expected['admin'], $expected['prefix']);
$expected['action'] = 'index';
$this->assertEquals($result, $expected);
}
示例15: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
App::build(array('plugins' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'Console/Command' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS)), true);
CakePlugin::loadAll();
}