本文整理汇总了PHP中CakePlugin::unload方法的典型用法代码示例。如果您正苦于以下问题:PHP CakePlugin::unload方法的具体用法?PHP CakePlugin::unload怎么用?PHP CakePlugin::unload使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类CakePlugin
的用法示例。
在下文中一共展示了CakePlugin::unload方法的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
/**
* tearDown method
*
* @return void
*/
public function tearDown()
{
parent::tearDown();
Cache::delete('object_map', '_cake_core_');
App::build();
CakePlugin::unload();
}
示例2: tearDown
/**
* tearDown method
*
* @return void
*/
public function tearDown()
{
$_SESSION = array();
unset($this->View, $this->Session);
CakePlugin::unload();
parent::tearDown();
}
示例3: tearDown
/**
* tearDown method
*
* @return void
*/
public function tearDown()
{
parent::tearDown();
unset($this->Task);
$Folder = new Folder($this->path);
$Folder->delete();
CakePlugin::unload();
}
示例4: setUp
/**
* setUp method
*
* @return void
*/
public function setUp()
{
parent::setUp();
require App::pluginPath('Lil') . DS . 'Config' . DS . 'core.php';
CakePlugin::unload('LilInvoices');
CakePlugin::unload('LilTravelOrders');
$this->Expense = ClassRegistry::init('LilExpenses.Expense');
}
示例5: setUp
/**
* setUp
*
* @return void
*/
public function setUp()
{
parent::setUp();
$appDir = CakePlugin::path('Croogo') . 'Test' . DS . 'test_app' . DS;
App::build(array('Plugin' => array($appDir . 'Plugin' . DS), 'View' => array($appDir . 'View' . DS)), App::PREPEND);
$this->_paths = App::paths();
CakePlugin::unload('Install');
CakePlugin::load('Example');
Configure::write('Acl.database', 'test');
$this->setupSettings($appDir);
}
示例6: setUp
/**
* setUp
*
* @return void
*/
public function setUp()
{
parent::setUp();
App::build(array('Plugin' => array(TESTS . 'test_app' . DS . 'Plugin' . DS), 'View' => array(TESTS . 'test_app' . DS . 'View' . DS)), App::PREPEND);
CakePlugin::unload('Install');
CakePlugin::load('Example');
Configure::write('Acl.database', 'test');
$Setting = ClassRegistry::init('Setting');
$Setting->settingsPath = TESTS . 'test_app' . DS . 'Config' . DS . 'settings.yml';
$Setting->writeConfiguration();
}
示例7: tearDown
/**
* end a test
*
* @return void
*/
public function tearDown()
{
parent::tearDown();
unset($this->Helper);
Cache::delete(AssetConfig::CACHE_BUILD_TIME_KEY, AssetConfig::CACHE_CONFIG);
Cache::drop(AssetConfig::CACHE_CONFIG);
// @codingStandardsIgnoreStart
@unlink(TMP . AssetConfig::BUILD_TIME_FILE);
// @codingStandardsIgnoreEnd
CakePlugin::unload('TestAssetIni');
}
示例8: setUp
/**
* setUp
*
* @return void
*/
public function setUp()
{
parent::setUp();
App::build(array('Plugin' => array(TESTS . 'test_app' . DS . 'Plugin' . DS), 'View' => array(TESTS . 'test_app' . DS . 'View' . DS)), App::PREPEND);
CakePlugin::unload('Install');
CakePlugin::load('Example');
Configure::write('Acl.database', 'test');
$Setting = ClassRegistry::init('Settings.Setting');
$Setting->settingsPath = TESTS . 'test_app' . DS . 'Config' . DS . 'settings.json';
Configure::drop('settings');
Configure::config('settings', new CroogoJsonReader(dirname($Setting->settingsPath) . DS));
$Setting->writeConfiguration();
}
示例9: testUnload
/**
* Tests unloading plugins
*
* @return void
*/
public function testUnload()
{
CakePlugin::load('TestPlugin');
$expected = array('TestPlugin');
$this->assertEquals($expected, CakePlugin::loaded());
CakePlugin::unload('TestPlugin');
$this->assertEquals(array(), CakePlugin::loaded());
CakePlugin::load('TestPlugin');
$expected = array('TestPlugin');
$this->assertEquals($expected, CakePlugin::loaded());
CakePlugin::unload('TestFakePlugin');
$this->assertEquals($expected, CakePlugin::loaded());
}
示例10: testImportingLoggers
/**
* test importing loggers from app/libs and plugins.
*
* @return void
*/
public function testImportingLoggers()
{
App::build(array('Lib' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Lib' . DS), 'Plugin' => array(CAKE . 'Test' . DS . 'test_app' . DS . 'Plugin' . DS)), App::RESET);
CakePlugin::load('TestPlugin');
$result = CakeLog::config('libtest', array('engine' => 'TestAppLog'));
$this->assertTrue($result);
$this->assertEquals(CakeLog::configured(), array('libtest'));
$result = CakeLog::config('plugintest', array('engine' => 'TestPlugin.TestPluginLog'));
$this->assertTrue($result);
$this->assertEquals(CakeLog::configured(), array('libtest', 'plugintest'));
App::build();
CakePlugin::unload();
}
示例11: make
/**
* Compile assets for admin ui
*/
public function make()
{
App::uses('AssetGenerator', 'Install.Lib');
if (!CakePlugin::loaded('Install')) {
CakePlugin::load('Install');
}
$generator = new AssetGenerator();
try {
$generator->generate(array('clone' => true));
} catch (Exception $e) {
$this->err('<error>' . $e->getMessage() . '</error>');
}
CakePlugin::unload('Install');
}
示例12: before
/**
* Before migration callback
*
* @param string $direction, up or down direction of migration process
* @return boolean Should process continue
* @access public
*/
public function before($direction)
{
$success = true;
if ($direction === 'up') {
if (Configure::read('Croogo.installed')) {
CakePlugin::load('Install');
$dm = new DataMigration();
$dir = CakePlugin::path('Install') . 'Config' . DS . 'Data' . DS;
$dm->loadFile($dir . 'SettingData.php', array('extract' => sprintf('{n}[key=%s]', $this->_assetTimestamp)));
CakePlugin::unload('Install');
}
} else {
$Setting = ClassRegistry::init('Settings.Setting');
$success = $Setting->deleteKey($this->_assetTimestamp);
}
return $success;
}
示例13: testConstructor
public function testConstructor()
{
$plugins = CakePlugin::loaded();
$plugins = array_filter(CakePlugin::loaded(), function ($plugin) {
return 'Common' != $plugin && is_null(CakePlugin::unload($plugin));
});
$this->Model->getEventManager()->flush();
ClassRegistry::flush();
CakePlugin::load('TestExample');
$Model = ClassRegistry::init('TestCommonAppModel');
$result = $Model->actsAs;
$expected = array('TestExample.TestExample' => null);
$this->assertEqual($result, $expected);
array_walk($plugins, function ($plugin) {
CakePlugin::load($plugin);
});
}
示例14: before
/**
* Before migration callback
*
* @param string $direction, up or down direction of migration process
* @return boolean Should process continue
* @access public
*/
public function before($direction)
{
$success = true;
if ($direction === 'up') {
if (Configure::read('Croogo.installed')) {
$settingsToUpdate = array('Site.locale', 'Site.admin_theme', 'Site.home_url');
CakePlugin::load('Install');
$dm = new DataMigration();
$dir = CakePlugin::path('Install') . 'Config' . DS . 'Data' . DS;
foreach ($settingsToUpdate as $key) {
$dm->loadFile($dir . 'SettingData.php', array('extract' => sprintf('{n}[key=%s]', $key)));
}
CakePlugin::unload('Install');
}
}
return $success;
}
示例15: setUp
/**
* setUp
*
* @return void
*/
public function setUp()
{
parent::setUp();
App::build(array('Plugin' => array(TESTS . 'test_app' . DS . 'Plugin' . DS), 'View' => array(TESTS . 'test_app' . DS . 'View' . DS)), App::PREPEND);
if (!isset($_SERVER['REMOTE_ADDR'])) {
$_SERVER['REMOTE_ADDR'] = '127.0.0.1';
}
CakePlugin::unload('Install');
CakePlugin::load(array('Users'), array('bootstrap' => true));
CakePlugin::load('Example');
Configure::write('Acl.database', 'test');
$Setting = ClassRegistry::init('Settings.Setting');
$Setting->settingsPath = TESTS . 'test_app' . DS . 'Config' . DS . 'settings.json';
Configure::drop('settings');
Configure::config('settings', new CroogoJsonReader(dirname($Setting->settingsPath) . DS));
CakeLog::drop('stdout');
CakeLog::drop('stderr');
$Setting->writeConfiguration();
}