MMOframework
Pourquoi l'IA Playground Bibliothèques Documentation Rechercher Agence
FR EN
Index

ProjectScaffold

MMO\admin\helpers · 1 symbole · générée le 27 Oct 2026

class

ProjectScaffold

ProjectScaffold.php:22

Makes an application built on the framework: mmo.admin's project/ skeleton, then its deployment files (templates/: deploy.json, .gitattributes, scripts/...) -- the very ones php scripts/admin.php init writes -- every {{placeholder}} filled (vars()).

class MMO\admin\helpers\ProjectScaffold
Espace de noms
MMO\admin\helpers
The hub's `php tools/mmo.php project` writes it into a folder, links the libraries and makes it a repository; mmoframework.fr's playground makes one in memory, for a visitor to browse and download. Both get the same files, from this library, so neither can start from a stale copy of them. They travel in mmo.admin's package (`mmo.json`'s `sources`), so a release has them too.
$scaffold = new ProjectScaffold(); $vars = $scaffold->vars(['name' => 'acme.portal', 'libraries' => ['mmo.pdo']]); $scaffold->create('/tmp/acme.portal', $vars); // ['AGENTS.md', 'bootstrap.php', ..., 'deploy.json', ...]

Index

TEXTthe skeleton's files whose text is templated; anything else (an icon, a font) is copied byte for byte
deploy
template
create($folder, $vars, $dryRun)Write the project into $folder: files(), a script staying executable (git ignores a hook it cannot run).
debugName()
files($vars)Every file of the project: the skeleton's, filled, then the deployment's it does not already have.
vars($options)The placeholders of a project, from what is known of it.
versions()

Constantes1

TEXT

the skeleton's files whose text is templated; anything else (an icon, a font) is copied byte for byte

const TEXT = '/(\\.(php|json|md|scs|scss|css|js|jhs|phtml|html|svg|xml|txt|yml|sh)|htaccess)$/'

Propriétés2

deploy

string $deploy = '{mmo.admin}/templates'
Type
string

template

string $template = '{{{name}}}'
Type
string

Méthodes5

create($folder, $vars, $dryRun)

ProjectScaffold.php:138

Write the project into $folder: files(), a script staying executable (git ignores a hook it cannot run).

function create(string $folder, array $vars, bool $dryRun = false): array
$folderstringcreated when missing; a file already there is written over
$varsarray
$dryRun = falseboolwrite nothing, say what would be written
retournearraythe files written (or that would be), by path in the project

files($vars)

ProjectScaffold.php:99

Every file of the project: the skeleton's, filled, then the deployment's it does not already have. A dot. prefix becomes a leading . (a template cannot ship a real .gitignore: git would apply it to the template).

function files(array $vars): array
$varsarray
retournearrayarray{content: string, executable: bool}> by path in the project, in natural order

vars($options)

ProjectScaffold.php:44

The placeholders of a project, from what is known of it.

function vars(array $options): array
$optionsarray
retournearraystring> {{placeholder}} => its value
lèvefor a name, a namespace or a library that is not one
(new ProjectScaffold())->vars(['name' => 'acme.portal'])['{{Namespace}}']; // 'AcmePortal'

versions()

ProjectScaffold.php:83
function versions(): array
retournearraystring> the major version of each library the application knows (mmo.core => 21.*), read from its manifest: a template that wrote them out would keep the majors of the day it was written