finish(); } /** * Check if the application is initialized * @return bool */ public static function initialized() { return !is_null(self :: $root_directory_path); } /** * 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 ); } /** * 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", _("Hello world !")); else echo "