<?php
$package = 'endroid/qr-code';

// Check if the package is installed
$installed = shell_exec("composer show $package 2>&1");

if (strpos($installed, 'No package found') !== false) {
    echo "Installing $package...\n";

    // Run the Composer command to install the package
    $output = shell_exec("composer require $package 2>&1");

    echo nl2br($output);
} else {
    echo "$package is already installed.\n";
}
?>
