From 9010938f1b143f6083cd7caaa2134290512faa9e Mon Sep 17 00:00:00 2001 From: Hillel Coren Date: Wed, 15 Nov 2017 11:54:23 +0200 Subject: [PATCH] Update min php to 7 --- README.md | 2 +- app/Http/Controllers/AppController.php | 6 +++ app/Http/Controllers/Auth/LoginController.php | 15 +++++++ .../ClientAuth/LoginController.php | 15 +++++++ app/Http/Middleware/StartupCheck.php | 4 +- composer.json | 4 +- composer.lock | 44 ++++++++++--------- docs/install.rst | 2 +- docs/update.rst | 8 +++- resources/views/setup.blade.php | 4 +- 10 files changed, 75 insertions(+), 29 deletions(-) diff --git a/README.md b/README.md index 0649db5d86..5b8a581004 100644 --- a/README.md +++ b/README.md @@ -25,7 +25,7 @@ The self-host zip includes all third party libraries whereas downloading the cod ## Requirements -* PHP >= 5.5.9 +* PHP 7 * MySQL ## Recommended Providers diff --git a/app/Http/Controllers/AppController.php b/app/Http/Controllers/AppController.php index ba0dc4cea4..f7240d317d 100644 --- a/app/Http/Controllers/AppController.php +++ b/app/Http/Controllers/AppController.php @@ -272,6 +272,12 @@ class AppController extends BaseController try { set_time_limit(60 * 5); $this->checkInnoDB(); + + $cacheCompiled = base_path('bootstrap/cache/compiled.php'); + if (file_exists($cacheCompiled)) { unlink ($cacheCompiled); } + $cacheServices = base_path('bootstrap/cache/services.json'); + if (file_exists($cacheServices)) { unlink ($cacheServices); } + Artisan::call('clear-compiled'); Artisan::call('cache:clear'); Artisan::call('debugbar:clear'); diff --git a/app/Http/Controllers/Auth/LoginController.php b/app/Http/Controllers/Auth/LoginController.php index aff9502a31..e1840d57fb 100644 --- a/app/Http/Controllers/Auth/LoginController.php +++ b/app/Http/Controllers/Auth/LoginController.php @@ -110,6 +110,21 @@ class LoginController extends Controller return $response; } + /** + * Get the failed login response instance. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\RedirectResponse + */ + protected function sendFailedLoginResponse(Request $request) + { + return redirect()->back() + ->withInput($request->only($this->username(), 'remember')) + ->withErrors([ + $this->username() => trans('texts.invalid_credentials'), + ]); + } + /** * Send the post-authentication response. * diff --git a/app/Http/Controllers/ClientAuth/LoginController.php b/app/Http/Controllers/ClientAuth/LoginController.php index befc498cfa..becb723d59 100644 --- a/app/Http/Controllers/ClientAuth/LoginController.php +++ b/app/Http/Controllers/ClientAuth/LoginController.php @@ -88,6 +88,21 @@ class LoginController extends Controller return $credentials; } + /** + * Get the failed login response instance. + * + * @param \Illuminate\Http\Request $request + * @return \Illuminate\Http\RedirectResponse + */ + protected function sendFailedLoginResponse(Request $request) + { + return redirect()->back() + ->withInput($request->only($this->username(), 'remember')) + ->withErrors([ + $this->username() => trans('texts.invalid_credentials'), + ]); + } + /** * Validate the user login request - don't require the email * diff --git a/app/Http/Middleware/StartupCheck.php b/app/Http/Middleware/StartupCheck.php index 5db83b89b0..9c82abad03 100644 --- a/app/Http/Middleware/StartupCheck.php +++ b/app/Http/Middleware/StartupCheck.php @@ -55,8 +55,8 @@ class StartupCheck $file = storage_path() . '/version.txt'; $version = @file_get_contents($file); if ($version != NINJA_VERSION) { - if (version_compare(phpversion(), '5.5.9', '<')) { - dd('Please update PHP to >= 5.5.9'); + if (version_compare(phpversion(), '7.0.0', '<')) { + dd('Please update PHP to >= 7.0.0'); } $handle = fopen($file, 'w'); fwrite($handle, NINJA_VERSION); diff --git a/composer.json b/composer.json index d4b3dad2fa..5946f95f37 100644 --- a/composer.json +++ b/composer.json @@ -13,10 +13,10 @@ } ], "require": { - "php": ">=5.5.9", + "php": ">=7.0.0", "ext-gd": "*", "ext-gmp": "*", - "anahkiasen/former": "4.0.*@dev", + "anahkiasen/former": "4.*", "asgrim/ofxparser": "^1.1", "bacon/bacon-qr-code": "^1.0", "barracudanetworks/archivestream-php": "^1.0", diff --git a/composer.lock b/composer.lock index 82604aefd2..77dbcbae5c 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "f2043c8ce923c8af3c99ba7c5bcf5d5e", - "content-hash": "dbc2b358c79e0abe0a58d2bd02310966", + "hash": "303fbf170906bca5a5354e7bbb92c94d", + "content-hash": "a1aaf83c53c00ce8dbb3ec13d70a42b3", "packages": [ { "name": "abdala/omnipay-pagseguro", @@ -169,16 +169,16 @@ }, { "name": "anahkiasen/former", - "version": "4.0.6", + "version": "4.1.1", "source": { "type": "git", "url": "https://github.com/formers/former.git", - "reference": "1ad9b332e8d8f5b23159aabbca89084276938382" + "reference": "56fd10035d7e7c34e2761e0458b92ca8890e6a9a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/formers/former/zipball/1ad9b332e8d8f5b23159aabbca89084276938382", - "reference": "1ad9b332e8d8f5b23159aabbca89084276938382", + "url": "https://api.github.com/repos/formers/former/zipball/56fd10035d7e7c34e2761e0458b92ca8890e6a9a", + "reference": "56fd10035d7e7c34e2761e0458b92ca8890e6a9a", "shasum": "" }, "require": { @@ -197,6 +197,11 @@ "phpunit/phpunit": "~4" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "3.5.x-dev" + } + }, "autoload": { "psr-4": { "Former\\": [ @@ -217,14 +222,14 @@ } ], "description": "A powerful form builder", - "homepage": "http://anahkiasen.github.com/former/", + "homepage": "http://formers.github.io/former/", "keywords": [ "bootstrap", "form", "foundation", "laravel" ], - "time": "2016-07-28 19:36:11" + "time": "2017-05-30 18:43:09" }, { "name": "anahkiasen/html-object", @@ -380,16 +385,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "3.38.1", + "version": "3.38.2", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "9f704274f4748d2039a16d45b3388ed8dde74e89" + "reference": "7b13de0b39f29833a977176ce58eed990e1487ba" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/9f704274f4748d2039a16d45b3388ed8dde74e89", - "reference": "9f704274f4748d2039a16d45b3388ed8dde74e89", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/7b13de0b39f29833a977176ce58eed990e1487ba", + "reference": "7b13de0b39f29833a977176ce58eed990e1487ba", "shasum": "" }, "require": { @@ -456,7 +461,7 @@ "s3", "sdk" ], - "time": "2017-11-09 19:15:59" + "time": "2017-11-14 23:47:41" }, { "name": "bacon/bacon-qr-code", @@ -2547,16 +2552,16 @@ }, { "name": "gocardless/gocardless-pro", - "version": "1.2.0", + "version": "1.3.0", "source": { "type": "git", "url": "https://github.com/gocardless/gocardless-pro-php.git", - "reference": "d2d4adb7cde53722858f1e7e5508697fefdb5390" + "reference": "16ac38c2531e08c15e54b4a82d44854349cbfcf6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/gocardless/gocardless-pro-php/zipball/d2d4adb7cde53722858f1e7e5508697fefdb5390", - "reference": "d2d4adb7cde53722858f1e7e5508697fefdb5390", + "url": "https://api.github.com/repos/gocardless/gocardless-pro-php/zipball/16ac38c2531e08c15e54b4a82d44854349cbfcf6", + "reference": "16ac38c2531e08c15e54b4a82d44854349cbfcf6", "shasum": "" }, "require": { @@ -2595,7 +2600,7 @@ "direct debit", "gocardless" ], - "time": "2017-09-18 15:08:13" + "time": "2017-11-14 15:46:50" }, { "name": "google/apiclient", @@ -12412,7 +12417,6 @@ ], "minimum-stability": "dev", "stability-flags": { - "anahkiasen/former": 20, "chumper/datatable": 20, "codedge/laravel-selfupdater": 20, "collizo4sky/omnipay-wepay": 20, @@ -12431,7 +12435,7 @@ "prefer-stable": true, "prefer-lowest": false, "platform": { - "php": ">=5.5.9", + "php": ">=7.0.0", "ext-gd": "*", "ext-gmp": "*" }, diff --git a/docs/install.rst b/docs/install.rst index 6cd6b3e548..cf4955fded 100644 --- a/docs/install.rst +++ b/docs/install.rst @@ -3,7 +3,7 @@ Install Thanks for taking the time to setup Invoice Ninja. -.. Note:: The applications requires PHP >= 5.5.9 and MySQL. +.. Note:: The applications requires PHP >= 7.0.0 and MySQL. Detailed Guides ^^^^^^^^^^^^^^^ diff --git a/docs/update.rst b/docs/update.rst index c8af0f37d3..ecc2797d53 100644 --- a/docs/update.rst +++ b/docs/update.rst @@ -24,6 +24,11 @@ If the auto-update fails you can manually run the update with the following comm .. TIP:: You can see the detailed changes for each release on our `GitHub release notes `_. +Version 4.0 +""""""""""""" + +The minimum PHP version is now 7.0.0 + Version 3.2 """"""""""" @@ -36,7 +41,8 @@ Make sure the .env file includes ``APP_CIPHER=rijndael-128`` Version 2.5.1 """"""""""""" -Minimum PHP version is now 5.5.9 + +The minimum PHP version is now 5.5.9 Version 2.0 """"""""""" diff --git a/resources/views/setup.blade.php b/resources/views/setup.blade.php index b4a4969e78..b1520c233e 100644 --- a/resources/views/setup.blade.php +++ b/resources/views/setup.blade.php @@ -26,8 +26,8 @@

Invoice Ninja Setup

- @if (version_compare(phpversion(), '5.5.9', '<')) -
Warning: The application requires PHP >= 5.5.9
+ @if (version_compare(phpversion(), '7.0.0', '<')) +
Warning: The application requires PHP >= 7.0.0
@endif @if (!function_exists('proc_open'))
Warning: proc_open must be enabled.