home *** CD-ROM | disk | FTP | other *** search
/ Enter 2004 June / ENTER.ISO / files / xampp-win32-1.4.5-installer.exe / xampp / create_package.xml.php < prev    next >
Encoding:
PHP Script  |  2004-03-24  |  7.6 KB  |  232 lines

  1. <?php
  2. require_once('PEAR/PackageFileManager.php');
  3. $test = new PEAR_PackageFileManager;
  4.  
  5. $packagedir = 'C:/Web Pages/chiara/phpdoc';
  6.  
  7. $e = $test->setOptions(
  8. array('baseinstalldir' => 'PhpDocumentor',
  9. 'version' => '1.2.3',
  10. 'packagedirectory' => $packagedir,
  11. 'state' => 'stable',
  12. 'filelistgenerator' => 'cvs',
  13. 'notes' => 'Bugfix release
  14.  
  15. From both Windows and Unix, both the command-line version
  16. of phpDocumentor and the web interface will work
  17. out of the box by using command phpdoc - guaranteed :)
  18.  
  19. WARNING: in order to use the web interface through PEAR, you must set your
  20. data_dir to a subdirectory of your document root.
  21.  
  22. $ pear config-set data_dir /path/to/public_html/pear
  23.  
  24. on Windows with default apache setup, it might be
  25.  
  26. C:\> pear config-set data_dir "C:\Program Files\Apache\htdocs\pear"
  27.  
  28. After this, install/upgrade phpDocumentor
  29.  
  30. $ pear upgrade phpDocumentor
  31.  
  32. and you can browse to:
  33.  
  34. http://localhost/pear/PhpDocumentor/
  35.  
  36. for the web interface
  37.  
  38. - WARNING: phpDocumentor installs phpdoc in the
  39.   scripts directory, and this will conflict with PHPDoc,
  40.   you can\'t have both installed at the same time
  41. - fixed these bugs:
  42.  [ 731750 ] Links to unparsed includes shown (2nd time reopened)
  43.  [ 771531 ] body styles not explicitly white
  44.  [ 795095 ] top_frame.tpl doesn\'t output single RIC element
  45.  [ 797066 ] HighlightParser stuffs whitespace in start of string in func
  46.  [ 802891 ] Inline link text does not show up
  47. ',
  48. 'package' => 'PhpDocumentor',
  49. 'dir_roles' => array(
  50.     'Documentation' => 'doc',
  51.     'Documentation/tests' => 'test',
  52.     'docbuilder' => 'data',
  53.     'HTML_TreeMenu-1.1.2' => 'data',
  54.     'tutorials' => 'doc',
  55.     ),
  56. 'exceptions' =>
  57.     array(
  58.         'index.html' => 'data',
  59.         'README' => 'doc',
  60.         'ChangeLog' => 'doc',
  61.         'PHPLICENSE.txt' => 'doc',
  62.         'poweredbyphpdoc.gif' => 'data',
  63.         'INSTALL' => 'doc',
  64.         'FAQ' => 'doc',
  65.         'Authors' => 'doc',
  66.         'Release-1.2.0beta1' => 'doc',
  67.         'Release-1.2.0beta2' => 'doc',
  68.         'Release-1.2.0beta3' => 'doc',
  69.         'Release-1.2.0rc1' => 'doc',
  70.         'Release-1.2.0rc2' => 'doc',
  71.         'Release-1.2.0' => 'doc',
  72.         'Release-1.2.1' => 'doc',
  73.         'Release-1.2.2' => 'doc',
  74.         'Release-1.2.3' => 'doc',
  75.         'pear-phpdoc' => 'script',
  76.         'pear-phpdoc.bat' => 'script',
  77.         'HTML_TreeMenu-1.1.2/TreeMenu.php' => 'php',
  78.         'phpDocumentor/Smarty-2.5.0/libs/debug.tpl' => 'php',
  79.         'new_phpdoc.php' => 'data',
  80.         'phpdoc.php' => 'data',
  81.         ),
  82. 'ignore' =>
  83.     array('package.xml', 
  84.           "$packagedir/phpdoc",
  85.           'phpdoc.bat', 
  86.           'LICENSE',
  87.           '*docbuilder/actions.php',
  88.           '*docbuilder/builder.php',
  89.           '*docbuilder/config.php',
  90.           '*docbuilder/file_dialog.php',
  91.           '*docbuilder/top.php',
  92.           'utilities.php',
  93.           'Converter.inc',
  94.           'IntermediateParser.inc',
  95.           '*templates/PEAR/*',
  96.           'Setup.inc.php',
  97.           'makedocs.ini',
  98.           'common.inc.php',
  99.           'publicweb-PEAR-1.2.1.patch.txt',
  100.           ),
  101. 'installas' =>
  102.     array('pear-phpdoc' => 'phpdoc',
  103.           'pear-phpdoc.bat' => 'phpdoc.bat',
  104.           'docbuilder/pear-actions.php' => 'docbuilder/actions.php',
  105.           'docbuilder/pear-builder.php' => 'docbuilder/builder.php',
  106.           'docbuilder/pear-config.php' => 'docbuilder/config.php',
  107.           'docbuilder/pear-file_dialog.php' => 'docbuilder/file_dialog.php',
  108.           'docbuilder/pear-top.php' => 'docbuilder/top.php',
  109.           'docbuilder/includes/pear-utilities.php' => 'docbuilder/includes/utilities.php',
  110.           'phpDocumentor/pear-IntermediateParser.inc' => 'phpDocumentor/IntermediateParser.inc',
  111.           'phpDocumentor/pear-Converter.inc' => 'phpDocumentor/Converter.inc',
  112.           'phpDocumentor/pear-Setup.inc.php' => 'phpDocumentor/Setup.inc.php',
  113.           'phpDocumentor/pear-common.inc.php' => 'phpDocumentor/common.inc.php',
  114.           'user/pear-makedocs.ini' => 'user/makedocs.ini',
  115.           ),
  116. 'installexceptions' => array('pear-phpdoc' => '/', 'pear-phpdoc.bat' => '/', 'scripts/makedoc.sh' => '/'),
  117. ));
  118. if (PEAR::isError($e)) {
  119.     echo $e->getMessage();
  120.     exit;
  121. }
  122. $e = $test->addPlatformException('pear-phpdoc.bat', 'windows');
  123. if (PEAR::isError($e)) {
  124.     echo $e->getMessage();
  125.     exit;
  126. }
  127. $e = $test->addDependency('php', '4.1.0', 'ge', 'php');
  128. if (PEAR::isError($e)) {
  129.     echo $e->getMessage();
  130.     exit;
  131. }
  132. // just to make sure people don't try to install this with a broken Archive_Tar
  133. $e = $test->addDependency('Archive_Tar', '1.1', 'ge');
  134. if (PEAR::isError($e)) {
  135.     echo $e->getMessage();
  136.     exit;
  137. }
  138. // replace @PHP-BIN@ in this file with the path to php executable!  pretty neat
  139. $e = $test->addReplacement('pear-phpdoc', 'pear-config', '@PHP-BIN@', 'php_bin');
  140. if (PEAR::isError($e)) {
  141.     echo $e->getMessage();
  142.     exit;
  143. }
  144. $e = $test->addReplacement('pear-phpdoc.bat', 'pear-config', '@PHP-BIN@', 'php_bin');
  145. if (PEAR::isError($e)) {
  146.     echo $e->getMessage();
  147.     exit;
  148. }
  149. $e = $test->addReplacement('pear-phpdoc.bat', 'pear-config', '@BIN-DIR@', 'bin_dir');
  150. if (PEAR::isError($e)) {
  151.     echo $e->getMessage();
  152.     exit;
  153. }
  154. $e = $test->addReplacement('pear-phpdoc.bat', 'pear-config', '@PEAR-DIR@', 'php_dir');
  155. if (PEAR::isError($e)) {
  156.     echo $e->getMessage();
  157.     exit;
  158. }
  159. $e = $test->addReplacement('pear-phpdoc.bat', 'pear-config', '@DATA-DIR@', 'data_dir');
  160. if (PEAR::isError($e)) {
  161.     echo $e->getMessage();
  162.     exit;
  163. }
  164. $e = $test->addReplacement('docbuilder/pear-builder.php', 'pear-config', '@DATA-DIR@', 'data_dir');
  165. if (PEAR::isError($e)) {
  166.     echo $e->getMessage();
  167.     exit;
  168. }
  169. $e = $test->addReplacement('docbuilder/pear-file_dialog.php', 'pear-config', '@DATA-DIR@', 'data_dir');
  170. if (PEAR::isError($e)) {
  171.     echo $e->getMessage();
  172.     exit;
  173. }
  174. $e = $test->addReplacement('docbuilder/pear-file_dialog.php', 'pear-config', '@WEB-DIR@', 'data_dir');
  175. if (PEAR::isError($e)) {
  176.     echo $e->getMessage();
  177.     exit;
  178. }
  179. $e = $test->addReplacement('docbuilder/pear-actions.php', 'pear-config', '@WEB-DIR@', 'data_dir');
  180. if (PEAR::isError($e)) {
  181.     echo $e->getMessage();
  182.     exit;
  183. }
  184. $e = $test->addReplacement('docbuilder/pear-config.php', 'pear-config', '@DATA-DIR@', 'data_dir');
  185. if (PEAR::isError($e)) {
  186.     echo $e->getMessage();
  187.     exit;
  188. }
  189. $e = $test->addReplacement('docbuilder/pear-config.php', 'pear-config', '@WEB-DIR@', 'data_dir');
  190. if (PEAR::isError($e)) {
  191.     echo $e->getMessage();
  192.     exit;
  193. }
  194. $e = $test->addReplacement('phpDocumentor/pear-Setup.inc.php', 'pear-config', '@DATA-DIR@', 'data_dir');
  195. if (PEAR::isError($e)) {
  196.     echo $e->getMessage();
  197.     exit;
  198. }
  199. $e = $test->addReplacement('phpDocumentor/pear-Converter.inc', 'pear-config', '@DATA-DIR@', 'data_dir');
  200. if (PEAR::isError($e)) {
  201.     echo $e->getMessage();
  202.     exit;
  203. }
  204. $e = $test->addReplacement('phpDocumentor/pear-common.inc.php', 'package-info', '@VER@', 'version');
  205. if (PEAR::isError($e)) {
  206.     echo $e->getMessage();
  207.     exit;
  208. }
  209. $e = $test->addReplacement('user/pear-makedocs.ini', 'pear-config', '@PEAR-DIR@', 'php_dir');
  210. if (PEAR::isError($e)) {
  211.     echo $e->getMessage();
  212.     exit;
  213. }
  214. $e = $test->addReplacement('user/pear-makedocs.ini', 'pear-config', '@DOC-DIR@', 'doc_dir');
  215. if (PEAR::isError($e)) {
  216.     echo $e->getMessage();
  217.     exit;
  218. }
  219. $test->addRole('inc', 'php');
  220. $test->addRole('sh', 'script');
  221. if (isset($_GET['make'])) {
  222.     $e = $test->writePackageFile();
  223. } else {
  224.     $e = $test->debugPackageFile();
  225. }
  226. if (PEAR::isError($e)) {
  227.     echo $e->getMessage();
  228. }
  229. if (!isset($_GET['make'])) {
  230.     echo '<a href="' . $_SERVER['PHP_SELF'] . '?make=1">Make this file</a>';
  231. }
  232. ?>