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 application
  • conf.plist : SDK configuration file in PLIST format for iOS
  • conf.xml : SDK configuration file in XML format for Android, Blackberry, Windows Phone

app.xml

Here are some useful data in the file:

  • appname : application name
  • appkey : application id
  • domain : application url
  • pathdata : 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"

899

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";