mirror of
https://github.com/avecms/AVE.cms.git
synced 2026-08-01 08:45:44 +00:00
2.3 KiB
2.3 KiB
Core and request lifecycle
How the request passes through the engine: from index.php to the response. Here are the basic ones
bricks on which both the public site and the control panel stand. Her catalog
by default it is called /adminx, but can be renamed.
Life cycle (simplified)
index.php / adminx/index.php
│
▼
system/bootstrap.php → App::init() // автозагрузчик, БД, сессия, настройки, Twig, хуки
│
▼
Router::match() // найти маршрут по пути и методу
│
▼
handler (Controller::method / Closure) // выполнить обработчик, получить строку/JSON
│
▼
Response // отдать HTML/JSON + статус
In the admin panel, the entry point adminx/index.php additionally raises modules
(ModuleManager) and routing via Dispatcher.
Section map
| Page | What about |
|---|---|
| Initialization (bootstrap) | What raises App::init(): autoloading, database, session, settings, Twig, hooks. |
| Routing (Router) | get/post/put/delete, parameters {id}, groups, _method. |
| Controllers | Basic App\Common\Controller: render / json / success / error / csrfGuard. |
| Authorization | Admin user and site visitor: check / user / id / attempt. |
| Sessions and CSRF | Session: Storage, CSRF token, form validation and AJAX. |
| Permission | Checking permissions, roles, registering rights by modules. |
Two contexts
The engine serves two independent contexts in one codebase:
| Public site | Admin /adminx |
|
|---|---|---|
| Login | index.php |
adminx/index.php |
| User | Auth::publicUser() (visitor) |
Auth::user() / systemUser() (admin) |
| Rights | — | Permission::check() |
| Modules | public modules | panel modules (ModuleManager) |
Session and CSRF mechanics are common (one DB session and cookie), which saves login when transitions between the site and the panel.
Extensions register namespaces and runtime contributions declaratively via module descriptor; manually changing the bootloader for no regular module required.