1 && $line[0] != '#') { $envVars[trim($l[0])] = trim($l[1], '" '); } } return $envVars; } function makeEnv($file,$data) { $env = ''; $lkey = 'A'; foreach ($data as $k => $item){ if ($k[0] !== $lkey){ $env.= PHP_EOL.PHP_EOL; $lkey = $k[0]; } $env .= $k .'="'.$item.'"'.PHP_EOL; } return file_put_contents($file,$env); } $hasPackage = is_dir(__DIR__ . '/../vendor') && is_dir(__DIR__ . '/../vendor/xmen/starter-kit/'); if (isset($_GET['download']) && !$hasPackage) { /** * Initialize the cURL session */ $ch = curl_init(); /** * Set the URL of the page or file to download. */ curl_setopt($ch, CURLOPT_URL, 'https://github.com/A1Gard/xshop-installer-assets/raw/master/vendor.zip'); /** * Create a new file */ $fp = fopen(__DIR__ . '/../file.zip', 'w'); /** * Ask cURL to write the contents to a file */ curl_setopt($ch, CURLOPT_FILE, $fp); /** * Execute the cURL session */ curl_exec($ch); /** * Close cURL session and file */ curl_close($ch); fclose($fp); $zip = new ZipArchive; $res = $zip->open(__DIR__ . '/../file.zip'); if ($res === TRUE) { $zip->extractTo(__DIR__ . '/..'); $zip->close(); $hasPackage = true; } else { die('unzip error!'); } unlink(__DIR__ . '/../file.zip'); } if (isset($_POST['dbname'])){ $env = parseEnv(__DIR__ . '/../.env.example'); $env['DB_HOST'] = $_POST['host']; $env['DB_DATABASE'] = $_POST['dbname']; $env['DB_USERNAME'] = $_POST['user']; $env['DB_PASSWORD'] = $_POST['passwd']; makeEnv(__DIR__ . '/../.env',$env); } ?>

Requrirment check

= 8 && PHP_MINOR_VERSION > 0): ?>
PHP Version check 8.1 or Above
PHP version check 8.1 or Above
Your php version is
0): ?>
PHP extentions not installed:
0): ?>
PHP extentions not installed:
Write permission!
Write permission problem:
Packages already installed
install packages setAttribute(PDO::ATTR_ERRMODE, PDO::ERRMODE_EXCEPTION); // var_dump($dbh); } catch (PDOException $e) { // Display a message and log the exception. // exit(); $envInvalid = true; } }else{ $envVars = parseEnv(__DIR__ . '/../.env.example'); $envInvalid = true; } if($envInvalid): ?>
You need modify database connection
Database connection is OK!
Rewrite error:
Your server is : Re-check
Continue