Changes for shared hosting and numerous installer fixes

This commit is contained in:
Nabeel Shahzad
2017-12-17 16:58:53 -06:00
parent 87ab746812
commit ddd92c8b37
47 changed files with 139 additions and 270 deletions

View File

@@ -6,16 +6,26 @@
namespace App\Http\Middleware;
use Closure;
use Illuminate\Http\Request;
class InstalledCheck
{
/**
* Check the app.key to see whether we're installed or not
*
* If the default key is set and we're not in any of the installer routes
* show the message that we need to be installed
*
* @param Request $request
* @param Closure $next
* @return \Illuminate\Contracts\View\Factory|\Illuminate\View\View|mixed
*/
public function handle($request, Closure $next)
public function handle(Request $request, Closure $next)
{
if (config('app.key') === 'NOT_INSTALLED') {
if (config('app.key') === 'base64:zdgcDqu9PM8uGWCtMxd74ZqdGJIrnw812oRMmwDF6KY='
&& !$request->is(['install', 'install/*'])
&& !$request->is(['update', 'update/*'])
) {
return view('system.errors.not_installed');
}

View File

@@ -14,3 +14,17 @@ if (!function_exists('setting')) {
return $settingRepo->retrieve($key);
}
}
/**
* Wrap the asset URL in the publicBaseUrl that's been
* set
*/
if (!function_exists('public_asset')) {
function public_asset($path, $parameters = [], $secure = null)
{
$publicBaseUrl = app()->publicUrlPath();
$path = $publicBaseUrl . $path;
return url($path, $parameters, $secure);
}
}