Skip to content

Commit 66d21dc

Browse files
committed
remove laravel 4 support, add compatibility module for future usage
1 parent 4df2754 commit 66d21dc

File tree

4 files changed

+21
-105
lines changed

4 files changed

+21
-105
lines changed

composer.json

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -11,7 +11,7 @@
1111
],
1212
"require": {
1313
"php": ">=5.4.0",
14-
"laravel/framework": "*",
14+
"laravel/framework": "~5",
1515
"doctrine/cache": "~1.4",
1616
"predis/predis": "~1.0"
1717
},

src/Application.php

Lines changed: 7 additions & 16 deletions
Original file line numberDiff line numberDiff line change
@@ -30,8 +30,6 @@
3030
*/
3131
class Application extends Container
3232
{
33-
use ApplicationCompatibility;
34-
3533
/**
3634
* @var string
3735
*/
@@ -86,31 +84,23 @@ public function removeProvider($provider)
8684
$this->baseProviders = array_diff($this->baseProviders, [$provider]);
8785
}
8886

89-
/**
90-
*
91-
*/
9287
public function boot()
9388
{
9489
$this['app'] = $this;
9590
$this['env'] = 'production';
96-
// $this['request'] = $this->captureRequest();
9791
$this->setPaths();
9892

93+
$this->setCompatibility('5');
94+
9995
if (file_exists($helpers = 'vendor/laravel/framework/src/Illuminate/Support/helpers.php')) {
10096
require $helpers;
10197
}
10298

103-
10499
$this->registerBaseProviders();
105100

106101
$this->bootProviders();
107102
$this->bladeCompatibility();
108103

109-
// $this->bootRequest();
110-
// $this->bootSession();
111-
112-
113-
114104
$this->bind('response', function () {
115105
return new Response();
116106
});
@@ -122,6 +112,11 @@ public function boot()
122112
$this->registerCoreContainerAliases();
123113
}
124114

115+
public function setCompatibility($version)
116+
{
117+
$this['compatibility'] = new Compatibility($version);
118+
}
119+
125120
public function setBaseApp(Container $app)
126121
{
127122
$this['base_app'] = $app;
@@ -140,12 +135,8 @@ public function useExistingRequest(\Illuminate\Http\Request $request)
140135
$this['session.store'] = $request->getSession();
141136
}
142137

143-
/**
144-
*
145-
*/
146138
public function bladeCompatibility()
147139
{
148-
149140
$compiler = $this['view']->getEngineResolver()->resolve('blade')->getCompiler();
150141
$compiler->setContentTags('{!!', '!!}'); // for variables and all things Blade
151142
$compiler->setEscapedContentTags('{{', '}}'); // for escaped data

src/Compatibility.php

Lines changed: 13 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,13 @@
1+
<?php namespace Ionut\Crud;
2+
3+
class Compatibility
4+
{
5+
6+
protected $laravelVersion;
7+
8+
public function __construct($laravelVersion)
9+
{
10+
$this->laravelVersion = $laravelVersion;
11+
}
12+
13+
}

src/Modules/LaravelCompatibility/ApplicationCompatibility.php

Lines changed: 0 additions & 88 deletions
This file was deleted.

0 commit comments

Comments
 (0)