style(some)
This commit is contained in:
@@ -1,9 +1,6 @@
|
|||||||
<?php
|
<?php
|
||||||
use Workerman\Worker;
|
use Workerman\Worker;
|
||||||
use Workerman\Lib\Timer;
|
use Workerman\Lib\Timer;
|
||||||
|
|
||||||
// watch Applications catalogue
|
|
||||||
|
|
||||||
// worker
|
// worker
|
||||||
$webDirSource = dirname(dirname(dirname(__FILE__)));
|
$webDirSource = dirname(dirname(dirname(__FILE__)));
|
||||||
$worker = new Worker();
|
$worker = new Worker();
|
||||||
@@ -18,18 +15,6 @@ $worker->onWorkerStart = function()
|
|||||||
// check files func
|
// check files func
|
||||||
function check_files_remove($webDirSource)
|
function check_files_remove($webDirSource)
|
||||||
{
|
{
|
||||||
// $files = [];
|
|
||||||
// $dateTime = date("Ymd",strtotime("-1 day"));
|
|
||||||
// if(is_dir($webDirSource)) {
|
|
||||||
// if($files = scandir($webDirSource)) {
|
|
||||||
// $files = array_slice($files,2);
|
|
||||||
// foreach($files as $file) {
|
|
||||||
// if ($file < $dateTime) {
|
|
||||||
// rmdir($webDirSource . $file);
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
// }
|
|
||||||
|
|
||||||
$pdo = new PDO('sqlite:' . $webDirSource . '/sql');
|
$pdo = new PDO('sqlite:' . $webDirSource . '/sql');
|
||||||
$data = $pdo->query("select * from file_info where addtime < '".(time() - 60*60*2+5)."'")->fetchAll();
|
$data = $pdo->query("select * from file_info where addtime < '".(time() - 60*60*2+5)."'")->fetchAll();
|
||||||
|
|||||||
@@ -42,7 +42,6 @@ $task_worker->onMessage = function ($connection, $task_data) use ($webDir,$datat
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
//&& !preg_match("/^.*(?<=(\.gz|\.tar\.gz|\.bz2|\.tar|\.tar\.bz2|\.zip|\.tar\.xz|\.tar\.z|\.rpm|\.deb|\.rar))$/ix",$dataArr['url'])
|
|
||||||
if (!preg_match("/^((https|http):\/\/)?([\w\.\/\-\_^]+?)\.(tar\.gz|gz|tar\.bz2|bz2|tar|zip|tar\.xz|tar\.z|rpm|deb|rar)$/iu",$dataArr['url'],$ext) && !preg_match("/^https:\/\/github.com\/([\w\/\-\.\_]+)$/iu", $dataArr['url'])
|
if (!preg_match("/^((https|http):\/\/)?([\w\.\/\-\_^]+?)\.(tar\.gz|gz|tar\.bz2|bz2|tar|zip|tar\.xz|tar\.z|rpm|deb|rar)$/iu",$dataArr['url'],$ext) && !preg_match("/^https:\/\/github.com\/([\w\/\-\.\_]+)$/iu", $dataArr['url'])
|
||||||
) {
|
) {
|
||||||
$connection->send(json_encode(["status" => 1, "msg" => "请输入正确的github地址:仅支持https协议 或<br> (gz|tar.gz|bz2|tar|tar.bz2|zip|tar.xz|tar.z|rpm|deb|rar)格式的压缩包下载链接"]) . "\r\n");
|
$connection->send(json_encode(["status" => 1, "msg" => "请输入正确的github地址:仅支持https协议 或<br> (gz|tar.gz|bz2|tar|tar.bz2|zip|tar.xz|tar.z|rpm|deb|rar)格式的压缩包下载链接"]) . "\r\n");
|
||||||
|
|||||||
Reference in New Issue
Block a user