OxyScripts.com
Menu spacer Home Tutorials Articles Code Forums irc.freenode.net #oxyscripts
Main (PHP)
Home Forums PHP News PHP Tutorials Articles PHP Code Snippets Contact Us Sysadmin Resources Books Template Shop
3rd Party Streams
SlashDot PHPDeveloper.org PHP.Net
Resources
PHP Manual MySQL Manual Smarty Manual PEAR Manual PHP-GTK Manual Symfony Manual
Code Snippets
Authentication Database Graphics HTTP Miscellaneous Time/Date
Affiliates
Scripts TutorialMan TutorialGuide CodingForums.com PHP Scripts Cheap Web Hosting Affordable Web Hosting Dreamweaver Templates

Search This Site :     PHP Function Reference :
 
Class Summary PEAR_PackageFileManager

Class Summary PEAR_PackageFileManager

Class Summary PEAR_PackageFileManager -- PEAR :: PackageFileManager updates the <filelist></filelist> section of a PEAR package.xml file to reflect the current files in preparation for a release.

PEAR :: PackageFileManager updates the <filelist></filelist> section of a PEAR package.xml file to reflect the current files in preparation for a release.

The PEAR_PackageFileManager class uses a plugin system to generate the list of files in a package. This allows both standard recursive directory parsing (plugin type file) and more intelligent options such as the CVS browser PEAR_PackageFileManager_Cvs, which grabs all files in a local CVS checkout to create the list, ignoring any other local files.

Other options include specifying roles for file extensions (all .php files are role="php", for example), roles for directories (all directories named "tests" are given role="tests" by default), and exceptions. Exceptions are specific pathnames with * and ? wildcards that match a default role, but should have another. For example, perhaps a debug.tpl template would normally be data, but should be included in the docs role. Along these lines, to exclude files entirely, use the ignore option.

Required options for a release include version, baseinstalldir, state, and packagedirectory (the full path to the local location of the package to create a package.xml file for)

Example usage:
1      <?php
2      require_once('PEAR/PackageFileManager.php');
3      $packagexml = new PEAR_PackageFileManager;
4      $e = $packagexml->setOptions(
5      array('baseinstalldir' => 'PhpDocumentor',
6       'version' => '1.2.1',
7       'packagedirectory' => 'C:/Web Pages/chiara/phpdoc2/',
8       'state' => 'stable',
9       'filelistgenerator' => 'cvs', // generate from cvs, use file for directory
10      'notes' => 'We\'ve implemented many new and exciting features',
11      'ignore' => array('TODO', 'tests/'), // ignore TODO, all files in tests/
12      'installexceptions' => array('phpdoc' => '/*'), // baseinstalldir ="/" for phpdoc
13      'dir_roles' => array('tutorials' => 'doc'),
14      'exceptions' => array('README' => 'doc', // README would be data, now is doc
15                            'PHPLICENSE.txt' => 'doc'))); // same for the license
16     if (PEAR::isError($e)) {
17         echo $e->getMessage();
18         die();
19     }
20     $e = $test->addPlatformException('pear-phpdoc.bat', 'windows');
21     if (PEAR::isError($e)) {
22         echo $e->getMessage();
23         exit;
24     }
25     $packagexml->addRole('pkg', 'doc'); // add a new role mapping
26     if (PEAR::isError($e)) {
27         echo $e->getMessage();
28         exit;
29     }
30     // replace @PHP-BIN@ in this file with the path to php executable!  pretty neat
31     $e = $test->addReplacement('pear-phpdoc', 'pear-config', '@PHP-BIN@', 'php_bin');
32     if (PEAR::isError($e)) {
33         echo $e->getMessage();
34         exit;
35     }
36     $e = $test->addReplacement('pear-phpdoc.bat', 'pear-config', '@PHP-BIN@', 'php_bin');
37     if (PEAR::isError($e)) {
38         echo $e->getMessage();
39         exit;
40     }
41     // note use of debugPackageFile() - this is VERY important
42     if (isset($_GET['make']) || $_SERVER['argv'][1] == 'make') {
43         $e = $packagexml->writePackageFile();
44     } else {
45         $e = $packagexml->debugPackageFile();
46     }
47     if (PEAR::isError($e)) {
48         echo $e->getMessage();
49         die();
50     }
51     ?>

In addition, a package.xml file can now be generated from scratch, with the usage of new options package, summary, description, and the use of the addMaintainer() method

Class Trees for PEAR_PackageFileManager

  • PEAR_PackageFileManager

 
   Print this page

Top Sponsor
Symantec\'s Norton SystemWorks 2006
Sponsors
CA
Sponsors
AdWords Dominator 125*125
Advertisting

Affiliates
VertexTemplates PHPFreaks CodeWalkers StarGeek DevScripts CGI & PHP Scripts PHP CMS

Shopping Rebates   Sell It 4 You   Flash Page Counters   Get Insured
GPS Tracking Service   Charity Donate Info   Web Site Hosting   VOIP Service

Privacy Policy | Links | Site Map | Advertising

All content on OxyScripts.com is (©)2002-2007

 
Powered by Adrastea - Version 1.0.0. Copyright © Rune Solutions, 2004-2005