From 7dee44140bcd19580a90a81b4b281cde1513c267 Mon Sep 17 00:00:00 2001 From: xiaomlove Date: Sun, 16 May 2021 02:57:00 +0800 Subject: [PATCH] define constant fix --- app/Console/Commands/BackuAll.php | 11 +++++------ app/Console/Commands/Test.php | 30 ++++++++++++++++++++++++++++-- bootstrap/app.php | 4 ++-- include/constants.php | 24 ++++++++++++------------ include/functions.php | 2 +- 5 files changed, 48 insertions(+), 23 deletions(-) diff --git a/app/Console/Commands/BackuAll.php b/app/Console/Commands/BackuAll.php index 538f9f6e..abc8f9bc 100644 --- a/app/Console/Commands/BackuAll.php +++ b/app/Console/Commands/BackuAll.php @@ -12,14 +12,14 @@ class BackuAll extends Command * * @var string */ - protected $signature = 'backup:all {--upload-to-google-drive}'; + protected $signature = 'backup:all'; /** * The console command description. * * @var string */ - protected $description = 'Backup all data, include web root and database. options: --upload-to-google-drive'; + protected $description = 'Backup all data, include web root and database.'; /** * Create a new command instance. @@ -38,12 +38,11 @@ class BackuAll extends Command */ public function handle() { - $uploadToGoogleDrive = $this->option('upload-to-google-drive'); $rep = new ToolRepository(); - $result = $rep->backupAll($uploadToGoogleDrive); + $result = $rep->backupAll(); $log = sprintf( - '[%s], %s, uploadToGoogleDrive: %s, result: %s', - REQUEST_ID, __METHOD__, var_export($uploadToGoogleDrive, true), var_export($result, true) + '[%s], %s, result: %s', + REQUEST_ID, __METHOD__, var_export($result, true) ); $this->info($log); do_log($log); diff --git a/app/Console/Commands/Test.php b/app/Console/Commands/Test.php index e2a26947..ddcb19d5 100644 --- a/app/Console/Commands/Test.php +++ b/app/Console/Commands/Test.php @@ -60,8 +60,34 @@ class Test extends Command // $disk = Storage::disk('google_dirve'); // $r = $disk->put('/', base_path('composer.json')); // $r = DB::table('users')->where('id', 1)->update(['modcomment' => DB::raw("concat_ws(',', 'ddddd', modcomment)")]); - $user = User::query()->find(1); - $r = $user->peer_torrents; + + $text = '[quote]转自PTer,感谢原制作者发布。[/quote] +[img]https://img9.doubanio.com/view/photo/l_ratio_poster/public/p2515853287.jpg[/img] +[img]https://pterclub.com/pic/PTerWEB.png[/img] +◎译  名 To us, From us / 再见18班 +◎片  名 再见十八班 +◎年  代 2018 +◎产  地 中国大陆 +◎类  别 剧情 +◎语  言 汉语普通话 +◎上映日期 2018-03-07(中国大陆) +◎IMDb评分 6.9/10 from 30 users +◎IMDb链接 https://www.imdb.com/title/tt7861446 +◎豆瓣评分 6.7/10 from 7214 users +◎豆瓣链接 https://movie.douban.com/subject/30159456/ +◎片  长 102分钟 +◎主  演 柯焱曦 Yanxi Ke +      熊婧文 Jingwen Xiong +      秦海 Hai Qin + + +◎标  签 青春 | 校园 | 感动 | 成长 | 高中 | 回忆 | 老师 | 教师 + +◎简  介 + +  梧桐中学高二十八班是远近闻名的问题班级,后进生、艺术生、体育生、不良少年聚集在此,以宋宸(柯焱曦 饰)为首的男生帮派和以秦淼淼(熊婧文 饰)为首的女生帮派互相不服,班级混乱无序。一天,高二十八班收到了一封信,这封信自称是由一年后的他们集体寄来。信上说,即将调来的班主任谭 睿明(秦海 饰)会改变十八班,成为对他们最重要的人。然而在一年后的未来,谭老师却永远地离开了他们。为了实现一段没有遗憾的青春,扭转历史,少年们决定按照信上所说,挑战一个个不可能实现的任务...'; + + $r = format_description($text); dd($r); } diff --git a/bootstrap/app.php b/bootstrap/app.php index 59a47a18..b4bff56a 100644 --- a/bootstrap/app.php +++ b/bootstrap/app.php @@ -1,7 +1,7 @@ ".PROJECTNAME.""); -define("THISTRACKER","General"); +defined('VERSION_NUMBER') || define('VERSION_NUMBER', '1.6.0-beta7'); +defined('RELEASE_DATE') || define('RELEASE_DATE', '2020-05-15'); +defined('IN_TRACKER') || define('IN_TRACKER', true); +defined('PROJECTNAME') || define("PROJECTNAME","NexusPHP"); +defined('NEXUSPHPURL') || define("NEXUSPHPURL","https://nexusphp.org"); +defined('NEXUSWIKIURL') || define("NEXUSWIKIURL","https://doc.nexusphp.org"); +defined('VERSION') || define("VERSION","Powered by ".PROJECTNAME.""); +defined('THISTRACKER') || define("THISTRACKER","General"); $showversion = " - Powered by ".PROJECTNAME; -define('ROOT_PATH', dirname(__DIR__) . '/'); -define('CURRENT_SCRIPT', strstr(basename($_SERVER['SCRIPT_FILENAME']), '.', true)); -define('IS_ANNOUNCE', CURRENT_SCRIPT == 'announce'); -define('REQUEST_ID', $_SERVER['HTTP_X_REQUEST_ID'] ?? $_SERVER['REQUEST_ID'] ?? str_pad(str_replace('.', '', NEXUS_START), 14, "0", STR_PAD_RIGHT)); +defined('ROOT_PATH') || define('ROOT_PATH', dirname(__DIR__) . '/'); +defined('CURRENT_SCRIPT') || define('CURRENT_SCRIPT', strstr(basename($_SERVER['SCRIPT_FILENAME']), '.', true)); +defined('IS_ANNOUNCE') || define('IS_ANNOUNCE', CURRENT_SCRIPT == 'announce'); +defined('REQUEST_ID') || define('REQUEST_ID', $_SERVER['HTTP_X_REQUEST_ID'] ?? $_SERVER['REQUEST_ID'] ?? str_pad(str_replace('.', '', NEXUS_START), 14, "0", STR_PAD_RIGHT)); diff --git a/include/functions.php b/include/functions.php index ab88d408..e2a40da2 100644 --- a/include/functions.php +++ b/include/functions.php @@ -4856,7 +4856,7 @@ function format_description(string $description) $quotePattern = '\[quote.*\].*\[\/quote\]'; $pattern = "/($attachPattern)|($imgPattern)|($urlPattern)|($quotePattern)/isU"; // $pattern = "/($attachPattern)|($imgPattern)|($urlPattern)/isU"; - $delimiter = '{{||}}'; + $delimiter = '{{__CYLX__}}'; $description = preg_replace_callback($pattern, function ($matches) use ($delimiter) { return $delimiter . $matches[0] . $delimiter; }, $description);