本文整理汇总了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.');
}