function installRelease($release)
{
    $baseFilename = "php-utils-{$release}";
    $filename = $baseFilename . ".zip";
    if (file_exists($filename)) {
        moveOldRelease($filename);
    }
    $url = "https://github.com/heliosbryan/php-utils/archive/{$release}.zip";
    $releaseDirectory = "phputils";
    executeShell("wget {$url} -O {$filename}");
    if (!file_exists($filename)) {
        die("File was not downloaded!");
    }
    moveOldRelease($releaseDirectory);
    executeShell("unzip {$filename}");
    if (file_exists($releaseDirectory)) {
        moveOldRelease($releaseDirectory);
    }
    renameDirectory($baseFilename, $releaseDirectory, "shell");
}
示例#2
0
/**
 * echo the tail of the error log
 */
function errorsTail()
{
    println("<pre>");
    executeShell("tail error_log");
    println("</pre>");
}
示例#3
0
function executeShells($commands)
{
    $allCommands = implode("&&", $commands);
    executeShell($allCommands);
}