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


PHP CakePlugin::load方法代码示例

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


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

示例1: testThemeAndPluginInclusion

    public function testThemeAndPluginInclusion()
    {
        App::build(array('Plugin' => array($this->_testFiles . 'Plugin' . DS), 'View' => array($this->_testFiles . 'View' . DS)));
        CakePlugin::load('TestAsset');
        $settings = array('paths' => array(), 'theme' => 'Red');
        $this->filter->settings($settings);
        $this->_themeDir = $this->_testFiles . DS . 'View' . DS . 'Themed' . DS . $settings['theme'] . DS;
        $content = file_get_contents($this->_themeDir . 'webroot' . DS . 'theme.js');
        $result = $this->filter->input('theme.js', $content);
        $expected = <<<TEXT
var Theme = new Class({

});
var ThemeInclude = new Class({

});

var Plugin = new Class({

});


TEXT;
        $this->assertTextEquals($expected, $result);
    }
开发者ID:superstarrajini,项目名称:cakepackages,代码行数:25,代码来源:SprocketsTest.php

示例2: links

 public function links()
 {
     if (!CakePlugin::loaded('Menus')) {
         CakePlugin::load('Menus');
     }
     App::uses('View', 'View');
     App::uses('AppHelper', 'View/Helper');
     App::uses('MenusHelper', 'Menus.View/Helper');
     $Menus = new MenusHelper(new View());
     $Link = ClassRegistry::init('Menus.Link');
     $links = $Link->find('all', array('fields' => array('id', 'title', 'link')));
     $count = 0;
     foreach ($links as $link) {
         if (!strstr($link['Link']['link'], 'controller:')) {
             continue;
         }
         if (strstr($link['Link']['link'], 'plugin:')) {
             continue;
         }
         $url = $Menus->linkStringToArray($link['Link']['link']);
         if (isset($this->_controllerMap[$url['controller']])) {
             $url['plugin'] = $this->_controllerMap[$url['controller']];
             $linkString = $Menus->urlToLinkString($url);
             $Link->id = $link['Link']['id'];
             $this->out(__('Updating Link %s', $Link->id));
             $this->warn(__('- %s', $link['Link']['link']));
             $this->success(__('+ %s', $linkString), 2);
             $Link->saveField('link', $linkString, false);
             $count++;
         }
     }
     $this->out(__('Links updated: %d rows', $count));
 }
开发者ID:laiello,项目名称:plankonindia,代码行数:33,代码来源:UpgradeTask.php

示例3: _basePath

 /**
  * Generates the base path to a set of tests based on the parameters.
  *
  * @param array $params
  * @return string The base path.
  */
 protected static function _basePath($params)
 {
     $result = null;
     if (!empty($params['core'])) {
         $result = CORE_TEST_CASES;
         // CUSTOMIZE ADD 2014/07/02 ryuring
         // >>>
     } elseif ($params['baser']) {
         $result = BASER_TEST_CASES;
         // <<<
     } elseif (!empty($params['plugin'])) {
         if (!CakePlugin::loaded($params['plugin'])) {
             try {
                 CakePlugin::load($params['plugin']);
                 $result = CakePlugin::path($params['plugin']) . 'Test' . DS . 'Case';
             } catch (MissingPluginException $e) {
             }
         } else {
             $result = CakePlugin::path($params['plugin']) . 'Test' . DS . 'Case';
         }
     } elseif (!empty($params['app'])) {
         $result = APP_TEST_CASES;
     }
     return $result;
 }
开发者ID:baserproject,项目名称:basercms,代码行数:31,代码来源:BaserTestLoader.php

示例4: setUp

	public function setUp() {
		parent::setUp();
		$this->_pluginPath = App::pluginPath('AssetCompress');
		$this->testConfig = $this->_pluginPath . 'Test' . DS . 'test_files' . DS . 'Config' . DS . 'integration.ini';

		$map = array(
			'TEST_FILES/' => $this->_pluginPath . 'Test' . DS . 'test_files' . DS
		);
		App::build(array(
			'Plugin' => array($map['TEST_FILES/'] . 'Plugin' . DS )
		));
		CakePlugin::load('TestAssetIni');
		
		AssetConfig::clearAllCachedKeys();

		$config = AssetConfig::buildFromIniFile($this->testConfig, $map);
		$config->filters('js', null, array());
		$this->Compressor = $this->getMock('AssetCompressor', array('_getConfig'));
		$this->Compressor->expects($this->atLeastOnce())
			->method('_getConfig')
			->will($this->returnValue($config));

		$this->request = new CakeRequest(null, false);
		$this->response = $this->getMock('CakeResponse', array('checkNotModified', 'type', 'send'));
		Configure::write('debug', 2);
	}
开发者ID:renan,项目名称:asset_compress,代码行数:26,代码来源:AssetCompressorTest.php

示例5: setUp

 public function setUp()
 {
     App::build(array('View' => array(App::pluginPath('Asset') . 'Test' . DS . 'test_app' . DS . 'View' . DS), 'Plugin' => array(App::pluginPath('Asset') . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), App::RESET);
     CakePlugin::load('Other', array());
     $this->path = App::pluginPath('Asset') . 'Test' . DS . 'test_app' . DS . 'webroot' . DS;
     $this->AssetEnvironment = new AssetEnvironment($this->path);
 }
开发者ID:rodrigorm,项目名称:asset-plugin,代码行数:7,代码来源:AssetEnvironmentTest.php

示例6: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     Cache::delete('object_map', '_cake_core_');
     App::build(array('Locale' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Locale' . DS), 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), App::RESET);
     CakePlugin::load(array('TestPlugin'));
 }
开发者ID:kuradakis,项目名称:cakephp-ex,代码行数:12,代码来源:I18nTest.php

示例7: onActivation

 public function onActivation(&$controller)
 {
     CakePlugin::load('Sites');
     App::import('Model', 'CakeSchema');
     App::import('Model', 'ConnectionManager');
     App::uses('Sites', 'Sites.Lib');
     include_once APP . 'Plugin' . DS . 'Sites' . DS . 'Config' . DS . 'Schema' . DS . 'schema.php';
     $db = ConnectionManager::getDataSource('default');
     //Get all available tables
     $tables = $db->listSources();
     $CakeSchema = new CakeSchema();
     $SiteSchema = new SiteSchema();
     foreach ($SiteSchema->tables as $table => $config) {
         if (!in_array($table, $tables)) {
             $db->execute($db->createSchema($SiteSchema, $table));
         }
     }
     //Ignore the cache since the tables wont be inside the cache at this point
     //$db->cacheSources = false;
     @unlink(TMP . 'cache' . DS . 'models/cake_model_' . ConnectionManager::getSourceName($db) . '_' . $db->config["database"] . '_list');
     $db->listSources();
     //Insert "ALL SITES"
     $controller->loadModel('Sites.Site');
     $controller->Site->create();
     $data = array('Site' => array('id' => Sites::ALL_SITES, 'title' => 'All Sites', 'tagline' => Configure::read('Site.tagline'), 'email' => Configure::read('Site.email'), 'locale' => Configure::read('Site.locale'), 'status' => Configure::read('Site.status'), 'timezone' => Configure::read('Site.timezone'), 'theme' => Configure::read('Site.theme'), 'default' => 1), 'SiteDomain' => array(0 => array('site_id' => Sites::ALL_SITES, 'domain' => $_SERVER["HTTP_HOST"])));
     $controller->Site->id = Sites::ALL_SITES;
     if ($controller->Site->exists()) {
         $count = $controller->Site->SiteDomain->find('count', array('conditions' => array('SiteDomain.site_id' => Sites::ALL_SITES)));
         if ($count > 0) {
             unset($data['SiteDomain']);
         }
     }
     $controller->Site->saveAll($data);
 }
开发者ID:daniel-neumann,项目名称:sites,代码行数:34,代码来源:SitesActivation.php

示例8: setUp

 public function setUp()
 {
     parent::setUp();
     App::build(array('Plugin' => array(App::pluginPath('TwigView') . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
     App::build(array('View' => array(App::pluginPath('TwigView') . 'Test' . DS . 'test_app' . DS . 'View' . DS)), App::RESET);
     CakePlugin::load('TestTwigView');
     $this->Loader = new Twig_Loader_Cakephp();
 }
开发者ID:alanrodas,项目名称:TwigView,代码行数:8,代码来源:Twig_Loader_CakephpTest.php

示例9: setUp

 public function setUp()
 {
     parent::setUp();
     CakePlugin::load('Translate');
     $this->View = new View(null);
     $this->AppHelper = new CroogoAppHelper($this->View);
     $this->AppHelper->request = new CakeRequest(null, false);
 }
开发者ID:saydulk,项目名称:croogo,代码行数:8,代码来源:CroogoAppHelperTest.php

示例10: setUp

 public function setUp()
 {
     parent::setUp();
     CakePlugin::load('Translate', array('bootstrap' => true));
     $this->View = new View(null);
     $this->AppHelper = new AppHelper($this->View);
     $this->AppHelper->request = new CakeRequest(null, false);
 }
开发者ID:laiello,项目名称:plankonindia,代码行数:8,代码来源:AppHelperTest.php

示例11: setUp

 /**
  * setUp
  */
 public function setUp()
 {
     parent::setUp();
     CakePlugin::load('Translate', array('bootstrap' => true));
     $this->TranslateController = $this->generate('Translate.Translate', array('methods' => array('redirect'), 'components' => array('Auth' => array('user'), 'Session')));
     $this->TranslateController->Auth->staticExpects($this->any())->method('user')->will($this->returnCallback(array($this, 'authUserCallback')));
     $this->TranslateController->Security->Session = $this->getMock('CakeSession');
 }
开发者ID:laiello,项目名称:plankonindia,代码行数:11,代码来源:TranslateControllerTest.php

示例12: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'Console/Command' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS)), App::RESET);
     CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
     $out = $this->getMock('ConsoleOutput', array(), array(), '', FALSE);
     $in = $this->getMock('ConsoleInput', array(), array(), '', FALSE);
     $this->CommandTask = $this->getMock('CommandTask', array('in', '_stop', 'clear'), array($out, $out, $in));
 }
开发者ID:mrbadao,项目名称:api-official,代码行数:14,代码来源:CommandTaskTest.php

示例13: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     App::build(array('Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS), 'Console/Command' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Console' . DS . 'Command' . DS)), App::RESET);
     CakePlugin::load(array('TestPlugin', 'TestPluginTwo'));
     $out = new TestStringOutput();
     $in = $this->getMock('ConsoleInput', array(), array(), '', false);
     $this->Shell = $this->getMock('CommandListShell', array('in', '_stop', 'clear'), array($out, $out, $in));
 }
开发者ID:pritten,项目名称:SmartCitizen.me,代码行数:14,代码来源:CommandListShellTest.php

示例14: setUp

 /**
  * setUp
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->Node = ClassRegistry::init('Nodes.Node');
     if (!CakePlugin::loaded('Translate')) {
         CakePlugin::load('Translate');
     }
     $this->Node->Behaviors->attach('Translate.CroogoTranslate', array('fields' => array('title' => 'titleTranslation')));
 }
开发者ID:saydulk,项目名称:croogo,代码行数:14,代码来源:CroogoTranslateBehaviorTest.php

示例15: setUp

 /**
  * setUp method
  *
  * @return void
  */
 public function setUp()
 {
     parent::setUp();
     $this->request = new CakeRequest(null, false);
     $this->Controller = new ScaffoldViewMockController($this->request);
     $this->Controller->response = $this->getMock('CakeResponse', array('_sendHeader'));
     App::build(array('View' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'View' . DS), 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)));
     CakePlugin::load('TestPlugin');
 }
开发者ID:saihe,项目名称:reservation,代码行数:14,代码来源:ScaffoldViewTest.php


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