ManiaLib 1.0b1 API Reference

Source for file config.default.php

Documentation is available at config.default.php

  1. <?php
  2. /**
  3.  * Framework default config
  4.  * 
  5.  * This is the default configuration file. You shouldn't modify anything in this
  6.  * file. Instead, override the constants you want in your "config.php" file.
  7.  * 
  8.  * @author Maxime Raoust
  9.  * @copyright 2009-2010 NADEO
  10.  * @package ManiaLib
  11.  */
  12.  
  13. if(!defined('APP_PATH'))
  14. {
  15.     /**
  16.      * Path to your application on the hard drive
  17.      */
  18.     define('APP_PATH'dirname(__FILE__'/../');
  19. }
  20. if(!defined('APP_URL_BASE'))
  21. {
  22.     if(isset($_SERVER&& isset($_SERVER['SERVER_PROTOCOL']&& isset($_SERVER['HTTP_HOST']))
  23.     {
  24.         /**
  25.          * Base URL of your application
  26.          * 
  27.          * If your manialink is hosted at "http//yourhost. com/mymanialink/", you
  28.          * should put here "http://yourhost.com/". Don't forget the trailing slash.
  29.          */
  30.         define('APP_URL_BASE'strtolower(preg_replace('/([^\/]*).*/i','$1',$_SERVER['SERVER_PROTOCOL'])).'://'.$_SERVER['HTTP_HOST'].'/');
  31.     }
  32.     else
  33.     {
  34.         /**
  35.          * @ignore
  36.          */
  37.         define('APP_URL_BASE''');
  38.     }
  39. }
  40. if(!defined('APP_URL_PATH'))
  41. {
  42.     /**
  43.      * URL path of your application
  44.      * 
  45.      * If your manialink is hosted at "http://yourhost. com/mymanialink/", you
  46.      * should put here "mymanialink/". Don't forget the trailing slash.
  47.      */
  48.     $str '';
  49.     if(isset($_SERVER['REQUEST_URI']))
  50.     {
  51.         $path explode('/',$_SERVER['REQUEST_URI']);
  52.         for($i 1$i count($path1$i++)
  53.         {
  54.             $str .= $path[$i].'/';
  55.         }
  56.     }
  57.     define('APP_URL_PATH'$str);
  58. }
  59. if(!defined('APP_URL'))
  60. {
  61.     /**
  62.      * Complete URL of your application.
  63.      * 
  64.      * You shouldn't have to change this value.
  65.      */
  66.     define('APP_URL'APP_URL_BASE APP_URL_PATH);
  67. }
  68. if(!defined('APP_FRAMEWORK_PATH'))
  69. {
  70.     /**
  71.      * Framework path
  72.      * 
  73.      * This is the path to the "manialib/" directory
  74.      */
  75.     define('APP_FRAMEWORK_PATH'APP_PATH 'manialib/');
  76. }
  77. if(!defined('APP_FRAMEWORK_LANGS_PATH'))
  78. {
  79.     /**
  80.      * Framework lang path
  81.      * 
  82.      * Default dictionaries of the framework
  83.      */
  84.     define('APP_FRAMEWORK_LANGS_PATH'APP_FRAMEWORK_PATH 'langs/');
  85. }
  86. if(!defined('APP_FRAMEWORK_LIBRARIES_PATH'))
  87. {
  88.     /**
  89.      * Framework libraries path
  90.      * 
  91.      * Path to the "libraries" directory of the framework
  92.      */
  93.     define('APP_FRAMEWORK_LIBRARIES_PATH'APP_FRAMEWORK_PATH 'libraries/');
  94. }
  95. if(!defined('APP_FRAMEWORK_GUI_TOOLKIT_PATH'))
  96. {
  97.     /**
  98.      * GUI Toolkit path
  99.      * 
  100.      * Path to the GUI Toolkit of the framework
  101.      */
  102.     define('APP_FRAMEWORK_GUI_TOOLKIT_PATH'APP_FRAMEWORK_PATH 'gui-toolkit/');
  103. }
  104. if(!defined('APP_LIBRARIES_PATH'))
  105. {
  106.     /**
  107.      * Libraries path
  108.      * 
  109.      * Path to the user libraries directory
  110.      */
  111.     define('APP_LIBRARIES_PATH'APP_PATH 'libraries/');
  112. }
  113. if(!defined('APP_LANGS_PATH'))
  114. {
  115.     /**
  116.      * Lang path
  117.      * 
  118.      * Directory containing the XML dictionaries for internationalizing your application
  119.      */
  120.     define('APP_LANGS_PATH'APP_PATH 'langs/');
  121. }
  122. if(!defined('APP_LOGS_PATH'))
  123. {
  124.     /**
  125.      * Logs path
  126.      * 
  127.      * Path to the logs directory
  128.      */
  129.     define('APP_LOGS_PATH'APP_PATH 'logs/');
  130. }
  131. if(!defined('APP_INCLUDE_PATH'))
  132. {
  133.     /**
  134.      * Include path
  135.      * 
  136.      * Misc include path, to put anything that is not a class
  137.      */
  138.     define('APP_INCLUDE_PATH'APP_PATH 'include/');
  139. }
  140. if(!defined('APP_CONFIG_PATH'))
  141. {
  142.     /**
  143.      * Config path
  144.      * 
  145.      * Path to the directory containing the config files of your application
  146.      */
  147.     define('APP_CONFIG_PATH'APP_PATH 'config/');
  148. }
  149. if(!defined('APP_WWW_PATH'))
  150. {
  151.     /**
  152.      * Webroot path
  153.      * 
  154.      * Path to the webroot of your application.
  155.      */
  156.     define('APP_WWW_PATH'APP_PATH);
  157. }
  158. if(!defined('APP_IMAGE_DIR_URL'))
  159. {
  160.     /**
  161.      * Images directory URL
  162.      * 
  163.      * URL of the directory when you store the images of your application
  164.      */
  165.     define('APP_IMAGE_DIR_URL'APP_URL 'images/');
  166. }
  167. if(!defined('APP_DATA_DIR_URL'))
  168. {
  169.     /**
  170.      * Data directory URL
  171.      * 
  172.      * URL of the directory when your store misc data of your application
  173.      */
  174.     define('APP_DATA_DIR_URL'APP_URL 'data/');
  175. }
  176. if(!defined('APP_ERROR_LOG'))
  177. {
  178.     /**
  179.      * Error log
  180.      * 
  181.      * All the runtime errors will be logged in this file
  182.      */
  183.     define('APP_ERROR_LOG'APP_LOGS_PATH 'error.log');
  184. }
  185. if(!defined('APP_USER_ERROR_LOG'))
  186. {
  187.     /**
  188.      * User error log
  189.      * 
  190.      * All the user errors (eg.someone enterded a bad parameter in a form) will
  191.      * be logged in this file
  192.      */
  193.     define('APP_USER_ERROR_LOG'APP_LOGS_PATH 'user-error.log');
  194. }
  195. if(!defined('APP_DEBUG_LOG'))
  196. {
  197.     /**
  198.      * Debug log
  199.      * 
  200.      * All the debug messages will be logged in this file
  201.      */
  202.     define('APP_DEBUG_LOG'APP_LOGS_PATH 'debug.log');
  203. }
  204. if(!defined('APP_MANIALINK'))
  205. {
  206.     /**
  207.      * Short Manialink
  208.      * 
  209.      * Short Manialink of your application. You can define Short Manialinks on
  210.      * the Player Page at http://player.trackmania.com
  211.      * 
  212.      * Note that the Short Manialink <b>"manialibdev" </b> redirects to
  213.      * <b>"http://localhost/manialib/"</b> for easy access to your local
  214.      * developement version
  215.      */
  216.     define('APP_MANIALINK''manialib');
  217. }
  218. if(!defined('APP_USE_SHORT_MANIALINKS'))
  219. {
  220.     /**
  221.      * Deprecated, please don't use it
  222.      * @deprecated
  223.      */
  224.     define('APP_USE_SHORT_MANIALINKS'false);
  225. }
  226. if(!defined('APP_DEFAULT_TIMEZONE'))
  227. {
  228.     /**
  229.      * Time zone
  230.      * 
  231.      * Default time zone of the server
  232.      */
  233.     define('APP_DEFAULT_TIMEZONE''Europe/Paris');
  234. }
  235. if(!defined('APP_TIMEZONE_NAME'))
  236. {
  237.     /**
  238.      * Time zone name
  239.      * 
  240.      * Human readable name of the time zone in case you need to print it
  241.      */
  242.     define('APP_TIMEZONE_NAME''GMT+1');
  243. }
  244. if(!defined('APP_LANG_ENGINE_MODE'))
  245. {
  246.     /**
  247.      * Lang engine mode
  248.      * 
  249.      * If set to "1", it will use the <b>dynamic lang engine mode</b>.
  250.      * The XML dicos will be loaded by LangEngine and you will be able
  251.      * to create dynamic sentances.
  252.      * 
  253.      * If set to "0", it won't do anything so you can use them as standard
  254.      * Manialink dictionaries. Note that you will need to include the XML
  255.      * files in your Manialink for localization to work.
  256.      * See Manialink::includeManialink() to do that
  257.      * 
  258.      * @see LangEngine
  259.      */
  260.     define('APP_LANG_ENGINE_MODE'1);
  261. }
  262. if(!defined('APP_DEBUG_LEVEL'))
  263. {
  264.     /**
  265.      * Debug level
  266.      * 
  267.      * <b>USE "0" FOR PRODUCTION ENVIRONEMENT !</b>
  268.      * 
  269.      * If <b>1</b>, all the debug messages and the errors will be outputed
  270.      * to the screen.
  271.      * 
  272.      * If <b>0</b>, only the user messages are shown in case of error
  273.      */
  274.     define('APP_DEBUG_LEVEL'0);
  275. }
  276. if(!defined('APP_DATABASE_HOST'))
  277. {
  278.     /**
  279.      * MySQL database hostname
  280.      */
  281.     define('APP_DATABASE_HOST''localhost');
  282. }
  283. if(!defined('APP_DATABASE_USER'))
  284. {
  285.     /**
  286.      * MySQL database username
  287.      */
  288.     define('APP_DATABASE_USER''root');
  289. }
  290. if(!defined('APP_DATABASE_PASSWORD'))
  291. {
  292.     /**
  293.      * MySQL database password
  294.      */
  295.     define('APP_DATABASE_PASSWORD''');
  296. }
  297. if(!defined('APP_DATABASE_NAME'))
  298. {
  299.     /**
  300.      * MySQL database name
  301.      */
  302.     define('APP_DATABASE_NAME''manialib');
  303. }
  304. if(!defined('APP_DATABASE_CHARSET'))
  305. {
  306.     /**
  307.      * MySQL charset
  308.      * 
  309.      */
  310.     define('APP_DATABASE_CHARSET''utf8');
  311. }
  312. if(!defined('APP_MVC_FRAMEWORK'&& !defined('APP_FRAMEWORK_REQUEST_ENGINE_CLASS'))
  313. {
  314.     /**
  315.      * Request engine class
  316.      * 
  317.      * Define the right request engine class depending on the mvc framework usage
  318.      */
  319.     define('APP_FRAMEWORK_REQUEST_ENGINE_CLASS''RequestEngine');
  320. }
  321. if(!defined('APP_MANIAHOME_SHOW_BUTTON'))
  322. {
  323.     /**
  324.      * Whether to show the ManiaHome favourite button
  325.      */
  326.     define('APP_MANIAHOME_SHOW_BUTTON'true);
  327. }
  328. if(!defined('APP_MANIAHOME_NAME'))
  329. {
  330.     /**
  331.      * Name of your Manialink for the ManiaHome favourite button.
  332.      * It can have special characters.
  333.      */
  334.     define('APP_MANIAHOME_NAME'APP_MANIALINK);
  335. }
  336. if(!defined('APP_MANIAHOME_URL'))
  337. {
  338.     /**
  339.      * URL or short Manialink of your Manialink for the ManiaHome favourite button
  340.      */
  341.     define('APP_MANIAHOME_URL'APP_MANIALINK);
  342. }
  343. if(!defined('APP_MANIAHOME_PICTURE'))
  344. {
  345.     /**
  346.      * URL of your banner for ManiaHome
  347.      */
  348.     define('APP_MANIAHOME_PICTURE'null);
  349. }
  350.  
  351. ?>