40 lines
1.2 KiB
PHP
40 lines
1.2 KiB
PHP
|
<?php
|
||
|
|
||
|
namespace FleetCart\Install;
|
||
|
|
||
|
class Requirement
|
||
|
{
|
||
|
public function extensions()
|
||
|
{
|
||
|
return [
|
||
|
'PHP >= 8.0.2' => version_compare(phpversion(), '8.0.2'),
|
||
|
'Intl PHP Extension' => extension_loaded('intl'),
|
||
|
'OpenSSL PHP Extension' => extension_loaded('openssl'),
|
||
|
'PDO PHP Extension' => extension_loaded('pdo'),
|
||
|
'Mbstring PHP Extension' => extension_loaded('mbstring'),
|
||
|
'Tokenizer PHP Extension' => extension_loaded('tokenizer'),
|
||
|
'XML PHP Extension' => extension_loaded('xml'),
|
||
|
'Ctype PHP Extension' => extension_loaded('ctype'),
|
||
|
'JSON PHP Extension' => extension_loaded('json'),
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function directories()
|
||
|
{
|
||
|
return [
|
||
|
'.env' => is_writable(base_path('.env')),
|
||
|
'storage' => is_writable(storage_path()),
|
||
|
'bootstrap/cache' => is_writable(app()->bootstrapPath('cache')),
|
||
|
];
|
||
|
}
|
||
|
|
||
|
public function satisfied()
|
||
|
{
|
||
|
return collect($this->extensions())
|
||
|
->merge($this->directories())
|
||
|
->every(function ($item) {
|
||
|
return $item;
|
||
|
});
|
||
|
}
|
||
|
}
|