The EuroCMS Components
EuroCMS Components are things that extend the EuroCMS experience in a specific way.
-
Core: extend it's usage to other ECMS components
-
Libraries: extend it's usage to all modules
-
Modules: Extend its usage to ECMS users.
-
Themes & widgets: extend its usage to the front-end users.
-
Planner: can extend its usage to all other components
-
handlers: Can change the usage of some core components
The EuroCMS Engine
We provide an all encompassing Engine class, where it loads everything needed to start, and will also load the Content class, which loads the output needed depending on the requested URL.
There will be several constant in the engine, that will we used in various component of ECMS.
Engine also functions as a jailer. Every 'system' settings, variables and component is loaded from here. This to prevent none installed php files to access ECMS functions/classess/... without accessing it.
You can only loaded components from the class engine, and the class engine will check if you have the rights to access the requested functions.
Contemplate
Add a autoloader php function?
https://www.php.net/manual/en/language.oop5.autoload.php
As a replacement to __construct();?
Concept code:
spl_autoload_register(function ($class_name) {
$file_name ="$class_name.php"
$path_to_file = Engine::ENGINE_CORE_DIR . "/$file_name";
if(file_exists($path_to_file)) {
include $class_name . '.php';
} else {
return false;
}
});
$obj = new Content();
Construct
When the class is constructed, it will check for the following
- Direct access check.
It is not allowed to access the file directly: /engine/core/core.php. Everything in the URL is passed to the /index.php.
- check_db - do we have a db connection?
If not, the Installer will be loaded, to generate the db credentials.
- Handlers
The pre defined handlers will be loaded
- Add core variables
These include the variables in $_SERVER as a constant.
This, makes is easier to request them, such as: $HTTP_HOST = constant('HTTP_HOST');.
- add core function
The bare minimum functions needed to turn on the Engine.
- Add Settings
The settings, such as handlers.
- Includes
Such as the cache class, and the core functions.
- Content
After that Themes and analytics will also be loaded.
The EuroCMS Content
-
domain
-
type
-
content