Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with HTTPS or Subversion.

Download ZIP
Browse files

#20104 added stream example

  • Loading branch information...
commit fc23906de0fcde4a7cf480e613fd0ec18c58f2b8 1 parent 64c99c2
@pce pce authored
Showing with 49 additions and 0 deletions.
  1. +49 −0 README.md
View
49 README.md
@@ -58,6 +58,11 @@ __Save Configuration file:__
```php
<?php
+require_once 'Config/Lite.php';
+
+// write with file locking
+$config = new Config_Lite('test.ini', LOCK_EX);
+
$config->set('db', 'user', 'JohnDoe')
->set('db', 'password', 'd0g1tcVs$HgIn1');
@@ -122,6 +127,50 @@ try {
}
```
+__Config without File - Streams, Filter or stdout:__
+
+```php
+<?php
+
+require_once 'Config/Lite.php';
+
+$config = new Config_Lite();
+
+$filename = sprintf(
+ "php://filter/write=string.rot13/resource=%s", "test.ini"
+);
+
+$config->write($filename, array(
+ 'public_key_file' => "~/.ssh/id_rsa.pub",
+ 'general' => array(
+ 'lang' => 'fr'
+ ),
+ 'db' => array(
+ 'user' => 'dionysis',
+ 'password' => 'd0g1tcVs$HgIn1'
+ )
+ )
+);
+
+// Writing to stdout
+$config->write("php://stdout", array(
+ 'public_key_file' => "~/.ssh/id_rsa.pub",
+ 'general' => array(
+ 'lang' => 'fr'
+ ),
+ 'db' => array(
+ 'user' => 'dionysis',
+ 'password' => 'd0g1tcVs$HgIn1'
+ )
+ )
+);
+
+```
+
+
+
+
+
__global Configuration options (without sections) :__
Please sign in to comment.
Something went wrong with that request. Please try again.