more php version check
This commit is contained in:
parent
e6f2075eef
commit
13a0113e8e
@ -159,6 +159,8 @@ class Item extends Controller
|
||||
$message = trans('modules.installed', ['module' => $json['data']['name']]);
|
||||
|
||||
flash($message)->success();
|
||||
} else {
|
||||
flash($json['message'])->error();
|
||||
}
|
||||
|
||||
return response()->json($json);
|
||||
@ -172,6 +174,8 @@ class Item extends Controller
|
||||
$message = trans('modules.uninstalled', ['module' => $json['data']['name']]);
|
||||
|
||||
flash($message)->success();
|
||||
} else {
|
||||
flash($json['message'])->error();
|
||||
}
|
||||
|
||||
return redirect()->route('apps.app.show', $alias)->send();
|
||||
@ -185,6 +189,8 @@ class Item extends Controller
|
||||
$message = trans('modules.enabled', ['module' => $json['data']['name']]);
|
||||
|
||||
flash($message)->success();
|
||||
} else {
|
||||
flash($json['message'])->error();
|
||||
}
|
||||
|
||||
return redirect()->route('apps.app.show', $alias)->send();
|
||||
@ -198,6 +204,8 @@ class Item extends Controller
|
||||
$message = trans('modules.disabled', ['module' => $json['data']['name']]);
|
||||
|
||||
flash($message)->success();
|
||||
} else {
|
||||
flash($json['message'])->error();
|
||||
}
|
||||
|
||||
return redirect()->route('apps.app.show', $alias)->send();
|
||||
|
@ -2,6 +2,7 @@
|
||||
|
||||
namespace App\Utilities;
|
||||
|
||||
use Exception;
|
||||
use Illuminate\Console\Application;
|
||||
use Illuminate\Support\Str;
|
||||
use Symfony\Component\Process\Exception\InvalidArgumentException;
|
||||
@ -9,6 +10,7 @@ use Symfony\Component\Process\Exception\LogicException;
|
||||
use Symfony\Component\Process\Exception\ProcessFailedException;
|
||||
use Symfony\Component\Process\Exception\RuntimeException;
|
||||
use Symfony\Component\Process\Process;
|
||||
use Throwable;
|
||||
|
||||
class Console
|
||||
{
|
||||
@ -29,12 +31,21 @@ class Console
|
||||
if (static::isValidOutput($output)) {
|
||||
return true;
|
||||
}
|
||||
} catch (InvalidArgumentException | LogicException | ProcessFailedException | RuntimeException $e) {
|
||||
} catch (Exception | InvalidArgumentException | LogicException | ProcessFailedException | RuntimeException | Throwable $e) {
|
||||
$output = $e->getMessage();
|
||||
}
|
||||
|
||||
logger('Console output:: ' . $output);
|
||||
|
||||
return static::formatOutput($output);
|
||||
}
|
||||
|
||||
public static function formatOutput($output)
|
||||
{
|
||||
$output = nl2br($output);
|
||||
$output = str_replace(['"', "'"], '', $output);
|
||||
$output = preg_replace('/[\x00-\x1F\x80-\xFF]/', '', $output);
|
||||
|
||||
return $output;
|
||||
}
|
||||
|
||||
|
@ -5,7 +5,15 @@ define('AKAUNTING_PHP', '7.2.5');
|
||||
|
||||
// Check PHP version
|
||||
if (version_compare(PHP_VERSION, AKAUNTING_PHP, '<')) {
|
||||
die('Error: Ask your hosting provider to use PHP ' . AKAUNTING_PHP . ' or higher for both HTTP and CLI.');
|
||||
$message = 'Error: Ask your hosting provider to use PHP ' . AKAUNTING_PHP . ' or higher for both HTTP and CLI.' . PHP_EOL . PHP_EOL . 'Current PHP version: ' . PHP_VERSION . PHP_EOL;
|
||||
|
||||
if (defined('STDOUT')) {
|
||||
fwrite(STDOUT, $message);
|
||||
} else {
|
||||
echo($message);
|
||||
}
|
||||
|
||||
die(1);
|
||||
}
|
||||
|
||||
define('LARAVEL_START', microtime(true));
|
||||
|
Loading…
x
Reference in New Issue
Block a user