Browse Source

- Turn the loader into a stream wrapper if necessary

PHAR_1_2
Marcus Boerger 19 years ago
parent
commit
17feef6b6c
  1. 12
      ext/phar/phar.php
  2. 5
      ext/phar/phar/pharcommand.inc

12
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.= '<?php if (!class_exists("Phar",0) && !class_exists("PHP_Archive")) { ?>';
$s.= file_get_contents($loader);
$s.= '<?php class Phar extends PHP_Archive {} } ?>';
$s .= '<?php if (!class_exists("Phar",0) && !class_exists("PHP_Archive")) { ?>';
$s .= file_get_contents($loader);
$s .= '<?php class Phar extends PHP_Archive { } ';
$s .= '} ';
$s .= 'if (!in_array(\'phar\', stream_get_wrappers())) { stream_wrapper_register(\'phar\', \'Phar\'); } ';
$s .= '?>';
if (substr($c,0,1) == '#') {
$s.= substr($c,strpos($c, "\n")+1);
}

5
ext/phar/phar/pharcommand.inc

@ -411,7 +411,10 @@ class PharCommand extends CLICommand
$s .= '<?php if (!class_exists("Phar",0) && !class_exists("PHP_Archive")) { ?>';
$s .= file_get_contents($loader);
$s .= '<?php class Phar extends PHP_Archive { } }?>';
$s .= '<?php class Phar extends PHP_Archive { } ';
$s .= '} ';
$s .= 'if (!in_array(\'phar\', stream_get_wrappers())) { stream_wrapper_register(\'phar\', \'Phar\'); } ';
$s .= '?>';
if (substr($c,0,1) == '#') {
$s.= substr($c,strpos($c, "\n")+1);

Loading…
Cancel
Save