cvs: pear /Config README.Config
| From: | Robert Janeczek | Date: | Tue, 07 May 2002 17:10:55 +0000 |
| Subject: | cvs: pear /Config README.Config | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-3704@lists.php.net to get a copy of this message | ||
rashid Tue May 7 13:10:55 2002 EDT
Modified files:
/pear/Config README.Config
Log:
WDDX container instructions added
Index: pear/Config/README.Config
diff -u pear/Config/README.Config:1.3 pear/Config/README.Config:1.4
--- pear/Config/README.Config:1.3 Mon Sep 10 04:06:18 2001
+++ pear/Config/README.Config Tue May 7 13:10:55 2002
@@ -1,7 +1,7 @@
Documentation and Tutorial for PEAR-Config
by Alexander Merz
-$Id: README.Config,v 1.3 2001/09/10 08:06:18 chregu Exp $
+$Id: README.Config,v 1.4 2002/05/07 17:10:55 rashid Exp $
A first example
@@ -439,3 +439,50 @@
mixed - true if success, else PEAR_ERROR
+WDDX
+[expat library + compiling PHP --with-xml and --enable-wddx required]
+
+Configuration can be also stored in XML based WDDX files. This container isn`t
+good for reading/modyfying by human, but it is very useful if you need config
+file for internal use of your application. This container supports nested
+blocks, can store arrays and can write modified configuration to file. This is
+very bad looking example of WDDX file [it is much nicer than you think -
+normaly there are no new lines or tabs :)]:
+
+<wddxPacket version='1.0'><header/><data>
+<struct>
+ <var name='/block1'><struct>
+ <var name='/block2'><struct>
+ <var name='/block3'><struct>
+ <var name='val123'><string>1</string></var>
+ </struct></var>
+ <var name='val121'><string>test</string></var>
+ <var name='val122'><string>2</string></var>
+ </struct></var>
+ <var name='/block11'><struct>
+ <var name='11'><string>bueeeee</string></var>
+ </struct></var>
+ <var name='valx1'><string>1</string></var>
+ <var name='valt1'><string>2</string></var>
+ </struct></var>
+ <var name='valxt1'><string>test1</string></var>
+</struct>
+</data></wddxPacket>
+
+You can try to use it as config file, because it is written as such. If
+you have any experience with WDDX you should know that not every WDDX
+compatible file will work as config file in this container - it needs to
+be in specific format to give full advantage of nested blocks - every block
+is an array stored in parent block, array must be stored under key, that
+starts with '/'. If it isn
t - its just an array used as configuration
+variable, so nesting will not be supported in those.
+
+If the text above doesnt seem to be much interesting it means you dont
+have to understand what`s in WDDX itself. So - create empty file, use it
+with Config class (parseInput), write some data to it (setValue) and then
+write the file to disk (writeInput). This is the easiest way of creating
+WDDX configuration without knowing anything about it.
+
+There are no special features to be set in parseInput - this argument is
+there for compability reasons. Preserving behaviour during file writing
+is also ignored.
\ No newline at end of file