Application Life Span
Processes that occur starting from the first time you request a page until all response body is successfully rendered to you.
- A visitor opens the web page at
http://127.0.0.1/article/lorem-ipsum - The web server responds as follows:
- Check if a file/folder exists in location
.\srv\http\article\lorem-ipsum- If so, load that extension-less file/folder. At this point, Mecha has no role whatsoever, and the application will stop.
- Otherwise, the web server will load
.\srv\http\index.phpfile.- Defines core application constants.
- Loads
.\srv\http\engine\f.php- Defines core application’s functions.
- Loads
.\srv\http\engine\fire.php- Sets PHP error reporting mode by checking the existence of
TESTconstant and its truthy value. - Normalizes and evaluates global variables (
$_GET,$_POST,$_REQUEST) values. - Normalizes
$_FILESvalues to$_POSTfor easy array iterations. - Sets up a queue to load class files stored in
.\srv\http\engine\kernelfolder, efficiently.- Loads related class files stored in
.\srv\http\engine\plugfolder once the class is loaded. - Loads related class files stored in
.\srv\http\lot\x\*\engine\plugand.\srv\http\lot\y\*\engine\plugfolder once the class is loaded.
- Loads related class files stored in
- Prepares the
enterhook to execute. - Prepares the
exithook to execute. - Loads core application’s state data to variable
$state. This should loads the.\srv\http\engine\kernel\state.phpfile. - Builds up current URL data from the server variables then loads it to variable
$url. This should loads the.\srv\http\engine\kernel\u-r-l.phpfile. - Looks for
state.phpfiles in all extension and layout folders and then registers the values to$state->x(for extensions) and$state->y(for layouts). - Sets up a queue to load class files stored in
.\srv\http\lot\x\*\engine\kerneland.\srv\http\lot\y\*\engine\kernelfolder, efficiently.- Loads related class files stored in
.\srv\http\lot\x\*\engine\plugand.\srv\http\lot\y\*\engine\plugfolder once the class is loaded.
- Loads related class files stored in
- Looks for
task.phpfiles in all extension and layout folders and then loads them.- In case of immediate
echo, theenterhook will be executed just before the firstecho. - In case of immediate
exit, theexithook will be executed here.
- In case of immediate
- Looks for
index.phpfiles in all extension and layout folders and then loads them.- In case of immediate
echo, theenterhook will be executed just before the firstecho. - In case of immediate
exit, theexithook will be executed here.
- In case of immediate
- Sets default response status to
403and sets anx-powered-byheader with value'Mecha/3.0.0'. - Sets default response type to
'text/html'(or to'text/plain'in case of errors). - Sets default application time zone from the
$state->zonevalue. - Loads the core
task.phpfile if any.- In case of immediate
echo, theenterhook will be executed just before the firstecho. - In case of immediate
exit, theexithook will be executed here.
- In case of immediate
- Clears all temporary global variables.
- Executes the
sethook. This should loads the.\srv\http\engine\kernel\hook.phpfile. - Executes the
gethook.- In case of immediate
echo, theenterhook will be executed just before the firstecho. - In case of immediate
exit, theexithook will be executed here.
- In case of immediate
- Executes the
lethook. - Executes the
exithook.
- Sets PHP error reporting mode by checking the existence of
- Check if a file/folder exists in location
Coding Style Guide
My coding preferences on this project you must follow to be able to contribute.
Constant
Core application constants.
Extension
Adds features to the core application.
Files
File and folder structure.
Form
Form data evaluation.
Function
Core application functions.
Hook
List of the core hooks and what they do.
Layout
Adds a front view to present the data.
Application Life Span
Processes that occur starting from the first time you request a page until all response body is successfully rendered to you.
Object
Core application objects.
Installation Guide
Various ways to install this application, each with its pros and cons.
Variable
Core application variables.