svn: /pear2/Pyrus/trunk/ scripts/pyrus stub.php

From: Date: Wed, 23 Dec 2009 21:32:05 +0000
Subject: svn: /pear2/Pyrus/trunk/ scripts/pyrus stub.php
Groups: php.pear.cvs php.pear.core 
Request: Send a blank email to pear-cvs+get-58354@lists.php.net to get a copy of this message
dufuz Wed, 23 Dec 2009 21:32:05 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=292564 Log: Spacing Changed paths: U pear2/Pyrus/trunk/scripts/pyrus U pear2/Pyrus/trunk/stub.php Modified: pear2/Pyrus/trunk/scripts/pyrus =================================================================== --- pear2/Pyrus/trunk/scripts/pyrus 2009-12-23 21:31:16 UTC (rev 292563) +++ pear2/Pyrus/trunk/scripts/pyrus 2009-12-23 21:32:05 UTC (rev 292564) @@ -7,17 +7,20 @@ exit -1; } } + foreach (array('phar', 'spl', 'pcre', 'simplexml') as $ext) { if (!extension_loaded($ext)) { echo 'Extension ', $ext, " is required\n"; exit -1; } } -if (file_exists(dirname(__FILE__).'/../../autoload.php')) { - $autoload = dirname(__FILE__).'/../../autoload.php'; + +if (file_exists(__DIR__ . '/../../autoload.php')) { + $autoload = __DIR__ . '/../../autoload.php'; } else { $autoload = '@php_dir@/PEAR2/Autoload.php'; } + require_once $autoload; $frontend = new \pear2\Pyrus\ScriptFrontend\Commands; @array_shift($_SERVER['argv']); Modified: pear2/Pyrus/trunk/stub.php =================================================================== --- pear2/Pyrus/trunk/stub.php 2009-12-23 21:31:16 UTC (rev 292563) +++ pear2/Pyrus/trunk/stub.php 2009-12-23 21:32:05 UTC (rev 292564) @@ -7,12 +7,14 @@ exit -1; } } + foreach (array('phar', 'spl', 'pcre', 'simplexml') as $ext) { if (!extension_loaded($ext)) { echo 'Extension ', $ext, " is required\n"; exit -1; } } + try { Phar::mapPhar(); } catch (Exception $e) { @@ -20,6 +22,7 @@ echo $e->getMessage(), "\n"; exit -1; } + function pyrus_autoload($class) { $class = str_replace(array('_','\\'), '/', $class); @@ -27,11 +30,13 @@ include 'phar://' . __FILE__ . '/PEAR2_Pyrus-@PACKAGE_VERSION@/php/' . $class . '.php'; } } + spl_autoload_register("pyrus_autoload"); $phar = new Phar(__FILE__); $sig = $phar->getSignature(); define('PYRUS_SIG', $sig['hash']); define('PYRUS_SIGTYPE', $sig['hash_type']); + $frontend = new \pear2\Pyrus\ScriptFrontend\Commands; @array_shift($_SERVER['argv']); $frontend->run($_SERVER['argv']);

« previous php.pear.cvs (#58354) next »