From 7e625b3dc7e8f5380a855f5e698b8083c15d1701 Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?=E6=B5=AA=E5=AD=90=E5=B0=8F=E6=96=B0?= Date: Sat, 28 Mar 2020 18:03:45 +0800 Subject: [PATCH] style(some) --- GatewayWorker/Applications/autoReload/start.php | 15 --------------- GatewayWorker/Applications/githubT/start_sync.php | 1 - 2 files changed, 16 deletions(-) diff --git a/GatewayWorker/Applications/autoReload/start.php b/GatewayWorker/Applications/autoReload/start.php index 0df6bff..0ce928e 100644 --- a/GatewayWorker/Applications/autoReload/start.php +++ b/GatewayWorker/Applications/autoReload/start.php @@ -1,9 +1,6 @@ onWorkerStart = function() // check files func 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'); $data = $pdo->query("select * from file_info where addtime < '".(time() - 60*60*2+5)."'")->fetchAll(); diff --git a/GatewayWorker/Applications/githubT/start_sync.php b/GatewayWorker/Applications/githubT/start_sync.php index f342bae..08fa475 100644 --- a/GatewayWorker/Applications/githubT/start_sync.php +++ b/GatewayWorker/Applications/githubT/start_sync.php @@ -42,7 +42,6 @@ $task_worker->onMessage = function ($connection, $task_data) use ($webDir,$datat 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']) ) { $connection->send(json_encode(["status" => 1, "msg" => "请输入正确的github地址:仅支持https协议 或
(gz|tar.gz|bz2|tar|tar.bz2|zip|tar.xz|tar.z|rpm|deb|rar)格式的压缩包下载链接"]) . "\r\n");