Reading from INI files
To read from an INI file, you must create an eZINI instance for the given file. You can check whether
a variable exists before you read it, but this is optional.
include_once( "lib/ezutils/classes/ezini.php" );
// Creates an eZINI instance for settings/site.ini
$ini =& eZINI::instance( "site.ini", "settings" );
// Reads the value of the key SiteName in the group SiteSettings, if it exists
if ( $ini->hasVariable( "SiteSettings", "SiteName" ) )
$var = $ini->variable( "SiteSettings", "SiteName" );
// Reads all key/value pairs of the SiteSettings group, it it exists
if ( $ini->hasGroup( "SiteSettings" ) )
$vars = $ini->group( "SiteSettings" );
|