本文整理汇总了PHP中Configure::configured方法的典型用法代码示例。如果您正苦于以下问题:PHP Configure::configured方法的具体用法?PHP Configure::configured怎么用?PHP Configure::configured使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configure
的用法示例。
在下文中一共展示了Configure::configured方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: tearDown
public function tearDown()
{
foreach (Configure::configured() as $config) {
if (strpos($config, 'YamlTestConfig') !== false) {
Configure::drop($config);
}
}
Configure::write($this->_config);
parent::tearDown();
}
示例2: 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);
}
示例3: 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.');
}
示例4: _find
/**
* Find the related code folding values for $char
*
* @param int $char decimal value of character
* @param string $type Type 'lower' or 'upper'. Defaults to 'lower'.
* @return array|null
*/
protected static function _find($char, $type = 'lower')
{
$found = array();
if (!isset(self::$_codeRange[$char])) {
$range = self::_codepoint($char);
if ($range === false) {
return null;
}
if (!Configure::configured('_cake_core_')) {
App::uses('PhpReader', 'Configure');
Configure::config('_cake_core_', new PhpReader(CAKE . 'Config' . DS));
}
Configure::load('unicode' . DS . 'casefolding' . DS . $range, '_cake_core_');
self::$_caseFold[$range] = Configure::read($range);
Configure::delete($range);
}
if (!self::$_codeRange[$char]) {
return null;
}
self::$_table = self::$_codeRange[$char];
$count = count(self::$_caseFold[self::$_table]);
for ($i = 0; $i < $count; $i++) {
if ($type === 'lower' && self::$_caseFold[self::$_table][$i][$type][0] === $char) {
$found[] = self::$_caseFold[self::$_table][$i];
} elseif ($type === 'upper' && self::$_caseFold[self::$_table][$i][$type] === $char) {
$found[] = self::$_caseFold[self::$_table][$i];
}
}
return $found;
}
示例5: reader
/**
* Setup configuration reader.
*
* @param mixed $config Optional. Reader configuration options as array or just name (i.e. ini)
* @param boolean $default Optional. If true, make this configuration the default one.
* @return array Full configuration settings.
*/
public static function reader($config = null, $default = false)
{
if (empty($config)) {
$config = array('id' => 'json', 'className' => 'JsonReader', 'location' => 'Common.Configure');
}
if (!is_array($config)) {
$config = array('id' => $config, 'className' => ucfirst($config) . 'Reader', 'location' => 'Configure');
}
extract($config);
if (Configure::configured($id)) {
throw new ConfigureException(__d('_common_', "A reader with the '%s' name already exists.", $id));
}
foreach (array('id', 'className', 'location') as $var) {
if (!isset(${$var}) || empty(${$var})) {
throw new ConfigureException(__d('_common_', "Reader configuration missing the '%s' key.", $key));
}
}
App::uses($className, $location);
Configure::config($default ? 'default' : $id, new $className());
return $config;
}