MMOframework
Why AI Playground Libraries Developers Agency
FR EN
Build a project live
Index

TypeOverrides

MMO\editor\cms · 1 symbol · generated 30 Nov 2026

class

TypeOverrides

TypeOverrides.php:21

The section types a site saved on its server, against the ones its code ships -- and its blocks and variants (SectionTypes), named by their path in the sections/ folder: _blocks/video, dg-news/liste.

class MMO\editor\cms\TypeOverrides
Namespace
MMO\editor\cms
In a release the section-type editor writes in [`Pages::$typesFolder`](https://mmoframework.fr/en/documentation/mmo.editor/php/cms/Pages.md#pages-typesfolder) -- a shared folder, the package being a phar nothing writes. A type saved there is read first: it replaces the one of the same name of the application's `templates` or mmo.editor's own until its files are deleted, whatever the next releases change in it. Here is what is there: each type, the folder whose type it replaces (null: it is new), which of its files differ, its last save. The saved files are given as their sha256 and time ([`Files`](https://mmoframework.fr/en/documentation/mmo.editor/php/cms/TypeOverrides.md#typeoverrides-files)), so that what was read on a server over ssh -- a hub, mmo.admin's `section-types` -- is compared like a folder of this machine.
foreach (TypeOverrides::Of(Pages::Shared()) as $name => $type) {echo $name, ' ', $type['replaces'] ?? 'new', "\n";} TypeOverrides::Compare(TypeOverrides::Files('/srv/acme/shared/db/cms/sections'), ['src/cms' => 'src/cms/sections']);

Index

FILESwhat a type is made of, a file each: SectionTypeStore -- a block too
LIBRARYthe origin of mmo.editor's own types (Pages::TEMPLATES)
VARIANT_FILESwhat a variant is made of (sections/{type}/{name}.*)
All($folder, $shipped) static
Compare($saved, $shipped) static
Files($folder) static
FilesOf($name) static
Of($pages) static
Shipped($pages) static

Constants3

FILES

what a type is made of, a file each: SectionTypeStore -- a block too

const FILES = ['schema.json', 'phtml', 'css']

LIBRARY

the origin of mmo.editor's own types (Pages::TEMPLATES)

const LIBRARY = 'mmo.editor'

VARIANT_FILES

what a variant is made of (sections/{type}/{name}.*)

const VARIANT_FILES = ['phtml', 'json', 'css']

Methods6

Compare($saved, $shipped)

staticTypeOverrides.php:67
static function Compare(array $saved, array $shipped): array
$savedarray
$shippedarray
returnsarrayarray{new: bool, replaces: ?string, files: array<string, string>, mtime: int}> by name: replaces the origin of the type it replaces, null when no folder has one of that name (new); files each file of the saved type, same, changed or added (the replaced type has none), and removed for a file only the replaced one has; mtime its last save

Files($folder)

staticTypeOverrides.php:39
static function Files(string $folder): array
$folderstringa sections/ folder
returnsarrayarray{sha256: string, mtime: int}> by file name (hero.phtml): the files of section types it holds

FilesOf($name)

staticTypeOverrides.php:28
static function FilesOf(string $name): array
$namestring
returnsarraythe files of a template named $name (hero, _blocks/video, dg-news/liste)

Of($pages)

staticTypeOverrides.php:129
static function Of(MMO\editor\cms\Pages $pages): array
$pagesPages
returnsarraythe types $pages's site saved (Compare): none when it saves no type apart from its templates (no typesFolder, or one of them: a checkout writing its sources)

Shipped($pages)

staticTypeOverrides.php:118
static function Shipped(MMO\editor\cms\Pages $pages): array
$pagesPages
returnsarraystring> origin => sections/ folder: what a saved type of $pages replaces, its templates (by the folder as configured) then mmo.editor's own (LIBRARY)