本文整理汇总了PHP中Configuration::setValue方法的典型用法代码示例。如果您正苦于以下问题:PHP Configuration::setValue方法的具体用法?PHP Configuration::setValue怎么用?PHP Configuration::setValue使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Configuration
的用法示例。
在下文中一共展示了Configuration::setValue方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: add
public function add($key, $value, $ns = 'conf')
{
$config = new Configuration();
$config->setKey($ns . ':' . $key);
$config->setValue($value);
$config->save();
$this->confTab[$ns][$key] = $value;
unset($_SESSION['configuration']);
}
示例2: set
/**
* @static
* @param $name
* @param $value
* @return void
*/
public static function set($name, $value = null)
{
$configuration = ConfigurationPeer::retrieveByName($name);
if (!$configuration) {
$configuration = new Configuration();
$configuration->setName($name);
}
$configuration->setValue($value);
$configuration->save();
}
示例3: save
/**
* The function saves configuration values.
*
* @access private
*/
private function save()
{
if (isset($_POST['submit'])) {
if (isset($_POST['Config']) && is_array($_POST['Config'])) {
foreach ($_POST['Config'] as $key => $value) {
Configuration::setValue($key, $value);
}
}
$this->halt();
}
}
示例4: saveForStorage
private function saveForStorage()
{
$tmp = Configuration::getValue('project_' . $this->projectId);
$tmp['b24connect'] = $this->resource;
if (isset($tmp['info']['USERINFO'])) {
$tmp['info']['USERINFO'] = array('access_token' => $this->resource['access_token'], 'refresh_token' => $this->resource['refresh_token'], 'expires_in' => $this->resource['expires_in'], 'domain' => $tmp['info']['USERINFO']['domain'], 'member_id' => $tmp['info']['USERINFO']['member_id']);
} else {
$tmp['info']['USERINFO'] = array('access_token' => $this->resource['access_token'], 'refresh_token' => $this->resource['refresh_token'], 'expires_in' => $this->resource['expires_in'], 'domain' => 'null', 'member_id' => 'null');
}
Configuration::setValue('project_' . $this->projectId, $tmp);
}
示例5: change
/**
* The departments edit handler.
*
* @access public
* @return string The HTML code.
*/
public function change()
{
if (isset($_POST['submit'])) {
if (isset($_POST['Depart'])) {
$arr = array();
foreach ($_POST['Depart']['Name'] as $i => $value) {
if ($value) {
$arr['Name'][$i] = $value;
$arr['Email'][$i] = $_POST['Depart']['Email'][$i];
}
}
$_POST['Config']['contact/departs'] = $arr;
}
if (isset($_POST['Config']) && is_array($_POST['Config'])) {
foreach ($_POST['Config'] as $key => $value) {
Configuration::setValue($key, $value);
}
}
return $this->halt();
}
return $this->getView()->render();
}
示例6: testGetChildrenByInitWithSimpleXmlElement
/**
* Test if a configuration init with a SimpleXMLElement
* has been added correctly.
*
* @return void
*/
public function testGetChildrenByInitWithSimpleXmlElement()
{
$this->configuration->init($this->getTestNode('test', 'testValue'));
$toBeTested = new Configuration('testNode');
$toBeTested->setAttr('test');
$toBeTested->setValue('testValue');
$this->assertEquals(array($toBeTested), $this->configuration->getChildren());
}