Skip to content
Skills Library
Programming · Learning & explanation

redaxo-architecture

/redaxo-architecture

REDAXO project structure, request lifecycle, and core classes. Use when the user works on a REDAXO codebase, mentions REDAXO directory layout, asks about rex_addon/rex_config/rex_path/rex_url/rex_clang/rex_request, or when files under redaxo/src/, redaxo/data/, or redaxo/cache/ appear in the conversation.

Licence
MIT
Last repository change
20.09.2026

Assessment and security

100/ 100Class: good
Format25 / 25
Frontmatter with name and description, valid name, description up to 1,024 characters, name matching the folder.
Discoverability25 / 25
Description explains when to use the skill, has a reasonable length and uses third person.
Content35 / 35
At least 150 words and at most 500 lines, headings, step lists, examples or code.
Hygiene15 / 15
No placeholders such as TODO, no Windows paths, with a licence.
Riskno signals detected in the scan
Files in this package
1
Scripts
0
HTML comments
0
URLs in SKILL.md
1
Deprecation

No signals detected. Repository changed on 20.09.2026, without references to retired models or APIs.

Licence

MIT, open: use and modify while retaining author attribution.

What it does and when to use it

REDAXO project structure, request lifecycle, and core classes. Use when the user works on a REDAXO codebase, mentions REDAXO directory layout, asks about rex_addon/rex_config/rex_path/rex_url/rex_clang/rex_request, or when files under redaxo/src/, redaxo/data/, or redaxo/cache/ appear in the conversation.

Original author description

REDAXO project structure, request lifecycle, and core classes. Use when the user works on a REDAXO codebase, mentions REDAXO directory layout, asks about rex_addon/rex_config/rex_path/rex_url/rex_clang/rex_request, or when files under redaxo/src/, redaxo/data/, or redaxo/cache/ appear in the conversation.

How it works

  1. Directory layout
  2. Request lifecycle (high level)
  3. Key core classes
  4. Conventions
  5. Common pitfalls
Original SKILL.md headings · 62 lines, 494 words
SKILL.md preview
---
name: redaxo-architecture
description: REDAXO project structure, request lifecycle, and core classes. Use when the user works on a REDAXO codebase, mentions REDAXO directory layout, asks about rex_addon/rex_config/rex_path/rex_url/rex_clang/rex_request, or when files under redaxo/src/, redaxo/data/, or redaxo/cache/ appear in the conversation.
---

# REDAXO Architecture

REDAXO is a PHP CMS organized around a small core plus addons. Almost every feature lives in an addon – including `structure` (articles/categories), `mediapool` (media management), `users`, and `cronjob`.

## Directory layout

```
redaxo/
├── src/
│   ├── core/              # Core classes (rex_*, never edit)
│   └── addons/
│       ├── structure/     # Articles & categories
│       ├── mediapool/     # Media library
│       ├── users/         # Backend user management
│       └── <your-addon>/  # Custom addons live here
├── data/
│   ├── addons/            # Addon-managed runtime data
│   ├── core/              # Core runtime data (config.yml lives here)
│   └── log/               # System logs
└── cache/                 # Generated files; safe to delete
```

The user's project root usually contains `redaxo/` plus `assets/` (public mirror of addon assets) and a frontend directory (often `public/` or root).

## Request lifecycle (high level)

1. `index.php` boots `rex` (frontend) or `redaxo/index.php` boots the backend.
2. Core loads `config.yml` and the `package.yml` of every installed addon.
3. Each addon's `boot.php` runs – this is where extension points get registered.
4. For frontend requests: structure resolves the article via URL → loads template → executes modules.
5. `OUTPUT_FILTER` runs on the final HTML before it's sent.

## Key core classes

- `rex_addon::get('addon_name')` – access addon instance, config, paths, version
- `rex_config::get('namespace', 'key', $default)` / `set()` – persistent key-value config
- `rex_path::addon('addon_name', 'sub/path')` – absolute filesystem paths
- `rex_path::frontend('relative/path')` – paths in the public frontend
- `rex_url::backendController(['page' => 'addon/section'])` – backend URLs
- `rex_url::frontendController(['article_id' => 5])` – frontend URLs (use yrewrite if installed)
- `rex_clang::getCurrentId()` / `rex_clang::getAll()` – language handling
- `rex_request::get('key', 'string', '')` / `post()` – type-safe input
- `rex_response::sendJson($data)` – JSON responses for AJAX
- `rex_logger::factory()->log('error', $msg)` – write to system log
- `rex::isBackend()` / `rex::isFrontend()` / `rex::getUser()` – context

## Conventions

- **Never edit core files.** Hook into the system via extension points or override via your own addon.
- Addon code goes in `redaxo/src/addons/<name>/` during development; published addons get distributed via the REDAXO Installer or [redaxo.org](https://redaxo.org).
- Public assets are placed in your addon's `assets/` folder. They're symlinked/copied to `assets/addons/<name>/` on install.
- For paths, always use `rex_path::*` instead of hardcoding `__DIR__ . '/../...'`.
- For URLs, always use `rex_url::*` so the system stays portable across installations and subdirectory deployments.

## Common pitfalls

- Forgetting `rex::isBackend()` checks in `boot.php` – many extension points fire in both contexts.
- Using `$_GET` / `$_POST` directly instead of `rex_request` – loses type safety and the built-in CSRF token handling.
- Hardcoding language IDs (assuming `1 = German`). Use `rex_clang::getCurrent()` and `rex_clang::getCurrentId()`.
- Changing `rex_config` with a direct SQL `UPDATE` on the `rex_config` table (`rex::getTable('config')`) – `rex_config` reads from the cache file `rex_path::coreCache('config.cache')` and only falls back to the table when that file is missing, so the old value stays active without any error. Values are also stored JSON-encoded. Use `rex_config::set()` (written to the table at shutdown, cache file invalidated); after an unavoidable SQL change call `rex_config::refresh()` or clear the cache.

Versions

The database has no other skills named redaxo-architecture.

Database snapshot: 13.11.2026 · package version 1440e2060e7d (SHA-256 digest of the entire package)

Downloads in the last 30 days: 1 · ranking

Report a problem with this skill: harmful content, incorrect descriptions or an author’s removal request.

Similar skills

  • 100redaxo-extension-points
    REDAXO Extension Points – the hook system for modifying core/addon behavior without patching files. Use when the user mentions rex_extension::register, hooks into events like ART_CONTENT / OUTPUT_FILTER / PACKAGES_INCLUDED, or wants to extend backend pages and content.
  • 100redaxo-templates
    REDAXO template authoring – page layouts that wrap article content. Use when the user creates or edits a template, asks about getArticle(), works with rex_fragment, sets up multi-language output, or wants to embed slices into a layout.
  • 100project-structure
    This skill should be used when the user is setting up a Python project structure, choosing between src/ and flat layout, organizing __init__.py files, creating a new package directory, or structuring a monorepo. Covers src/ layout, flat layout, __init__.py design, __all__…

Feedback and reports

Your message goes to Bartosz Sokoliński. An email address is needed only for a reply. See the privacy policy.