Migrate bootstrap process

This commit is contained in:
Samuel Georges 2015-02-04 19:31:41 +11:00
parent b1b700368f
commit ed22cc9186
35 changed files with 223 additions and 128 deletions

View File

@ -1,13 +1,5 @@
* **Build !!!** (2015-!!-!!)
- **Upgraded framework to Laravel version 5**
- Renamed classes:
```
October\Rain\Support\Yaml -> Yaml
October\Rain\Support\Markdown -> Markdown
System\Classes\ApplicationException -> ApplicationException
System\Classes\SystemException -> SystemException
October\Rain\Support\ValidationException -> ValidationException
```
- Introduced a linking policy to control the way URLs are generated globally (see config cms.linkPolicy).
* **Build 18x** (2015-01-xx)

15
UPGRADE.md Normal file
View File

@ -0,0 +1,15 @@
### Renamed classes:
October\Rain\Support\Yaml -> Yaml
October\Rain\Support\Markdown -> Markdown
System\Classes\ApplicationException -> ApplicationException
System\Classes\SystemException -> SystemException
October\Rain\Support\ValidationException -> ValidationException
### File system changes
[MOVE] /app/config -> /config
[MOVE] /app/storage -> /storage
[CREATE] /storage/framework

View File

@ -1 +0,0 @@
services.manifest

View File

@ -1,2 +0,0 @@
*
!.gitignore

View File

@ -1,2 +0,0 @@
*
!.gitignore

View File

@ -11,22 +11,35 @@
|
*/
$app = new Illuminate\Foundation\Application;
$app = new October\Rain\Foundation\Application(
realpath(__DIR__.'/../')
);
/*
|--------------------------------------------------------------------------
| Detect The Application Environment
| Bind Important Interfaces
|--------------------------------------------------------------------------
|
| Laravel takes a dead simple approach to your application environments
| so you can just specify a machine name or HTTP host that matches a
| given environment, then we will automatically detect it for you.
| Next, we need to bind some important interfaces into the container so
| we will be able to resolve them when needed. The kernels serve the
| incoming requests to this application from both the web and CLI.
|
*/
$env = $app->detectEnvironment(function () {
return getenv('CMS_ENV') ?: 'production';
});
$app->singleton(
'Illuminate\Contracts\Http\Kernel',
'October\Rain\Foundation\Http\Kernel'
);
$app->singleton(
'Illuminate\Contracts\Console\Kernel',
'October\Rain\Foundation\Console\Kernel'
);
$app->singleton(
'Illuminate\Contracts\Debug\ExceptionHandler',
'October\Rain\Foundation\Exceptions\Handler'
);
/*
|--------------------------------------------------------------------------
@ -39,7 +52,7 @@ $env = $app->detectEnvironment(function () {
|
*/
$app->bindInstallPaths(require __DIR__.'/paths.php');
// $app->bindInstallPaths(require __DIR__.'/paths.php');
/*
|--------------------------------------------------------------------------
@ -52,9 +65,9 @@ $app->bindInstallPaths(require __DIR__.'/paths.php');
|
*/
$framework = $app['path.base'].'/vendor/laravel/framework/src';
// $framework = $app['path.base'].'/vendor/laravel/framework/src';
require $framework.'/Illuminate/Foundation/start.php';
// require $framework.'/Illuminate/Foundation/start.php';
/*
|--------------------------------------------------------------------------
@ -62,15 +75,15 @@ require $framework.'/Illuminate/Foundation/start.php';
|--------------------------------------------------------------------------
*/
if (!isset($unitTesting) || !$unitTesting) {
header('Cache-Control: no-store, private, no-cache, must-revalidate'); // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0, max-stale = 0', false); // HTTP/1.1
header('Pragma: public');
header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
header('Expires: 0', false);
header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
header('Pragma: no-cache');
}
// if (!isset($unitTesting) || !$unitTesting) {
// header('Cache-Control: no-store, private, no-cache, must-revalidate'); // HTTP/1.1
// header('Cache-Control: pre-check=0, post-check=0, max-age=0, max-stale = 0', false); // HTTP/1.1
// header('Pragma: public');
// header('Expires: Sat, 26 Jul 1997 05:00:00 GMT'); // Date in the past
// header('Expires: 0', false);
// header('Last-Modified: '.gmdate('D, d M Y H:i:s').' GMT');
// header('Pragma: no-cache');
// }
/*
|--------------------------------------------------------------------------

View File

@ -27,23 +27,12 @@ require __DIR__.'/../vendor/autoload.php';
|
*/
if (file_exists($compiled = __DIR__.'/compiled.php')) {
require $compiled;
$compiledPath = __DIR__.'/../storage/framework/compiled.php';
if (file_exists($compiledPath)) {
require $compiledPath;
}
/*
|--------------------------------------------------------------------------
| Setup Patchwork UTF-8 Handling
|--------------------------------------------------------------------------
|
| The Patchwork library provides solid handling of UTF-8 strings as well
| as provides replacements for all mb_* and iconv type functions that
| are not available by default in PHP. We'll setup this stuff here.
|
*/
Patchwork\Utf8\Bootup::initMbstring();
/*
|--------------------------------------------------------------------------
| Register The October Auto Loader
@ -55,16 +44,3 @@ Patchwork\Utf8\Bootup::initMbstring();
October\Rain\Support\ClassLoader::register();
October\Rain\Support\ClassLoader::addDirectories(array(__DIR__.'/../modules', __DIR__.'/../plugins'));
/*
|--------------------------------------------------------------------------
| Register The Laravel Auto Loader
|--------------------------------------------------------------------------
|
| We register an auto-loader "behind" the Composer loader that can load
| model classes on the fly, even if the autoload files have not been
| regenerated for the application. We'll add it to the stack here.
|
*/
Illuminate\Support\ClassLoader::register();

View File

@ -24,7 +24,7 @@
},
"require": {
"php": ">=5.4",
"laravel/framework": "4.2.*",
"laravel/framework": "5.0.*@dev",
"october/system": "~1.0",
"october/backend": "~1.0",
"october/cms": "~1.0",

View File

@ -85,6 +85,20 @@ return array(
'cipher' => MCRYPT_RIJNDAEL_128,
/*
|--------------------------------------------------------------------------
| Logging Configuration
|--------------------------------------------------------------------------
|
| Here you may configure the log settings for your application. Out of
| the box, Laravel uses the Monolog PHP logging library. This gives
| you a variety of powerful log handlers / formatters to utilize.
|
| Available Settings: "single", "daily", "syslog"
|
*/
'log' => 'single',
/*
|--------------------------------------------------------------------------
| Autoloaded Service Providers
@ -103,19 +117,6 @@ return array(
'System\ServiceProvider',
)),
/*
|--------------------------------------------------------------------------
| Service Provider Manifest
|--------------------------------------------------------------------------
|
| The service provider manifest is used by Laravel to lazy load service
| providers which are not needed for each request, as well to keep a
| list of all of the services. Here, you may set its storage spot.
|
*/
'manifest' => storage_path().'/meta',
/*
|--------------------------------------------------------------------------
| Class Aliases

View File

@ -1,6 +1,6 @@
<?php
return array(
return [
/*
|--------------------------------------------------------------------------
@ -11,12 +11,12 @@ return array(
| requests. By default, we will use the lightweight native driver but
| you may specify any of the other wonderful drivers provided here.
|
| Supported: "native", "cookie", "database", "apc",
| Supported: "file", "cookie", "database", "apc",
| "memcached", "redis", "array"
|
*/
'driver' => 'native',
'driver' => env('SESSION_DRIVER', 'file'),
/*
|--------------------------------------------------------------------------
@ -33,6 +33,19 @@ return array(
'expire_on_close' => false,
/*
|--------------------------------------------------------------------------
| Session Encryption
|--------------------------------------------------------------------------
|
| This option allows you to easily specify that all of your session data
| should be encrypted before it is stored. All encryption will be run
| automatically by Laravel and you can use the Session like normal.
|
*/
'encrypt' => false,
/*
|--------------------------------------------------------------------------
| Session File Location
@ -44,7 +57,7 @@ return array(
|
*/
'files' => storage_path().'/sessions',
'files' => storage_path().'/framework/sessions',
/*
|--------------------------------------------------------------------------
@ -83,7 +96,7 @@ return array(
|
*/
'lottery' => array(2, 100),
'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
@ -124,4 +137,17 @@ return array(
'domain' => null,
);
/*
|--------------------------------------------------------------------------
| HTTPS Only Cookies
|--------------------------------------------------------------------------
|
| By setting this option to true, session cookies will only be sent back
| to the server if the browser has a HTTPS connection. This will keep
| the cookie from being sent to you if it can not be done securely.
|
*/
'secure' => false,
];

View File

@ -26,7 +26,7 @@ require __DIR__.'/bootstrap/autoload.php';
|
*/
$app = require_once __DIR__.'/bootstrap/start.php';
$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
@ -37,4 +37,12 @@ $app = require_once __DIR__.'/bootstrap/start.php';
|
*/
$app->run();
$kernel = $app->make('Illuminate\Contracts\Http\Kernel');
$response = $kernel->handle(
$request = Illuminate\Http\Request::capture()
);
$response->send();
$kernel->terminate($request, $response);

View File

@ -57,7 +57,7 @@ class ServiceProvider extends ModuleServiceProvider
$manager->registerFormWidget('Backend\FormWidgets\DataGrid', [
'label' => 'Data Grid',
'code' => 'datagrid'
]); // @deprecated if year >= 2015
]); // @deprecated if year >= 2016
$manager->registerFormWidget('Backend\FormWidgets\DataTable', [
'label' => 'Data Table',
'code' => 'datatable'

View File

@ -4,7 +4,7 @@ use Str;
use App;
use File;
use Config;
use Controller as ControllerBase;
use Illuminate\Routing\Controller as ControllerBase;
use October\Rain\Router\Helper as RouterHelper;
/**

View File

@ -41,7 +41,6 @@ class ServiceProvider extends ModuleServiceProvider
/*
* Register core providers
*/
App::register('October\Rain\Config\ConfigServiceProvider');
App::register('October\Rain\Translation\TranslationServiceProvider');
/*
@ -103,10 +102,10 @@ class ServiceProvider extends ModuleServiceProvider
/*
* Error handling for uncaught Exceptions
*/
App::error(function (\Exception $exception, $httpCode) {
$handler = new ErrorHandler;
return $handler->handleException($exception, $httpCode);
});
// App::error(function (\Exception $exception, $httpCode) {
// $handler = new ErrorHandler;
// return $handler->handleException($exception, $httpCode);
// });
/*
* Write all log events to the database

View File

@ -5,36 +5,70 @@ return [
/*
* Laravel aliases
*/
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
'Cache' => 'Illuminate\Support\Facades\Cache',
'ClassLoader' => 'Illuminate\Support\ClassLoader',
'Controller' => 'Illuminate\Routing\Controller',
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
'Hash' => 'Illuminate\Support\Facades\Hash',
'HTML' => 'Illuminate\Support\Facades\HTML',
'Input' => 'Illuminate\Support\Facades\Input',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Paginator' => 'Illuminate\Support\Facades\Paginator',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Session' => 'Illuminate\Support\Facades\Session',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Form' => 'Illuminate\Support\Facades\Form',
// 'App' => 'Illuminate\Support\Facades\App',
// 'Artisan' => 'Illuminate\Support\Facades\Artisan',
// 'Cache' => 'Illuminate\Support\Facades\Cache',
// 'ClassLoader' => 'Illuminate\Support\ClassLoader',
// 'Controller' => 'Illuminate\Routing\Controller',
// 'Cookie' => 'Illuminate\Support\Facades\Cookie',
// 'Crypt' => 'Illuminate\Support\Facades\Crypt',
// 'DB' => 'Illuminate\Support\Facades\DB',
// 'Eloquent' => 'Illuminate\Database\Eloquent\Model',
// 'Event' => 'Illuminate\Support\Facades\Event',
// 'Hash' => 'Illuminate\Support\Facades\Hash',
// 'HTML' => 'Illuminate\Support\Facades\HTML',
// 'Input' => 'Illuminate\Support\Facades\Input',
// 'Lang' => 'Illuminate\Support\Facades\Lang',
// 'Log' => 'Illuminate\Support\Facades\Log',
// 'Mail' => 'Illuminate\Support\Facades\Mail',
// 'Paginator' => 'Illuminate\Support\Facades\Paginator',
// 'Password' => 'Illuminate\Support\Facades\Password',
// 'Queue' => 'Illuminate\Support\Facades\Queue',
// 'Redirect' => 'Illuminate\Support\Facades\Redirect',
// 'Redis' => 'Illuminate\Support\Facades\Redis',
// 'Request' => 'Illuminate\Support\Facades\Request',
// 'Response' => 'Illuminate\Support\Facades\Response',
// 'Route' => 'Illuminate\Support\Facades\Route',
// 'Schema' => 'Illuminate\Support\Facades\Schema',
// 'Session' => 'Illuminate\Support\Facades\Session',
// 'URL' => 'Illuminate\Support\Facades\URL',
// 'Validator' => 'Illuminate\Support\Facades\Validator',
// 'View' => 'Illuminate\Support\Facades\View',
// 'Form' => 'Illuminate\Support\Facades\Form',
'App' => 'Illuminate\Support\Facades\App',
'Artisan' => 'Illuminate\Support\Facades\Artisan',
// 'Auth' => 'Illuminate\Support\Facades\Auth',
// 'Blade' => 'Illuminate\Support\Facades\Blade',
'Bus' => 'Illuminate\Support\Facades\Bus',
'Cache' => 'Illuminate\Support\Facades\Cache',
// 'Config' => 'Illuminate\Support\Facades\Config',*
'Cookie' => 'Illuminate\Support\Facades\Cookie',
'Crypt' => 'Illuminate\Support\Facades\Crypt',
'DB' => 'Illuminate\Support\Facades\DB',
'Eloquent' => 'Illuminate\Database\Eloquent\Model',
'Event' => 'Illuminate\Support\Facades\Event',
// 'File' => 'Illuminate\Support\Facades\File',*
'Hash' => 'Illuminate\Support\Facades\Hash',
'Input' => 'Illuminate\Support\Facades\Input',
// 'Inspiring' => 'Illuminate\Foundation\Inspiring',
'Lang' => 'Illuminate\Support\Facades\Lang',
'Log' => 'Illuminate\Support\Facades\Log',
'Mail' => 'Illuminate\Support\Facades\Mail',
'Password' => 'Illuminate\Support\Facades\Password',
'Queue' => 'Illuminate\Support\Facades\Queue',
'Redirect' => 'Illuminate\Support\Facades\Redirect',
'Redis' => 'Illuminate\Support\Facades\Redis',
'Request' => 'Illuminate\Support\Facades\Request',
'Response' => 'Illuminate\Support\Facades\Response',
'Route' => 'Illuminate\Support\Facades\Route',
'Schema' => 'Illuminate\Support\Facades\Schema',
'Session' => 'Illuminate\Support\Facades\Session',
'Storage' => 'Illuminate\Support\Facades\Storage',
'URL' => 'Illuminate\Support\Facades\URL',
'Validator' => 'Illuminate\Support\Facades\Validator',
'View' => 'Illuminate\Support\Facades\View',
'Form' => 'Illuminate\Support\Facades\Form',
/*
* October aliases

View File

@ -5,24 +5,47 @@ return [
/*
* Laravel providers
*/
// 'Illuminate\Foundation\Providers\ArtisanServiceProvider',
// 'Illuminate\Cache\CacheServiceProvider',
// 'Illuminate\Session\CommandsServiceProvider',
// 'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
// 'Illuminate\Routing\ControllerServiceProvider',
// 'Illuminate\Cookie\CookieServiceProvider',
// 'Illuminate\Encryption\EncryptionServiceProvider',
// 'Illuminate\Hashing\HashServiceProvider',
// 'Illuminate\Log\LogServiceProvider',
// 'Illuminate\Database\MigrationServiceProvider',
// 'Illuminate\Foundation\Providers\OptimizeServiceProvider',
// 'Illuminate\Pagination\PaginationServiceProvider',
// 'Illuminate\Queue\QueueServiceProvider',
// 'Illuminate\Redis\RedisServiceProvider',
// 'Illuminate\Remote\RemoteServiceProvider',
// 'Illuminate\Database\SeedServiceProvider',
// 'Illuminate\Foundation\Providers\ServerServiceProvider',
// 'Illuminate\Session\SessionServiceProvider',
// 'Illuminate\Validation\ValidationServiceProvider',
// 'Illuminate\View\ViewServiceProvider',
'Illuminate\Foundation\Providers\ArtisanServiceProvider',
// 'Illuminate\Auth\AuthServiceProvider',
'Illuminate\Bus\BusServiceProvider',
'Illuminate\Cache\CacheServiceProvider',
'Illuminate\Session\CommandsServiceProvider',
'Illuminate\Foundation\Providers\ConsoleSupportServiceProvider',
'Illuminate\Routing\ControllerServiceProvider',
'Illuminate\Cookie\CookieServiceProvider',
// 'Illuminate\Database\DatabaseServiceProvider',**
'Illuminate\Encryption\EncryptionServiceProvider',
// 'Illuminate\Filesystem\FilesystemServiceProvider',**
'Illuminate\Foundation\Providers\FoundationServiceProvider',
'Illuminate\Hashing\HashServiceProvider',
'Illuminate\Log\LogServiceProvider',
'Illuminate\Database\MigrationServiceProvider',
'Illuminate\Foundation\Providers\OptimizeServiceProvider',
// 'Illuminate\Mail\MailServiceProvider',**
'Illuminate\Pagination\PaginationServiceProvider',
'Illuminate\Pipeline\PipelineServiceProvider',
'Illuminate\Queue\QueueServiceProvider',
'Illuminate\Redis\RedisServiceProvider',
'Illuminate\Remote\RemoteServiceProvider',
'Illuminate\Database\SeedServiceProvider',
'Illuminate\Foundation\Providers\ServerServiceProvider',
// 'Illuminate\Auth\Passwords\PasswordResetServiceProvider',
'Illuminate\Session\SessionServiceProvider',
// 'Illuminate\Translation\TranslationServiceProvider',
'Illuminate\Validation\ValidationServiceProvider',
'Illuminate\View\ViewServiceProvider',
@ -32,7 +55,7 @@ return [
'October\Rain\Cron\CronServiceProvider',
'October\Rain\Database\DatabaseServiceProvider',
'October\Rain\Filesystem\FilesystemServiceProvider',
'October\Rain\Config\ConfigServiceProvider',
// 'October\Rain\Config\ConfigServiceProvider',
'October\Rain\Html\HtmlServiceProvider',
'October\Rain\Network\NetworkServiceProvider',
'October\Rain\Translation\TranslationServiceProvider',

1
storage/.gitignore vendored Normal file
View File

@ -0,0 +1 @@
laravel.log

6
storage/framework/.gitignore vendored Normal file
View File

@ -0,0 +1,6 @@
config.php
routes.php
compiled.php
services.json
events.scanned.php
routes.scanned.php

2
storage/framework/sessions/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
storage/framework/views/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore

2
storage/logs/.gitignore vendored Normal file
View File

@ -0,0 +1,2 @@
*
!.gitignore