/dev/null //Applications/MAMP/htdocs/Swift Document App/Swift Document App.xcodeproj //Applications/MAMP/htdocs/Playground/.build/checkouts/Files/Files.xcodeproj //Applications/MAMP/htdocs/DccumentProject/My File C Program/My File C Program.xcodeproj //Applications/MAMP/htdocs/DccumentProject/Sample Document Project/Sample Document Project.xcodeproj //Applications/MAMP/htdocs/DccumentProject/TestiOSApp/TestiOSApp.xcodeproj //Applications/MAMP/htdocs/DccumentProject/My Screen Saver/My Screen Saver.xcodeproj //Applications/MAMP/htdocs/DccumentProject/My Next File C Program/My Next File C Program.xcodeproj //Applications/MAMP/htdocs/DccumentProject/My C Command Line Project/My C Command Line Project.xcodeproj //Applications/MAMP/htdocs/Swift Command Line/Swift Command Line.xcodeproj //Applications/MAMP/htdocs/Fibonacci/Fibonacci.xcodeproj //Applications/MAMP/htdocs/AudioUnit/Sample Audio Unit/Sample Audio Unit.xcodeproj ini_set('max_execution_time', 60000); $dactor="Terminal"; $dverb="do script"; $undis=""; if (strtoupper(PHP_OS) == 'DARWIN') { $undis="\n document.getElementById('ilog').style.visibility='visible'; \n"; } else { $undis="\n if (('' + navigator.platform).toLowerCase().indexOf('mac') == 0) { window.open('http://localhost:8888/find_xcode_executable.php' + (locpath == '' ? '?locpath=' : '?locpath=' + encodeURIComponent(locpath)) + (locargs == '' ? '' : locargs), '_blank','top=50,left=50,width=' + eval(-100 + eval('' + screen.width)) + ',height=' + eval(-100 + eval('' + screen.height)) + ''); } else { window.open('http://localhost/find_xcode_executable.php' + (locpath == '' ? '?locpath=' : '?locpath=' + encodeURIComponent(locpath)) + (locargs == '' ? '' : locargs), '_blank','top=50,left=50,width=' + eval(-100 + eval('' + screen.width)) + ',height=' + eval(-100 + eval('' + screen.height)) + ''); } \n"; } $startin="."; if (isset($_GET['isurl']) || isset($_POST['isurl'])) { $dactor="Safari"; $dverb="open location"; } if (isset($_GET['startin'])) { if ($_GET['startin'] != '') { $startin=str_replace('+',' ',urldecode($_GET['startin'])); } } $starterforone=""; $two=2; function ourpassthru($passwhat) { if (strpos($passwhat, "\\\"http") !== false || strpos($passwhat, "\\\"//") !== false) { if (strtoupper(PHP_OS) == 'DARWIN') { $rest=explode('"',explode("\\\"", $passwhat)[2])[0]; echo "tab 1 of window "; $upref=""; if (strpos($passwhat, "\\\"//") !== false) { $upref="https:"; } if (strpos($rest, '&') !== false) { return exec('open "' . $upref . explode("\\\"", $passwhat)[1] . trim($rest) . '"'); } else { return exec('open ' . $upref . explode("\\\"", $passwhat)[1] . trim($rest)); } } else { $rest=explode('"',explode("\\\"", $passwhat)[2])[0]; echo "
tab 1 of window"; exit; } } if (!isset($argc)) { if (strpos($_SERVER['SERVER_NAME'], 'localhost') === false) { return exec($passwhat); } } return passthru($passwhat); } if (isset($argc)) { // osascript -e 'do shell script "/path/to/executable --flag \"argument with spaces\""' //$command="osascript -e 'tell application \"" . $argv[1] . "\""; //" to activate'; $pex=$argv[1]; if ($pex == "script") { $starterforone=$pex . ' ' . $argv[2] . ' '; $pex=$argv[3]; } $command="osascript -e 'tell application \"" . $dactor . "\" to " . $dverb . " \"" . $starterforone . "\\" . "\"" . str_replace('"','',$pex) . "\\\""; //" to activate'; for ($ii=$two; $ii<$argc; $ii++) { //$command.=' ' . "\\\"" . $argv[$ii] . "\\\""; $command.=' ' . "" . $argv[$ii] . ""; } $descriptors = [ 0 => STDIN, // Inherit standard input (keyboard) 1 => STDOUT, // Inherit standard output (terminal screen) 2 => STDERR, // Inherit standard error ]; $process=proc_open($command . $dae . "\"'", $descriptors, $pipes); if (is_resource($process)) { $exitCode = proc_close($process); } exit; } if (isset($_POST['execexec'])) { if (isset($_POST['argsare'])) { $pex=str_replace('+',' ',urldecode($_POST['execexec'])); if (strpos('~' . $pex, '~script ') !== false) { $starterforone='script ' . explode(' ',explode('script ', $pex)[1])[0] . ' '; $pex=str_replace($starterforone,"",$pex); } $command="osascript -e 'tell application \"" . $dactor . "\" to " . $dverb . " \"" . $starterforone . "\\" . "\"" . str_replace('"','',$pex) . "\\\""; //" to activate'; if ($_POST['argsare'] != '') { //$command.=' ' . "\\\"" . str_replace('"','',str_replace('+',' ',urldecode($_POST['argsare']))) . "\\\""; $command.=' ' . "" . str_replace('"','',str_replace('+',' ',urldecode($_POST['argsare']))) . ""; } ourpassthru($command . "\"'"); //passthru("php " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "find_xcode_executable.php " . str_replace('+',' ',urldecode($_POST['execexec'])) . ' ' . str_replace('+',' ',urldecode($_POST['argsare'])) . ""); exit; } else { $command="osascript -e 'tell application \"" . $dactor . "\" to " . $dverb . " \"\\" . "\"" . str_replace('"','',str_replace('+',' ',urldecode($_POST['execexec']))) . "\\\""; //" to activate'; ourpassthru($command . "\"'"); //passthru("php " . $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR . "find_xcode_executable.php " . str_replace('+',' ',urldecode($_POST['execexec'])) . ""); exit; } } $sofarcnt=1; //echo "find " . $startin . " -name '*.xcodeproj' 2> /dev/null"; //exit; $list=""; if (strtoupper(PHP_OS) == 'DARWIN') { $list=str_replace("." . DIRECTORY_SEPARATOR, $_SERVER['DOCUMENT_ROOT'] . DIRECTORY_SEPARATOR, shell_exec("cd " . $_SERVER['DOCUMENT_ROOT'] . " ; " . "find " . $startin . " -name '*.xcodeproj' -maxdepth 7 2> /dev/null")); } $recs=explode("\n", $list); $selis=""; if ($list != '') { for ($i=0; $i| Desktop program ... or ... | Online URL ... | " . $selis . " |
|---|