finish(); } /** * Check if the application is initialized * @return bool */ public static function initialized() { return !is_null(self :: $root_directory_path); } /** * Check if a specific configuration variable is set * * @param string $key The configuration variable key * @return bool **/ public static function isset($key) { return Config::isset($key, self :: $options) || (Config::loaded() && Config::isset($key)); } /** * Get a specific option value * * @param string $key The configuration variable key * @param mixed $default The default value to return if configuration variable * is not set (Default : null) * @param string $cast The type of expected value. The configuration variable * value will be cast as this type. Could be : bool, int, * float or string. (Optional, default : raw value) * @param bool $split If true, $cast is 'array' and value retreived from configuration * is a string, split the value by comma (optional, default: true) * @return mixed The configuration variable value **/ public static function get($key, $default=null, $cast=null, $split=true) { return Config::get( $key, Config::loaded()?Config::get($key, $default, $cast, $split):$default, $cast, $split, self :: $options ); } /** * Set a specific option value * * @param string $key The configuration variable key * @param mixed $value The configuration variable value * @return boolean **/ public static function set($key, $value) { if (Config::isset($key, self :: $options)) return Config::set($key, $value, self :: $options); return Config::set($key, $value); } /** * Retreive application root directory path * @return string|null */ public static function root_directory_path() { return self :: $root_directory_path?self :: $root_directory_path:'.'; } /** * Default homepage handler * @param UrlRequest $request * @return void */ public static function handle_homepage($request) { if (Tpl::initialized()) Tpl :: display("homepage.tpl", I18n::_("Hello world !")); else echo "