本文整理汇总了PHP中Setting::remove方法的典型用法代码示例。如果您正苦于以下问题:PHP Setting::remove方法的具体用法?PHP Setting::remove怎么用?PHP Setting::remove使用的例子?那么恭喜您, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类Setting
的用法示例。
在下文中一共展示了Setting::remove方法的5个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: up
public function up()
{
$this->createTable('p_user', array('id' => 'pk', 'email' => 'string NOT NULL', 'username' => 'string NOT NULL', 'password' => 'string NOT NULL', 'email' => 'string NOT NULL', 'last_login' => 'datetime', 'is_deleted' => 'boolean'));
$this->addAutoIncrement('p_user', 'id');
$this->insert('p_user', ['email' => "dev@company.com", 'username' => 'dev', 'password' => Setting::get('devInstallPassword'), 'last_login' => null, 'is_deleted' => 0]);
Setting::remove("devInstallPassword");
}
示例2: actionIndex
public function actionIndex($force = false)
{
$isPMRunning = null;
while (true) {
if (!$force) {
$isPMRunning = ProcessHelper::isPMRunning();
}
if (!$isPMRunning) {
break;
}
$cmds = Setting::get('process', null, true);
foreach ($cmds as $id => $cmd) {
$curTime = time();
$isStillRunning = false;
# Getting PID of previous process.
if (isset($cmd['pid'])) {
$isStillRunning = ProcessHelper::findRunningProcess($cmd['pid']);
}
# Remove one task kill process from Process Manager List
if ($cmd['runOnce'] && !$isStillRunning) {
Setting::remove('process.' . $id);
}
if ($cmd['runOnce']) {
echo $cmd['name'] . "\n";
continue;
}
$isStarted = $cmd['isStarted'];
# Running periodic process continously
if ((!isset($cmd['lastRun']) || abs($curTime - $cmd['lastRun']) % $cmd['periodCount'] == 0) && !$isStillRunning && $isStarted && !$cmd['runOnce']) {
chdir(Yii::getPathOfAlias('application'));
exec("process run yiic " . $cmd['command'], $pid);
$cmd['lastRun'] = $curTime;
$cmd['pid'] = $pid[0];
Setting::set('process.' . $id, $cmd);
// Logging
// echo "[".date('d-m-Y H:i:s')."] ".$cmd['name']." is running\n";
}
}
sleep(1);
}
}
示例3: actionDelete
public function actionDelete($id = null)
{
if (isset($id)) {
Setting::remove('process.' . $id);
}
$this->redirect(['/dev/processManager/']);
}
示例4: setSettings
public function setSettings($data)
{
#App
Setting::set('app.name', $data['appName'], false);
Setting::set('app.mode', $data['appMode'], false);
Setting::set('app.passEncrypt', $data['appPassEncrypt'], false);
#Database
Setting::set('db.driver', $data['dbSys'], false);
Setting::set('db.dbname', $data['dbName'], false);
Setting::set('db.password', $data['dbPass'], false);
Setting::set('db.host', $data['dbHost'], false);
Setting::set('db.username', $data['dbUser'], false);
#Repo
Setting::set('repo.path', $data['repoPath'], false);
#Notif
$enableNotif = true;
$enableNotifEmail = true;
if ($data['notifEnable'] != 'ON') {
$enableNotif = false;
$data['notifWithEmail'] = false;
}
if ($data['notifWithEmail'] != 'ON') {
$enableNotifEmail = false;
}
Setting::set('notif.enable', $enableNotif, false);
Setting::set('notif.email', $enableNotifEmail, false);
#Audit Trail
$enableAudit = true;
if ($data['auditEnable'] != 'ON') {
$enableAudit = false;
}
Setting::set("auditTrail.enable", $enableAudit, false);
if ($enableAudit) {
Setting::set("auditTrail.track", $data['auditTrack'], false);
} else {
Setting::set("auditTrail.track", null, false);
}
#Email
Setting::remove("email.transport");
if ($data['emailService'] == 'ses') {
Setting::set("email.transport.auth.accessKeyId", $data['emailAccessKeyId'], false);
Setting::set("email.transport.auth.secretAccessKey", $data['emailSecretAccessKey'], false);
Setting::set("email.transport.auth.rateLimit", $data['emailRateLimit'], false);
Setting::set("email.transport.auth.region", $data['emailRegion'], false);
} elseif ($data['emailService'] == 'gmail') {
Setting::set("email.transport.auth.user", $data['emailUser'], false);
Setting::set("email.transport.auth.pass", $data['emailPass'], false);
} elseif ($data['emailService'] == 'smtp') {
Setting::set("email.transport.auth.user", $data['emailUser'], false);
Setting::set("email.transport.auth.pass", $data['emailPass'], false);
Setting::set("email.transport.host", $data['emailHost'], false);
Setting::set("email.transport.port", $data['emailPort'], false);
}
if ($data['emailService'] != 'none') {
Setting::set("email.from", $data['emailSender'], false);
} else {
Setting::set("email.from", null, false);
}
if ($data['emailService'] == 'smtp') {
Setting::set("email.transport.service", null, false);
} elseif ($data['emailService'] == 'none') {
Setting::set("email.transport.service", 'none', false);
} else {
Setting::set("email.transport.service", $data['emailService'], false);
}
#LDAP
if ($data['ldapEnable'] === 'ON') {
Setting::set("ldap.enable", true, false);
Setting::set("ldap.ad_port", $data['ldapAdPort'], false);
Setting::set("ldap.account_suffix", $data['ldapAccountSuffix'], false);
Setting::set("ldap.base_dn", $data['ldapBaseDn'], false);
Setting::set("ldap.domain_controllers", $data['ldapDomainControllers'], false);
Setting::set("ldap.admin_password", $data['ldapPassword'], false);
Setting::set("ldap.admin_username", $data['ldapUsername'], false);
} else {
Setting::remove("ldap.ad_port");
Setting::remove("ldap.account_suffix");
Setting::remove("ldap.base_dn");
Setting::remove("ldap.domain_controllers");
Setting::remove("ldap.admin_password");
Setting::remove("ldap.admin_username");
Setting::set("ldap.enable", false, false);
}
Setting::write();
return true;
}
示例5: actionDelete
public function actionDelete($m)
{
Setting::remove('services.list.' . $m);
}