Configuration files
The configuration class is used for reading XML files with a key/value format as shown below.
<?php exit(); ?> <?xml version="1.0" encoding="ISO-8859-1"?> <entries> <entry key="Username" value="admin" /> <entry key="Password" value="secret" /> </entries> |
This functionality is used for reading the configuration file config.xml.php from the root of the Sitemagic CMS installation.
Notice the first line, which is PHP code protecting the file from being read by visitors. This will only have an effect if the filename ends on .php (as in config.xml.php). Using the protection is optional.
SMConfiguration class
| Function |
Return type
|
Description
|
| __construct($file:string) |
|
Create an instance of the configuration reader.
|
GetEntry($entry:string)
|
String
|
Get the value of a configuration entry. Returns null if not found.
|
EntryExists($entry:string)
|
Boolean
|
Returns True if configuration entry exists, otherwise False.
|