cvs: pear-core(PEAR_1_4) / make-gopear-phar.php make-installpear-nozlib-phar.php
| From: | Greg Beaver | Date: | Tue, 18 Jul 2006 00:53:56 +0000 |
| Subject: | cvs: pear-core(PEAR_1_4) / make-gopear-phar.php make-installpear-nozlib-phar.php | ||
| Groups: | php.pear.cvs php.pear.core | ||
| Request: | Send a blank email to pear-core+get-4880@lists.php.net to get a copy of this message | ||
cellog Tue Jul 18 00:53:56 2006 UTC
Modified files: (Branch: PEAR_1_4)
/pear-core make-gopear-phar.php make-installpear-nozlib-phar.php
Log:
fix phar creation scripts for PHP_Archive 0.8.0
http://cvs.php.net/viewvc.cgi/pear-core/make-gopear-phar.php?r1=1.12&r2=1.12.2.1&diff_format=u
Index: pear-core/make-gopear-phar.php
diff -u pear-core/make-gopear-phar.php:1.12 pear-core/make-gopear-phar.php:1.12.2.1
--- pear-core/make-gopear-phar.php:1.12 Sat Mar 4 15:26:20 2006
+++ pear-core/make-gopear-phar.php Tue Jul 18 00:53:56 2006
@@ -27,7 +27,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 2005-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: make-gopear-phar.php,v 1.12 2006/03/04 15:26:20 cellog Exp $
+ * @version CVS: $Id: make-gopear-phar.php,v 1.12.2.1 2006/07/18 00:53:56 cellog Exp $
*/
$peardir = dirname(__FILE__);
@@ -44,6 +44,16 @@
}
$packages[] = $entry;
}
+$x = explode(PATH_SEPARATOR, get_include_path());
+$y = array();
+foreach ($x as $path) {
+ if ($path == '.') {
+ continue;
+ }
+ $y[] = $path;
+}
+// remove current dir, we will otherwise include CVS files, which is not good
+set_include_path(implode(PATH_SEPARATOR, $y));
require_once 'PEAR/PackageFile.php';
require_once 'PEAR/Config.php';
require_once 'PHP/Archive/Creator.php';
@@ -53,9 +63,15 @@
$pkg = &new PEAR_PackageFile($config);
$pf = $pkg->fromPackageFile($peardir . DIRECTORY_SEPARATOR . 'package2.xml',
PEAR_VALIDATE_NORMAL);
+if (PEAR::isError($pf)) {
+ foreach ($pf->getUserInfo() as $warn) {
+ echo $warn['message'] . "\n";
+ }
+ die($pf->getMessage());
+}
$pearver = $pf->getVersion();
-$creator = new PHP_Archive_Creator('index.php', true, 'go-pear.phar');
+$creator = new PHP_Archive_Creator('index.php', 'go-pear.phar', true);
foreach ($packages as $package) {
echo "adding PEAR/go-pear-tarballs/$package\n";
$creator->addFile("PEAR/go-pear-tarballs/$package",
"PEAR/go-pear-tarballs/$package");
@@ -259,6 +275,7 @@
$commandcontents);
$creator->addString($commandcontents, 'PEAR/PackageFile.php');
+$creator->addMagicRequireCallback(array($creator, 'simpleMagicRequire'));
$creator->addDir($peardir, array('tests/',
'scripts/',
'go-pear-phar.php',
@@ -327,6 +344,6 @@
'*Archive/Tar.php',
'*Console/Getopt.php',
'System.php',
- ), 'go-pear.phar');
+ ));
$creator->savePhar(dirname(__FILE__) . DIRECTORY_SEPARATOR . 'go-pear.phar');
?>
http://cvs.php.net/viewvc.cgi/pear-core/make-installpear-nozlib-phar.php?r1=1.9&r2=1.9.2.1&diff_format=u
Index: pear-core/make-installpear-nozlib-phar.php
diff -u pear-core/make-installpear-nozlib-phar.php:1.9
pear-core/make-installpear-nozlib-phar.php:1.9.2.1
--- pear-core/make-installpear-nozlib-phar.php:1.9 Fri Jan 6 04:51:56 2006
+++ pear-core/make-installpear-nozlib-phar.php Tue Jul 18 00:53:56 2006
@@ -26,7 +26,7 @@
* @author Greg Beaver <cellog@php.net>
* @copyright 2005-2006 The PHP Group
* @license http://www.php.net/license/3_0.txt
PHP License 3.0
- * @version CVS: $Id: make-installpear-nozlib-phar.php,v 1.9 2006/01/06 04:51:56 cellog Exp $
+ * @version CVS: $Id: make-installpear-nozlib-phar.php,v 1.9.2.1 2006/07/18 00:53:56 cellog Exp
$
*/
$peardir = dirname(__FILE__);
@@ -48,6 +48,16 @@
$packages[$matches[1]] = $entry;
}
$packages['PEAR'] = $pearentry;
+$x = explode(PATH_SEPARATOR, get_include_path());
+$y = array();
+foreach ($x as $path) {
+ if ($path == '.') {
+ continue;
+ }
+ $y[] = $path;
+}
+// remove current dir, we will otherwise include CVS files, which is not good
+set_include_path(implode(PATH_SEPARATOR, $y));
require_once 'PEAR/PackageFile.php';
require_once 'PEAR/Config.php';
require_once 'PHP/Archive/Creator.php';
@@ -59,7 +69,7 @@
$pf = $pkg->fromPackageFile($peardir . DIRECTORY_SEPARATOR . 'package2.xml',
PEAR_VALIDATE_NORMAL);
$pearver = $pf->getVersion();
-$creator = new PHP_Archive_Creator('index.php', false,
'install-pear-nozlib.phar'); // no compression
+$creator = new PHP_Archive_Creator('index.php', 'install-pear-nozlib.phar'); //
no compression
$install_files = '$install_files = array(';
foreach ($packages as $name => $package) {
echo "$name => $package\n";
@@ -275,6 +285,7 @@
$commandcontents);
$creator->addString($commandcontents, 'PEAR/PackageFile.php');
+$creator->addMagicRequireCallback(array($creator, 'simpleMagicRequire'));
$creator->addDir($peardir, array('tests/',
'scripts/',
'go-pear-phar.php',
@@ -343,6 +354,6 @@
'*Archive/Tar.php',
'*Console/Getopt.php',
'System.php',
- ), 'install-pear-nozlib.phar');
+ ));
$creator->savePhar(dirname(__FILE__) . DIRECTORY_SEPARATOR .
'install-pear-nozlib.phar');
?>