cvs: peardoc /en/pyrus/extending packagefile.xml

[email protected] ("Greg Beaver")
Newsgroups php.pear.doc
Message-ID <cvscellog1247160200@cvsserver>
cellog		Thu Jul  9 17:23:20 2009 UTC

  Modified files:              
    /peardoc/en/pyrus/extending	packagefile.xml 
  Log:
  finish docs on managing files in package.xml
  
http://cvs.php.net/viewvc.cgi/peardoc/en/pyrus/extending/packagefile.xml?r1=1.3&r2=1.4&diff_format=u
Index: peardoc/en/pyrus/extending/packagefile.xml
diff -u peardoc/en/pyrus/extending/packagefile.xml:1.3 peardoc/en/pyrus/extending/packagefile.xml:1.4
--- peardoc/en/pyrus/extending/packagefile.xml:1.3	Thu Jul  9 15:54:36 2009
+++ peardoc/en/pyrus/extending/packagefile.xml	Thu Jul  9 17:23:20 2009
@@ -553,7 +553,28 @@
   </section>
   <section xml:id="pyrus.extending.packagefile.files.setting">
    <info><title>Adding new files, changing file properties</title></info>
-   <para></para>
+   <para>
+    Finally, adding files to package.xml is done by directly setting an
+    index in the <literal>files</literal> property.  Properties are
+    manipulated with the <function>setFileAttribute</function> method.
+   </para>
+   <para>
+    <programlisting role="php">
+     <![CDATA[
+<?php
+$package->files['path/to/file.php'] = array(
+    'role' => 'php'
+);
+$package->setFileAttribute('path/to/file.php', 'md5sum', md5('hi'));
+
+// adding a task to a file
+$replace = $package->getTask('path/to/file.php', 'replace');
+$replace->setReplacement('package-info', '@API-VER@', 'api-version');
+$package->setFileAttribute('path/to/file.php', 'tasks:replace', $replace);
+?>
+     ]]>
+    </programlisting>
+   </para>
   </section>
  </section>
  <section xml:id="pyrus.extending.packagefile.pecl">
lmpx.com only provides a reader for public news (NNTP) servers. It is not affiliated with the servers or forums shown here and is not responsible for the content of articles, which is written by their respective authors.