示例#1
0
     * Determine if PHP is being run from the CLI
     * 
     * @return boolean
     */
    public function isCli()
    {
        return php_sapi_name() === 'cli';
    }
}
/*
|--------------------------------------------------------------------------
| Contentify Installation Launcher
|--------------------------------------------------------------------------
*/
$tester = new Tester();
if ($tester->isCli()) {
    $tester->run();
    echo "The installer cannot be launched from a console.\n\r";
    echo 'Please navigate to the website with a browser to install Contentify.';
} else {
    if (!file_exists(__DIR__ . '/../storage/app/.install')) {
        die('Contentify already has been installed.');
    }
    echo '<html><head><title>Installer</title>
        <link href="http://fonts.googleapis.com/css?family=Open+Sans" rel="stylesheet" type="text/css">
        <style>body { margin: 20px; font-family: "Open Sans", arial; color: #666 }</style></head><body><table>';
    $tester->run();
    echo '</table><a href="./install" style="display: inline-block; padding: 20px; text-decoration: none; 
        background-color: #00afff; color: white; font-size: 18px; border-radius: 5px">Launch Installer</a>';
    echo '</body></html>';
}