ERROR : $msg \033[0m\n"; } function shell_echo_success($msg) { echo "\033[32m> INFO : $msg \033[0m\n"; } function shell_echo_info($msg) { echo "\033[36m> INFO : $msg \033[0m\n"; } function shell_echo($msg) { echo "> " . $msg . "\n"; } function shell_throws_if($msg, $boolean) { if ($boolean) { shell_echo_error($msg); exit(-1); } } function shell_command_check($command) { @exec($command, $output, $ret); return $ret === 0; } function shell_file_write($filepath, $content) { $dir = dirname($filepath); if (!file_exists($dir)) { mkdir($dir, 0755, true); } file_put_contents($filepath, $content); }