package.xml for Smarty
| From: | Greg Beaver | Date: | Mon, 29 Sep 2003 16:35:59 +0000 |
| Subject: | package.xml for Smarty | ||
| Groups: | php.smarty.general | ||
| Request: | Send a blank email to php-smarty-general+get-10280@lists.php.net to get a copy of this message | ||
Hi all,
the PEAR package PEAR_PackageFileManager can be used to create a package.xml for Smarty really easily. Here's a short script that would create the package.xml based on CVS. To use, you'll need to first of all check out Smarty, then change $packagedir to the path to the CVS checkout. Finally, change the version from ???? to whatever it actually is, and the state to stable if it is a stable release. Then, view the file in your web browser, click make, and you've got a current package.xml. I can add this script to CVS if people feel it is really helpful.
<?php
/**
* Create Smarty's package.xml file
* @package PEAR_PackageFileManager
*/
/**
* Include the package file manager
*/
require_once('PEAR/PackageFileManager.php');
$test = new PEAR_PackageFileManager;
// directory that Smarty CVS is located in
$packagedir = 'C:/path/to/Smarty';
$e = $test->setOptions(
array('baseinstalldir' => 'Smarty',
'version' => '????',
'packagedirectory' => $packagedir,
'state' => 'beta',
'filelistgenerator' => 'cvs',
'notes' => 'package.xml for Smarty',
'package' => 'Smarty',
'dir_roles' => array('docs' => 'doc'),
'exceptions' =>
array(
'debug.tpl' => 'php',
),
));
if (PEAR::isError($e)) {
echo $e->getMessage();
exit;
}
$e = $test->addDependency('php', '4.0.6', 'ge', 'php');
if (PEAR::isError($e)) {
echo $e->getMessage();
exit;
}
if (isset($_GET['make'])) {
$e = $test->writePackageFile();} else {
$e = $test->debugPackageFile();} if (PEAR::isError($e)) {
echo $e->getMessage();} if (!isset($_GET['make'])) {
echo '<a href="' . $_SERVER['PHP_SELF'] . '?make=1">Make this file</a>';} ?>