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


PHP Configure::store方法代码示例

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


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

示例1: getPrivateId

 function getPrivateId()
 {
     Configure::load('gitrbug');
     $id_n = Configure::read('gitrbug.num_secrets');
     Configure::load('gitrbug_secrets');
     $id_s = Configure::read('gitrbug_s.secrets');
     $id_a = unserialize(stripslashes($id_s));
     if (count($id_a) < $id_n) {
         App::Import('Model', 'Peer');
         $peerModel =& ClassRegistry::init('Peer');
         while (count($id_a) < $id_n) {
             $id_a[] = $peerModel->_genUUID();
         }
         Configure::write('gitrbug_s.secrets', serialize($id_a));
         Configure::store('gitrbug', 'gitrbug_secrets', Configure::read('gitrbug_s'));
     }
     $id_x = rand(0, $id_n - 1);
     return $id_a[$id_x];
 }
开发者ID:busytoby,项目名称:gitrbug,代码行数:19,代码来源:setting.php

示例2: testStoreAndLoad

 /**
  * testStore method
  *
  * @access public
  * @return void
  */
 function testStoreAndLoad()
 {
     Configure::write('Cache.disable', false);
     $expected = array('data' => 'value');
     Configure::store('SomeExample', 'test', $expected);
     Configure::load('test');
     $config = Configure::read('SomeExample');
     $this->assertEqual($config, $expected);
     $expected = array('data' => array('first' => 'value', 'second' => 'value2'));
     Configure::store('AnotherExample', 'test.config', $expected);
     Configure::load('test.config');
     $config = Configure::read('AnotherExample');
     $this->assertEqual($config, $expected);
 }
开发者ID:Jaciss,项目名称:wildflower,代码行数:20,代码来源:configure.test.php

示例3: testStoreAndRestoreWithData

 /**
  * test that store and restore only store/restore the provided data.
  *
  * @return void
  */
 public function testStoreAndRestoreWithData()
 {
     Configure::write('Cache.disable', false);
     Configure::write('testing', 'value');
     Configure::store('store_test', 'default', array('store_test' => 'one'));
     Configure::delete('testing');
     $this->assertNull(Configure::read('store_test'), 'Calling store with data shouldn\'t modify runtime.');
     Configure::restore('store_test', 'default');
     $this->assertEquals('one', Configure::read('store_test'));
     $this->assertNull(Configure::read('testing'), 'Values that were not stored are not restored.');
     Cache::delete('store_test', 'default');
 }
开发者ID:angel-mendoza,项目名称:proyecto-pasantia,代码行数:17,代码来源:ConfigureTest.php

示例4: testStoreAndLoad

	/**
	 * testStore method
	 *
	 * @access public
	 * @return void
	 */
	function testStoreAndLoad() {
		Configure::write('Cache.disable', false);

		$expected = array('data' => 'value with backslash \, \'singlequote\' and "doublequotes"');
		Configure::store('SomeExample', 'test', $expected);

		Configure::load('test');
		$config = Configure::read('SomeExample');
		$this->assertEqual($config, $expected);

		$expected = array(
			'data' => array('first' => 'value with backslash \, \'singlequote\' and "doublequotes"', 'second' => 'value2'),
			'data2' => 'value'
			);
			Configure::store('AnotherExample', 'test_config', $expected);

			Configure::load('test_config');
			$config = Configure::read('AnotherExample');
			$this->assertEqual($config, $expected);
	}
开发者ID:ralmeida,项目名称:FoundFree.org,代码行数:26,代码来源:configure.test.php

示例5: _writeTestConfiguration

 protected function _writeTestConfiguration()
 {
     $name = 'test_authority';
     $acl = array('editor' => array('articles' => array('publish', 'edit', 'delete')), 'administrator' => '*', 'csr' => array('orders', 'payments', 'users' => array('view', 'resend_password')));
     Configure::store('ACL', $name, $acl);
 }
开发者ID:plank,项目名称:authority,代码行数:6,代码来源:authority.test.php

示例6: define

}
if (!defined('SERVER_IIS') && php_sapi_name() == 'isapi') {
    define('SERVER_IIS', true);
}
/**
 * Configuration, directory layout and standard libraries
 */
if (!isset($bootstrap)) {
    require CORE_PATH . 'cake' . DS . 'basics.php';
    $TIME_START = getMicrotime();
    require CORE_PATH . 'cake' . DS . 'config' . DS . 'paths.php';
    require LIBS . 'object.php';
    require LIBS . 'inflector.php';
    require LIBS . 'configure.php';
}
require LIBS . 'cache.php';
Configure::getInstance();
if (Configure::read('Cache.disable') !== true) {
    $cache = Cache::settings();
    if (empty($cache)) {
        trigger_error('Cache not configured. Please use Cache::config(); in APP/config/core.php', E_USER_WARNING);
        Cache::config('default', array('engine' => 'File'));
    }
}
require LIBS . 'session.php';
require LIBS . 'security.php';
require LIBS . 'string.php';
Configure::store(null, 'class.paths');
Configure::load('class.paths');
$url = null;
require CAKE . 'dispatcher.php';
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:31,代码来源:bootstrap.php

示例7: loadComponent

/**
 * Loads a component
 *
 * @param string $name Name of component
 * @return boolean Success
 */
function loadComponent($name)
{
    if ($name === null) {
        return true;
    }
    if (strpos($name, '.') !== false) {
        list($plugin, $name) = explode('.', $name);
    }
    $className = $name . 'Component';
    if (!class_exists($className)) {
        $name = Inflector::underscore($name);
        $components = Configure::read('Components');
        if (is_array($components)) {
            if (array_key_exists($className, $components)) {
                require $components[$className]['path'];
                return true;
            } elseif (isset($components['Core']) && array_key_exists($className, $components['Core'])) {
                require $components['Core'][$className]['path'];
                return true;
            }
        }
        $paths = Configure::getInstance();
        foreach ($paths->componentPaths as $path) {
            if (file_exists($path . $name . '.php')) {
                Configure::store('Components', 'class.paths', array($className => array('path' => $path . $name . '.php')));
                require $path . $name . '.php';
                return true;
            }
        }
        if ($componentFilename = fileExistsInPath(LIBS . 'controller' . DS . 'components' . DS . $name . '.php')) {
            if (file_exists($componentFilename)) {
                Configure::store('Components\'][\'Core', 'class.paths', array($className => array('path' => $componentFilename)));
                require $componentFilename;
                return true;
            } else {
                return false;
            }
        }
    }
    return true;
}
开发者ID:rhencke,项目名称:mozilla-cvs-history,代码行数:47,代码来源:basics.php


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