Subject | Hash | Author | Date (UTC) |
---|---|---|---|
init | c35b49e211a32f427413661bfd9834314b56de3d | Luck | 2020-08-22 15:41:02 |
File | Lines added | Lines deleted |
---|---|---|
public/index.php | 42 | 0 |
File public/index.php added (mode: 100755) (index 0000000..0ceba16) | |||
1 | <?php | ||
2 | // Valid PHP Version? | ||
3 | $minPHPVersion = '7.2'; | ||
4 | if (phpversion() < $minPHPVersion) { | ||
5 | die("你的PHP版本必须大于{$minPHPVersion}. 你当前的PHP版本: " . phpversion()); | ||
6 | } | ||
7 | unset($minPHPVersion); | ||
8 | |||
9 | //定义当前目录 | ||
10 | define('FCPATH', __DIR__ . DIRECTORY_SEPARATOR); | ||
11 | |||
12 | //路径配置文件,根据自己的来配置 | ||
13 | $pathsPath = realpath(FCPATH . '../green/Config/Paths.php'); | ||
14 | // ^^^ 如果您移动您的应用程序文件夹,请更改此选项 | ||
15 | |||
16 | /* | ||
17 | *--------------------------------------------------------------- | ||
18 | * BOOTSTRAP THE APPLICATION | ||
19 | *--------------------------------------------------------------- | ||
20 | * This process sets up the path constants, loads and registers | ||
21 | * our autoloader, along with Composer's, loads our constants | ||
22 | * and fires up an environment-specific bootstrapping. | ||
23 | */ | ||
24 | |||
25 | // Ensure the current directory is pointing to the front controller's directory | ||
26 | chdir(__DIR__); | ||
27 | |||
28 | // Load our paths config file | ||
29 | require $pathsPath; | ||
30 | $paths = new Config\Paths(); | ||
31 | |||
32 | // Location of the framework bootstrap file. | ||
33 | $app = require rtrim($paths->systemDirectory, '/ ') . '/bootstrap.php'; //包含vendor/codeigniter4/framework/system/bootstrap.php | ||
34 | |||
35 | /* | ||
36 | *--------------------------------------------------------------- | ||
37 | * LAUNCH THE APPLICATION | ||
38 | *--------------------------------------------------------------- | ||
39 | * Now that everything is setup, it's time to actually fire | ||
40 | * up the engines and make this app do its thang. | ||
41 | */ | ||
42 | $app->run(); |