Guest User

Untitled

a guest
May 31st, 2018
179
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.72 KB | None | 0 0
  1.  
  2. [config]
  3. db.set.user = hello
  4. db.set.pass = secrate
  5.  
  6. class IndexController extends Zend_Controller_Action
  7. {
  8.  
  9. public function indexAction()
  10. {
  11. // Load/Open the file
  12. $config = new Zend_Config_Ini(
  13. APPLICATION_PATH . '/configs/httpd.conf',
  14. 'config',
  15. array('skipExtends'=> true,'allowModifications' => true)
  16. );
  17. // Output the value
  18. echo $config->db->set->user;
  19.  
  20. // Change the value
  21. $config->db->set->user ="change";
  22. // Write it.
  23. $writer = new Zend_Config_Writer_Ini(
  24. array('config' => $config,
  25. 'filename' => APPLICATION_PATH . '/configs/httpd.conf'));
  26. $writer->write();
  27.  
  28. }
  29. }
Add Comment
Please, Sign In to add comment