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"); }
/** * echo the tail of the error log */ function errorsTail() { println("<pre>"); executeShell("tail error_log"); println("</pre>"); }
function executeShells($commands) { $allCommands = implode("&&", $commands); executeShell($allCommands); }