Location: PHPKode > projects > PHP on Trax > johnpipi-trax-f599562/trax/doc/__filesource/fsource_PHPonTrax__makepkg.php.html
<html>
<head>
<title>File Source for makepkg.php</title>
<link rel="stylesheet" type="text/css" href="../media/style.css">
</head>
<body>

<table border="0" cellspacing="0" cellpadding="0" height="48" width="100%">
  <tr>
    <td class="header_top">PHPonTrax</td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
  <tr>
    <td class="header_menu">
  		  [ <a href="../classtrees_PHPonTrax.html" class="menu">class tree: PHPonTrax</a> ]
		  [ <a href="../elementindex_PHPonTrax.html" class="menu">index: PHPonTrax</a> ]
		  [ <a href="../elementindex.html" class="menu">all elements</a> ]
    </td>
  </tr>
  <tr><td class="header_line"><img src="../media/empty.png" width="1" height="1" border="0" alt=""  /></td></tr>
</table>

<table width="100%" border="0" cellpadding="0" cellspacing="0">
  <tr valign="top">
    <td width="200" class="menu">
	<div id="todolist">
			<p><a href="../todolist.html">Todo List</a></p>
	</div>
      <b>Packages:</b><br />
              <a href="../li_PHPonTrax.html">PHPonTrax</a><br />
              <a href="../li_PHPonTraxTest.html">PHPonTraxTest</a><br />
            <br /><br />
                  
                </td>
    <td>
      <table cellpadding="10" cellspacing="0" width="100%" border="0"><tr><td valign="top">

<h1 align="center">Source for file makepkg.php</h1>
<p>Documentation is available at <a href="../PHPonTrax/_makepkg_php.html">makepkg.php</a></p>
<div class="php">
<div class="listing"><pre><ol><li><a name="a1"></a>#!@PHP-BIN@</li>
<li><a name="a2"></a><span class="src-php">&lt;?php</span></li>
<li><a name="a3"></a><span class="src-doc">/**</span></li>
<li><a name="a4"></a><span class="src-doc"> *  Make a Pear installable package of the PHPonTrax distribution</span></li>
<li><a name="a5"></a><span class="src-doc"> *</span></li>
<li><a name="a6"></a><span class="src-doc"> *  (PHP 5)</span></li>
<li><a name="a7"></a><span class="src-doc"> *</span></li>
<li><a name="a8"></a><span class="src-doc"> *  To make a package, connect to the top directory and type</span></li>
<li><a name="a9"></a><span class="src-doc"> *  &lt;b&gt;php makepkg.php&lt;/b&gt; (or on Unix-type systems, &lt;b&gt;./makepkg.php&lt;/b&gt;).</span></li>
<li><a name="a10"></a><span class="src-doc"> *  Information about how to build the package and what to put in it</span></li>
<li><a name="a11"></a><span class="src-doc"> *  comes from two sources: this script, and the information</span></li>
<li><a name="a12"></a><span class="src-doc"> *  maintained by </span><span class="src-doc-inlinetag">{@link http://subversion.tigris.org Subversion}</span><span class="src-doc"> in</span></li>
<li><a name="a13"></a><span class="src-doc"> *  the various .svn directories that identifies which files are part</span></li>
<li><a name="a14"></a><span class="src-doc"> *  of the distribution.</span></li>
<li><a name="a15"></a><span class="src-doc"> *  </span></li>
<li><a name="a16"></a><span class="src-doc"> *  Requires Pear package</span></li>
<li><a name="a17"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://pear.php.net/package/PEAR_PackageFileManager PEAR_PackageFileManager}</span><span class="src-doc"> .</span></li>
<li><a name="a18"></a><span class="src-doc"> *  The Subversion plugin uses</span></li>
<li><a name="a19"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://pear.php.net/package/XML_Tree XML_Tree}</span><span class="src-doc"> .</span></li>
<li><a name="a20"></a><span class="src-doc"> *  Unfortunately XML_Tree has a couple of methods named</span></li>
<li><a name="a21"></a><span class="src-doc"> *  </span><span class="src-doc-inlinetag">{@link http://www.php.net/manual/en/language.oop5.cloning.php clone}</span></li>
<li><a name="a22"></a><span class="src-doc"> *  which is a reserved word in PHP 5.  The fix is</span></li>
<li><a name="a23"></a><span class="src-doc"> *  easy, just edit XML_Tree to change every use of 'clone' to 'clone4'.</span></li>
<li><a name="a24"></a><span class="src-doc"> *</span></li>
<li><a name="a25"></a><span class="src-doc"> *  PackageFileManager has several undocumented limitations that</span></li>
<li><a name="a26"></a><span class="src-doc"> *  seriously affect what you can do with it:</span></li>
<li><a name="a27"></a><span class="src-doc"> *  &lt;ul&gt;</span></li>
<li><a name="a28"></a><span class="src-doc"> *    &lt;li&gt;PackageFileManager will not add an empty directory to a</span></li>
<li><a name="a29"></a><span class="src-doc"> *      package.  Therefore you need to put at least one file in any</span></li>
<li><a name="a30"></a><span class="src-doc"> *      directory that is to go into a package.&lt;/li&gt;</span></li>
<li><a name="a31"></a><span class="src-doc"> *    &lt;li&gt;The Pear Installer will not install an empty file. Therefore</span></li>
<li><a name="a32"></a><span class="src-doc"> *      you need to put at least one character into any file to be</span></li>
<li><a name="a33"></a><span class="src-doc"> *      installed as part of a package.&lt;/li&gt;</span></li>
<li><a name="a34"></a><span class="src-doc"> *    &lt;li&gt;The PackageFileManager options 'include' and 'ignore' use a</span></li>
<li><a name="a35"></a><span class="src-doc"> *      regular expression match to identify the files and directories</span></li>
<li><a name="a36"></a><span class="src-doc"> *      that they affect.  For each file and directory managed by</span></li>
<li><a name="a37"></a><span class="src-doc"> *      Subversion, PackageFileManager first attempts to apply the</span></li>
<li><a name="a38"></a><span class="src-doc"> *      RE pattern as coded.  Then it appends leading and trailing '/'</span></li>
<li><a name="a39"></a><span class="src-doc"> *      to the pattern and tries again.  The results are hard to</span></li>
<li><a name="a40"></a><span class="src-doc"> *      predict.&lt;/li&gt;</span></li>
<li><a name="a41"></a><span class="src-doc"> *  &lt;/ul&gt;</span></li>
<li><a name="a42"></a><span class="src-doc"> *</span></li>
<li><a name="a43"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@package</span><span class="src-doc"> PHPonTrax</span></li>
<li><a name="a44"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@license</span><span class="src-doc"> http://opensource.org/licenses/gpl-license.php GNU Public License</span></li>
<li><a name="a45"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@copyright</span><span class="src-doc"> (c) Walter O. Haas 2006</span></li>
<li><a name="a46"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@version</span><span class="src-doc"> $Id$</span></li>
<li><a name="a47"></a><span class="src-doc"> *  </span><span class="src-doc-coretag">@author</span><span class="src-doc"> Walt Haas &lt;hide@address.com&gt;</span></li>
<li><a name="a48"></a><span class="src-doc"> */</span></li>
<li><a name="a49"></a>&nbsp;</li>
<li><a name="a50"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-str">'PEAR/PackageFileManager.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a51"></a><span class="src-inc">require_once</span><span class="src-sym">(</span><span class="src-str">'PEAR/Packager.php'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a52"></a>&nbsp;</li>
<li><a name="a53"></a><span class="src-var">$packagexml </span>= <span class="src-key">new </span><span class="src-id">PEAR_PackageFileManager</span><span class="src-sym">;</span></li>
<li><a name="a54"></a>&nbsp;</li>
<li><a name="a55"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">setOptions</span><span class="src-sym">(</span></li>
<li><a name="a56"></a>          <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'package' </span>=&gt; <span class="src-str">'PHPonTrax'</span><span class="src-sym">,</span></li>
<li><a name="a57"></a>                <span class="src-str">'summary' </span>=&gt; <span class="src-str">'Rapid Application Development Made Easy'</span><span class="src-sym">,</span></li>
<li><a name="a58"></a>                <span class="src-str">'description' </span>=&gt; <span class="src-str">'PHP port of Ruby on Rails'</span><span class="src-sym">,</span></li>
<li><a name="a59"></a>                <span class="src-str">'baseinstalldir' </span>=&gt; <span class="src-str">'PHPonTrax'</span><span class="src-sym">,</span></li>
<li><a name="a60"></a>                <span class="src-str">'version' </span>=&gt; <span class="src-str">'199svn'</span><span class="src-sym">,</span></li>
<li><a name="a61"></a>                <span class="src-str">'packagedirectory' </span>=&gt; <span class="src-str">'.'</span><span class="src-sym">,</span></li>
<li><a name="a62"></a>                <span class="src-str">'state' </span>=&gt; <span class="src-str">'alpha'</span><span class="src-sym">,</span></li>
<li><a name="a63"></a>                <span class="src-str">'filelistgenerator' </span>=&gt; <span class="src-str">'svn'</span><span class="src-sym">, </span><span class="src-comm">// generate from svn</span></li>
<li><a name="a64"></a>                                <span class="src-str">'notes' </span>=&gt; <span class="src-str">'We\'ve implemented many new and exciting features'</span><span class="src-sym">,</span></li>
<li><a name="a65"></a>                <span class="src-str">'dir_roles' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'doc' </span>=&gt; <span class="src-str">'doc'</span><span class="src-sym">,</span></li>
<li><a name="a66"></a>                                     <span class="src-str">'test' </span>=&gt; <span class="src-str">'test'</span><span class="src-sym">,</span></li>
<li><a name="a67"></a>                                     <span class="src-str">'data' </span>=&gt; <span class="src-str">'data'</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a68"></a>                <span class="src-str">'exceptions' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pear-trax' </span>=&gt; <span class="src-str">'script'</span><span class="src-sym">,</span></li>
<li><a name="a69"></a>                                      <span class="src-str">'pear-trax.bat' </span>=&gt; <span class="src-str">'script'</span><span class="src-sym">,</span></li>
<li><a name="a70"></a> <span class="src-str">'vendor/trax/templates/error.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a71"></a> <span class="src-str">'vendor/trax/templates/view.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a72"></a> <span class="src-str">'vendor/trax/templates/scaffolds/add.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a73"></a> <span class="src-str">'vendor/trax/templates/scaffolds/edit.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a74"></a> <span class="src-str">'vendor/trax/templates/scaffolds/index.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a75"></a> <span class="src-str">'vendor/trax/templates/scaffolds/layout.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a76"></a> <span class="src-str">'vendor/trax/templates/scaffolds/show.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a77"></a> <span class="src-str">'vendor/trax/templates/scaffolds/scaffold.css' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a78"></a> <span class="src-str">'vendor/trax/templates/scaffolds/generator_templates/form_scaffolding.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a79"></a> <span class="src-str">'vendor/trax/templates/scaffolds/generator_templates/layout.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a80"></a> <span class="src-str">'vendor/trax/templates/scaffolds/generator_templates/view_add.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a81"></a> <span class="src-str">'vendor/trax/templates/scaffolds/generator_templates/view_edit.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a82"></a> <span class="src-str">'vendor/trax/templates/scaffolds/generator_templates/view_index.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a83"></a> <span class="src-str">'vendor/trax/templates/scaffolds/generator_templates/view_show.phtml' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a84"></a> <span class="src-str">'vendor/trax/templates/scaffolds/generator_templates/style.css' </span>=&gt; <span class="src-str">'php'</span><span class="src-sym">,</span></li>
<li><a name="a85"></a><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a86"></a>                <span class="src-str">'installexceptions' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pear-trax' </span>=&gt; <span class="src-str">'/'</span><span class="src-sym">,</span></li>
<li><a name="a87"></a>                                             <span class="src-str">'dispatch.php' </span>=&gt; <span class="src-str">'public'</span><span class="src-sym">)</span><span class="src-sym">,</span></li>
<li><a name="a88"></a>                <span class="src-str">'installas' </span>=&gt; <span class="src-key">array</span><span class="src-sym">(</span><span class="src-str">'pear-trax' </span>=&gt; <span class="src-str">'trax'</span><span class="src-sym">,</span></li>
<li><a name="a89"></a>                                     <span class="src-str">'pear-trax.bat' </span>=&gt; <span class="src-str">'trax'</span><span class="src-sym">)</span></li>
<li><a name="a90"></a>                <span class="src-sym">))</span><span class="src-sym">;</span></li>
<li><a name="a91"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a92"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a93"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a94"></a>&nbsp;</li>
<li><a name="a95"></a> <span class="src-sym">}</span></li>
<li><a name="a96"></a>&nbsp;</li>
<li><a name="a97"></a><span class="src-comm">//  Depends on PHP 5</span></li>
<li><a name="a98"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addDependency</span><span class="src-sym">(</span><span class="src-str">'php'</span><span class="src-sym">,</span><span class="src-str">'5.0.3'</span><span class="src-sym">,</span><span class="src-str">'ge'</span><span class="src-sym">,</span><span class="src-str">'php'</span><span class="src-sym">,</span><span class="src-str">'no'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a99"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a100"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a101"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a102"></a>&nbsp;</li>
<li><a name="a103"></a> <span class="src-sym">}</span></li>
<li><a name="a104"></a>&nbsp;</li>
<li><a name="a105"></a><span class="src-comm">//  Depends on these PEAR modules</span></li>
<li><a name="a106"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addDependency</span><span class="src-sym">(</span><span class="src-str">'DB'</span><span class="src-sym">,</span><span class="src-str">'1.0'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a107"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a108"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a109"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a110"></a>&nbsp;</li>
<li><a name="a111"></a> <span class="src-sym">}</span></li>
<li><a name="a112"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addDependency</span><span class="src-sym">(</span><span class="src-str">'Mail'</span><span class="src-sym">,</span><span class="src-str">'1.0'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a113"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a114"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a115"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a116"></a>&nbsp;</li>
<li><a name="a117"></a> <span class="src-sym">}</span></li>
<li><a name="a118"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addDependency</span><span class="src-sym">(</span><span class="src-str">'Mail_Mime'</span><span class="src-sym">,</span><span class="src-str">'1.0'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a119"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a120"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a121"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a122"></a>&nbsp;</li>
<li><a name="a123"></a> <span class="src-sym">}</span></li>
<li><a name="a124"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addDependency</span><span class="src-sym">(</span><span class="src-str">'PHPUnit2'</span><span class="src-sym">,</span><span class="src-str">'1.0'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a125"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a126"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a127"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a128"></a>&nbsp;</li>
<li><a name="a129"></a> <span class="src-sym">}</span></li>
<li><a name="a130"></a>&nbsp;</li>
<li><a name="a131"></a><span class="src-comm">//  Optionally uses these PEAR modules</span></li>
<li><a name="a132"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addDependency</span><span class="src-sym">(</span><span class="src-str">'PhpDocumentor'</span><span class="src-sym">,</span><span class="src-str">'1.3.0RC4'</span><span class="src-sym">,</span><span class="src-str">'ge'</span><span class="src-sym">,</span><span class="src-str">'pkg'</span><span class="src-sym">,</span><span class="src-str">'yes'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a133"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a134"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a135"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a136"></a>&nbsp;</li>
<li><a name="a137"></a> <span class="src-sym">}</span></li>
<li><a name="a138"></a>&nbsp;</li>
<li><a name="a139"></a><span class="src-comm">//  Who maintains this package</span></li>
<li><a name="a140"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addMaintainer</span><span class="src-sym">(</span><span class="src-str">'john'</span><span class="src-sym">,</span><span class="src-str">'lead'</span><span class="src-sym">,</span><span class="src-str">'John Peterson'</span><span class="src-sym">,</span></li>
<li><a name="a141"></a>                                <span class="src-str">'hide@address.com'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a142"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a143"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a144"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a145"></a>&nbsp;</li>
<li><a name="a146"></a> <span class="src-sym">}</span></li>
<li><a name="a147"></a>&nbsp;</li>
<li><a name="a148"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addMaintainer</span><span class="src-sym">(</span><span class="src-str">'haas'</span><span class="src-sym">,</span><span class="src-str">'developer'</span><span class="src-sym">,</span><span class="src-str">'Walt Haas'</span><span class="src-sym">,</span></li>
<li><a name="a149"></a>                                <span class="src-str">'hide@address.com'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a150"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a151"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a152"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a153"></a>&nbsp;</li>
<li><a name="a154"></a> <span class="src-sym">}</span></li>
<li><a name="a155"></a>&nbsp;</li>
<li><a name="a156"></a><span class="src-comm">//  Substitute local configuration values for these symbols</span></li>
<li><a name="a157"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addGlobalReplacement</span><span class="src-sym">(</span><span class="src-str">'pear-config'</span><span class="src-sym">, </span><span class="src-str">'@BIN-DIR@'</span><span class="src-sym">,</span></li>
<li><a name="a158"></a>                                       <span class="src-str">'bin_dir'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a159"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a160"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a161"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a162"></a>&nbsp;</li>
<li><a name="a163"></a> <span class="src-sym">}</span></li>
<li><a name="a164"></a>&nbsp;</li>
<li><a name="a165"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addGlobalReplacement</span><span class="src-sym">(</span><span class="src-str">'pear-config'</span><span class="src-sym">, </span><span class="src-str">'@DOC-DIR@'</span><span class="src-sym">,</span></li>
<li><a name="a166"></a>                                       <span class="src-str">'doc_dir'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a167"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a168"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a169"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a170"></a>&nbsp;</li>
<li><a name="a171"></a> <span class="src-sym">}</span></li>
<li><a name="a172"></a>&nbsp;</li>
<li><a name="a173"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addGlobalReplacement</span><span class="src-sym">(</span><span class="src-str">'pear-config'</span><span class="src-sym">, </span><span class="src-str">'@PHP-DIR@'</span><span class="src-sym">,</span></li>
<li><a name="a174"></a>                                       <span class="src-str">'php_dir'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a175"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a176"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a177"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a178"></a>&nbsp;</li>
<li><a name="a179"></a> <span class="src-sym">}</span></li>
<li><a name="a180"></a>&nbsp;</li>
<li><a name="a181"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addGlobalReplacement</span><span class="src-sym">(</span><span class="src-str">'pear-config'</span><span class="src-sym">, </span><span class="src-str">'@DATA-DIR@'</span><span class="src-sym">,</span></li>
<li><a name="a182"></a>                                       <span class="src-str">'data_dir'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a183"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a184"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a185"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a186"></a>&nbsp;</li>
<li><a name="a187"></a> <span class="src-sym">}</span></li>
<li><a name="a188"></a>&nbsp;</li>
<li><a name="a189"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addGlobalReplacement</span><span class="src-sym">(</span><span class="src-str">'pear-config'</span><span class="src-sym">, </span><span class="src-str">'@PHP-BIN@'</span><span class="src-sym">,</span></li>
<li><a name="a190"></a>                                       <span class="src-str">'php_bin'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a191"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a192"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a193"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a194"></a>&nbsp;</li>
<li><a name="a195"></a> <span class="src-sym">}</span></li>
<li><a name="a196"></a>&nbsp;</li>
<li><a name="a197"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addGlobalReplacement</span><span class="src-sym">(</span><span class="src-str">'pear-config'</span><span class="src-sym">, </span><span class="src-str">'@TEST-DIR@'</span><span class="src-sym">,</span></li>
<li><a name="a198"></a>                                       <span class="src-str">'test_dir'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a199"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a200"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a201"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a202"></a>&nbsp;</li>
<li><a name="a203"></a> <span class="src-sym">}</span></li>
<li><a name="a204"></a>&nbsp;</li>
<li><a name="a205"></a><span class="src-comm">//  Platform-dependent command lines</span></li>
<li><a name="a206"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addPlatformException</span><span class="src-sym">(</span><span class="src-str">'pear-trax.bat'</span><span class="src-sym">, </span><span class="src-str">'windows'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a207"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a208"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a209"></a>    <span class="src-key">exit</span><span class="src-sym">;</span></li>
<li><a name="a210"></a> <span class="src-sym">}</span></li>
<li><a name="a211"></a>&nbsp;</li>
<li><a name="a212"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">addPlatformException</span><span class="src-sym">(</span><span class="src-str">'pear-trax'</span><span class="src-sym">, </span><span class="src-str">'*ix|*ux|*BSD|Darwin'</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a213"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a214"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a215"></a>    <span class="src-key">exit</span><span class="src-sym">;</span></li>
<li><a name="a216"></a> <span class="src-sym">}</span></li>
<li><a name="a217"></a>&nbsp;</li>
<li><a name="a218"></a><span class="src-comm">//  Study the Subversion .svn directories to see what goes in the</span></li>
<li><a name="a219"></a><span class="src-comm">//  package, then write package.xml</span></li>
<li><a name="a220"></a><span class="src-comm">//  (Needs: XML_Tree with patch s/clone/clone4/g)</span></li>
<li><a name="a221"></a><span class="src-var">$e </span>= <span class="src-var">$packagexml</span><span class="src-sym">-&gt;</span><span class="src-id">writePackageFile</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a222"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a223"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a224"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a225"></a> <span class="src-sym">}</span></li>
<li><a name="a226"></a>&nbsp;</li>
<li><a name="a227"></a><span class="src-comm">//  Make a tarball of the files listed in package.xml</span></li>
<li><a name="a228"></a><span class="src-var">$packager </span>= <span class="src-key">new </span><span class="src-id">PEAR_Packager</span><span class="src-sym">;</span></li>
<li><a name="a229"></a><span class="src-var">$e </span>= <span class="src-var">$packager</span><span class="src-sym">-&gt;</span><span class="src-id">package</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a230"></a><span class="src-key">if </span><span class="src-sym">(</span><span class="src-id">PEAR</span><span class="src-sym">::</span><span class="src-id">isError</span><span class="src-sym">(</span><span class="src-var">$e</span><span class="src-sym">)) </span><span class="src-sym">{</span></li>
<li><a name="a231"></a>    echo <span class="src-var">$e</span><span class="src-sym">-&gt;</span><span class="src-id">getMessage</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a232"></a>    <span class="src-key">die</span><span class="src-sym">(</span><span class="src-sym">)</span><span class="src-sym">;</span></li>
<li><a name="a233"></a> <span class="src-sym">}</span></li>
<li><a name="a234"></a>&nbsp;</li>
<li><a name="a235"></a><span class="src-comm">// -- set Emacs parameters --</span></li>
<li><a name="a236"></a><span class="src-comm">// Local variables:</span></li>
<li><a name="a237"></a><span class="src-comm">// tab-width: 4</span></li>
<li><a name="a238"></a><span class="src-comm">// c-basic-offset: 4</span></li>
<li><a name="a239"></a><span class="src-comm">// c-hanging-comment-ender-p: nil</span></li>
<li><a name="a240"></a><span class="src-comm">// indent-tabs-mode: nil</span></li>
<li><a name="a241"></a><span class="src-comm">// End:</span></li>
<li><a name="a242"></a>&nbsp;</li>
<li><a name="a243"></a><span class="src-php">?&gt;</span></li>
</ol></pre></div>
</div>
        <div class="credit">
		    <hr />
		    Documentation generated on Thu, 04 May 2006 19:47:51 -0600 by <a href="http://www.phpdoc.org">phpDocumentor 1.3.0RC4</a>
	      </div>
      </td></tr></table>
    </td>
  </tr>
</table>

</body>
</html>
Return current item: PHP on Trax