本文整理汇总了PHP中ctrl_options::SetSystemOption方法的典型用法代码示例。如果您正苦于以下问题:PHP ctrl_options::SetSystemOption方法的具体用法?PHP ctrl_options::SetSystemOption怎么用?PHP ctrl_options::SetSystemOption使用的例子?那么, 这里精选的方法代码示例或许可以为您提供帮助。您也可以进一步了解该方法所在类ctrl_options
的用法示例。
在下文中一共展示了ctrl_options::SetSystemOption方法的7个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: doGenerate
/**
* Generate a new API key and add it to the database.
*/
static function doGenerate()
{
$new_random_key = sha1(rand() . ctrl_options::GetOption('server_ip'));
ctrl_options::SetSystemOption('apikey', $new_random_key);
self::$updated = true;
return true;
}
示例2: CheckZPanelLatestVersion
function CheckZPanelLatestVersion()
{
// Grab the latest version of ZPanel from the ZPanel API servers and cache it into the database.
$live_version = ws_generic::ReadURLRequestResult(ctrl_options::GetSystemOption('update_url'));
if (!$live_version) {
return false;
}
$versionnumber = ws_generic::JSONToArray($live_version);
ctrl_options::SetSystemOption('latestzpversion', $versionnumber[0]['version']);
return true;
}
示例3: CheckMADminLatestVersion
function CheckMADminLatestVersion()
{
// Grab the latest version of MADmin from the MADmin API servers and cache it into the database.
$live_version = ws_generic::ReadURLRequestResult(ctrl_options::GetSystemOption('update_url'));
if (!$live_version) {
return false;
}
$versionnumber = ws_generic::JSONToArray($live_version);
# MADmin API returns simple object not in an array like it was for zpanel.
# if(count($versionnumber) > 1) {
# $currentVersionSetting = current($versionnumber);
# $currentVersion = $currentVersionSetting['version'];
# } else {
$currentVersion = $versionnumber['version'];
# }
ctrl_options::SetSystemOption('latestzpversion', $currentVersion);
return true;
}
示例4: time
ctrl_options::SetSystemOption('daemon_hourrun', time());
runtime_hook::Execute("OnStartDaemonHour");
runtime_hook::Execute("OnDaemonHour");
runtime_hook::Execute("OnEndDaemonHour");
}
if (time() >= ctrl_options::GetSystemOption('daemon_dayrun') + 24 * 3600) {
ctrl_options::SetSystemOption('daemon_dayrun', time());
runtime_hook::Execute("OnStartDaemonDay");
runtime_hook::Execute("OnDaemonDay");
runtime_hook::Execute("OnEndDaemonDay");
}
if (time() >= ctrl_options::GetSystemOption('daemon_weekrun') + 7 * 24 * 3600) {
ctrl_options::SetSystemOption('daemon_weekrun', time());
runtime_hook::Execute("OnStartDaemonWeek");
runtime_hook::Execute("OnDaemonWeek");
runtime_hook::Execute("OnEndDaemonWeek");
}
if (time() >= ctrl_options::GetSystemOption('daemon_monthrun') + 30 * 24 * 3600) {
ctrl_options::SetSystemOption('daemon_monthrun', time());
runtime_hook::Execute("OnStartDaemonMonth");
runtime_hook::Execute("OnDaemonMonth");
runtime_hook::Execute("OnEndDaemonMonth");
}
echo "\nDaemon run complete! (" . date($dateformat) . ")\n";
ctrl_options::SetSystemOption('daemon_lastrun', time());
$daemonLog->detail = "Daemon execution completed!";
$daemonLog->writeLog();
if (!runtime_controller::IsCLI()) {
echo "</pre>";
}
exit;
示例5: checkVersion
function checkVersion($whmcs_version = null)
{
$version = module_controller::getVersion();
if (empty($whmcs_version)) {
$request_data = $this->XMLDataToArray($this->wsdata);
$ctags = $request_data['xmws']['content'];
$whmcs_version = $ctags['whmcs_version'];
}
$dataobject = new runtime_dataobject();
$dataobject->addItemValue('response', '');
if ((int) $version != (int) $whmcs_version) {
$dataobject->addItemValue('content', ws_xmws::NewXMLTag('pass', 'false'));
//check database if this is first time
$alreadyReported = ctrl_options::GetSystemOption('whmcs_reported');
if ($alreadyReported == 'false') {
//if so then update database
ctrl_options::SetSystemOption('whmcs_reported', $ctags['whmcs_version']);
//then send email to admins if possible
$sendemail = ctrl_options::GetSystemOption('whmcs_sendemail_bo');
if ($sendemail == 'true') {
module_controller::sendBadVersionMail($ctags['whmcs_version']);
}
}
} else {
$alreadyReported = ctrl_options::GetSystemOption('whmcs_reported');
if ($alreadyReported != 'false') {
ctrl_options::SetSystemOption('whmcs_reported', 'false');
}
$dataobject->addItemValue('content', ws_xmws::NewXMLTag('pass', 'true'));
}
return $dataobject->getDataObject();
}
示例6: doUpdateSettings
/**
* Accepts Admin settings form
* @return null
*/
static function doUpdateSettings()
{
global $controller;
runtime_csfr::Protect();
$form = $controller->GetAllControllerRequests('FORM');
if (!isset($form['inAdminSettings'])) {
return false;
}
ctrl_options::SetSystemOption('whmcs_sendemail_bo', $form['SendEmail']);
ctrl_options::SetSystemOption('whmcs_link', $form['Link']);
self::$Results[] = ui_sysmessage::shout('Settings updated!', 'alert-success');
}
示例7: doUpdateSettings
static function doUpdateSettings()
{
global $controller;
runtime_csfr::Protect();
$form = $controller->GetAllControllerRequests('FORM');
if (!isset($form['inAdminSettings'])) {
return false;
}
if (!self::getIsAdmin()) {
return false;
}
ctrl_options::SetSystemOption('whmcs_sendemail_bo', $form['SendEmail']);
ctrl_options::SetSystemOption('whmcs_reseller_view_api', $form['ResellerViewAPI']);
ctrl_options::SetSystemOption('whmcs_link', $form['Link']);
self::$Results[] = ui_sysmessage::shout(ui_language::translate("Changes to your settings have been saved successfully!"));
}