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.php
file.- Defines core application constants.
- Loads
.\srv\http\engine\f.php
- Defines core application’s functions.
- Loads
.\srv\http\engine\fire.php
- ets PHP error reporting mode by checking the existence of
TEST
constant and its truthy value. - ormalizes and evaluates global variables (
$_GET
,$_POST
,$_REQUEST
) values. - ormalizes
$_FILES
values to$_POST
for easy array iterations. - ets up a queue to load class files stored in
.\srv\http\engine\kernel
folder, efficiently.- Loads related class files stored in
.\srv\http\engine\plug
folder once the class is loaded. - Loads related class files stored in
.\srv\http\lot\x\*\engine\plug
and.\srv\http\lot\y\*\engine\plug
folder once the class is loaded.
- Loads related class files stored in
- repares the
enter
hook to execute. - repares the
exit
hook to execute. - oads core application’s state data to variable
$state
. This should loads the.\srv\http\engine\kernel\state.php
file. - uilds 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.php
file. - ooks for
state.php
files 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\kernel
and.\srv\http\lot\y\*\engine\kernel
folder, efficiently.- Loads related class files stored in
.\srv\http\lot\x\*\engine\plug
and.\srv\http\lot\y\*\engine\plug
folder once the class is loaded.
- Loads related class files stored in
- Looks for
task.php
files in all extension and layout folders and then loads them.- In case of immediate
echo
, theenter
hook will be executed just before the firstecho
. - In case of immediate
exit
, theexit
hook will be executed here.
- In case of immediate
- Looks for
index.php
files in all extension and layout folders and then loads them.- In case of immediate
echo
, theenter
hook will be executed just before the firstecho
. - In case of immediate
exit
, theexit
hook will be executed here.
- In case of immediate
- Sets default response status to
403
and sets anx-powered-by
header 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->zone
value. - Loads the core
task.php
file if any.- In case of immediate
echo
, theenter
hook will be executed just before the firstecho
. - In case of immediate
exit
, theexit
hook will be executed here.
- In case of immediate
- Clears all temporary global variables.
- Executes the
set
hook. This should loads the.\srv\http\engine\kernel\hook.php
file. - Executes the
get
hook.- In case of immediate
echo
, theenter
hook will be executed just before the firstecho
. - In case of immediate
exit
, theexit
hook will be executed here.
- In case of immediate
- Executes the
let
hook. - Executes the
exit
hook.
- ets 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.