本文整理匯總了PHP中Configure::drop方法的典型用法代碼示例。如果您正苦於以下問題:PHP Configure::drop方法的具體用法?PHP Configure::drop怎麽用?PHP Configure::drop使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類Configure
的用法示例。
在下文中一共展示了Configure::drop方法的6個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: setupSettings
public function setupSettings($appDir)
{
if (!$this->setupSettings) {
return;
}
$Setting = ClassRegistry::init('Settings.Setting');
$Setting->settingsPath = $appDir . 'Config' . DS . 'settings.json';
Configure::drop('settings');
Configure::config('settings', new CroogoJsonReader(dirname($Setting->settingsPath) . DS));
$Setting->writeConfiguration();
}
示例2: 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();
}
示例3: tearDown
public function tearDown()
{
parent::tearDown();
foreach (Configure::configured() as $config) {
if (strpos($config, 'I18nYamlTestConfig') !== false) {
Configure::drop($config);
}
}
I18n::clear();
App::build();
foreach (array_keys(Configure::read()) as $key) {
Configure::delete($key);
}
Configure::write($this->_config);
}
示例4: testRead
public function testRead()
{
$this->_configTestFile();
Configure::load('spyc', 'YamlTestConfig');
$expected = array(array('name' => 'spartan', 'notes' => array('Needs to be backed up', 'Needs to be normalized'), 'type' => 'mysql'));
$this->assertIdentical(Configure::read('spyc.databases'), $expected);
Configure::drop('YamlTestConfig');
Configure::delete('spyc');
$this->_configTestFile(array('path' => App::pluginPath('YamlReader') . 'Test' . DS . 'files' . DS));
Configure::load('spyc', 'YamlTestConfig');
$this->assertIdentical(Configure::read('spyc.databases'), $expected);
$this->_configTestFile(null, false);
Configure::load('spyc', 'YamlTestConfig');
$this->assertIdentical(Configure::read('databases'), $expected);
}
示例5: 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();
}
示例6: testReaderSetup
/**
* test adding new readers.
*
* @return void
*/
public function testReaderSetup()
{
$reader = new PhpReader();
Configure::config('test', $reader);
$configured = Configure::configured();
$this->assertTrue(in_array('test', $configured));
$this->assertTrue(Configure::configured('test'));
$this->assertFalse(Configure::configured('fake_garbage'));
$this->assertTrue(Configure::drop('test'));
$this->assertFalse(Configure::drop('test'), 'dropping things that do not exist should return false.');
}