svn: /pear/peardoc/trunk/en/package/configuration/config/ avail-container/ini-commented.xml examples/ini-commented-write.php
examples/ini-commented-write.txt

From: Date: Tue, 08 Mar 2011 17:49:53 +0000
Subject: svn: /pear/peardoc/trunk/en/package/configuration/config/ avail-container/ini-commented.xml examples/ini-commented-write.php
examples/ini-commented-write.txt
Groups: php.pear.doc 
Request: Send a blank email to pear-doc+get-12057@lists.php.net to get a copy of this message
cweiske Tue, 08 Mar 2011 17:49:53 +0000 Revision: http://svn.php.net/viewvc?view=revision&revision=309031 Log: example for Config's inicommented container Changed paths: U pear/peardoc/trunk/en/package/configuration/config/avail-container/ini-commented.xml A pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.php A pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.txt Modified: pear/peardoc/trunk/en/package/configuration/config/avail-container/ini-commented.xml =================================================================== --- pear/peardoc/trunk/en/package/configuration/config/avail-container/ini-commented.xml 2011-03-08 17:39:07 UTC (rev 309030) +++ pear/peardoc/trunk/en/package/configuration/config/avail-container/ini-commented.xml 2011-03-08 17:49:53 UTC (rev 309031) @@ -42,6 +42,31 @@ </table> + <section> + <info> + <title>Writing a .desktop file</title> + </info> - <!-- FIXME: example file, example load, example save --> + <programlisting role="php"> + <xi:include parse="text" + xmlns:xi="http://www.w3.org/2001/XInclude" + href="&package.configuration.config.examples.ini-commented-write.php;" + > + <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + + <example> + <title>Generated file</title> + <programlisting role="ini"> + <xi:include parse="text" + xmlns:xi="http://www.w3.org/2001/XInclude" + href="&package.configuration.config.examples.ini-commented-write.txt;" + > + <xi:fallback>FIXME:MISSING XINCLUDE CONTENT</xi:fallback> + </xi:include> + </programlisting> + </example> + </section> + </section> Added: pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.php =================================================================== --- pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.php (rev 0) +++ pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.php 2011-03-08 17:49:53 UTC (rev 309031) @@ -0,0 +1,24 @@ +<?php +require_once 'Config.php'; + +$conf = new Config(); +$root = $conf->getRoot(); +//note: inicommented uses ";" as comment indicator while the desktop entry spec +// says that it has to be "#" - so no comments for .desktop files +$entry = $root->createSection('Desktop Entry'); +$entry->createDirective('Version', '1.0'); +$entry->createDirective('Type', 'Link'); +$entry->createDirective('URL', 'http://pear.php.net/'); +$entry->createDirective('Name', 'go to pear.php.net'); +$entry->createDirective('Icon', 'gnome-fs-bookmark'); +$r = $conf->writeConfig( + '/home/cweiske/Desktop/pear.php.net.desktop', + 'inicommented', + //windows newlines are not required in desktop files; + // they just serve as example how to use container options + array('linebreak' => "\r\n") +); +if (PEAR::isError($r)) { + echo $r->getMessage() . "\n"; +} +?> \ No newline at end of file Added: pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.txt =================================================================== --- pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.txt (rev 0) +++ pear/peardoc/trunk/en/package/configuration/config/examples/ini-commented-write.txt 2011-03-08 17:49:53 UTC (rev 309031) @@ -0,0 +1,6 @@ +[Desktop Entry] +Version = 1.0 +Type = Link +URL = http://pear.php.net/ +Name = go to pear.php.net +Icon = gnome-fs-bookmark

« previous php.pear.doc (#12057) next »