Hi Greg

2009/6/10 Greg Beaver <g...@chiaraquartet.net>:
> Fantastic, in that case, all that needs to be added to mkdist.php is this:
>
> echo "Generating phar.phar\r\n";
> $phar = new Phar($path_to_php . '/phar.phar', 0, 'pharcommand');
> foreach (new DirectoryIterator($path_to_phar . '/phar') as $file) {
>    if ($file->isDir() || $file == 'phar.php') continue;
>    echo 'adding ', $file, "\r\n";
>    $phar[(string) $file] = file_get_contents($path_to_phar.  '/phar/' .
> $file);
> }
> $phar->setSignatureAlgorithm(Phar::SHA1);
> $stub = file($path_to_phar . '/phar/phar.php');
> unset($stub[0]); // remove hashbang
> $phar->setStub(implode('', $stub));
> echo "Creating phar.phar.bat\r\n";
> file_put_contents($path_to_php . '/phar.phar.bat', 'php phar.phar %1 %2
> %3 %4 %5 %6 %7 %8 %9\r\n");

To use unlimited parameters, then use %* and it will catch all the parameters.

>
> That should do it.  The only problem is that the user will need to
> adjust the path of phar.phar at install-time, but I don't see any
> obvious way around this outside of the win32 installer.
>
> Note that $path_to_php should be the equivalent of C:\php5 and
> $path_to_phar should be C:\php5\ext\phar
>
> Greg
>
> --
> PHP Internals - PHP Runtime Development Mailing List
> To unsubscribe, visit: http://www.php.net/unsub.php
>
>



-- 
regrads,

Kalle Sommer Nielsen
ka...@php.net

--
PHP Internals - PHP Runtime Development Mailing List
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to