Skip to content
This repository has been archived by the owner on Nov 28, 2023. It is now read-only.

Feat: show warning message if required php functions are not available #243

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/Config/installer.php
Original file line number Diff line number Diff line change
Expand Up @@ -28,6 +28,9 @@
'JSON',
'cURL',
],
'php-function' => [
'apache_get_modules',
],
'apache' => [
'mod_rewrite',
],
Expand Down
12 changes: 12 additions & 0 deletions src/Helpers/RequirementsChecker.php
Original file line number Diff line number Diff line change
Expand Up @@ -35,6 +35,18 @@ public function check(array $requirements)
}
}
break;
// check php function requirements
case 'php-function':
foreach ($requirements[$type] as $requirement) {
$results['requirements'][$type][$requirement] = true;

if (! function_exists($requirement)) {
$results['requirements'][$type][$requirement] = false;

$results['warnings'] = true;
}
}
break;
// check apache requirements
case 'apache':
foreach ($requirements[$type] as $requirement) {
Expand Down
2 changes: 2 additions & 0 deletions src/Lang/en/installer_messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
'templateTitle' => 'Step 1 | Server Requirements',
'title' => 'Server Requirements',
'next' => 'Check Permissions',
'warning' => 'Warning',
'warningNotExistPhpFunction' => 'You may experience problems during installation and/or later because the specified PHP functions do not work.',
],

/*
Expand Down
2 changes: 2 additions & 0 deletions src/Lang/tr/installer_messages.php
Original file line number Diff line number Diff line change
Expand Up @@ -36,6 +36,8 @@
'templateTitle' => 'Adım 1 | Sunucu Gereksinimleri',
'title' => 'Sunucu Gereksinimleri',
'next' => 'İzinleri Kontrol Et',
'warning' => 'Uyarı',
'warningNotExistPhpFunction' => 'Belirtilen PHP fonksiyonları çalışmadığı için yükleme esnasında ve/veya daha sonrasında sorun yaşayabilirsiniz.',
],

/*
Expand Down
14 changes: 13 additions & 1 deletion src/Views/requirements.blade.php
Original file line number Diff line number Diff line change
Expand Up @@ -39,8 +39,20 @@
@endforeach

@if ( ! isset($requirements['errors']) && $phpSupportInfo['supported'] )
@if(isset($requirements['warnings']))
<div class="alert alert-warning" id="error_alert">
<button type="button" class="close" id="close_alert" data-dismiss="alert" aria-hidden="true">
<span aria-hidden="true">×</span>
</button>
<div class="alert-icon">
<i class="fa fa-exclamation" aria-hidden="true"></i>
<strong>{{ trans('installer_messages.requirements.warning') }}</strong>
</div>
<span class="alert-text">{{ trans('installer_messages.requirements.warningNotExistPhpFunction') }}</span>
</div>
@endif
<div class="buttons">
<a class="button" href="{{ route('LaravelInstaller::permissions') }}">
<a @class(['button', 'warning'=> isset($requirements['warnings'])]) href="{{ route('LaravelInstaller::permissions') }}">
{{ trans('installer_messages.requirements.next') }}
<i class="fa fa-angle-right fa-fw" aria-hidden="true"></i>
</a>
Expand Down
4 changes: 4 additions & 0 deletions src/assets/css/scss/_variables.scss
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,10 @@ $color_36: rgba(0, 0, 0, 0.1);
$color_37: #ccc;
$color_38: rgba(0, 0, 0, 0.3);
$color_39: #ffffff;
$color_40: #ffc107;
$color_41: #856404;
$color_42: #fff3cd;
$color_43: #ffeeba;

//fonts
$font_0: sans-serif;
Expand Down
27 changes: 27 additions & 0 deletions src/assets/css/scss/style.scss
Original file line number Diff line number Diff line change
Expand Up @@ -889,6 +889,10 @@ input[type=text] {
box-shadow: 0 10px 10px $color_7, 0 6px 3px $color_8;
background-color: $color_16;
}
&.warning {
background-color: $color_40;
color: $color_18;
}
}
.button--light {
padding: 3px 16px;
Expand Down Expand Up @@ -1238,6 +1242,29 @@ input[type='number'] {
margin: 0;
}
}
&.alert-warning {
color: $color_41;
background-color: $color_42;
border-color: $color_43;
.close {
border: 0;
width: unset;
height: unset;
padding: .75rem 1.25rem;
float: right;
font-weight: 700;
line-height: 1;
color: inherit;
text-shadow: 0 1px 0 $color_10;
opacity: .5;
&:hover {
background-color: transparent;
color: $color_1;
text-decoration: none;
opacity: .75;
}
}
}
.close {
width: 25px;
height: 25px;
Expand Down
26 changes: 26 additions & 0 deletions src/assets/css/style.css

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

2 changes: 1 addition & 1 deletion src/assets/css/style.min.css

Large diffs are not rendered by default.