root/branches/PRE_NAMESPACES/package.php

Revision 139, 2.9 kB (checked in by mikey, 5 months ago)

bugfix: throw exception if opening of xml files fails

Line 
1 <?php
2 /**
3  * script to automate the generation of the
4  * package.xml file.
5  *
6  * $Id: package.php 442 2006-08-20 13:21:58Z schst $
7  *
8  * @author      Stephan Schmidt <schst@php-tools.net>
9  * @package     XJConfForPHP
10  * @subpackage  Tools
11  */
12
13 /**
14  * uses PackageFileManager
15  */
16 require_once 'PEAR/PackageFileManager2.php';
17 require_once 'PEAR/PackageFileManager/Svn.php';
18
19 /**
20  * current version
21  */
22 $version = '0.3.0dev';
23
24 /**
25  * Current API version
26  */
27 $apiVersion = '0.3.0';
28
29 /**
30  * current state
31  */
32 $state = 'alpha';
33
34 /**
35  * current API stability
36  */
37 $apiStability = 'alpha';
38
39 /**
40  * release notes
41  */
42 $notes = <<<EOT
43 Feature additions:
44 - bugfix in converting primitive: string "false" should evaluate to false (mikey)
45 - changed package separator from dot to Paamayim Nekudotayim (mikey)
46 - added support for octal numbers (mikey)
47 - added XmlParser::clearConfigValues() (mikey)
48 - bugfix: throw exception if opening of xml files fails (mikey)
49 EOT;
50
51 /**
52  * package description
53  */
54 $description = <<<EOT
55 XJConfForPHP is a port of XJConf. It enables you to create complex data structures consisting of
56 objects, arrays and primitives from virtually any XML document. It provides a simple XML language
57 to define the XML-to-object mappings. It features namespace support and is easily extendible.
58 EOT;
59
60 $package = new PEAR_PackageFileManager2();
61
62 $result = $package->setOptions(array(
63     'filelistgenerator' => 'svn',
64     'ignore'            => array( 'package.php', 'package.xml', '.svn', 'rfcs' ),
65     'simpleoutput'      => true,
66     'baseinstalldir'    => '/',
67     'packagedirectory'  => './',
68     'dir_roles'         => array(
69                                  'docs' => 'doc',
70                                  'examples' => 'doc',
71                                  'tests' => 'test',
72                                  )
73     ));
74 if (PEAR::isError($result)) {
75     echo $result->getMessage();
76     die();
77 }
78
79 $package->setPackage('XJConfForPHP');
80 $package->setSummary('XML-to-object mapper.');
81 $package->setDescription($description);
82
83 $package->setChannel('pear.php-tools.net');
84 $package->setAPIVersion($apiVersion);
85 $package->setReleaseVersion($version);
86 $package->setReleaseStability($state);
87 $package->setAPIStability($apiStability);
88 $package->setNotes($notes);
89 $package->setPackageType('php');
90 $package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.txt');
91
92 $package->addMaintainer('lead', 'schst', 'Stephan Schmidt', 'schst@xjconf.net', 'yes');
93 $package->addMaintainer('lead', 'mikey', 'Frank Kleine', 'mikey@xjconf.net', 'yes');
94
95 $package->setPhpDep('5.0.0');
96 $package->setPearinstallerDep('1.4.0');
97
98 $package->addExtensionDep('required', 'xmlreader');
99
100 $package->generateContents();
101
102 if (isset($_GET['make']) || (isset($_SERVER['argv'][1]) && $_SERVER['argv'][1] == 'make')) {
103     $result = $package->writePackageFile();
104 } else {
105     $result = $package->debugPackageFile();
106 }
107
108 if (PEAR::isError($result)) {
109     echo $result->getMessage();
110     die();
111 }
112 ?>
Note: See TracBrowser for help on using the browser.