Config
Class \Lib\Config
Introduction
The entire configuration of the application is divided into 3 files at the root of the project :
app.xml
: xml file configuration of my applicationconf.plist
: SDK configuration file in PLIST format for iOSconf.xml
: SDK configuration file in XML format for Android, Blackberry, Windows Phone
app.xml
Here are some useful data in the file:
appname
: application nameappkey
: application iddomain
: application urlpathdata
: path to the application's data folder (data from the back office or uploaded from the application)pathapplication
: path to the application (useful for adding external libraries or building file urls)- db (
db.hosts
,db.dbname
,db.login
,db.password
) : contains accesses to the application-specific database
Note
Feel free to use app.xml to store frozen data. For each modification of the app.xml file
Important
The app.xml form is cached. This involves reloading the cache each time the file is modified.
To reload the cache, go to the backoffice, in the section https://backend.appspanel.com/config/confcache/, then at the bottom click on "Reload the cache of my application"
Methods
getConf
<?php public static function \Lib\Config::getConf()
Description
Get all the config of the application.
Note
The configuration is read from the app.xml file.
Return
An array that follows the app.xml file tree.
Examples
Build a url from the application domain
<?php
$conf = \Lib\Config::getConf();
$url = "http://priv-{$conf['domain']}/test.html";
Updated almost 7 years ago