Permalink
Browse files

Migrate bootstrap process

  • Loading branch information...
1 parent b1b7003 commit ed22cc91861c5d6f920c5818ed9b03bee70819c4 @daftspunk daftspunk committed Feb 4, 2015
View
@@ -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)
View
@@ -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
+
@@ -1,2 +0,0 @@
-*
-!.gitignore
@@ -1 +0,0 @@
-services.manifest
@@ -1,2 +0,0 @@
-*
-!.gitignore
@@ -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 @@
|
*/
-$app->bindInstallPaths(require __DIR__.'/paths.php');
+// $app->bindInstallPaths(require __DIR__.'/paths.php');
/*
|--------------------------------------------------------------------------
@@ -52,25 +65,25 @@
|
*/
-$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';
/*
|--------------------------------------------------------------------------
| Disable any caching
|--------------------------------------------------------------------------
*/
-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');
+// }
/*
|--------------------------------------------------------------------------
@@ -27,22 +27,11 @@
|
*/
-if (file_exists($compiled = __DIR__.'/compiled.php')) {
- require $compiled;
-}
+$compiledPath = __DIR__.'/../storage/framework/compiled.php';
-/*
-|--------------------------------------------------------------------------
-| 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();
+if (file_exists($compiledPath)) {
+ require $compiledPath;
+}
/*
|--------------------------------------------------------------------------
@@ -55,16 +44,3 @@
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
@@ -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",
@@ -87,6 +87,20 @@
/*
|--------------------------------------------------------------------------
+ | 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
|--------------------------------------------------------------------------
|
@@ -105,19 +119,6 @@
/*
|--------------------------------------------------------------------------
- | 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
|--------------------------------------------------------------------------
|
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
File renamed without changes.
@@ -1,6 +1,6 @@
<?php
-return array(
+return [
/*
|--------------------------------------------------------------------------
@@ -11,12 +11,12 @@
| 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'),
/*
|--------------------------------------------------------------------------
@@ -35,6 +35,19 @@
/*
|--------------------------------------------------------------------------
+ | 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 @@
|
*/
- 'files' => storage_path().'/sessions',
+ 'files' => storage_path().'/framework/sessions',
/*
|--------------------------------------------------------------------------
@@ -83,7 +96,7 @@
|
*/
- 'lottery' => array(2, 100),
+ 'lottery' => [2, 100],
/*
|--------------------------------------------------------------------------
@@ -124,4 +137,17 @@
'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,
+
+];
File renamed without changes.
File renamed without changes.
View
@@ -26,7 +26,7 @@
|
*/
-$app = require_once __DIR__.'/bootstrap/start.php';
+$app = require_once __DIR__.'/bootstrap/app.php';
/*
|--------------------------------------------------------------------------
@@ -37,4 +37,12 @@
|
*/
-$app->run();
+$kernel = $app->make('Illuminate\Contracts\Http\Kernel');
+
+$response = $kernel->handle(
+ $request = Illuminate\Http\Request::capture()
+);
+
+$response->send();
+
+$kernel->terminate($request, $response);
@@ -57,7 +57,7 @@ public function register()
$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'
@@ -4,7 +4,7 @@
use App;
use File;
use Config;
-use Controller as ControllerBase;
+use Illuminate\Routing\Controller as ControllerBase;
use October\Rain\Router\Helper as RouterHelper;
/**
@@ -41,7 +41,6 @@ public function register()
/*
* Register core providers
*/
- App::register('October\Rain\Config\ConfigServiceProvider');
App::register('October\Rain\Translation\TranslationServiceProvider');
/*
@@ -103,10 +102,10 @@ public function register()
/*
* 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
Oops, something went wrong.

0 comments on commit ed22cc9

Please sign in to comment.