{"id":27,"date":"2024-05-14T22:14:41","date_gmt":"2024-05-14T14:14:41","guid":{"rendered":"https:\/\/www.iforz.cn\/?p=27"},"modified":"2024-05-15T12:01:42","modified_gmt":"2024-05-15T04:01:42","slug":"intellij-idea-%e9%85%8d%e7%bd%aephp%e6%a1%86%e6%9e%b6%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83","status":"publish","type":"post","link":"https:\/\/www.iforz.cn\/index.php\/2024\/05\/14\/intellij-idea-%e9%85%8d%e7%bd%aephp%e6%a1%86%e6%9e%b6%e5%bc%80%e5%8f%91%e7%8e%af%e5%a2%83\/","title":{"rendered":"IntelliJ IDEA \u914d\u7f6ephp\u6846\u67b6\u5f00\u53d1\u73af\u5883"},"content":{"rendered":"\n<p class=\"wp-block-paragraph\">*\u9002\u5408\u4ee5public\u6216\u5176\u5b50\u76ee\u5f55\u4e3a\u8fd0\u884c\u76ee\u5f55\u7684\u6846\u67b6<\/p>\n\n\n\n<ol class=\"wp-block-list\">\n<li>\u76f4\u63a5\u4e0arouter.php\u4ee3\u7801, <strong>\u9700\u8981\u6839\u636e\u9879\u76ee\u81ea\u884c\u9002\u914d,\u5982\u679c\u4e0d\u4f1a, \u53ef\u6709\u507f\u5e2e\u5fd9<\/strong><\/li>\n<\/ol>\n\n\n\n<pre class=\"wp-block-code\"><code>&lt;?php\nif (is_file($_SERVER&#91;\"DOCUMENT_ROOT\"] . $_SERVER&#91;\"SCRIPT_NAME\"])) {\n    return false;\n}\n$ex = pathinfo($_SERVER&#91;\"SCRIPT_NAME\"], PATHINFO_EXTENSION);\nif ( $ex !== '' &amp;&amp; $ex !== 'php') {\n    $path = $_SERVER&#91;\"DOCUMENT_ROOT\"] . '\/public' . $_SERVER&#91;\"SCRIPT_NAME\"];\n    $Files = file_get_contents($path);\n\/\/    print_r($_SERVER&#91;'HTTP_SEC_FETCH_DEST']);\n    if ($_SERVER&#91;'HTTP_SEC_FETCH_DEST'] === 'script') {\n        header('Content-Type: text\/javascript');\n    } elseif ($_SERVER&#91;'HTTP_SEC_FETCH_DEST'] === 'style') {\n        header('Content-Type: text\/css');\n    } else {\n        header('Content-Type: image\/png');\n    }\n    echo $Files;\n} else {\n    $url = $_SERVER&#91;\"REQUEST_URI\"];\n    if ($_SERVER&#91;'REQUEST_URI'] === '\/') {\n        $url = '\/index.php';\n    }\n    preg_match('\/(.*\\.php)(.*)\/', $url, $Match);\n    if (isset($Match&#91;1])) {\n        $_SERVER&#91;'SCRIPT_FILENAME'] = __DIR__ . $Match&#91;1];\n        if (isset($Match&#91;2])) {\n            $_SERVER&#91;'REQUEST_URI'] = $Match&#91;2];\n        } else {\n            $_SERVER&#91;'REQUEST_URI'] = \"\/\";\n        }\n        $extension = pathinfo($Match&#91;1], PATHINFO_EXTENSION);\n        if ($extension === 'php') {\n            require __DIR__ . $Match&#91;1];\n        } else {\n            echo '404';\n        }\n    } else {\n        require __DIR__ . '\/index.php';\n    }\n}\n<\/code><\/pre>\n\n\n\n<p class=\"wp-block-paragraph\">2. IntelliJ IDEA\u8fd0\u884c\u914d\u7f6e<\/p>\n\n\n\n<figure class=\"wp-block-image size-large\"><img loading=\"lazy\" decoding=\"async\" width=\"1024\" height=\"564\" src=\"https:\/\/www.iforz.cn\/wp-content\/uploads\/2024\/05\/image-1-1024x564.png\" alt=\"\" class=\"wp-image-29\" srcset=\"https:\/\/www.iforz.cn\/wp-content\/uploads\/2024\/05\/image-1-1024x564.png 1024w, https:\/\/www.iforz.cn\/wp-content\/uploads\/2024\/05\/image-1-300x165.png 300w, https:\/\/www.iforz.cn\/wp-content\/uploads\/2024\/05\/image-1-768x423.png 768w, https:\/\/www.iforz.cn\/wp-content\/uploads\/2024\/05\/image-1-1536x846.png 1536w, https:\/\/www.iforz.cn\/wp-content\/uploads\/2024\/05\/image-1.png 1898w\" sizes=\"auto, (max-width: 1024px) 100vw, 1024px\" \/><\/figure>\n","protected":false},"excerpt":{"rendered":"<p>*\u9002\u5408\u4ee5public\u6216\u5176\u5b50\u76ee\u5f55\u4e3a\u8fd0\u884c\u76ee\u5f55\u7684\u6846\u67b6 2. IntelliJ IDEA\u8fd0\u884c\u914d\u7f6e<\/p>\n","protected":false},"author":1,"featured_media":0,"comment_status":"closed","ping_status":"","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[8,5],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-tool-reviews","category-code"],"_links":{"self":[{"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":2,"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"predecessor-version":[{"id":31,"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/posts\/27\/revisions\/31"}],"wp:attachment":[{"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.iforz.cn\/index.php\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}