#### ignore_user_abort()
~~~
private $interval=60*10;
/**
* 賬戶刷新解禁
*/
public function banStatusScan(){
/*
* 內存限制 [ini_set('memory_limit','30M')]
* 不限時間 [set_time_limit(0)]
* 免掉線 [ignore_user_abort(true)]
*/
ini_set('memory_limit','30M');
set_time_limit(0);
ignore_user_abort(true);
//日志初始化
Log::init([
'type' => 'File',
'path' => APP_PATH.'index/log/crontab/'
]);
try{
while(1){
//允許循環判斷
$run = Config::get('accountban_scan');
if(!$run) die('process abort');
// 查詢賬戶的封禁狀態
// 如果當前時間小于賬號的解封時間,賬號實際未封禁則請求賬號封禁
// 如果當前時間大于賬號的解封時間則請求賬號解封
// 如果解封請求的返回結果為OK則刪除封禁操作記錄
$nowtime = time();
if(connection_status() != CONNECTION_NORMAL){
break;
}
// Sleep for 10 minutes
sleep($this->interval);
}
}
}
catch (\Exception $e){
Log::write($e->getMessage(),'log');
throw new \think\Exception('異常消息:' . $e->getMessage());
}
~~~
- 目錄
- Array
- array_column()
- 數組和變量
- compact() 函數
- extract() 函數
- Url
- base64_encode — 使用 MIME base64 對數據進行編碼
- 圖像
- getimagesize()
- 隨機數
- getrandmax
- mt_getrandmax
- mt_rand
- rand
- empty函數
- exec()函數
- 權限修改
- 可變函數
- 函數閉包
- 報警級別
- 持續函數
- 自定義
- 字符處理
- 中文首字母
- 隨機字符串
- url函數
- parse_url_param
- 頁面采集
- 簡單采集
- Referer采集
- CURL
- 發送json數據
- Curl多線程
- 文件處理
- 遞歸刪除
- 圖片顯示
- 類方法
- 保留字
- 檢查類文件名稱
- Cookie
- 數組
- 數學函數
- 第三方函數庫
- 精度計算
- BC Math
- 計算執行時間
- 日期時間
- 時間戳
- header
- 調試函數
- get_class
- get_class_methods
- 數組函數
- array_intersect_key()
- 二維數組
- Base64編碼
- URL安全
- 加密擴展
- Hash函數
- hash_file
- hash_hmac
- hash_algos
- 文件讀寫
- is_writable()
- file_put_contents()