Guest User

Untitled

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