Open Source Content Management Framework

PHP midgard_config method read_file

  1. Example

Read named configuration and sets object properties.

boolean read_file(name, [bool user]);

midgard_config method read_file takes two parameters.

  • configuration name
  • user configuration toggle

If second user parameter is set to TRUE, then configuration is read from user's home directory. By default, configuration is read from system wide directory. The latter depends on prefix defined for core. Usually /etc, /usr/local/etc.

Returns TRUE if named configuration has been successfuly read, FALSE otherwise.

Example

<?php

 try {
     $config = new midgard_config();
 } catch (Exception $e) {
     echo $e->getMessage();  
 }

 if(!$config->read_file('midgard', true))
     echo "Could not read user's midgard configuration";     
 ?>
Tagged
ragnaroek
vinland
Designed by Nemein, hosted by Anykey