baseDirectory = dirname(__DIR__);
chdir($this->baseDirectory);
putenv('HOME=' . $this->baseDirectory);
// Display errors so installer never gets a WSOD!
ini_set('display_errors', true);
}
public function run()
{
if (strtoupper($_SERVER['REQUEST_METHOD']) == 'POST')
{
// Handle post
$this->runInstall();
exit();
}
?>
Blue Twilight Setup
Blue Twilight Setup
We need to download a few things - namely Composer and related packages - before we can kick off the Blue Twilight installer.
We can do this for you - simply click the button below.
This can take a few minutes so please be patient!
Got Composer?
If you already have Composer installed, however, you may want to use that instead. Just run the below commands on your server, changing the path to Composer as appropriate:
Please note: "composer.phar" may actually be "composer" on your system.
cd baseDirectory; ?>
/path/to/composer.phar install
Installing Blue Twilight Setup Files
%s...%s", $step[0], PHP_EOL);
$result = call_user_func([$this, $step[1]]);
if (!$result)
{
$successful = false;
break;
}
}
if ($successful)
{
header('Location: install/check');
exit();
}
?>
0)
{
$this->echoError(sprintf('The following PHP modules are missing and need to be installed to continue: %s', join(', ', $invalidModules)));
return false;
}
return true;
}
private function echoError($message)
{
echo sprintf("%s.%s", $message, PHP_EOL);
}
private function echoOK($message = '')
{
echo "OK";
if (strlen($message) > 0)
{
echo sprintf('... %s', $message);
}
echo '' . PHP_EOL;
}
private function fetchComposerSignature()
{
$signatureUrl = 'https://composer.github.io/installer.sig';
$this->composerSignature = trim(file_get_contents($signatureUrl));
if (strlen($this->composerSignature) == 0)
{
$this->echoError(sprintf("Failed downloading the Composer signature from %s", $signatureUrl));
return false;
}
else
{
$this->echoOK($this->composerSignature);
}
return true;
}
private function generateAppKey()
{
if (!file_exists('.env') && file_exists('.env.example'))
{
copy('.env.example', '.env');
}
ob_start();
system('touch .env', $rc);
$result = ob_get_clean();
echo nl2br($result);
ob_start();
system('php artisan key:generate', $rc);
$result = ob_get_clean();
echo nl2br($result);
if ($rc != 0)
{
$this->echoError('Failed to generate application key');
return false;
}
$this->echoOK();
return true;
}
private function installComposer()
{
$rc = -1;
ob_start();
system('php -r "copy(\'https://getcomposer.org/installer\', \'composer-setup.php\');"', $rc);
$result = ob_get_clean();
echo nl2br($result);
if ($rc != 0)
{
$this->echoError('Failed to fetch Composer');
return false;
}
ob_start();
system(sprintf('php -r "if (hash_file(\'SHA384\', \'composer-setup.php\') === \'%s\') { echo \'Installer verified\'; } else { echo \'Installer corrupt\'; unlink(\'composer-setup.php\'); } echo PHP_EOL;"', $this->composerSignature), $rc);
$result = ob_get_clean();
echo nl2br($result);
if ($rc != 0)
{
$this->echoError('Composer verification failed');
return false;
}
ob_start();
system('php composer-setup.php', $rc);
$result = ob_get_clean();
echo nl2br($result);
if ($rc != 0)
{
$this->echoError('Failed to install Composer');
return false;
}
ob_start();
system('php -r "unlink(\'composer-setup.php\');"', $rc);
$result = ob_get_clean();
echo nl2br($result);
if ($rc != 0)
{
$this->echoError('Failed to remove Composer setup file');
return false;
}
$this->echoOK();
return true;
}
private function runComposer()
{
ob_start();
system('php composer.phar install', $rc);
$result = ob_get_clean();
echo nl2br($result);
if ($rc != 0)
{
$this->echoError('Installing Composer packages failed');
return false;
}
$this->echoOK();
return true;
}
}
$installer = new BlueTwilightInstaller();
$installer->run();