本文整理汇总了PHP中config::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP config::remove方法的具体用法?PHP config::remove怎么用?PHP config::remove使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类config
的用法示例。
在下文中一共展示了config::remove方法的6个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: switchUnderConstruction
/**
* switchUnderConstruction
*
* switches the under cunstruction setting
*
* @return boolean
*/
public function switchUnderConstruction()
{
if ($this->adminUser) {
$config = new config();
$underConstruction = $config->getByType('under_construction');
$underConstruction = $underConstruction[0];
if ($underConstruction) {
$config->remove('under_construction', $underConstruction);
$config->add('under_construction', '0');
} else {
$config->remove('under_construction', $underConstruction);
$config->add('under_construction', '1');
}
}
return true;
}
示例2: remove
function remove()
{
$cron = cron::byId(config::byKey('xPLDeamonCronId', 'xPL'));
if (is_object($cron)) {
$cron->remove();
}
config::remove('xPLDeamonCronId', 'xPL');
}
示例3: remove
public function remove()
{
$cache = cache::byKey('market::info::' . $this->getLogicalId());
if (is_object($cache)) {
$cache->remove();
}
switch ($this->getType()) {
case 'plugin':
try {
$plugin = plugin::byId($this->getLogicalId());
if (is_object($plugin)) {
try {
$plugin->setIsEnable(0);
} catch (Exception $e) {
}
foreach (eqLogic::byType($this->getLogicalId()) as $eqLogic) {
try {
$eqLogic->remove();
} catch (Exception $e) {
}
}
}
config::remove('*', $this->getLogicalId());
} catch (Exception $e) {
}
try {
$cibDir = dirname(__FILE__) . '/../../plugins/' . $this->getLogicalId();
if (file_exists($cibDir)) {
rrmdir($cibDir);
}
} catch (Exception $e) {
}
break;
default:
$type = $this->getType();
if (class_exists($type) && method_exists($type, 'removeFromMarket')) {
$type::removeFromMarket($this);
}
break;
}
$update = update::byTypeAndLogicalId($this->getType(), $this->getLogicalId());
if (is_object($update)) {
$update->remove();
}
}
示例4: array
$configRemove[] = array('key' => $value['key'], 'plugin' => $value['plugin']);
}
try {
$update->save();
} catch (Exception $ex) {
}
}
$sql = 'SELECT *
FROM config
WHERE `key` = "installVersionDate"';
$values = DB::Prepare($sql, array(), DB::FETCH_TYPE_ALL);
foreach ($values as $value) {
$update = new update();
if ($value['plugin'] != '') {
$update->setLogicalId($value['plugin']);
$update->setLocalVersion($value['value']);
$update->setType('plugin');
try {
$update->save();
$configRemove[] = array('key' => "installVersionDate", 'plugin' => $value['plugin']);
} catch (Exception $ex) {
}
}
}
foreach ($configRemove as $remove) {
if (isset($remove['plugin'])) {
config::remove($remove['key'], $remove['plugin']);
} else {
config::remove($remove['key']);
}
}
示例5: init
}
} else {
if (network::dns_run()) {
network::dns_stop();
}
}
}
}
ajax::success();
}
if (init('action') == 'removeKey') {
$keys = init('key');
if ($keys == '') {
throw new Exception(__('Aucune clef demandée', __FILE__));
}
if (is_json($keys)) {
$keys = json_decode($keys, true);
$return = array();
foreach ($keys as $key => $value) {
config::remove($key, init('plugin', 'core'));
}
} else {
config::remove(init('key'), init('plugin', 'core'));
}
ajax::success();
}
throw new Exception(__('Aucune méthode correspondante à : ', __FILE__) . init('action'));
/* * *********Catch exeption*************** */
} catch (Exception $e) {
ajax::error(displayExeption($e), $e->getCode());
}
示例6: MigrateDatas
public static function MigrateDatas()
{
//log::add('arduidom', 'debug', 'MigrateDatas() called'
log::add('arduidom', 'info', "*************************************************************************");
log::add('arduidom', 'info', "* Début de la migration des données arduidom pour la mise a jour > 1.07 *");
log::add('arduidom', 'info', "*************************************************************************");
self::deamon_stop();
$model = config::byKey('model', 'arduidom');
if ($model == "uno" || $model == "duemilanove328" || $model == "leo" || $model == "nano168" || $model == "nano328") {
for ($i = 0; $i < 100; $i++) {
// Migration des configs de pins DIGI et ANA
$tomigrate = 'pin::' . $i;
$DataToMigrate = config::byKey($tomigrate, 'arduidom', '');
if ($DataToMigrate != '') {
log::add('arduidom', 'info', "Migration de " . $tomigrate . " vers A1_" . $tomigrate . "...");
config::save('A1_' . $tomigrate, $DataToMigrate, 'arduidom');
log::add('arduidom', 'info', "Suppression de " . $tomigrate . "...");
config::remove($tomigrate, 'arduidom');
}
}
for ($i = 101; $i < 130; $i++) {
// Migration des configs de pins DHT
$tomigrate = 'pin::' . $i;
$DataToMigrate = config::byKey($tomigrate, 'arduidom', '');
if ($DataToMigrate != '') {
log::add('arduidom', 'info', "Migration de " . $tomigrate . " vers A1_" . 'pin::' . ($i + 400) . "...");
config::save('A1_' . 'pin::' . ($i + 400), $DataToMigrate, 'arduidom');
log::add('arduidom', 'info', "Suppression de " . $tomigrate . "...");
config::remove($tomigrate, 'arduidom');
}
}
}
if ($model == "mega1280" || $model == "mega2560") {
}
if ($model == "due") {
}
$tomigrate = "port";
// Migration de la config du Port du 1er Arduino
$DataToMigrate = config::byKey($tomigrate, 'arduidom', '');
if ($DataToMigrate != '') {
log::add('arduidom', 'info', "Migration de " . $tomigrate . " vers A1_" . $tomigrate . "...");
$DataToMigrate = config::byKey($tomigrate, 'arduidom', 'none');
config::save('A1_' . $tomigrate, $DataToMigrate, 'arduidom');
config::save('A2_' . $tomigrate, "none", 'arduidom');
config::save('A3_' . $tomigrate, "none", 'arduidom');
config::save('A4_' . $tomigrate, "none", 'arduidom');
config::save('A5_' . $tomigrate, "none", 'arduidom');
config::save('A6_' . $tomigrate, "none", 'arduidom');
config::save('A7_' . $tomigrate, "none", 'arduidom');
config::save('A8_' . $tomigrate, "none", 'arduidom');
log::add('arduidom', 'info', "Suppression de " . $tomigrate . "...");
config::remove($tomigrate, 'arduidom');
}
$tomigrate = "daemonip";
// Migration de la config du Daemon du 1er Arduino
$DataToMigrate = config::byKey($tomigrate, 'arduidom', '');
if ($DataToMigrate != '') {
//log::add('arduidom', 'info', "Migration de " . $tomigrate . " vers A1_" . $tomigrate . "...");
//$DataToMigrate = config::byKey($tomigrate, 'arduidom', 'none');
log::add('arduidom', 'info', "Suppression de " . $tomigrate . "...");
config::remove($tomigrate, 'arduidom');
}
config::save('A1_' . $tomigrate, "127.0.0.1", 'arduidom');
config::save('A2_' . $tomigrate, "127.0.0.1", 'arduidom');
config::save('A3_' . $tomigrate, "127.0.0.1", 'arduidom');
config::save('A4_' . $tomigrate, "127.0.0.1", 'arduidom');
config::save('A5_' . $tomigrate, "127.0.0.1", 'arduidom');
config::save('A6_' . $tomigrate, "127.0.0.1", 'arduidom');
config::save('A7_' . $tomigrate, "127.0.0.1", 'arduidom');
config::save('A8_' . $tomigrate, "127.0.0.1", 'arduidom');
$tomigrate = "daemonenable";
// Migration de la config du StopDaemon du 1er Arduino
config::save('A1_' . $tomigrate, 0, 'arduidom');
config::save('A2_' . $tomigrate, 0, 'arduidom');
config::save('A3_' . $tomigrate, 0, 'arduidom');
config::save('A4_' . $tomigrate, 0, 'arduidom');
config::save('A5_' . $tomigrate, 0, 'arduidom');
config::save('A6_' . $tomigrate, 0, 'arduidom');
config::save('A7_' . $tomigrate, 0, 'arduidom');
config::save('A8_' . $tomigrate, 0, 'arduidom');
$tomigrate = "model";
// Migration de la config du Modele du 1er Arduino
$DataToMigrate = config::byKey($tomigrate, 'arduidom', '');
if ($DataToMigrate != '') {
log::add('arduidom', 'info', "Migration de " . $tomigrate . " vers A1_" . $tomigrate . "...");
$DataToMigrate = config::byKey($tomigrate, 'arduidom', 'none');
config::save('A1_' . $tomigrate, $DataToMigrate, 'arduidom');
config::save('A2_' . $tomigrate, "", 'arduidom');
config::save('A3_' . $tomigrate, "", 'arduidom');
config::save('A4_' . $tomigrate, "", 'arduidom');
config::save('A5_' . $tomigrate, "", 'arduidom');
config::save('A6_' . $tomigrate, "", 'arduidom');
config::save('A7_' . $tomigrate, "", 'arduidom');
config::save('A8_' . $tomigrate, "", 'arduidom');
log::add('arduidom', 'info', "Suppression de " . $tomigrate . "...");
config::remove($tomigrate, 'arduidom');
}
foreach (eqLogic::byType('arduidom') as $eqLogic) {
// Migration des LogicalPin du 1er Arduino
foreach ($eqLogic->getCmd() as $cmd) {
//.........这里部分代码省略.........