From: Marcus Boerger Date: Mon, 28 May 2007 19:04:08 +0000 (+0000) Subject: - Turn the loader into a stream wrapper if necessary X-Git-Tag: RELEASE_1_4~37 X-Git-Url: https://granicus.if.org/sourcecode?a=commitdiff_plain;h=17feef6b6c488829aa3f21d3cffc492f161da1c4;p=php - Turn the loader into a stream wrapper if necessary --- diff --git a/ext/phar/phar.php b/ext/phar/phar.php index b6e899cb73..121d7cb636 100644 --- a/ext/phar/phar.php +++ b/ext/phar/phar.php @@ -524,12 +524,18 @@ class PharCommand extends CLICommand { $c = file_get_contents($stub); $s = ''; + if (substr($c,0,2) == '#!') { $s.= substr($c,0,strpos($c, "\n")+1); } - $s.= ''; - $s.= file_get_contents($loader); - $s.= ''; + + $s .= ''; + $s .= file_get_contents($loader); + $s .= ''; + if (substr($c,0,1) == '#') { $s.= substr($c,strpos($c, "\n")+1); } diff --git a/ext/phar/phar/pharcommand.inc b/ext/phar/phar/pharcommand.inc index 4497802a75..8ac6ea12a7 100755 --- a/ext/phar/phar/pharcommand.inc +++ b/ext/phar/phar/pharcommand.inc @@ -411,7 +411,10 @@ class PharCommand extends CLICommand $s .= ''; $s .= file_get_contents($loader); - $s .= ''; + $s .= ''; if (substr($c,0,1) == '#') { $s.= substr($c,strpos($c, "\n")+1);