Table of Contents
The core component of the Web:Extend framework represents a set of classes,
constants and functions defined upon inclusion of the core file, wee/wee.php.
The core of the framework is very minimalist, initializing only what is required by other modules to work correctly.
You can load Web:Extend using the following code:
<?php define('ALLOW_INCLUSION', 1); require('wee/wee.php');
The framework version can be obtained through the WEE_VERSION constant.
The format of the version is compatible with PHP's version_compare function. You can determine if the current version of the framework is the one you need by using the following snippet:
<?php if (version_compare(WEE_VERSION, '0.4.0')) { echo 'I am running Web:Extend version 0.4.0.'; }
If magic quotes are enabled, the framework will automatically disable them and remove all the magic quotes from the input data. We recommend however that you disable it directly in the PHP configuration file if possible.
weeAutoload: see the autoload documentation
weeException: see the exceptions documentation
Apart from the framework's version, a few other constants are defined. Some can be overridden while others are defined depending on the context.
These constants are defined only if they are not yet defined. This means you can override their default value if you define them before loading the framework.
APP_PATH: path to the application's root based on the requested URI
ROOT_PATH: path to the application's root in the filesystem (the folder containing the bootstrap file index.php)
PHP_EXT: extension for PHP files; defaults to '.php'
CLASS_EXT: extension for PHP class files; defaults to '.class' . PHP_EXT
These constants are defined depending on the environment. You cannot override them.
WEE_CLI: defined if the script was called from the command line
WEE_ON_WINDOWS: defined if the script is running on Windows
_T and _WT: see the native language support documentation
array_value: shortcut for if (isset($a['key'])) return $a['key']; else return 'default';
burn: safely throw an exception (see the exceptions documentation)
rmdir_recursive: recursively remove a directory
safe_header: same as header, but also prevent attacks like HTTP splitting and header injections
safe_path_info: returns a correct PATHINFO based on many parameters
xmlspecialchars: convert special characters to XML entities