cvs: peardoc /en/pyrus/extending packagefile.xml
| From: | Greg Beaver | Date: | Thu, 09 Jul 2009 17:23:20 +0000 |
| Subject: | cvs: peardoc /en/pyrus/extending packagefile.xml | ||
| Groups: | php.pear.doc | ||
| Request: | Send a blank email to pear-doc+get-11733@lists.php.net to get a copy of this message | ||
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">