* #355 Calculate distance button in add/edit Flight page * Styling * Move add/edit flight logic out of controller and into service layer * Styling * Formatting * Run styleci against modules dir * Styleci config * Style fixes in /modules
This commit is contained in:
@@ -2,20 +2,19 @@
|
||||
|
||||
namespace Modules\Installer\Services;
|
||||
|
||||
|
||||
use App\Contracts\Service;
|
||||
|
||||
class RequirementsService extends Service
|
||||
{
|
||||
|
||||
/**
|
||||
* Check the PHP version that it meets the minimum requirement
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkPHPVersion(): array
|
||||
{
|
||||
$passed = false;
|
||||
if(version_compare(PHP_VERSION, config('installer.php.version')) >= 0) {
|
||||
if (version_compare(PHP_VERSION, config('installer.php.version')) >= 0) {
|
||||
$passed = true;
|
||||
}
|
||||
|
||||
@@ -24,19 +23,20 @@ class RequirementsService extends Service
|
||||
|
||||
/**
|
||||
* Make sure the minimal extensions required are loaded
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkExtensions(): array
|
||||
{
|
||||
$extensions = [];
|
||||
foreach(config('installer.extensions') as $ext) {
|
||||
foreach (config('installer.extensions') as $ext) {
|
||||
$pass = true;
|
||||
if(!\extension_loaded($ext)) {
|
||||
if (!\extension_loaded($ext)) {
|
||||
$pass = false;
|
||||
}
|
||||
|
||||
$extensions[] = [
|
||||
'ext' => $ext,
|
||||
'ext' => $ext,
|
||||
'passed' => $pass,
|
||||
];
|
||||
}
|
||||
@@ -47,6 +47,7 @@ class RequirementsService extends Service
|
||||
/**
|
||||
* Check the permissions for the directories specified
|
||||
* Make sure they exist and are writable
|
||||
*
|
||||
* @return array
|
||||
*/
|
||||
public function checkPermissions(): array
|
||||
@@ -54,21 +55,20 @@ class RequirementsService extends Service
|
||||
clearstatcache();
|
||||
|
||||
$directories = [];
|
||||
foreach (config('installer.permissions') as $dir)
|
||||
{
|
||||
foreach (config('installer.permissions') as $dir) {
|
||||
$pass = true;
|
||||
$path = base_path($dir);
|
||||
|
||||
if(!file_exists($path)) {
|
||||
if (!file_exists($path)) {
|
||||
$pass = false;
|
||||
}
|
||||
|
||||
if(!is_writable($path)) {
|
||||
if (!is_writable($path)) {
|
||||
$pass = false;
|
||||
}
|
||||
|
||||
$directories[] = [
|
||||
'dir' => $dir,
|
||||
'dir' => $dir,
|
||||
'passed' => $pass,
|
||||
];
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user