iriven /
ConfigManager
| 1 | <?php |
||||
| 2 | |||||
| 3 | /*provenant du formulaire*/ |
||||
| 4 | $licence = array( |
||||
| 5 | 'software'=> 'Iriven MVC System', // Application Name, |
||||
| 6 | 'version'=> 1.04, // Application Version |
||||
| 7 | 'copyright'=> '© Iriven France', // you can limit the key to per domain |
||||
| 8 | 'username'=> 'mon client', // you can limit the key to per user name or compagny |
||||
| 9 | 'uniqid'=> 1025, // add if any (user id) |
||||
| 10 | 'domain'=> 'monclient.com', // you can limit the key to per domain |
||||
| 11 | 'expiration'=> '1390389563', // [time()+(30*24*3600)]; (30 days) you can limit the key to per expiration time |
||||
| 12 | 'algorithm'=>'md5', |
||||
| 13 | 'serial'=>'736CC-AFB84-9B6C0-65252-6C107',//by key generator |
||||
| 14 | 'salt'=>pack('H*', md5(time())), |
||||
| 15 | 'lastvalidation' => 98745612 // default: time(), execution du script pour la 1ere fois |
||||
| 16 | ); |
||||
| 17 | $ini = new Iriven\ConfigManager('./licence.ini'); |
||||
| 18 | $ini->set('licence',$licence); //with section |
||||
| 19 | $test = array('test1'=>'my tester1','test2'=>'my tester2','test3'=>'my tester3'); |
||||
| 20 | $ini->set($test); //no section |
||||
| 21 | $ini->set('repo','centos'); //no section |
||||
| 22 | $ini->set('linux','repo','fedora'); //with section |
||||
| 23 | |||||
| 24 | echo $ini->get('test1').PHP_EOL; |
||||
|
0 ignored issues
–
show
Bug
introduced
by
Loading history...
|
|||||
| 25 | |||||
| 26 | echo $ini->get('test2').PHP_EOL; |
||||
|
0 ignored issues
–
show
Are you sure
$ini->get('test2') of type boolean|array|mixed can be used in concatenation?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 27 | |||||
| 28 | echo $ini->get('test3').PHP_EOL; |
||||
|
0 ignored issues
–
show
Are you sure
$ini->get('test3') of type boolean|array|mixed can be used in concatenation?
(
Ignorable by Annotation
)
If this is a false-positive, you can also ignore this issue in your code via the
Loading history...
|
|||||
| 29 | |||||
| 30 | |||||
| 31 | |||||
| 32 | echo '<pre>'; |
||||
| 33 | print_r($ini->get('licence')); |
||||
| 34 | echo '</pre>'; |
||||
| 35 | |||||
| 36 | |||||
| 37 | echo '<pre>'; |
||||
| 38 | print_r($ini->get()); |
||||
| 39 | echo '</pre>'; |
||||
| 40 |