本文整理匯總了PHP中cron::aset方法的典型用法代碼示例。如果您正苦於以下問題:PHP cron::aset方法的具體用法?PHP cron::aset怎麽用?PHP cron::aset使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類cron
的用法示例。
在下文中一共展示了cron::aset方法的4個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: elseif
} elseif (!empty($_GET['dis'])) {
cron::aset($_GET['dis'], array('no' => 1));
} elseif (isset($_GET['uninst'])) {
cron::del($_GET['uninst']);
} elseif (isset($_GET['add'])) {
if (stripos($_POST['file'], 'do.php') !== false) {
msg('<h4>請不要將do.php加入到雲簽的計劃任務中來</h4>若需簽到,請用雲監控監控<br/>' . SYSTEM_URL . 'do.php<br/>即可實現計劃任務(cron)的效果<br/><br/>推薦雲監控:<a href="http://www.aliyun.com/product/jiankong/" target="_blank">阿裏雲監控</a> 或 <a href="http://jk.cloud.360.cn/" target="_blank">360網站服務監控</a> 或 <a href="http://ce.baidu.com/" target="_blank">百度雲觀測</a><br/>如果你的服務器在國外且國內訪問較慢,則推薦使用:<a href="http://www.mywebcron.com/" target="_blank">Free Web Cron Service </a>', SYSTEM_URL . 'index.php?mod=admin:cron');
} else {
cron::set($_POST['name'], $_POST['file'], $_POST['no'], $_POST['status'], $_POST['freq'], $_POST['lastdo'], $_POST['log']);
}
} elseif (isset($_GET['run'])) {
$return = cron::run($_GET['file'], $_GET['run']);
cron::aset($_GET['run'], array('lastdo' => time(), 'log' => $return));
} elseif (isset($_GET['xorder'])) {
foreach ($_POST['order'] as $key => $value) {
cron::aset($key, array('orde' => $value));
}
}
doAction('cron_setting_2');
Redirect('index.php?mod=admin:cron&ok');
break;
case 'admin:update:back':
if (isset($_GET['del'])) {
if (file_exists(SYSTEM_ROOT . '/setup/update_backup/' . $_GET['del'])) {
DeleteFile(SYSTEM_ROOT . '/setup/update_backup/' . $_GET['del']);
}
Redirect('index.php?mod=admin:update:back&ok');
}
if (isset($_GET['dir'])) {
if (file_exists(SYSTEM_ROOT . '/setup/update_backup/' . $_GET['dir'] . '/__backup.ini')) {
if (CopyAll(SYSTEM_ROOT . '/setup/update_backup/' . $_GET['dir'], SYSTEM_ROOT) !== true) {
示例2: define
if (isset($_GET['in_thread'])) {
define('SYSTEM_CRON_THREAD', true);
}
doAction('cron_1');
if (SYSTEM_PAGE == 'runcron') {
$cron = isset($_GET['cron']) ? sqladds(strip_tags($_GET['cron'])) : msg('運行失敗:計劃任務未指定');
$cpw = option::get('cron_pw');
$x = $m->once_fetch_array("SELECT * FROM `" . DB_PREFIX . "cron` WHERE `name` = '{$cron}';");
if (empty($x['id'])) {
msg('運行失敗:此計劃任務不存在');
}
$log = cron::run($x['file'], $x['name']);
if ($x['freq'] == '-1') {
cron::del($x['name']);
} else {
cron::aset($x['name'], array('lastdo' => time(), 'log' => $log));
}
} else {
$sign_multith = option::get('sign_multith');
if (!isset($_GET['donnot_sign_multith']) && !empty($sign_multith) && function_exists('fsockopen')) {
for ($ii = 0; $ii < $sign_multith; $ii++) {
sendRequest(SYSTEM_URL . 'do.php?donnot_sign_multith&in_thread&pw=' . $cron_pw);
}
}
$return = '';
if (option::get('cron_last_do_time') != $today) {
option::set('cron_last_do_time', $today);
option::set('cron_last_do', '0');
}
cron::runall();
}
示例3: runall
/**
* 按運行順序運行所有計劃任務
*
*/
public static function runall()
{
global $m;
$cron = $m->query("SELECT * FROM `" . DB_NAME . "`.`" . DB_PREFIX . "cron` ORDER BY `orde` ASC ");
while ($cs = $m->fetch_array($cron)) {
if ($cs['no'] != '1') {
if (option::get('cron_asyn')) {
self::arun($cs['name']);
} else {
if ($cs['freq'] == '-1') {
self::run($cs['file'], $cs['name']);
self::del($cs['name']);
} elseif (empty($cs['freq']) || empty($cs['lastdo']) || time() - $cs['lastdo'] >= $cs['freq']) {
$return = self::run($cs['file'], $cs['name']);
cron::aset($cs['name'], array('lastdo' => time(), 'log' => $return));
}
}
}
}
}
示例4: msg
if (ROLE == 'admin') {
$cv = option::get('core_version');
if (!empty($cv) && $cv >= '3.8') {
msg('您的雲簽到已升級到 V3.8 版本,請勿重複更新<br/><br/>請立即刪除 /setup/update3.45to3.48.php');
}
option::add('core_version', '3.8');
option::add('isapp', '0');
option::add('cron_asyn', '0');
option::add('mail_ssl', '0');
option::add('baidu_name', '1');
option::set('sign_sleep', option::get('sign_sleep') * 1000);
$m->query("CREATE TABLE IF NOT EXISTS `" . DB_PREFIX . "plugins` (\r\n`id` int(10) NOT NULL AUTO_INCREMENT ,\r\n`name` varchar(100) CHARACTER SET utf8 COLLATE utf8_general_ci NOT NULL ,\r\n`status` tinyint(1) NOT NULL DEFAULT 0 ,\r\n`options` text CHARACTER SET utf8 COLLATE utf8_general_ci NULL ,\r\nPRIMARY KEY (`id`),\r\nUNIQUE INDEX `name` (`name`) USING BTREE \r\n)\r\nENGINE=MyISAM\r\nDEFAULT CHARACTER SET=utf8 COLLATE=utf8_general_ci\r\nCHECKSUM=0\r\nROW_FORMAT=DYNAMIC\r\nDELAY_KEY_WRITE=0\r\n;");
$plugins = unserialize(option::get('actived_plugins'));
foreach ($plugins as $plug) {
if (isset($i['opt']['plugin_' . $plug])) {
$set = $i['opt']['plugin_' . $plug];
} else {
$set = '';
}
$m->query("INSERT IGNORE INTO `" . DB_NAME . "`.`" . DB_PREFIX . "plugins` (`name`,`status`,`options`) VALUES ('{$plug}','1','{$set}');");
}
$m->query("ALTER TABLE `" . DB_PREFIX . "cron` ADD COLUMN `desc` text NULL AFTER `no`;");
$m->query("ALTER TABLE `" . DB_PREFIX . "cron` DROP COLUMN `status`;", true);
cron::aset('system_sign', array('desc' => '每天對所有貼吧進行簽到' . "\n" . '忽略或卸載此任務會導致停止簽到'));
cron::add('system_sign_retry', array('orde' => '1', 'file' => 'lib/cron_system_sign_retry.php', 'no' => '0', 'desc' => '對所有簽到失敗的貼吧進行複簽' . "\n" . '忽略或卸載此任務會導致停止複簽', 'freq' => '0'));
$m->query("ALTER TABLE `" . DB_PREFIX . "baiduid` ADD COLUMN `name` varchar(40) NULL AFTER `bduss`;");
unlink(__FILE__);
msg('您的雲簽到已成功升級到 V3.8 版本,請立即刪除 /setup/update3.45to3.8.php,謝謝<br/><br/>若要獲取 V3.8 版本新特性,請前往 <a href="http://www.stus8.com/forum.php?mod=viewthread&tid=6411">StusGame GROUP</a> ', SYSTEM_URL);
} else {
msg('您需要先登錄舊版本的雲簽到,才能繼續升級');
}