Aliro basic symbol definitions
During the very early stages of handling every request, Aliro defines some symbols. Although for most purposes globals are strongly discouraged, some basic information is usefully provided as symbols (which have global scope). In addition, symbols have the advantage that they cannot be modified once set. This contributes to the security of the system. For all requests, the following symbols are given values:
_ALIRO_ABSOLUTE_PATH is the absolute path to the root of the Aliro based system. It may not be the document root for the web server, since the system may be running in a subdirectory. The value of the symbol will have a different form, depending on the kind of server. For a Windows server, it might look like c:\home\user\public_html while for a Linux system it might look like /var/www/mydomain.com/public_html, although enormous variation is obviously possible. Note that this is a path that will be within the web server's document root (or may be the same as the document root) and therefore files defined using this path can be served by the web server, subject to other possible constraints in the web server configuration. The path will NOT have a slash at the end.
_ALIRO_CURRENT_PATH has exactly the same value as _ALIRO_ABSOLUTE_PATH for a request on the user side. But for a request on the administrator side, it will have the same value as _ALIRO_ADMIN_PATH.
_ALIRO_CLASS_BASE is an absolute path that points somewhere in the file system, to a directory structure that must be accessible for the loading of PHP code. It is not necessarily within the web server document root. At the time of writing, the feature is not fully implemented or validated, but it is intended that it should be possible to run both the Aliro standard classes and add-on classes in a directory structure based on _ALIRO_CLASS_BASE rather than _ALIRO_ABSOLUTE_PATH. In fact, the value of _ALIRO_CLASS_BASE should not often be needed by add-ons since classes are best autoloaded by Aliro. The structure below _ALIRO_CLASS_BASE exactly mirrors that below _ALIRO_ABSOLUTE_PATH so far as familiar locations such as /components are concerned. The path will NOT have a slash at the end.
_ALIRO_IS_ADMIN is defined to be zero for a user side request (equivalent to false) whereas it is defined to be one for an administrator side request (equivalent to true).
_ALIRO_ADMIN_PATH is defined to be a null string for a user side request, to prevent it being set to a spurious value, whereas for an administrator side request it is set to the absolute path to the main administrator directory.
Note: it should not be assumed that the main administrator directory is called "administrator" and user side code should not need to know what it is called. The path will NOT have a slash at the end.
_ALIRO_ADMIN_DIR is defined to be a null string for a user side request, to prevent it being set to a spurious value, whereas for an administrator side request it is set to the name of the main administrator directory. It will start with a slash so that it can be directly concatenated with a pointer to the base location for the system.
_ALIRO_ADMIN_CLASS_BASE follows the same logic as the previous two items, being a null string on the user side and the base for code (possibly outside the document root) for the administrator side. When it is set, it would typically be the same as the _ALIRO_CLASS_BASE concatenated with the _ALIRO_ADMIN_DIR but this should not be assumed.
A number of other symbols have fixed values but are used to make code clearer and to avoid the use of arbitrary numbers etc.
DEFINE('_ALIRO_REGEXP_URL','/(https?|ftps?)\:\/\/[a-zA-Z0-9\-\.]+\.[a-zA-Z]{2,3}(:[a-zA-Z0-9]*)?\/?([a-zA-Z0-9\-\._\?\,\'\/\\\+&%\$#\=~])*[^\.\,\)\(\s]/');
DEFINE('_ALIRO_REGEXP_IP','/(https?|ftps?)\:\/\/\d{1,3}\.\d{1,3}\.\d{1,3}\.\d{1,3}\/?([a-zA-Z0-9\-\._\?\,\'\/\\\+&%\$#\=~])*[^\.\,\)\(\s]/');
define ('_ALIRO_IS_PRESENT', 1);
Define values for login validation results
define ('_ALIRO_LOGIN_GOOD', 0);
define ('_ALIRO_LOGIN_FAILED', 1);
define ('_ALIRO_LOGIN_PROHIBITED', 2);
Allows extensions written for Joomla 1.5+ to run
define ('_JEXEC', 1);
define ('JPATH_BASE', _ALIRO_ABSOLUTE_PATH);
define ('DS', '/');
Used with the getParam method of aliroAbstractRequest
define( '_MOS_NOTRIM', 0x0001 ); prevent getParam trimming input
define( '_MOS_ALLOWHTML', 0x0002 );
cause getParam to allow HTML - purified on user side
define( '_MOS_ALLOWRAW', 0x0004 ); suppresses forcing of integer if default is numeric
define( '_MOS_NOSTRIP', 0x0008 );
suppress stripping of magic quotes
Aliro error levels
define ('_ALIRO_ERROR_INFORM', 0);
define ('_ALIRO_ERROR_WARN', 1);
define ('_ALIRO_ERROR_SEVERE', 2);
define ('_ALIRO_ERROR_FATAL', 3);
Aliro form checking mechanism
define ('_ALIRO_FORM_CHECK_OK', 0);
define ('_ALIRO_FORM_CHECK_REPEAT', 1);
define ('_ALIRO_FORM_CHECK_FAIL', 2);
define ('_ALIRO_FORM_CHECK_NULL', 3);
define ('_ALIRO_FORM_CHECK_EXPIRED', 4);
Database error conditions
define ('_ALIRO_DB_NO_INTERFACE', 1);
define ('_ALIRO_DB_CONNECT_FAILED', 2);
define ('_ALIRO_USER_SIDE', 1);
define ('_ALIRO_ADMIN_SIDE', 2);
Menu options
define ('_ALIRO_SHOW_NO_SUBMENUS', 0);
define ('_ALIRO_SHOW_ACTIVE_SUBMENUS', 1);
define ('_ALIRO_SHOW_ALL_SUBMENUS', 2);
Default user side page size
DEFINE ('_ALIRO_PAGE_NAV_DISPLAY_PAGES', 10);
Cache size and time limits
define ('_ALIRO_OBJECT_CACHE_SIZE_LIMIT', 150000);
define ('_ALIRO_OBJECT_CACHE_TIME_LIMIT', 3600);
define ('_ALIRO_HTML_CACHE_SIZE_LIMIT', 100000);
define ('_ALIRO_HTML_CACHE_TIME_LIMIT', 600);
define ('_ALIRO_SEF_MAX_CACHE_SIZE', 500000);
define ('_ALIRO_AUTHORISER_SESSION_CACHE_TIME', 600);
define ('_ALIRO_DATABASE_CACHE_TIME', 3600);
How long to keep records of material checked for spam
define ('_ALIRO_KEEP_DAYS_OF_SPAM', 7);
There are no comments on this page. [Add comment]