#17: Fixed a crash in the installer when the app is not configured
This commit is contained in:
parent
f3e69512e2
commit
6b704e67fd
2
.idea/webServers.xml
generated
2
.idea/webServers.xml
generated
@ -3,7 +3,7 @@
|
||||
<component name="WebServers">
|
||||
<option name="servers">
|
||||
<webServer id="b14a34b0-0127-4886-964a-7be75a2281ac" name="Development" url="http://blue-twilight-dev.andys.eu">
|
||||
<fileTransfer host="scar.andys.eu" port="22" privateKey="$USER_HOME$/.ssh/id_rsa" rootFolder="/srv/www/blue-twilight-dev" accessType="SFTP" keyPair="true">
|
||||
<fileTransfer host="orlando.andys.eu" port="22" privateKey="$USER_HOME$/.ssh/id_rsa" rootFolder="/srv/www/blue-twilight-dev" accessType="SFTP" keyPair="true">
|
||||
<advancedOptions>
|
||||
<advancedOptions dataProtectionLevel="Private" />
|
||||
</advancedOptions>
|
||||
|
@ -60,6 +60,12 @@ class MiscHelper
|
||||
public static function getEnvironmentSetting($settingName)
|
||||
{
|
||||
$envFile = MiscHelper::getEnvironmentFilePath();
|
||||
|
||||
if (!file_exists($envFile))
|
||||
{
|
||||
return null;
|
||||
}
|
||||
|
||||
$matches = null;
|
||||
if (preg_match(sprintf('/^\s*%s\s*=\s*(.+)$/im', preg_quote($settingName)), file_get_contents($envFile), $matches))
|
||||
{
|
||||
@ -69,6 +75,11 @@ class MiscHelper
|
||||
return null;
|
||||
}
|
||||
|
||||
public static function isAppInstalled()
|
||||
{
|
||||
return MiscHelper::getEnvironmentSetting('APP_INSTALLED');
|
||||
}
|
||||
|
||||
/**
|
||||
* Tests whether the provided URL belongs to the current application (i.e. both scheme and hostname match.)
|
||||
* @param $url
|
||||
|
@ -5,6 +5,7 @@ namespace App\Providers;
|
||||
use App\Album;
|
||||
use App\Helpers\ConfigHelper;
|
||||
use App\Helpers\ImageHelper;
|
||||
use App\Helpers\MiscHelper;
|
||||
use App\Helpers\ThemeHelper;
|
||||
use App\Helpers\ValidationHelper;
|
||||
use App\ModelObservers\AlbumObserver;
|
||||
@ -48,7 +49,10 @@ class AppServiceProvider extends ServiceProvider
|
||||
Album::observe(AlbumObserver::class);
|
||||
|
||||
// Configure our default pager
|
||||
LengthAwarePaginator::defaultView($themeHelper->viewName('partials.pager_links'));
|
||||
if (MiscHelper::isAppInstalled())
|
||||
{
|
||||
LengthAwarePaginator::defaultView($themeHelper->viewName('partials.pager_links'));
|
||||
}
|
||||
}
|
||||
|
||||
/**
|
||||
|
Loading…
Reference in New Issue
Block a user