Changes for shared hosting and numerous installer fixes
This commit is contained in:
@@ -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');
|
||||
}
|
||||
|
||||
|
||||
@@ -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);
|
||||
}
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user