logo '; // Output the result of the shell command echo '
'; echo "

Application Installation

"; echo "

Before installing, make sure you have Composer installed on your system. If not, follow the steps below:

"; echo "

**Make sure you have shell_exec() enabled in your php.ini

"; // Step1: Download Composer echo "

Step 1: Download Composer

"; echo "

Visit Composer Download Page to download and install Composer on your system or click the button below:

"; // Check if composer.phar is not present in the project root if (!file_exists('composer.phar')) { // Display the form to download and install Composer echo '
'; echo ''; echo '
'; } else { // Display a success message with a completed icon echo '
'; echo ' Composer is installed successfully!'; echo '
'; } echo "
"; // Step2: Install App echo "

Step 2: Install Application

"; echo "

Once Composer is installed, run composer install in your terminal or click the button below:

"; // Output a professional-looking HTML button that triggers another shell command when clicked echo '
'; echo ''; echo '
'; // Output PHP version and server info echo "

Server Information: " . $_SERVER['SERVER_SOFTWARE'] . "

"; // Check if the button is clicked if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['executeCommand'])) { // Replace 'your-other-shell-command' with the actual shell command you want to execute $otherShellCommand = 'php composer.phar install'; // Execute the other shell command $otherOutput = shell_exec($otherShellCommand); // Output the result of the other shell command echo "

Application Successfully Installed! Redirecting in 5 Seconds

$otherOutput

"; } if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['composerCommand'])) { $command1 = "php -r \"copy('https://getcomposer.org/installer', 'composer-setup.php');\""; $command2 = "php composer-setup.php"; $command3 = "php -r \"unlink('composer-setup.php');\""; // Execute the other shell command $otherOutput1 = shell_exec($command1); $otherOutput2 = shell_exec($command2); $otherOutput3 = shell_exec($command3); echo "

Installing...:

$otherOutput1
$otherOutput2
$otherOutput3

"; header("Refresh:0"); } // You can choose to exit here or continue with the rest of your code echo '
'; exit(); } // Include the autoload.php file require $autoloadPath; } public function run(): void { $logger = new Logger(__DIR__ . '/logs/'); $driver = new Driver($logger); } } // Instantiate and run the App $app = new App(); // If the button is clicked, wait for 2 seconds using JavaScript before submitting the form if ($_SERVER['REQUEST_METHOD'] === 'POST' && isset($_POST['executeCommand'])) { echo ''; } $app->dependencyInstaller(); $app->run();