File "InstallerController.php"

Full Path: /home/trinadezambia/public_html/admin_panel/app/Http/Resources/InstallerController.php
File size: 1.88 KB
MIME-type: text/x-php
Charset: utf-8

<?php

namespace App\Http\Controllers;

use dacoto\LaravelWizardInstaller\Controllers\InstallFolderController;
use dacoto\LaravelWizardInstaller\Controllers\InstallServerController;
use Illuminate\Routing\Controller;

class InstallerController extends Controller {

    public function phpFunctionIndex() {
        if (!(new InstallServerController())->check() || !(new InstallFolderController())->check()) {
            return redirect()->route('LaravelWizardInstaller::install.folders');
        }
        return view('vendor.installer.steps.symlink_basedir_check', [
            'result'          => $this->checkSymlink(),
            'execResult'      => $this->checkExec(),
            'shellExecResult' => $this->checkShellExec(),
            'procOpenResult'  => $this->checkProcOpen(),
        ]);
    }

    public function checkSymlink(): bool
    {
        $disabled = array_map('trim', explode(',', (string) ini_get('disable_functions')));
        return function_exists('symlink') && !in_array('symlink', $disabled, true);
    }

    public function checkExec(): bool
    {
        $disabled = array_map('trim', explode(',', (string) ini_get('disable_functions')));
        return function_exists('exec') && !in_array('exec', $disabled, true);
    }

    public function checkShellExec(): bool
    {
        $disabled = array_map('trim', explode(',', (string) ini_get('disable_functions')));
        return function_exists('shell_exec') && !in_array('shell_exec', $disabled, true);
    }

    public function checkProcOpen(): bool
    {
        $disabled = array_map('trim', explode(',', (string) ini_get('disable_functions')));
        return function_exists('proc_open') && !in_array('proc_open', $disabled, true);
    }

    public function checkBaseDir(): bool
    {
        $openBaseDir = ini_get('open_basedir');
        if ($openBaseDir) {
            return false;
        }
        return true;
    }

}