function git_current_branch($cwd) { $result = syscall('git branch', $cwd); if (preg_match('/\\* (.*)/', $result, $matches)) { return $matches[1]; } }
} .overridehidden { display: inline !important; } </style> <script type="text/javascript" src="http://ajax.googleapis.com/ajax/libs/jquery/1.4.2/jquery.min.js"> </script> <script type="text/javascript" src="/fancybox/fancybox/jquery.fancybox-1.3.1.pack.js"></script> <link rel="stylesheet" href="/fancybox/fancybox/jquery.fancybox-1.3.1.css" type="text/css" media="screen" /> </head> <body> <?php $file = 'debug'; if (isset($_GET['file'])) { $file = $_GET['file']; } echo syscall("tail -n 150000 {$ROOT}/admin/{$file}.html > {$ROOT}/admin/{$file}" . "2.html"); echo file_get_contents("{$ROOT}/admin/{$file}" . "2.html"); ?> <script type="text/javascript" src="../js/jquery.hotkeys-0.7.9.min.js"> </script> <script type="text/javascript"> var cmdstate = ''; jQuery(document).ready(function() { jQuery('.group').each(function (idx) { jQuery(this).fancybox(); }); }); /*jQuery(document).bind('keydown', 'shift+;', function() { if(cmdstate == '') cmdstate = ':'; alert(cmdstate); }); jQuery(document).bind('keydown', 'g', function() {
<title>Log</title> <style type="text/css"> body { background-color: #000; color: #fff; } .fatal { background-color: #f00; } .warn { background-color: #980; } .notice { background-color: #000; } .debug { background-color: #000; color: #0f0; } </style> </head> <body> <?php echo syscall("tail -n 100 {$ROOT}/admin/debug.html > {$ROOT}/admin/debug2.html"); ?> <?php echo file_get_contents("admin/debug2.html"); ?> </body> </html>
<?php $passarg = ""; if ($CONFIG['dbpass'] != "") { $passarg = ' -p' . $CONFIG['dbpass']; } echo syscall("/usr/local/mysql/bin/mysql -u{$CONFIG['dbuser']}{$passarg} -D{$CONFIG['dbname']} < {$ROOT}/admin/migrations/create_users.sql", $status);
<form action="whois.php" method="get"> Domain name: <input type="text" name="a" /> <input type="submit" /> </form> <?php $a = escapeshellarg($_GET['a']); echo syscall("whois {$a} > {$ROOT}/admin/whois.txt"); echo nl2br(file_get_contents("{$ROOT}/admin/whois.txt"));
function mpdvalidator($result_array, $locate, $foldername) { global $string_info; $function_result = array(); $schematronIssuesReport; $url_array = $result_array; chdir($url_array[1]); // Change default execution directory to the location of the mpd validator $mpdvalidator = syscall("ant run -Dinput=\"" . $url_array[0] . "\" -Dresolved=" . $url_array[3] . "/resolved.xml" . " -Dschema=schemas/DASH-MPD.xsd"); //run mpd validator $mpdvalidator = str_replace('[java]', "", $mpdvalidator); //save the mpd validator output to variable $valid_word = 'Start XLink resolving'; $report_start = strpos($mpdvalidator, $valid_word); // Checking the begining of the Xlink validation $mpdvalidator = substr($mpdvalidator, $report_start); // $mpdreport = fopen($locate . '/mpdreport.txt', 'a+b'); fwrite($mpdreport, $mpdvalidator); //get mpd validator result to text file $temp_string = str_replace(array('$Template$'), array("mpdreport"), $string_info); // copy mpd report to html file $mpd_rep_loc = 'temp/' . $foldername . '/mpdreport.html'; // location of mpd report file_put_contents($locate . '/mpdreport.html', $temp_string); // create HTML to contain mpd report $exit = false; if (strpos($mpdvalidator, "XLink resolving successful") !== false) { $totarr[] = 'true'; //incase of mpd validation success send true to client } else { $totarr[] = $mpd_rep_loc; // if failed send client the location of mpdvalidator report $exit = true; // if failed terminate conformance check } if (strpos($mpdvalidator, "MPD validation successful") !== false) { $totarr[] = 'true'; //incase of mpd validation success send true to client } else { $totarr[] = $mpd_rep_loc; /// if failed send client the location of mpdvalidator report $exit = true; // if failed terminate conformance check } if (strpos($mpdvalidator, "Schematron validation successful") !== false) { $totarr[] = 'true'; // if succesful send true to client } else { $schematronIssuesReport = analyzeSchematronIssues($mpdvalidator); $totarr[] = $mpd_rep_loc; /// if failed send client the location of mpdvalidator report $exit = true; // if failed terminate conformance check } if ($url_array[2] === 1) { $exit = true; } $function_result[0] = $exit; $function_result[1] = $totarr; $function_result[2] = $schematronIssuesReport; return $function_result; }
} else { //if branch dir doesn't exist, create it with a clone $result = syscall("git clone {$reposURL} ./", $wd); //change dir to the clone directory, and checkout the branch $result = syscall("git checkout {$branch}", "{$wd}"); } } elseif (!$ignoreAll) { if (is_dir("{$wd}/{$branch}")) { //lets check if branch dir exists //hey look, the branch directory already exists, so lets use it as our working directory and just run the pull command -- obviously we want to pull from the remote origin & branch name $result = syscall("git pull origin {$branch}", "{$wd}/{$branch}"); } else { //if branch dir doesn't exist, create it with a clone $result = syscall("git clone {$reposURL} {$branch}", $wd); //change dir to the clone directory, and checkout the branch $result = syscall("git checkout {$branch}", "{$wd}/{$branch}"); } } return 1; //this isn't necessary but I put it here for good measure, just to say we are done and everything got executed properly } else { throw new Exception("branch variable is not set or == to 'heads'"); } } else { throw new Exception("An error was encountered while attempting to json_decode the HTTP_RAW_POST_DATA str"); } } else { throw new Exception("HTTP_RAW_POST_DATA is not set or 'ref' is not a valid array element"); } } catch (Exception $e) { error_log(sprintf("%s >> %s", date('Y-m-d H:i:s'), $e));