php-src/ext/phar/package.php

91 lines
3.7 KiB
PHP
Raw Normal View History

2007-03-25 20:04:39 +00:00
<?php
$notes = '
Major feature functionality release
2008-03-26 03:55:37 +00:00
* new default stub allows running of phar-based phars without phar extension [Greg/Steph]
* add support for tar-based and zip-based phar archives [Greg]
* add Phar::isTar(), Phar::isZip(), and Phar::isPhar() [Greg]
* add Phar::convertToTar(), Phar::convertToZip(), and Phar::convertToPhar() [Greg]
2008-03-26 03:55:37 +00:00
* add Phar::compress() [Greg]
* conversion to compressed or to other file formats automatically copies the archive
to a new extension (i.e. ".phar" to ".phar.tar" or ".tar" to ".tar.gz") [Steph]
* add Phar::webPhar() for running a web-based application unmodified
directly from a phar archive [Greg]
* file functions (fopen-based and stat-based) can be instructed to only look for
relative paths within a phar via Phar::interceptFileFuncs()
2008-03-26 03:55:37 +00:00
* add PharData class to allow manipulation/creation of non-executable tar and zip archives. [Steph]
non-executable tar/zip manipulation is allowed even when phar.readonly=1 [Greg]
* paths with . and .. work (phar://blah.phar/a/../b.php => phar://blah.phar/b.php) [Greg]
* add support for mkdir()/rmdir() and support for empty directories to phar file format [Greg]
* add option to compress the entire phar file for phar/tar file format [Greg]
2008-01-09 08:49:58 +00:00
* implement Phar::isCompressed() returning 0, Phar::GZ or Phar::BZ2 [Greg]
2007-12-16 06:31:00 +00:00
* implement Phar::copy(string $from, string $to) [Greg]
* implement Phar::buildFromIterator(Iterator $it[, string $base_directory]) [Greg]
2008-03-26 03:55:37 +00:00
* implement Phar::mount() for mounting external paths or files to locations inside a phar [Greg]
* add Phar::delete() [Greg]
';
2007-03-25 20:04:39 +00:00
if (!class_exists("Phar") && !extension_loaded("Phar")) {
die("Extension phar not present");
}
2008-03-26 03:55:37 +00:00
error_reporting(E_ALL & ~E_DEPRECATED);
2007-03-25 20:04:39 +00:00
require_once 'PEAR/PackageFileManager2.php';
PEAR::setErrorHandling(PEAR_ERROR_DIE);
$options = array(
'filelistgenerator' => 'CVS',
'changelogoldtonew' => false,
'simpleoutput' => true,
'baseinstalldir' => '/',
'packagedirectory' => dirname(__FILE__),
'packagefile' => 'package.xml',
'clearcontents' => true,
'ignore' => array('package*.php', 'package*.xml'),
'dir_roles' => array(
'docs' => 'doc',
'examples' => 'doc',
'tests' => 'test',
2007-05-10 20:55:28 +00:00
'phar' => 'src',
2007-03-25 20:04:39 +00:00
),
2007-03-25 20:36:19 +00:00
'exceptions' => array(
'CREDITS' => 'doc',
'EXPERIMENTAL' => 'doc',
'LICENSE' => 'doc',
'Makefile.frag' => 'src',
'phar_path_check.re' => 'src',
'TODO' => 'doc',
2007-11-23 05:51:59 +00:00
'phar.phar' => 'script',
2007-03-25 20:36:19 +00:00
),
2007-03-25 20:04:39 +00:00
);
$package = PEAR_PackageFileManager2::importOptions(dirname(__FILE__) . '/package.xml', $options);
$package->clearDeps();
$package->setPhpDep('5.2.0');
$package->setPearInstallerDep('1.4.3');
$package->addPackageDepWithChannel('optional', 'bz2', 'pecl.php.net', false, false, false, false, 'bz2');
// all this false business sets the <providesextension> tag that allows us to have hash built
// in statically
$package->addPackageDepWithChannel('optional', 'hash', 'pecl.php.net', false, false, false, false, 'hash');
2007-03-25 20:04:39 +00:00
$package->addExtensionDep('optional', 'spl');
$package->addExtensionDep('optional', 'zlib');
2007-03-26 15:51:17 +00:00
$package->setPackageType('extsrc');
2007-03-25 20:04:39 +00:00
$package->addRelease();
$package->setReleaseVersion(phpversion('phar'));
$package->setAPIVersion(Phar::apiVersion());
2008-03-26 03:55:37 +00:00
$package->setReleaseStability('alpha');
$package->setAPIStability('alpha');
2007-03-25 20:14:35 +00:00
$package->setNotes("\n$notes\n");
//$package->addGlobalReplacement('package-info', '@package_version@', 'version');
2007-03-25 20:04:39 +00:00
$package->generateContents();
if (isset($_GET['make']) || (isset($_SERVER['argv']) && @$_SERVER['argv'][1] == 'make')) {
$package->writePackageFile();
} else {
$package->debugPackageFile();
}
?>