filemtime($file_real_path)) {//新格式图存在且比原图新 // if (!filesize($file_cover_path)) {//文件体积异常0 // header("Location:{$file_real_url}");//跳转原图 // // } else {//读取webp // header('HTTP/1.1 301 Moved Permanently'); //永久跳转 // header("Location:{$file_cover_url}");//跳转原图 // //$image = image_read($file_cover_path); // //echo $image; // } // return; // } //} //是否设置了访问密码 //$pathSystemParams = '../storage/app/conf/system_params.json'; //$systemAuthPassword = null; //if (file_exists($pathSystemParams)) { // $systemJsonRaw = file_get_contents($pathSystemParams); // if (!empty($systemJsonRaw)) { // $systemJsonData = json_decode($systemJsonRaw, true); // $systemAuthPassword = $systemJsonData['authentication_password'] ?? null;//访问密码 // } //} /** * 超级静态 */ //require_once __DIR__ . '/../bootstrap/includes/UrlHelper.php'; //require_once __DIR__ . '/../bootstrap/includes/CacheHTMLHelper.php'; // //$cacheDisableConditions = [//缓存屏蔽条件 // url_is_debug(),//调试特征地址 // url_is_dynamic(),//动态页面 // url_auto_entry(),//语种自动引导 // !empty($systemAuthPassword),//已设访问密码(则不输出缓存,让程序继续执行到密码验证页面) //]; // //$cacheDisable = in_array(true, $cacheDisableConditions);//是否需要屏蔽缓存 // //if(!$cacheDisable){//未关闭缓存 // $cacheHtml = url_cache_flush();//缓存读取 // // //缓存是否完整 // $cacheAvailableConditions = [ // str_contains($cacheHtml, ''), // ]; // // $cacheAvailable = !in_array(false, $cacheAvailableConditions); // // if (!empty($cacheHtml) && $cacheAvailable) {//缓存不为空且有效 // ## 请求头安全协议(Content-Security-Policy) // //header("Content-Security-Policy: default-src * 'self' 'unsafe-inline' 'unsafe-eval' data: gap: content: https://ssl.gstatic.com; media-src * blob: 'self' https://* 'unsafe-inline' 'unsafe-eval'; style-src * 'self' 'unsafe-inline'; img-src * 'self' data: content:; connect-src * blob: wss: *.tawk.to; script-src 'self' ".$_HTTP_HOST." *.digood.cc *.digoodcms.com *.google.com *.googletagmanager.com *.google-analytics.com *.doubleclick.net *.jsdelivr.net *.tawk.to 'unsafe-inline' 'unsafe-eval';"); // // echo $cacheHtml;//默认输出缓存内容 // if (!url_cache_expired()) return;//缓存未过期,直接截断执行 // if (!empty($cacheHtml)) define('VIEW_FLUSH_ONLY', true);//定义只渲染和生成缓存,并继续执行业务程序,而本次生成不输出到客户端留待下次访问时输出 // } //} /* |-------------------------------------------------------------------------- | Check If The Application Is Under Maintenance |-------------------------------------------------------------------------- | | If the application is in maintenance / demo mode via the "down" command | we will load this file so that any pre-rendered content can be shown | instead of starting the framework, which could cause an exception. | */ if (file_exists($maintenance = __DIR__ . '/../storage/framework/maintenance.php')) { require $maintenance; } /* |-------------------------------------------------------------------------- | Register The Auto Loader |-------------------------------------------------------------------------- | | Composer provides a convenient, automatically generated class loader for | this application. We just need to utilize it! We'll simply require it | into the script here so we don't need to manually load our classes. | */ require __DIR__ . '/../vendor/autoload.php'; /* |-------------------------------------------------------------------------- | Run The Application |-------------------------------------------------------------------------- | | Once we have the application, we can handle the incoming request using | the application's HTTP kernel. Then, we will send the response back | to this client's browser, allowing them to enjoy our application. | */ $app = require_once __DIR__ . '/../bootstrap/app.php'; $kernel = $app->make(Kernel::class); $response = $kernel->handle( $request = Request::capture() )->send(); $kernel->terminate($request, $response);