root/tags/RELEASE_0_2_0/autopackage2.php

Revision 103, 3.4 kB (checked in by mikey, 1 year ago)

added implicit and explicit call to set as well as possibility for setting public properties
whitespace fixes

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  * Base version
21  */
22 $baseVersion = '0.2.0';
23
24 /**
25  * current version
26  */
27 $version    = $baseVersion . 'dev' . $argv[1];
28 $dir        = dirname( __FILE__ );
29
30 /**
31  * Current API version
32  */
33 $apiVersion = '0.2.0';
34
35 /**
36  * current state
37  */
38 $state = 'devel';
39
40 /**
41  * current API stability
42  */
43 $apiStability = 'alpha';
44
45 /**
46  * release notes
47  */
48 $notes = <<<EOT
49 Feature additions:
50 - New feature to define abstract tags, which enables yo to define the concrete type in the tag instead of the definition (mikey)
51 - It is now possible to define an explicit setter method for character data inside a tag (schst)
52 - Added possibility to declare tags as static (schst)
53 - Added several unit tests (mikey)
54 - Added possibility to package XJConfForPHP as a STAR archive (mikey, schst)
55 - Added new value type "xjonf:auto-primitive" to guess the type of a scalar value (schst)
56 - Added implicit and explicit call to __set as well as possibility for setting public properties (mikey)
57 Bugfixes:
58 - Fixed bug #6: Enable factory methods without parameters in PHP 5.0.x (schst)
59 - Fixed bug #7: check, whether factory method can be called statically (schst)
60 - Fixed bug: prevent errors in case factory method does not return an instance of an object (mikey)
61 EOT;
62
63 /**
64  * package description
65  */
66 $description = <<<EOT
67 XJConfForPHP is a port of XJConf. It enables you to create complex data structures consisting of
68 objects, arrays and primitives from virtually any XML document. It provides a simple XML language
69 to define the XML-to-object mappings. It features namespace support and is easily extendible.
70 EOT;
71
72 $package = new PEAR_PackageFileManager2();
73
74 $result = $package->setOptions(array(
75     'filelistgenerator' => 'file',
76     'ignore'            => array( 'package.php', 'autopackage2.php', 'package.xml', '.svn', 'rfcs' ),
77     'simpleoutput'      => true,
78     'baseinstalldir'    => '/',
79     'packagedirectory'  => './',
80     'dir_roles'         => array(
81                                  'docs' => 'doc',
82                                  'examples' => 'doc',
83                                  'tests' => 'test',
84                                  )
85     ));
86 if (PEAR::isError($result)) {
87     echo $result->getMessage();
88     die();
89 }
90
91 $package->setPackage('XJConfForPHP');
92 $package->setSummary('XML-to-object mapper.');
93 $package->setDescription($description);
94
95 $package->setChannel('pear.php-tools.net');
96 $package->setAPIVersion($apiVersion);
97 $package->setReleaseVersion($version);
98 $package->setReleaseStability($state);
99 $package->setAPIStability($apiStability);
100 $package->setNotes($notes);
101 $package->setPackageType('php');
102 $package->setLicense('LGPL', 'http://www.gnu.org/copyleft/lesser.txt');
103
104 $package->addMaintainer('lead', 'schst', 'Stephan Schmidt', 'schst@xjconf.net', 'yes');
105 $package->addMaintainer('lead', 'mikey', 'Frank Kleine', 'mikey@xjconf.net', 'yes');
106
107 $package->setPhpDep('5.0.0');
108 $package->setPearinstallerDep('1.4.0');
109
110 $package->addExtensionDep('required', 'xmlreader');
111
112 $package->generateContents();
113
114 $result = $package->writePackageFile();
115
116 if (PEAR::isError($result)) {
117     echo $result->getMessage();
118     die();
119 }
120 ?>
Note: See TracBrowser for help on using the browser.