[
MAINHACK
]
Mail Test
BC
Config Scan
HOME
Create...
New File
New Folder
Viewing / Editing File: InstallController.php
<?php namespace App\Http\Controllers; use App\CentralLogics\Helpers; use Illuminate\Http\Request; use Illuminate\Support\Facades\Artisan; use Illuminate\Support\Facades\DB; use Illuminate\Support\Facades\URL; class InstallController extends Controller { public function step0() { return view('installation.step0'); } public function step1() { $permission['curl_enabled'] = function_exists('curl_version'); $permission['db_file_write_perm'] = is_writable(base_path('.env')); $permission['routes_file_write_perm'] = is_writable(base_path('app/Providers/RouteServiceProvider.php')); return view('installation.step1', compact('permission')); } public function step2() { return view('installation.step2'); } public function step3() { return view('installation.step3'); } public function step4() { return view('installation.step4'); } public function step5() { return view('installation.step5'); } public function purchase_code(Request $request) { Helpers::setEnvironmentValue('SOFTWARE_ID', 'MzM1NzE3NTA='); Helpers::setEnvironmentValue('BUYER_USERNAME', $request['username']); Helpers::setEnvironmentValue('PURCHASE_CODE', $request['purchase_key']); return redirect()->route('dmvf', ['purchase_key' => $request['purchase_key'], 'username' => $request['username']]); } public function system_settings(Request $request) { DB::table('admins')->insertOrIgnore([ 'f_name' => $request['f_name'], 'l_name' => $request['l_name'], 'email' => $request['email'], 'role_id' => 1, 'password' => bcrypt($request['password']), 'phone' => $request['phone'], 'created_at' => now(), 'updated_at' => now() ]); DB::table('business_settings')->where(['key' => 'business_name'])->update([ 'value' => $request['business_name'] ]); $previousRouteServiceProvier = base_path('app/Providers/RouteServiceProvider.php'); $newRouteServiceProvier = base_path('app/Providers/RouteServiceProvider.txt'); copy($newRouteServiceProvier, $previousRouteServiceProvier); //sleep(5); return view('installation.step6'); } public function database_installation(Request $request) { if (self::check_database_connection($request->DB_HOST, $request->DB_DATABASE, $request->DB_USERNAME, $request->DB_PASSWORD)) { $key = base64_encode(random_bytes(32)); $output = 'APP_NAME=laravel APP_ENV=live APP_KEY=base64:' . $key . ' APP_DEBUG=false APP_INSTALL=true APP_LOG_LEVEL=debug APP_MODE=live APP_URL=' . URL::to('/') . ' SOFTWARE_VERSION=4.0 DB_CONNECTION=mysql DB_HOST=' . $request->DB_HOST . ' DB_PORT=3306 DB_DATABASE=' . $request->DB_DATABASE . ' DB_USERNAME=' . $request->DB_USERNAME . ' DB_PASSWORD=' . $request->DB_PASSWORD . ' BROADCAST_DRIVER=log CACHE_DRIVER=file SESSION_DRIVER=file SESSION_LIFETIME=120 QUEUE_DRIVER=sync REDIS_HOST=127.0.0.1 REDIS_PASSWORD=null REDIS_PORT=6379 PUSHER_APP_ID= PUSHER_APP_KEY= PUSHER_APP_SECRET= PUSHER_APP_CLUSTER=mt1 PURCHASE_CODE=' . session('purchase_key') . ' BUYER_USERNAME=' . session('username') . ' SOFTWARE_ID=MzM1NzE3NTA= '; $file = fopen(base_path('.env'), 'w'); fwrite($file, $output); fclose($file); $path = base_path('.env'); if (file_exists($path)) { return redirect('step4'); } else { session()->flash('error', 'Database error!'); return redirect('step3'); } } else { session()->flash('error', 'Database error!'); return redirect('step3'); } } public function import_sql() { try { $sql_path = base_path('installation/database.sql'); DB::unprepared(file_get_contents($sql_path)); return redirect('step5'); } catch (\Exception $exception) { session()->flash('error', 'Your database is not clean, do you want to clean database then import?'); return back(); } } public function force_import_sql() { try { Artisan::call('db:wipe'); $sql_path = base_path('installation/database.sql'); DB::unprepared(file_get_contents($sql_path)); return redirect('step5'); } catch (\Exception $exception) { session()->flash('error', 'Check your database permission!'); return back(); } } function check_database_connection($db_host = "", $db_name = "", $db_user = "", $db_pass = "") { if (@mysqli_connect($db_host, $db_user, $db_pass, $db_name)) { return true; } else { return false; } } }
Save Changes
Cancel / Back
Close ×
Server Info
Hostname: premium166.web-hosting.com
Server IP: 162.0.209.40
PHP Version: 8.1.34
Server Software: LiteSpeed
System: Linux premium166.web-hosting.com 4.18.0-553.45.1.lve.el8.x86_64 #1 SMP Wed Mar 26 12:08:09 UTC 2025 x86_64
HDD Total: 97.87 GB
HDD Free: 75.25 GB
Domains on IP: N/A (Requires external lookup)
System Features
Safe Mode:
Off
disable_functions:
None
allow_url_fopen:
On
allow_url_include:
Off
magic_quotes_gpc:
Off
register_globals:
Off
open_basedir:
None
cURL:
Enabled
ZipArchive:
Enabled
MySQLi:
Enabled
PDO:
Enabled
wget:
Yes
curl (cmd):
Yes
perl:
Yes
python:
Yes (py3)
gcc:
No
pkexec:
No
git:
Yes
User Info
Username: kataubyb
User ID (UID): 624
Group ID (GID): 625
Script Owner UID: 624
Current Dir Owner: 624