phpvms/public/index.php

63 lines
1.7 KiB
PHP
Raw Normal View History

2017-06-09 02:28:26 +08:00
<?php
/**
2020-09-03 06:47:38 +08:00
* phpVMS Entry Point
* https://phpvms.net
* https://docs.phpvms.net
*/
2021-03-05 20:33:42 +08:00
use Illuminate\Contracts\Http\Kernel;
use Illuminate\Http\Request;
/**
2020-09-03 06:47:38 +08:00
* NOTE!!
*
2020-03-02 23:50:39 +08:00
* If you move the public folder, or all the files in the public folder,
* be sure to change this to point to the right place. View these docs:
*
2020-09-03 06:47:38 +08:00
* https://docs.phpvms.net/installation/uploading
2017-06-09 02:28:26 +08:00
*/
2017-12-16 09:31:32 +08:00
$path_to_phpvms_folder = __DIR__.'/../';
2020-09-03 06:47:38 +08:00
if (file_exists($path_to_phpvms_folder.'bootstrap/autoload.php')) {
2021-03-05 20:33:42 +08:00
// noop
}
// Look up one more folder up (outside of the Laravel root) and in the `phpvms` subfolder
2020-09-03 06:52:52 +08:00
elseif (file_exists($path_to_phpvms_folder.'phpvms/bootstrap/autoload.php')) {
2021-03-05 20:33:42 +08:00
$path_to_phpvms_folder = $path_to_phpvms_folder.'phpvms';
2020-09-03 06:47:38 +08:00
}
// Bail out
else {
echo 'Cannot find path to bootstrap/autoload.php. Modify this file to the proper path';
exit();
}
2017-06-09 02:28:26 +08:00
2021-03-05 20:33:42 +08:00
require $path_to_phpvms_folder.'/bootstrap/autoload.php';
$app = require_once $path_to_phpvms_folder.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
| Check If Application Is Under Maintenance
|--------------------------------------------------------------------------
|
| If the application is maintenance / demo mode via the "down" command we
| will require this file so that any prerendered template can be shown
| instead of starting the framework, which could cause an exception.
|
*/
if (file_exists($path_to_phpvms_folder.'/storage/framework/maintenance.php')) {
require $path_to_phpvms_folder.'/storage/framework/maintenance.php';
}
2021-03-05 20:33:42 +08:00
$app->setPublicPath(__DIR__);
2017-06-09 02:28:26 +08:00
2021-03-05 20:33:42 +08:00
$kernel = $app->make(Kernel::class);
2017-06-09 02:28:26 +08:00
2021-03-05 20:33:42 +08:00
$response = tap($kernel->handle(
$request = Request::capture()
))->send();
2017-06-09 02:28:26 +08:00
$kernel->terminate($request, $response);