| 1 |
<?php |
|---|
| 2 |
|
|---|
| 3 |
|
|---|
| 4 |
|
|---|
| 5 |
|
|---|
| 6 |
|
|---|
| 7 |
|
|---|
| 8 |
|
|---|
| 9 |
|
|---|
| 10 |
|
|---|
| 11 |
|
|---|
| 12 |
|
|---|
| 13 |
|
|---|
| 14 |
|
|---|
| 15 |
|
|---|
| 16 |
$baseVersion = '2.0.0'; |
|---|
| 17 |
|
|---|
| 18 |
|
|---|
| 19 |
|
|---|
| 20 |
|
|---|
| 21 |
require_once 'PEAR/PackageFileManager.php'; |
|---|
| 22 |
|
|---|
| 23 |
|
|---|
| 24 |
|
|---|
| 25 |
|
|---|
| 26 |
$version = $baseVersion . 'dev' . $argv[1]; |
|---|
| 27 |
$dir = dirname( __FILE__ ); |
|---|
| 28 |
|
|---|
| 29 |
|
|---|
| 30 |
|
|---|
| 31 |
|
|---|
| 32 |
$state = 'devel'; |
|---|
| 33 |
|
|---|
| 34 |
|
|---|
| 35 |
|
|---|
| 36 |
|
|---|
| 37 |
$notes = <<<EOT |
|---|
| 38 |
patConfiguration has been refactored with version 2.0 is not fully downwards compatible. |
|---|
| 39 |
Changes include: |
|---|
| 40 |
- driver based architecture |
|---|
| 41 |
- uses patError |
|---|
| 42 |
- support for INI and WDDX has been added |
|---|
| 43 |
- no more namespace handlers by supplying extensions |
|---|
| 44 |
- huge improvements for the define tag |
|---|
| 45 |
- license has been changed to PHP License |
|---|
| 46 |
|
|---|
| 47 |
Changes since patConfiguration 2.0.0b1: |
|---|
| 48 |
- fixed bug #104 (wrong parameter name) (schst) |
|---|
| 49 |
- added an error check in the writeConfigFile() method in case the target file cannot be written (argh) |
|---|
| 50 |
- fixed check for the writer's serializeConfig() method return values (argh) |
|---|
| 51 |
- added new <define child="..." default="..." type="..."/> to define default values of non-existent child-tags |
|---|
| 52 |
|
|---|
| 53 |
Changes since patConfiguration 2.0.0b2: |
|---|
| 54 |
- added missing examples |
|---|
| 55 |
- prevent PHP-Notices with issetConfigValue() (bug #145, contributed by Frank Kleine) |
|---|
| 56 |
- fixed and improved the "could not load xxx for filetype" error message (argh) |
|---|
| 57 |
EOT; |
|---|
| 58 |
|
|---|
| 59 |
|
|---|
| 60 |
|
|---|
| 61 |
|
|---|
| 62 |
$description = <<<EOT |
|---|
| 63 |
patConfiguration is an interface to read and write different types of configuration files. |
|---|
| 64 |
Formats include: |
|---|
| 65 |
- read/write XML files |
|---|
| 66 |
- read/write INI files |
|---|
| 67 |
- read/write WDDX files |
|---|
| 68 |
- write PHP files. |
|---|
| 69 |
To improve performance, patConfiguration is able to use a caching system instead of parsing the files everytime they are needed. |
|---|
| 70 |
|
|---|
| 71 |
It is best known for its support for XML based configurations, as you may define your own tags |
|---|
| 72 |
and specify which PHP type they represent. Features include: |
|---|
| 73 |
- create any PHP type (from boolean to objects) |
|---|
| 74 |
- infinite nesting level |
|---|
| 75 |
- define namespaces, tags and attributes |
|---|
| 76 |
- choose how whitespace is handled |
|---|
| 77 |
- xInclude |
|---|
| 78 |
- use PHP constants in you configuration files |
|---|
| 79 |
EOT; |
|---|
| 80 |
|
|---|
| 81 |
$package = new PEAR_PackageFileManager(); |
|---|
| 82 |
|
|---|
| 83 |
$result = $package->setOptions(array( |
|---|
| 84 |
'package' => 'patConfiguration', |
|---|
| 85 |
'summary' => 'Interface for configuration files.', |
|---|
| 86 |
'description' => $description, |
|---|
| 87 |
'version' => $version, |
|---|
| 88 |
'state' => $state, |
|---|
| 89 |
'license' => 'PHP', |
|---|
| 90 |
'filelistgenerator' => 'file', |
|---|
| 91 |
'ignore' => array( 'package.php', 'autopackage.php', 'package.xml', '.cvsignore' ), |
|---|
| 92 |
'notes' => $notes, |
|---|
| 93 |
'simpleoutput' => true, |
|---|
| 94 |
'baseinstalldir' => 'pat', |
|---|
| 95 |
'packagedirectory' => $dir, |
|---|
| 96 |
'dir_roles' => array( |
|---|
| 97 |
'docs' => 'doc', |
|---|
| 98 |
'examples' => 'doc', |
|---|
| 99 |
'tests' => 'test', |
|---|
| 100 |
) |
|---|
| 101 |
)); |
|---|
| 102 |
|
|---|
| 103 |
if (PEAR::isError($result)) { |
|---|
| 104 |
echo $result->getMessage(); |
|---|
| 105 |
die(); |
|---|
| 106 |
} |
|---|
| 107 |
|
|---|
| 108 |
$package->addMaintainer('schst', 'lead', 'Stephan Schmidt', 'schst@php-tools.net'); |
|---|
| 109 |
|
|---|
| 110 |
$package->addDependency('patError', '', 'has', 'pkg', false); |
|---|
| 111 |
$package->addDependency('php', '4.3.0', 'ge', 'php', false); |
|---|
| 112 |
|
|---|
| 113 |
$result = $package->writePackageFile(); |
|---|
| 114 |
|
|---|
| 115 |
if (PEAR::isError($result)) { |
|---|
| 116 |
echo $result->getMessage(); |
|---|
| 117 |
die(); |
|---|
| 118 |
} |
|---|
| 119 |
?> |
|---|