Skip to content

Commit

Permalink
Update min php to 7
Browse files Browse the repository at this point in the history
  • Loading branch information
hillelcoren committed Nov 15, 2017
1 parent 0f5f1b6 commit 9010938
Show file tree
Hide file tree
Showing 10 changed files with 75 additions and 29 deletions.
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -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
Expand Down
6 changes: 6 additions & 0 deletions app/Http/Controllers/AppController.php
Original file line number Diff line number Diff line change
Expand Up @@ -272,6 +272,12 @@ public function update()
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');
Expand Down
15 changes: 15 additions & 0 deletions app/Http/Controllers/Auth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -110,6 +110,21 @@ public function postLoginWrapper(Request $request)
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.
*
Expand Down
15 changes: 15 additions & 0 deletions app/Http/Controllers/ClientAuth/LoginController.php
Original file line number Diff line number Diff line change
Expand Up @@ -88,6 +88,21 @@ protected function credentials(Request $request)
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
*
Expand Down
4 changes: 2 additions & 2 deletions app/Http/Middleware/StartupCheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -55,8 +55,8 @@ public function handle(Request $request, Closure $next)
$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);
Expand Down
4 changes: 2 additions & 2 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -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",
Expand Down
44 changes: 24 additions & 20 deletions composer.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion docs/install.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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
^^^^^^^^^^^^^^^
Expand Down
8 changes: 7 additions & 1 deletion docs/update.rst
Original file line number Diff line number Diff line change
Expand Up @@ -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 <https://github.com/invoiceninja/invoiceninja/releases>`_.

Version 4.0
"""""""""""""

The minimum PHP version is now 7.0.0

Version 3.2
"""""""""""

Expand All @@ -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
"""""""""""
Expand Down
4 changes: 2 additions & 2 deletions resources/views/setup.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,8 +26,8 @@

<div class="jumbotron">
<h2>Invoice Ninja Setup</h2>
@if (version_compare(phpversion(), '5.5.9', '<'))
<div class="alert alert-warning">Warning: The application requires PHP >= 5.5.9</div>
@if (version_compare(phpversion(), '7.0.0', '<'))
<div class="alert alert-warning">Warning: The application requires PHP >= 7.0.0</div>
@endif
@if (!function_exists('proc_open'))
<div class="alert alert-warning">Warning: <a href="http://php.net/manual/en/function.proc-open.php" target="_blank">proc_open</a> must be enabled.</div>
Expand Down

0 comments on commit 9010938

Please sign in to comment.