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


PHP CakePlugin::loadAll方法代碼示例

本文整理匯總了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();
 }
開發者ID:Romger,項目名稱:sga-moz,代碼行數:13,代碼來源:MigrationVersionTest.php

示例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));
 }
開發者ID:Chromedian,項目名稱:inventory,代碼行數:14,代碼來源:CommandListShellTest.php

示例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);
 }
開發者ID:Nervie,項目名稱:Beta,代碼行數:14,代碼來源:HtmlCoverageReportTest.php

示例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;
 }
開發者ID:asper,項目名稱:mwb,代碼行數:23,代碼來源:Mwb.php

示例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'));
開發者ID:wangshipeng,項目名稱:license,代碼行數:7,代碼來源:bootstrap.php

示例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);
 }
開發者ID:roongr2k7,項目名稱:cakephp,代碼行數:29,代碼來源:ObjectTest.php

示例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();
 }
開發者ID:shama,項目名稱:oven,代碼行數:8,代碼來源:OvenTestCase.php

示例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');
 }
開發者ID:nabeelio,項目名稱:CakePHP-Base,代碼行數:22,代碼來源:RouterTest.php

示例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');
 }
開發者ID:kevguy,項目名稱:Auth-Website,代碼行數:46,代碼來源:ConnectionManagerTest.php

示例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();
 }
開發者ID:ronaldsalazar23,項目名稱:ComercialChiriguano,代碼行數:13,代碼來源:ControllerTestCaseTest.php

示例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)));
開發者ID:x86Labs,項目名稱:MISP,代碼行數:30,代碼來源:bootstrap.php

示例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;
 }
開發者ID:naokomc,項目名稱:candycane,代碼行數:18,代碼來源:PluginContainer.php

示例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.
開發者ID:Glitchbone,項目名稱:yolped,代碼行數:31,代碼來源:bootstrap.php

示例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);
 }
開發者ID:SebFav,項目名稱:ApplicationInternet2,代碼行數:33,代碼來源:I18nRouteTest.php

示例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();
 }
開發者ID:ronaldsalazar23,項目名稱:ComercialChiriguano,代碼行數:11,代碼來源:ShellDispatcherTest.php


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