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

HubScaffold

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

class

HubScaffold

HubScaffold.php:19

Makes a monitoring hub for a project: a folder of its own holding hub.json, its page, its command line, and the README saying how to use them -- mmo.admin's hub-template/, its {{placeholders}} filled (Hub).

class MMO\admin\monitoring\HubScaffold
Espace de noms
MMO\admin\monitoring
One hub per project: `~/hubs/my.oviepro` watching every client of my.oviepro, `~/hubs/mmoframework.fr` the framework's site. Each reads its project's `deploy.json`, and gets a port of its own for `php hub.php serve`. What exists is kept: running it again on a hub fills in what is missing (a file deleted, a new one in the template) and never rewrites a `hub.json` someone edited -- unless asked to, with `force`.
$plan = (new HubScaffold())->create('~/hubs/my.oviepro', ['project' => '~/dev/src/my.oviepro'], dryRun: true); // ['hub.json' => 'create', 'bootstrap.php' => 'create', ...]

Index

RENAMEa file's name in the template => its name in the hub
libs
template
create($folder, $options, $dryRun, $force)
debugName()
embed($project, $options, $dryRun, $force)A project's own hub, in the project itself: its local site in dev mode shows the hub's pages beside its Développeur menu (boards, checklists) -- one hub per project, its variants and its servers.
embeddedCommandLine($name)
EmbeddedConfig($pages) staticWhat the project's configs/dev.json gets for its hub: HubController routed and reading its hub.json (collections left to cron: the web server has no ssh agent), the hub's pages in its theme.
files()
home($path)
vars($folder, $options)

Constantes1

RENAME

a file's name in the template => its name in the hub

const RENAME = ['dot.htaccess' => '.htaccess', 'dot.gitignore' => '.gitignore']

Propriétés2

libs

string $libs = '{mmoframework}/libs'
Type
string

template

string $template = '{mmo.admin}/hub-template'
Type
string

Méthodes8

create($folder, $options, $dryRun, $force)

HubScaffold.php:40
function create( string $folder, array $options = [], bool $dryRun = false, bool $force = false ): array
$folderstringwhere the hub goes (~/ allowed)
$options = []array
$dryRun = falseboolonly say what would be done
$force = falseboolwrite over existing files (but hub.credentials.json, never in the template)
retournearraystring> file => create, overwrite or keep
lèvefor a name that is not one, or no declaration at all

embed($project, $options, $dryRun, $force)

HubScaffold.php:79

A project's own hub, in the project itself: its local site in dev mode shows the hub's pages beside its Développeur menu (boards, checklists) -- one hub per project, its variants and its servers. Writes hub.json (the template's, reading the project's deploy.json, keeping its readings in hub-data/, linking its boards, its checklists and the root hub) and hub.php (collect, status, cron... on the project's bootstrap); the project's configuration is the caller's to change: EmbeddedConfig.

function embed( string $project, array $options = [], bool $dryRun = false, bool $force = false ): array
$projectstringthe project's folder (~/ allowed)
$options = []array
$dryRun = falseboolonly say what would be done
$force = falseboolwrite over existing files
retournearraystring> file => create, overwrite or keep
lèvewhen $project has no mmo.json
(new HubScaffold())->embed('~/dev/src/my.oviepro', [], true); // ['hub.json' => 'create', 'hub.php' => 'create', 'hub-data/' => 'create']

embeddedCommandLine($name)

HubScaffold.php:125
protected function embeddedCommandLine(string $name): string
$namestring
retournestringa project's hub.php: the hub's command line on the project's own bootstrap

EmbeddedConfig($pages)

staticHubScaffold.php:116

What the project's configs/dev.json gets for its hub: HubController routed and reading its hub.json (collections left to cron: the web server has no ssh agent), the hub's pages in its theme.

static function EmbeddedConfig(array $pages): array
$pagesarraythe theme's pages the project has ({Oviepro}/pages): kept first
retournearraythe configuration to merge

home($path)

HubScaffold.php:194
protected function home(string $path): string
$pathstring
retournestring$path with the home folder written ~: a hub.json that reads the same on another machine

vars($folder, $options)

HubScaffold.php:168
function vars(string $folder, array $options): array
$folderstring
$optionsarray
retournearraystring> {{placeholder}} => its value, JSON-ready where it lands in hub.json
lève