separate codes with namespaced class names from index.php

This commit is contained in:
printempw 2016-12-17 13:06:36 +08:00
parent 4f30cc6eb7
commit c9a3c0549b
3 changed files with 25 additions and 25 deletions

View File

@ -28,7 +28,8 @@ Blessing Skin Server has a few system requirements.
1. Web server which supports URL rewriting
2. **PHP version >= 5.5.9**
3. GD PHP Extension
4. Writeable directory
4. OpenSSL PHP Extension
5. Writeable directory
Quick Start Install
-----------

View File

@ -1,5 +1,18 @@
<?php
/*
|--------------------------------------------------------------------------
| Handle The Request
|--------------------------------------------------------------------------
|
| Blessing Skin Server separated these codes here to ensure that
| runtime check will be executed correctly, since namespaced class names
| will be regarded as parse error under PHP 5.3.
|
*/
require __DIR__.'/autoload.php';
/*
|--------------------------------------------------------------------------
| Create The Application
@ -41,15 +54,12 @@ $app->singleton(
App\Exceptions\Handler::class
);
/*
|--------------------------------------------------------------------------
| Return The Application
|--------------------------------------------------------------------------
|
| This script returns the application instance. The instance is given to
| the calling script so we can separate the building of the instances
| from the actual running of the application and sending responses.
|
*/
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
return $app;
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);

View File

@ -20,16 +20,5 @@ if (!function_exists('openssl_encrypt')) {
exit('[Error] You have not installed the OpenSSL extension');
}
require __DIR__.'/bootstrap/autoload.php';
$app = require_once __DIR__.'/bootstrap/app.php';
$kernel = $app->make(Illuminate\Contracts\Http\Kernel::class);
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);
// handle the request
require __DIR__.'/bootstrap/handler.php';