chore(release): bump to 09.22.00 — CliFramework migration
Generic: Repo Health / Site Health (push) Has been cancelled
Generic: Repo Health / Access control (push) Has been cancelled
Universal: PR Check / Branch Policy (pull_request) Has been cancelled
Universal: PR Check / Validate PR (pull_request) Has been cancelled
Universal: Secret Scanning / Gitleaks Secret Scan (pull_request) Has been cancelled
Universal: Auto Version Bump / Version Bump (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (push) Has been cancelled
Platform: moko-platform CI / Gate 1: Code Quality (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (pull_request) Has been cancelled
Platform: moko-platform CI / CI Summary (pull_request) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.1) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.2) (push) Has been cancelled
Platform: moko-platform CI / Gate 2: Unit Tests (8.3) (push) Has been cancelled
Platform: moko-platform CI / Gate 3: Self-Health Check (push) Has been cancelled
Platform: moko-platform CI / Gate 4: Governance (push) Has been cancelled
Platform: moko-platform CI / Gate 5: Template Integrity (push) Has been cancelled
Platform: moko-platform CI / CI Summary (push) Has been cancelled
Generic: Repo Health / Release configuration (push) Has been cancelled
Generic: Repo Health / Scripts governance (push) Has been cancelled
Generic: Repo Health / Repository health (push) Has been cancelled
Universal: PR Check / Build RC Package (pull_request) Has been cancelled

Authored-by: Moko Consulting
Co-Authored-By: Claude Opus 4.6 (1M context) <noreply@anthropic.com>
This commit is contained in:
Jonathan Miller
2026-05-31 12:14:34 -05:00
parent 34ab5c43ee
commit ae2860c3b5
252 changed files with 3724 additions and 1762 deletions
+1 -1
View File
@@ -42,7 +42,7 @@ Suggested text here
<!-- Add any other context, screenshots, or references -->
## Standards Alignment
- [ ] Follows MokoStandards documentation guidelines
- [ ] Follows moko-platform documentation guidelines
- [ ] Uses en_US/en_GB localization
- [ ] Includes proper SPDX headers where applicable
+1 -1
View File
@@ -37,7 +37,7 @@ If you have ideas about how this could be implemented, share them here:
Add any other context, mockups, or screenshots about the feature request here.
## Relevant Standards
Does this relate to any standards in [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)?
Does this relate to any standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)?
- [ ] Accessibility (WCAG 2.1 AA)
- [ ] Localization (en_US/en_GB)
- [ ] Security best practices
+1 -1
View File
@@ -35,7 +35,7 @@ Use this template only for:
<!-- Describe how this could be addressed -->
## Standards Reference
Does this relate to security standards in [MokoStandards](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)?
Does this relate to security standards in [moko-platform](https://git.mokoconsulting.tech/MokoConsulting/moko-platform)?
- [ ] SPDX license identifiers
- [ ] Secret management
- [ ] Dependency security
+1 -1
View File
@@ -62,7 +62,7 @@ jobs:
API="${GITEA_URL}/api/v1"
# Platform/standards/infra repos to exclude
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private MokoStandards moko-platform MokoTesting"
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform MokoTesting"
EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate"
if [ -n "${{ inputs.repos }}" ]; then
+1 -1
View File
@@ -61,7 +61,7 @@ jobs:
run: |
API="${GITEA_URL}/api/v1"
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private MokoStandards moko-platform MokoTesting"
EXCLUDE="gitea-org-config org-profile gitea-private .mokogitea-private moko-platform MokoTesting"
EXCLUDE="$EXCLUDE MokoStandards-Template-Client MokoStandards-Template-Dolibarr MokoStandards-Template-Generic MokoStandards-Template-Joomla MokoDoliProjTemplate"
if [ -n "${{ inputs.repos }}" ]; then
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Release
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /.mokogitea/workflows/auto-bump.yml
# VERSION: 09.02.00
# VERSION: 09.22.00
# BRIEF: Auto patch-bump version on every push to dev (skips merge commits)
name: "Universal: Auto Version Bump"
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Release
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
# PATH: /templates/workflows/universal/auto-release.yml.template
# VERSION: 05.00.00
# VERSION: 09.22.00
# BRIEF: Universal build & release detects platform from manifest.xml
#
# +========================================================================+
+2 -2
View File
@@ -4,10 +4,10 @@
#
# FILE INFORMATION
# DEFGROUP: Gitea.Workflow
# INGROUP: MokoStandards.Universal
# INGROUP: MokoPlatform.Universal
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /.mokogitea/workflows/branch-cleanup.yml
# VERSION: 01.00.00
# VERSION: 09.22.00
# BRIEF: Delete feature branches after PR merge
name: "Branch Cleanup"
+2 -2
View File
@@ -7,11 +7,11 @@
# INGROUP: moko-platform.CI
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /.gitea/workflows/ci-platform.yml
# VERSION: 01.00.00
# VERSION: 09.22.00
# BRIEF: moko-platform CI — the standards engine validates itself
#
# +========================================================================+
# | MOKOSTANDARDS PLATFORM CI |
# | MOKO-PLATFORM CI |
# +========================================================================+
# | |
# | This is NOT a generic CI workflow. This is the self-validation |
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Maintenance
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /.gitea/workflows/cleanup.yml
# VERSION: 01.00.00
# VERSION: 09.22.00
# BRIEF: Scheduled cleanup — delete merged branches and old workflow runs
name: "Universal: Repository Cleanup"
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Security
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
# PATH: /templates/workflows/gitleaks.yml.template
# VERSION: 01.00.00
# VERSION: 09.22.00
# BRIEF: Secret scanning — detect leaked credentials, API keys, and tokens
#
# +========================================================================+
+1 -1
View File
@@ -5,7 +5,7 @@
# FILE INFORMATION
# DEFGROUP: Gitea.Workflow
# INGROUP: moko-platform.Automation
# VERSION: 09.21.00
# VERSION: 09.22.00
# BRIEF: Auto-create feature branch when an issue is opened
name: "Universal: Issue Branch"
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Notifications
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /.gitea/workflows/notify.yml
# VERSION: 01.00.00
# VERSION: 09.22.00
# BRIEF: Push notifications via ntfy on release success or workflow failure
name: "Universal: Notifications"
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.CI
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
# PATH: /templates/workflows/universal/pr-check.yml.template
# VERSION: 05.00.00
# VERSION: 09.22.00
# BRIEF: PR gate — branch policy + code validation before merge
name: "Universal: PR Check"
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Release
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /templates/workflows/universal/pre-release.yml.template
# VERSION: 05.01.00
# VERSION: 09.22.00
# BRIEF: Manual pre-release -- builds dev/alpha/beta/rc packages from any branch
name: "Universal: Pre-Release"
+1 -1
View File
@@ -10,7 +10,7 @@
# INGROUP: moko-platform.Validation
# REPO: https://git.mokoconsulting.tech/mokoconsulting-tech/moko-platform
# PATH: /templates/workflows/joomla/repo_health.yml.template
# VERSION: 04.06.00
# VERSION: 09.22.00
# BRIEF: Enforces repository guardrails by validating release configuration, scripts governance, tooling availability, and core repository health artifacts.
# ============================================================================
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Security
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /.gitea/workflows/security-audit.yml
# VERSION: 01.00.00
# VERSION: 09.22.00
# BRIEF: Dependency vulnerability scanning for composer and npm packages
name: "Universal: Security Audit"
+1 -1
View File
@@ -7,7 +7,7 @@
# INGROUP: moko-platform.Universal
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /templates/workflows/update-server.yml
# VERSION: 05.00.00
# VERSION: 09.22.00
# BRIEF: Pre-release build + update server XML for dev/alpha/beta/rc branches
#
# Thin wrapper around moko-platform CLI tools.
+1 -1
View File
@@ -1,7 +1,7 @@
{
"metadata": {
"generated_at": "2026-03-10T19:51:42.238134Z",
"repository": "mokoconsulting-tech/MokoStandards",
"repository": "MokoConsulting/moko-platform",
"version": "1.0.0"
},
"scripts": [
+3
View File
@@ -10,8 +10,11 @@ BRIEF: Release changelog
-->
# Changelog
## [Unreleased]
## [09.22.00] --- 2026-05-31
### Changed
- **refactor(cli):** migrate 64 legacy scripts to CliFramework (#235) — all tools in cli/, automation/, maintenance/, deploy/, release/ now extend CliFramework with free --help, --verbose, --quiet, --dry-run, --json, banners, and coloured logging
+3 -3
View File
@@ -2,8 +2,8 @@
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
SPDX-License-Identifier: GPL-3.0-or-later
FILE INFORMATION
DEFGROUP: MokoStandards.Root
INGROUP: MokoStandards
DEFGROUP: MokoPlatform.Root
INGROUP: MokoPlatform
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /PLUGIN_SCRIPTS.md
BRIEF: Plugin system CLI documentation
@@ -11,7 +11,7 @@ BRIEF: Plugin system CLI documentation
# Plugin System CLI Scripts
Command-line scripts for validating, health checking, and managing projects using the MokoStandards plugin system.
Command-line scripts for validating, health checking, and managing projects using the moko-platform plugin system.
## Available Scripts
+5 -5
View File
@@ -2,19 +2,19 @@
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
SPDX-License-Identifier: GPL-3.0-or-later
FILE INFORMATION
DEFGROUP: MokoStandards.Root
INGROUP: MokoStandards
DEFGROUP: MokoPlatform.Root
INGROUP: MokoPlatform
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /README.md
VERSION: 09.21.00
VERSION: 09.22.00
BRIEF: Project overview and documentation
-->
# MokoStandards Enterprise API
# moko-platform Enterprise API
![Version](https://img.shields.io/badge/version-09.01.00-blue) ![PHP](https://img.shields.io/badge/PHP-8.1%2B-777BB4) ![License](https://img.shields.io/badge/license-GPL--3.0--or--later-green)
PHP implementation of MokoStandards — enterprise standards, automation framework, workflow templates, and bulk sync tooling.
PHP implementation of moko-platform — enterprise standards, automation framework, workflow templates, and bulk sync tooling.
> **Primary platform**: [Gitea — git.mokoconsulting.tech](https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API)
> **Backup mirror**: [GitHub](https://github.com/MokoConsulting/MokoStandards-API) *(read-only mirror)*
+2 -2
View File
@@ -2,8 +2,8 @@
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
SPDX-License-Identifier: GPL-3.0-or-later
FILE INFORMATION
DEFGROUP: MokoStandards.Index
INGROUP: MokoStandards.Analysis
DEFGROUP: MokoPlatform.Index
INGROUP: MokoPlatform.Analysis
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /analysis/index.md
BRIEF: Analysis directory index
+5 -5
View File
@@ -9,8 +9,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Automation
* INGROUP: MokoStandards.Scripts
* DEFGROUP: MokoPlatform.Automation
* INGROUP: MokoPlatform.Scripts
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /automation/bulk_joomla_template.php
* BRIEF: Bulk scaffold and sync Joomla template repositories
@@ -42,7 +42,7 @@ use MokoEnterprise\{
*
* Provides three operations for Joomla template projects:
* --scaffold: Create a new template repository with the full directory structure
* --sync: Push MokoStandards files to existing template repositories
* --sync: Push moko-platform files to existing template repositories
* --list: List all repositories tagged as joomla-template
*
* Works with both GitHub and Gitea via the PlatformAdapterFactory.
@@ -50,7 +50,7 @@ use MokoEnterprise\{
class BulkJoomlaTemplate extends CliFramework
{
public const DEFAULT_ORG = 'MokoConsulting';
public const VERSION = '04.06.10';
public const VERSION = '09.22.00';
private GitPlatformAdapter $adapter;
private Config $config;
@@ -318,7 +318,7 @@ class BulkJoomlaTemplate extends CliFramework
$name,
$path,
$content,
"chore: update {$path} from MokoStandards",
"chore: update {$path} from moko-platform",
$existingSha,
$branch
);
+42 -42
View File
@@ -9,8 +9,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Automation
* INGROUP: MokoStandards.Scripts
* DEFGROUP: MokoPlatform.Automation
* INGROUP: MokoPlatform.Scripts
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /automation/bulk_sync.php
* BRIEF: Enterprise-grade bulk repository synchronization
@@ -42,7 +42,7 @@ use MokoEnterprise\{
/**
* Bulk Repository Synchronization Tool
*
* Synchronizes MokoStandards files across multiple repositories using
* Synchronizes moko-platform files across multiple repositories using
* the Enterprise library for robust, audited operations.
*/
class BulkSync extends CliFramework
@@ -57,7 +57,7 @@ class BulkSync extends CliFramework
* Script version number
* Public to allow script instantiation with class constants
*/
public const VERSION = '04.06.00';
public const VERSION = '09.22.00';
public const VERSION_MINOR = '04.05';
private ApiClient $api;
@@ -95,7 +95,7 @@ class BulkSync extends CliFramework
*/
protected function run(): int
{
$this->log("🚀 MokoStandards Bulk Synchronization v" . self::VERSION, 'INFO');
$this->log("🚀 moko-platform Bulk Synchronization v" . self::VERSION, 'INFO');
// Initialize enterprise components
if (!$this->initializeComponents()) {
@@ -180,7 +180,7 @@ class BulkSync extends CliFramework
$results['health'] = $this->runHealthChecksAll($org, $repositories);
}
// Create/update tracking issue in MokoStandards
// Create/update tracking issue in moko-platform
$this->createSyncIssue($org, $results);
// Create/update a failure issue when any repos failed
@@ -244,7 +244,7 @@ class BulkSync extends CliFramework
* Filter repositories based on include/exclude lists
*/
/** Repositories that are permanently excluded from bulk sync. */
private const ALWAYS_EXCLUDE = ['MokoStandards', '.github-private'];
private const ALWAYS_EXCLUDE = ['moko-platform', '.github-private'];
private function filterRepositories(array $repositories, array $include, array $exclude): array
{
@@ -426,7 +426,7 @@ class BulkSync extends CliFramework
$this->log("", 'ERROR');
$this->log("Required Implementation:", 'ERROR');
$this->log(" 1. Clone/fetch target repository", 'ERROR');
$this->log(" 2. Apply file updates based on MokoStandards configuration", 'ERROR');
$this->log(" 2. Apply file updates based on moko-platform configuration", 'ERROR');
$this->log(" 3. Create pull request with changes", 'ERROR');
$this->log(" 4. Handle merge conflicts and validation", 'ERROR');
$this->log("", 'ERROR');
@@ -837,7 +837,7 @@ class BulkSync extends CliFramework
}
/**
* Ensure all standard MokoStandards labels exist on a target repository.
* Ensure all standard moko-platform labels exist on a target repository.
*
* Fetches existing labels first (GET) and only POSTs the ones that are
* missing. This avoids the 422 "already exists" responses that would
@@ -872,7 +872,7 @@ class BulkSync extends CliFramework
// Workflow / Process
['automation', '8B4513', 'Automated processes or scripts'],
['mokostandards', 'B60205', 'MokoStandards compliance'],
['moko-platform', 'B60205', 'moko-platform compliance'],
['needs-review', 'FBCA04', 'Awaiting code review'],
['work-in-progress', 'D93F0B', 'Work in progress, not ready for merge'],
['breaking-change', 'D73A4A', 'Breaking API or functionality change'],
@@ -912,8 +912,8 @@ class BulkSync extends CliFramework
['health: poor', 'FF6B6B', 'Health score below 50'],
// Sync / Automation (used by bulk_sync, scan_drift, check_repo_health)
['standards-update', 'B60205', 'MokoStandards sync update'],
['standards-drift', 'FBCA04', 'Repository drifted from MokoStandards'],
['standards-update', 'B60205', 'moko-platform sync update'],
['standards-drift', 'FBCA04', 'Repository drifted from moko-platform'],
['sync-report', '0075CA', 'Bulk sync run report'],
['sync-failure', 'D73A4A', 'Bulk sync failure requiring attention'],
['push-failure', 'D73A4A', 'File push failure requiring attention'],
@@ -925,10 +925,10 @@ class BulkSync extends CliFramework
['type: version', '0E8A16', 'Version-related change'],
];
// Quick check: if the repo already has the 'mokostandards' label, it was
// Quick check: if the repo already has the 'moko-platform' label, it was
// provisioned previously — skip the expensive full label provisioning.
try {
$probe = $this->api->get("/repos/{$org}/{$repo}/labels/mokostandards");
$probe = $this->api->get("/repos/{$org}/{$repo}/labels/moko-platform");
if (!empty($probe['name'])) {
return; // already provisioned
}
@@ -1024,7 +1024,7 @@ class BulkSync extends CliFramework
*/
private function updateOpenBranches(string $org, string $repo): void
{
$syncBranchPrefix = 'chore/sync-mokostandards-';
$syncBranchPrefix = 'chore/sync-moko-platform-';
try {
$defaultBranch = 'main';
@@ -1055,7 +1055,7 @@ class BulkSync extends CliFramework
$this->api->post("/repos/{$org}/{$repo}/merges", [
'base' => $branch,
'head' => $defaultBranch,
'commit_message' => "chore: merge {$defaultBranch} into {$branch} (MokoStandards sync)",
'commit_message' => "chore: merge {$defaultBranch} into {$branch} (moko-platform sync)",
]);
$this->log(" 🔀 Merged {$defaultBranch}{$branch} (PR #{$prNum})", 'INFO');
} catch (\Exception $e) {
@@ -1076,7 +1076,7 @@ class BulkSync extends CliFramework
/**
* Records which sync run touched the repo, the PR number, and the
* MokoStandards version that was applied — giving each repo a clear audit
* moko-platform version that was applied — giving each repo a clear audit
* trail of what was changed and why.
*/
/**
@@ -1119,16 +1119,16 @@ class BulkSync extends CliFramework
$minor = self::VERSION_MINOR;
$force = isset($this->options['force']) ? ' *(--force)*' : '';
$prLink = $this->adapter->getPullRequestWebUrl($org, $repo, $prNumber);
$source = $this->adapter->getRepoWebUrl($org, 'MokoStandards');
$branchName = 'chore/sync-mokostandards-v' . $minor;
$source = $this->adapter->getRepoWebUrl($org, 'moko-platform');
$branchName = 'chore/sync-moko-platform-v' . $minor;
$branchLink = $this->adapter->getBranchWebUrl($org, $repo, $branchName);
$title = "chore: MokoStandards v{$minor} sync tracking";
$title = "chore: moko-platform v{$minor} sync tracking";
$body = <<<MD
## MokoStandards Sync Applied
## moko-platform Sync Applied
A MokoStandards bulk sync run has updated files in this repository.
A moko-platform bulk sync run has updated files in this repository.
| Field | Value |
|-------|-------|
@@ -1144,13 +1144,13 @@ class BulkSync extends CliFramework
Protected files (README, CHANGELOG, GOVERNANCE, etc.) were not overwritten.
---
*Updated automatically by [MokoStandards]({$source}) `bulk_sync.php`*
*Updated automatically by [moko-platform]({$source}) `bulk_sync.php`*
MD;
// Dedent heredoc
$body = preg_replace('/^ /m', '', $body);
$labelNames = ['standards-update', 'mokostandards', 'type: chore', 'automation'];
$labelNames = ['standards-update', 'moko-platform', 'type: chore', 'automation'];
$labels = $this->resolveLabelIds($org, $repo, $labelNames);
try {
@@ -1213,7 +1213,7 @@ class BulkSync extends CliFramework
}
/**
* Create a tracking issue in MokoStandards for this sync run.
* Create a tracking issue in moko-platform for this sync run.
*/
private function createSyncIssue(string $org, array $results): void
{
@@ -1232,7 +1232,7 @@ class BulkSync extends CliFramework
$issues = $results['issues'] ?? [];
// Stable title — no timestamp so repeated runs update a single issue
$title = "sync: MokoStandards v" . self::VERSION_MINOR . " bulk sync report";
$title = "sync: moko-platform v" . self::VERSION_MINOR . " bulk sync report";
$protection = $results['protection'] ?? [];
$hasProtect = !empty($protection);
@@ -1281,7 +1281,7 @@ class BulkSync extends CliFramework
: "|---|---|---|---|";
$body = <<<MD
## MokoStandards Bulk Sync Report
## moko-platform Bulk Sync Report
**Organisation:** `{$org}`
**Triggered:** {$now}{$force}
@@ -1301,7 +1301,7 @@ class BulkSync extends CliFramework
try {
// Search for existing issue by label — any state so we can reopen closed ones
$existing = $this->api->get("/repos/{$org}/MokoStandards/issues", [
$existing = $this->api->get("/repos/{$org}/moko-platform/issues", [
'labels' => 'sync-report',
'state' => 'all',
'per_page' => 1,
@@ -1309,8 +1309,8 @@ class BulkSync extends CliFramework
'direction' => 'desc',
]);
$labelNames = ['sync-report', 'mokostandards', 'type: chore', 'automation'];
$labels = $this->resolveLabelIds($org, 'MokoStandards', $labelNames);
$labelNames = ['sync-report', 'moko-platform', 'type: chore', 'automation'];
$labels = $this->resolveLabelIds($org, 'moko-platform', $labelNames);
$existing = array_values($existing);
if (!empty($existing) && isset($existing[0]['number'])) {
@@ -1319,22 +1319,22 @@ class BulkSync extends CliFramework
if (($existing[0]['state'] ?? 'open') === 'closed') {
$patch['state'] = 'open';
}
$this->api->patch("/repos/{$org}/MokoStandards/issues/{$issueNumber}", $patch);
$this->api->patch("/repos/{$org}/moko-platform/issues/{$issueNumber}", $patch);
try {
$this->api->post("/repos/{$org}/MokoStandards/issues/{$issueNumber}/labels", ['labels' => $labels]);
$this->api->post("/repos/{$org}/moko-platform/issues/{$issueNumber}/labels", ['labels' => $labels]);
} catch (\Exception $le) {
/* non-fatal */
}
$this->log("📋 Sync report issue updated: {$org}/MokoStandards#{$issueNumber}", 'INFO');
$this->log("📋 Sync report issue updated: {$org}/moko-platform#{$issueNumber}", 'INFO');
} else {
$issue = $this->api->post("/repos/{$org}/MokoStandards/issues", [
$issue = $this->api->post("/repos/{$org}/moko-platform/issues", [
'title' => $title,
'body' => $body,
'labels' => $labels,
'assignees' => ['jmiller'],
]);
$issueNumber = $issue['number'] ?? '?';
$this->log("📋 Sync report issue created: {$org}/MokoStandards#{$issueNumber}", 'INFO');
$this->log("📋 Sync report issue created: {$org}/moko-platform#{$issueNumber}", 'INFO');
}
} catch (\Exception $e) {
$this->log("⚠️ Failed to create/update sync report issue: " . $e->getMessage(), 'WARN');
@@ -1342,7 +1342,7 @@ class BulkSync extends CliFramework
}
/**
* Create or update a failure issue in MokoStandards when repos fail to sync.
* Create or update a failure issue in moko-platform when repos fail to sync.
* Uses the 'sync-failure' label so it is distinct from the run-report issue.
* Reopens a closed issue rather than creating a duplicate.
*/
@@ -1388,7 +1388,7 @@ class BulkSync extends CliFramework
$body = preg_replace('/^ /m', '', $body);
try {
$existing = $this->api->get("/repos/{$org}/MokoStandards/issues", [
$existing = $this->api->get("/repos/{$org}/moko-platform/issues", [
'labels' => 'sync-failure',
'state' => 'all',
'per_page' => 1,
@@ -1403,17 +1403,17 @@ class BulkSync extends CliFramework
if (($existing[0]['state'] ?? 'open') === 'closed') {
$patch['state'] = 'open';
}
$this->api->patch("/repos/{$org}/MokoStandards/issues/{$num}", $patch);
$this->log("🚨 Failure issue #{$num} updated: {$org}/MokoStandards#{$num}", 'WARN');
$this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch);
$this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN');
} else {
$issue = $this->api->post("/repos/{$org}/MokoStandards/issues", [
$issue = $this->api->post("/repos/{$org}/moko-platform/issues", [
'title' => $title,
'body' => $body,
'labels' => $this->resolveLabelIds($org, 'MokoStandards', ['sync-failure']),
'labels' => $this->resolveLabelIds($org, 'moko-platform', ['sync-failure']),
'assignees' => ['jmiller'],
]);
$num = $issue['number'] ?? '?';
$this->log("🚨 Failure issue created: {$org}/MokoStandards#{$num}", 'WARN');
$this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN');
}
} catch (\Exception $e) {
$this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN');
+2 -2
View File
@@ -2,8 +2,8 @@
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
SPDX-License-Identifier: GPL-3.0-or-later
FILE INFORMATION
DEFGROUP: MokoStandards.Index
INGROUP: MokoStandards.Automation
DEFGROUP: MokoPlatform.Index
INGROUP: MokoPlatform.Automation
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /automation/index.md
BRIEF: Automation directory index
+4 -4
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Automation
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Automation
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /automation/migrate_to_gitea.php
* BRIEF: Migrate repositories from GitHub to self-hosted Gitea instance
@@ -17,7 +17,7 @@
* USAGE
* php automation/migrate_to_gitea.php --dry-run
* php automation/migrate_to_gitea.php --repos MokoCRM MokoDoliMods
* php automation/migrate_to_gitea.php --exclude MokoStandards --skip-archived
* php automation/migrate_to_gitea.php --exclude moko-platform --skip-archived
* php automation/migrate_to_gitea.php --resume
*/
@@ -278,7 +278,7 @@ class MigrateToGitea extends CliFramework
try {
$this->gitea->createIssue(
$giteaOrg,
'MokoStandards',
'moko-platform',
'chore: GitHub → Gitea migration report — ' . count($results['migrated']) . ' repos migrated',
$report,
['labels' => ['automation', 'type: chore']]
+22 -22
View File
@@ -9,8 +9,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Automation
* INGROUP: MokoStandards.Scripts
* DEFGROUP: MokoPlatform.Automation
* INGROUP: MokoPlatform.Scripts
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /automation/push_files.php
* BRIEF: Push one or more specific files to one or more remote repositories
@@ -35,7 +35,7 @@ use MokoEnterprise\{
/**
* Targeted File Push Tool
*
* Pushes one or more specific files from MokoStandards templates to one or
* Pushes one or more specific files from moko-platform templates to one or
* more remote repositories — without running a full sync.
*
* Files are specified by their destination path as they appear in the target
@@ -53,7 +53,7 @@ use MokoEnterprise\{
class PushFiles extends CliFramework
{
public const DEFAULT_ORG = 'MokoConsulting';
public const VERSION = '04.06.00';
public const VERSION = '09.22.00';
private ApiClient $api;
private GitPlatformAdapter $adapter;
@@ -81,7 +81,7 @@ class PushFiles extends CliFramework
*/
protected function run(): int
{
$this->log('📦 MokoStandards File Push v' . self::VERSION, 'INFO');
$this->log('📦 moko-platform File Push v' . self::VERSION, 'INFO');
if (!$this->initializeComponents()) {
return 1;
@@ -336,7 +336,7 @@ class PushFiles extends CliFramework
$prNumber = null;
if (!$direct) {
$prTitle = "chore: push " . count($entries) . " file(s) from MokoStandards";
$prTitle = "chore: push " . count($entries) . " file(s) from moko-platform";
$prBody = $this->buildPRBody($entries);
$pr = $this->adapter->createPullRequest(
$org,
@@ -413,7 +413,7 @@ class PushFiles extends CliFramework
$message = !empty($customMessage)
? $customMessage
: "chore: update {$destPath} from MokoStandards";
: "chore: update {$destPath} from moko-platform";
// Fetch existing file SHA (needed for updates)
$existingSha = null;
@@ -456,9 +456,9 @@ class PushFiles extends CliFramework
): void {
$now = gmdate('Y-m-d H:i:s') . ' UTC';
$version = self::VERSION;
$source = $this->adapter->getRepoWebUrl($org, 'MokoStandards');
$source = $this->adapter->getRepoWebUrl($org, 'moko-platform');
$title = "chore: MokoStandards file push tracking";
$title = "chore: moko-platform file push tracking";
$deliveryLine = $prNumber !== null
? "| **Pull request** | [#{$prNumber}](" . $this->adapter->getPullRequestWebUrl($org, $repo, $prNumber) . ") |"
@@ -470,9 +470,9 @@ class PushFiles extends CliFramework
));
$body = <<<MD
## MokoStandards File Push
## moko-platform File Push
One or more files were pushed to this repository from MokoStandards.
One or more files were pushed to this repository from moko-platform.
| Field | Value |
|-------|-------|
@@ -486,12 +486,12 @@ class PushFiles extends CliFramework
{$fileRows}
---
*Generated automatically by [MokoStandards]({$source}) `push_files.php`*
*Generated automatically by [moko-platform]({$source}) `push_files.php`*
MD;
$body = preg_replace('/^ /m', '', $body);
$labels = ['standards-update', 'mokostandards', 'type: chore', 'automation'];
$labels = ['standards-update', 'moko-platform', 'type: chore', 'automation'];
try {
$existing = $this->api->get("/repos/{$org}/{$repo}/issues", [
@@ -549,7 +549,7 @@ class PushFiles extends CliFramework
}
/**
* Create or update a failure issue in MokoStandards when repos fail to receive files.
* Create or update a failure issue in moko-platform when repos fail to receive files.
* Uses the 'push-failure' label. Reopens a closed issue rather than creating a duplicate.
*/
private function createFailureIssue(string $org, array $results): void
@@ -597,7 +597,7 @@ class PushFiles extends CliFramework
$body = preg_replace('/^ /m', '', $body);
try {
$existing = $this->api->get("/repos/{$org}/MokoStandards/issues", [
$existing = $this->api->get("/repos/{$org}/moko-platform/issues", [
'labels' => 'push-failure',
'state' => 'all',
'per_page' => 1,
@@ -612,17 +612,17 @@ class PushFiles extends CliFramework
if (($existing[0]['state'] ?? 'open') === 'closed') {
$patch['state'] = 'open';
}
$this->api->patch("/repos/{$org}/MokoStandards/issues/{$num}", $patch);
$this->log("🚨 Failure issue #{$num} updated: {$org}/MokoStandards#{$num}", 'WARN');
$this->api->patch("/repos/{$org}/moko-platform/issues/{$num}", $patch);
$this->log("🚨 Failure issue #{$num} updated: {$org}/moko-platform#{$num}", 'WARN');
} else {
$issue = $this->api->post("/repos/{$org}/MokoStandards/issues", [
$issue = $this->api->post("/repos/{$org}/moko-platform/issues", [
'title' => $title,
'body' => $body,
'labels' => ['push-failure'],
'assignees' => ['jmiller'],
]);
$num = $issue['number'] ?? '?';
$this->log("🚨 Failure issue created: {$org}/MokoStandards#{$num}", 'WARN');
$this->log("🚨 Failure issue created: {$org}/moko-platform#{$num}", 'WARN');
}
} catch (\Exception $e) {
$this->log("⚠️ Could not create/update failure issue: " . $e->getMessage(), 'WARN');
@@ -637,14 +637,14 @@ class PushFiles extends CliFramework
private function buildPRBody(array $entries): string
{
$now = gmdate('Y-m-d H:i:s') . ' UTC';
$lines = ["## MokoStandards File Push\n", "**Pushed:** {$now}\n", '### Files\n'];
$lines = ["## moko-platform File Push\n", "**Pushed:** {$now}\n", '### Files\n'];
foreach ($entries as $entry) {
$lines[] = "- `{$entry['destination']}`";
}
$sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'MokoStandards');
$lines[] = "\n---\n*Generated by [MokoStandards]({$sourceUrl}) `push_files.php`*";
$sourceUrl = $this->adapter->getRepoWebUrl(self::DEFAULT_ORG, 'moko-platform');
$lines[] = "\n---\n*Generated by [moko-platform]({$sourceUrl}) `push_files.php`*";
return implode("\n", $lines);
}
+12 -12
View File
@@ -9,8 +9,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Automation
* INGROUP: MokoStandards.Scripts
* DEFGROUP: MokoPlatform.Automation
* INGROUP: MokoPlatform.Scripts
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /automation/repo_cleanup.php
* BRIEF: Enterprise repository cleanup — branches, PRs, issues, workflows, labels, logs
@@ -38,15 +38,15 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework, Config, GitPlatformAda
*/
class RepoCleanup extends CliFramework
{
private const VERSION = '04.06.00';
private const SYNC_PREFIX = 'chore/sync-mokostandards-';
private const CURRENT_BRANCH = 'chore/sync-mokostandards-v04.02.00';
private const VERSION = '09.22.00';
private const SYNC_PREFIX = 'chore/sync-moko-platform-';
private const CURRENT_BRANCH = 'chore/sync-moko-platform-v04.02.00';
/** Workflow files that have been retired and should be deleted from governed repos. */
private const RETIRED_WORKFLOWS = [
'build.yml', 'code-quality.yml', 'release-cycle.yml', 'release-pipeline.yml',
'branch-cleanup.yml', 'auto-update-changelog.yml', 'enterprise-issue-manager.yml',
'flush-actions-cache.yml', 'mokostandards-script-runner.yml', 'unified-ci.yml',
'flush-actions-cache.yml', 'moko-platform-script-runner.yml', 'unified-ci.yml',
'unified-platform-testing.yml', 'reusable-build.yml', 'reusable-ci-validation.yml',
'reusable-deploy.yml', 'reusable-php-quality.yml', 'reusable-platform-testing.yml',
'reusable-project-detector.yml', 'reusable-release.yml', 'reusable-script-executor.yml',
@@ -98,7 +98,7 @@ class RepoCleanup extends CliFramework
}
$this->logMsg("🧹 MokoStandards Repository Cleanup v" . self::VERSION);
$this->logMsg("🧹 moko-platform Repository Cleanup v" . self::VERSION);
$this->logMsg("Organization: {$org}");
$this->logMsg("Current sync branch: " . self::CURRENT_BRANCH);
if ($this->dryRun) {
@@ -225,7 +225,7 @@ class RepoCleanup extends CliFramework
}
$allRepos = $this->adapter->listOrgRepos($org, $skipArchived);
return array_filter($allRepos, fn($r) => !in_array($r['name'], ['MokoStandards', '.github-private'], true));
return array_filter($allRepos, fn($r) => !in_array($r['name'], ['moko-platform', '.github-private'], true));
}
// ─── Cleanup operations ──────────────────────────────────────────────
@@ -463,9 +463,9 @@ class RepoCleanup extends CliFramework
private function checkLabels(string $org, string $repo, array &$results): void
{
try {
$this->api->get("/repos/{$org}/{$repo}/labels/mokostandards");
$this->api->get("/repos/{$org}/{$repo}/labels/moko-platform");
} catch (\Exception $e) {
$this->logMsg(" ⚠️ Missing 'mokostandards' label");
$this->logMsg(" ⚠️ Missing 'moko-platform' label");
$results['labels_missing']++;
$this->api->resetCircuitBreaker();
}
@@ -479,9 +479,9 @@ class RepoCleanup extends CliFramework
if (preg_match('/^\s*VERSION:\s*(\d{2}\.\d{2}\.\d{2})/m', $content, $m)) {
$version = $m[1];
// Check .mokostandards for the tracked MokoStandards version
// Check manifest.xml for the tracked moko-platform version
try {
$mokoFile = $this->api->get("/repos/{$org}/{$repo}/contents/.mokostandards");
$mokoFile = $this->api->get("/repos/{$org}/{$repo}/contents/.mokogitea/manifest.xml");
$mokoContent = base64_decode($mokoFile['content'] ?? '');
if (preg_match('/standards_version:\s*(\d{2}\.\d{2}\.\d{2})/m', $mokoContent, $vm)) {
if ($vm[1] !== self::VERSION) {
+2 -2
View File
@@ -4,8 +4,8 @@
# Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
# SPDX-License-Identifier: GPL-3.0-or-later
#
# DEFGROUP: MokoStandards.Automation.ServerAutoheal
# INGROUP: MokoStandards.Automation
# DEFGROUP: MokoPlatform.Automation.ServerAutoheal
# INGROUP: MokoPlatform.Automation
# REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
# PATH: /automation/server-autoheal.sh
# BRIEF: Server auto-heal on unclean restart + split system/content backups
+108 -37
View File
@@ -19,26 +19,22 @@
* php bin/moko <command> [options] (all platforms)
* ./bin/moko <command> [options] (Unix, after: chmod +x bin/moko)
*
* COMMANDS
* sync Bulk-sync MokoStandards to organisation repos
* health Full repository health check (runs most validators)
* inventory Refresh docs/reference/REPOSITORY_INVENTORY.md
* COMMANDS (run `php bin/moko list` for the full list — 97 commands)
*
* check:syntax PHP syntax check (php -l) on all tracked .php files
* check:version Verify VERSION fields and badges match composer.json
* check:changelog Validate CHANGELOG.md format
* check:structure Verify required root files and directories
* check:headers Check SPDX-License-Identifier presence in source files
* check:secrets Scan for leaked credentials / API keys
* check:tabs Detect tab characters in YAML files
* check:paths Detect backslash path separators in PHP source
* check:xml Validate XML files are well-formed
* check:enterprise Full enterprise-readiness check (headers, strict types, PSR-12)
* check:dolibarr Validate Dolibarr module directory structure
* check:joomla Validate Joomla XML manifest
* check:language Validate Joomla/Dolibarr .ini language files
* detect Auto-detect repository platform type
* drift Scan org repos for drift from MokoStandards templates
* Automation sync, automation:cleanup, automation:migrate-gitea
* Validation health, detect, drift, check:syntax, check:version, ...
* Release release, release:joomla, release:create, release:publish, ...
* Version version:read, version:bump, version:auto-bump, ...
* Build build:package, build:joomla, build:updates-xml, ...
* Deploy deploy:joomla, deploy:dolibarr, deploy:sftp, deploy:rollback, ...
* Repository repo:create, repo:archive, repo:rename-branch, repo:reset-dev, ...
* Bulk Operations bulk:push-workflow, bulk:push-manifest, bulk:template-joomla, ...
* Maintenance maintenance:labels, maintenance:rotate-secrets, maintenance:pin-shas, ...
* Fix fix:line-endings, fix:tabs, fix:trailing, fix:permissions
* Monitoring dashboard, grafana, client:inventory, client:health-check
* Platform platform:detect, manifest:read, manifest:element
* Wiki wiki:sync
* Badges badge:update
*
* COMMON OPTIONS (passed through to each script)
* --path <dir> Repository root to check (default: .)
@@ -89,10 +85,18 @@ require_once $autoloader;
*/
const COMMAND_MAP = [
// Automation
'sync' => 'automation/bulk_sync.php',
'sync' => 'automation/bulk_sync.php',
'automation:cleanup' => 'automation/repo_cleanup.php',
'automation:migrate-gitea' => 'automation/migrate_to_gitea.php',
// Maintenance
'inventory' => 'maintenance/update_repo_inventory.php',
'inventory' => 'maintenance/update_repo_inventory.php',
'maintenance:pin-shas' => 'maintenance/pin_action_shas.php',
'maintenance:inventory' => 'maintenance/repo_inventory.php',
'maintenance:rotate-secrets' => 'maintenance/rotate_secrets.php',
'maintenance:labels' => 'maintenance/setup_labels.php',
'maintenance:sync-dolibarr' => 'maintenance/sync_dolibarr_readmes.php',
'maintenance:update-shas' => 'maintenance/update_sha_hashes.php',
// Validation — general
'health' => 'validate/check_repo_health.php',
@@ -108,11 +112,13 @@ const COMMAND_MAP = [
'check:enterprise' => 'validate/check_enterprise_readiness.php',
// Validation — platform-specific
'check:dolibarr' => 'validate/check_dolibarr_module.php',
'check:joomla' => 'validate/check_joomla_manifest.php',
'check:language' => 'validate/check_language_structure.php',
'check:client' => 'validate/check_client_theme.php',
'check:wiki' => 'validate/check_wiki_health.php',
'check:dolibarr' => 'validate/check_dolibarr_module.php',
'check:joomla' => 'validate/check_joomla_manifest.php',
'check:joomla-compat' => 'cli/joomla_compat_check.php',
'check:language' => 'validate/check_language_structure.php',
'check:client' => 'validate/check_client_theme.php',
'check:theme' => 'cli/theme_lint.php',
'check:wiki' => 'validate/check_wiki_health.php',
// Detection
'detect' => 'validate/auto_detect_platform.php',
@@ -124,13 +130,18 @@ const COMMAND_MAP = [
'release' => 'cli/release.php',
'release:notes' => 'cli/release_notes.php',
'release:validate' => 'cli/release_validate.php',
'manifest:element' => 'cli/manifest_element.php',
'release:cascade' => 'cli/release_cascade.php',
'release:promote' => 'cli/release_promote.php',
'release:create' => 'cli/release_create.php',
'release:manage' => 'cli/release_manage.php',
'release:mirror' => 'cli/release_mirror.php',
'release:package' => 'cli/release_package.php',
'release:joomla' => 'cli/joomla_release.php',
'release:body-update' => 'cli/release_body_update.php',
'release:publish' => 'cli/release_publish.php',
'release:verify' => 'cli/release_verify.php',
'release:gen-dolibarr' => 'release/generate_dolibarr_version_txt.php',
'release:gen-joomla' => 'release/generate_joomla_update_xml.php',
// Changelog
'changelog:promote' => 'cli/changelog_promote.php',
@@ -143,31 +154,71 @@ const COMMAND_MAP = [
'version:propagate' => 'maintenance/update_version_from_readme.php',
'version:set-platform' => 'cli/version_set_platform.php',
'version:reset-dev' => 'cli/version_reset_dev.php',
'version:auto-bump' => 'cli/version_auto_bump.php',
'version:bump-remote' => 'cli/version_bump_remote.php',
// Build & package
'build:package' => 'cli/package_build.php',
'build:joomla' => 'cli/joomla_build.php',
'build:updates-xml' => 'cli/updates_xml_build.php',
'build:package' => 'cli/package_build.php',
'build:joomla' => 'cli/joomla_build.php',
'build:updates-xml' => 'cli/updates_xml_build.php',
'build:updates-xml-sync' => 'cli/updates_xml_sync.php',
// Platform detection
// Platform detection & manifest
'platform:detect' => 'cli/platform_detect.php',
'manifest:read' => 'cli/manifest_read.php',
'manifest:element' => 'cli/manifest_element.php',
// Repository management
'repo:create' => 'cli/create_repo.php',
'repo:create-project' => 'cli/create_project.php',
'repo:archive' => 'cli/archive_repo.php',
'repo:scaffold-client' => 'cli/scaffold_client.php',
'repo:provision' => 'cli/client_provision.php',
'repo:rename-branch' => 'cli/branch_rename.php',
'repo:reset-dev' => 'cli/dev_branch_reset.php',
// Bulk operations
'bulk:push-workflow' => 'cli/bulk_workflow_push.php',
'bulk:trigger' => 'cli/bulk_workflow_trigger.php',
'bulk:sync-rulesets' => 'cli/sync_rulesets.php',
'bulk:push-workflow' => 'cli/bulk_workflow_push.php',
'bulk:trigger' => 'cli/bulk_workflow_trigger.php',
'bulk:sync-rulesets' => 'cli/sync_rulesets.php',
'bulk:push-files' => 'automation/push_files.php',
'bulk:push-manifest' => 'automation/push_manifest_xml.php',
'bulk:push-mokostandards' => 'automation/push_mokostandards_xml.php',
'bulk:enrich-manifest' => 'automation/enrich_manifest_xml.php',
'bulk:enrich-mokostandards' => 'automation/enrich_mokostandards_xml.php',
'bulk:template-joomla' => 'automation/bulk_joomla_template.php',
// Deploy
'deploy:joomla' => 'cli/deploy_joomla.php',
'deploy:joomla-legacy' => 'deploy/deploy-joomla.php',
'deploy:dolibarr' => 'deploy/deploy-dolibarr.php',
'deploy:sftp' => 'deploy/deploy-sftp.php',
'deploy:backup' => 'deploy/backup-before-deploy.php',
'deploy:health-check' => 'deploy/health-check.php',
'deploy:rollback' => 'deploy/rollback-joomla.php',
'deploy:sync' => 'deploy/sync-joomla.php',
// Fix / auto-remediation
'fix:line-endings' => 'fix/fix_line_endings.php',
'fix:tabs' => 'fix/fix_tabs.php',
'fix:trailing' => 'fix/fix_trailing_spaces.php',
'fix:permissions' => 'fix/fix_permissions.php',
// Monitoring & dashboards
'dashboard' => 'cli/client_dashboard.php',
'grafana' => 'cli/grafana_dashboard.php',
'client:inventory' => 'cli/client_inventory.php',
'client:health-check' => 'cli/client_health_check.php',
// Badge & wiki
'badge:update' => 'cli/badge_update.php',
'wiki:sync' => 'cli/wiki_sync.php',
// Licensing
'license' => 'cli/license_manage.php',
// Shell completion
'completion' => 'cli/completion.php',
// Module validation
'validate:module' => 'bin/validate-module',
@@ -197,16 +248,28 @@ if ($command === 'list' || $command === 'commands') {
// ── Dispatch ──────────────────────────────────────────────────────────────────
if (!array_key_exists($command, COMMAND_MAP)) {
$scriptRelative = null;
if (array_key_exists($command, COMMAND_MAP)) {
$scriptRelative = COMMAND_MAP[$command];
} else {
// Fall back to plugin-provided commands before giving up.
$pluginCommands = loadPluginCommands();
if (isset($pluginCommands[$command]) && !empty($pluginCommands[$command]['script'])) {
$scriptRelative = $pluginCommands[$command]['script'];
}
}
if ($scriptRelative === null) {
fwrite(STDERR, "Error: Unknown command '{$command}'\n\n");
printCommandList();
exit(2);
}
$scriptPath = $repoRoot . '/' . COMMAND_MAP[$command];
$scriptPath = $repoRoot . '/' . $scriptRelative;
if (!is_file($scriptPath)) {
fwrite(STDERR, "Error: Script not found: " . COMMAND_MAP[$command] . "\n");
fwrite(STDERR, "Error: Script not found: {$scriptRelative}\n");
fwrite(STDERR, "Ensure the repository is complete and run: composer install\n");
exit(2);
}
@@ -268,6 +331,12 @@ function printCommandList(): void
'bulk' => 'Bulk Operations',
'client' => 'Client Management',
'validate' => 'Module Validation',
'deploy' => 'Deploy',
'fix' => 'Fix / Auto-remediation',
'maintenance' => 'Maintenance',
'automation' => 'Automation',
'badge' => 'Badges',
'wiki' => 'Wiki',
default => ucfirst($prefix),
};
} else {
@@ -277,6 +346,8 @@ function printCommandList(): void
'health' => 'Validation',
'detect', 'drift' => 'Validation',
'dashboard', 'grafana' => 'Monitoring',
'release' => 'Release',
'license' => 'Licensing',
default => 'Other',
};
}
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/branch_rename.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Rename a git branch via Gitea API (create new, update PR, delete old)
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/bulk_workflow_push.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Push a workflow file to all governed repos via the Gitea Contents API
*/
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/bulk_workflow_trigger.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Trigger a workflow across multiple repos at once
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/client_dashboard.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Generate unified client dashboard HTML
*/
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/client_inventory.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Discover and list all client-waas repos with their server configuration status
*/
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/client_provision.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Provision a new client environment end-to-end
*/
File diff suppressed because it is too large Load Diff
+1 -1
View File
@@ -12,7 +12,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/grafana_dashboard.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Manage Grafana dashboards via API
*/
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/joomla_build.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Build a Joomla extension ZIP from manifest — all types supported
* NOTE: Called by pre-release and auto-release workflows.
*/
+2 -2
View File
@@ -36,7 +36,7 @@ use MokoEnterprise\{ApiClient, AuditLogger, CliFramework, Config, PlatformAdapte
*/
class JoomlaRelease extends CliFramework
{
private const VERSION = '04.06.00';
private const VERSION = '09.22.00';
private const ORG = 'MokoConsulting';
private const STABILITY_TAGS = [
@@ -379,7 +379,7 @@ class JoomlaRelease extends CliFramework
$this->api->post("/repos/{$repo}/releases", [
'tag_name' => $tag,
'name' => $releaseName,
'body' => "## {$version}\n\nCreated by MokoStandards release pipeline.",
'body' => "## {$version}\n\nCreated by moko-platform release pipeline.",
'prerelease' => ($stability !== 'stable'),
]);
}
+683
View File
@@ -0,0 +1,683 @@
#!/usr/bin/env php
<?php
/* Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: moko-platform.CLI
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/license_manage.php
* BRIEF: Manage license packages and keys via MokoGitea licensing API
*
* Usage:
* php bin/moko license:list --org MokoConsulting
* php bin/moko license:create-package --org MokoConsulting --name "Pro Annual" --duration 365 --max-sites 5
* php bin/moko license:issue --org MokoConsulting --package-id 1 --licensee "Client Inc" --email client@example.com
* php bin/moko license:revoke --org MokoConsulting --key-id 42
* php bin/moko license:renew --org MokoConsulting --key-id 42 --days 365
* php bin/moko license:validate --key MOKO-ABCD-1234-EF56-7890 --domain example.com
* php bin/moko license:usage --org MokoConsulting --key-id 42
* php bin/moko license:master-key --org MokoConsulting
*/
declare(strict_types=1);
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
use MokoEnterprise\CliFramework;
class LicenseManage extends CliFramework
{
private string $apiBase = '';
private string $token = '';
private string $subcommand = '';
protected function configure(): void
{
$this->setDescription('Manage license packages and keys via MokoGitea licensing API');
$this->addArgument('--org', 'Organization name', '');
$this->addArgument('--api-base', 'Gitea API base URL', '');
$this->addArgument('--token', 'API token (or set GH_TOKEN env)', '');
// Package args
$this->addArgument('--name', 'Package name (for create-package)', '');
$this->addArgument('--description', 'Package description', '');
$this->addArgument('--duration', 'Duration in days (0 = lifetime)', '0');
$this->addArgument('--max-sites', 'Max sites per key (0 = unlimited)', '0');
$this->addArgument('--repo-scope', 'Repo scope: all or comma-separated repo IDs', 'all');
$this->addArgument('--channels', 'Allowed channels: JSON array or comma-separated', '');
// Key args
$this->addArgument('--package-id', 'License package ID', '');
$this->addArgument('--key-id', 'License key ID', '');
$this->addArgument('--key', 'Raw license key string (for validate)', '');
$this->addArgument('--licensee', 'Licensee name', '');
$this->addArgument('--email', 'Licensee email', '');
$this->addArgument('--domain', 'Domain restriction or validation domain', '');
$this->addArgument('--domains', 'Comma-separated allowed domains', '');
$this->addArgument('--payment-ref', 'Payment reference (idempotency key)', '');
$this->addArgument('--days', 'Days to extend (for renew)', '365');
$this->addArgument('--custom-key', 'Use a custom key string instead of auto-generated', '');
// Output
$this->addArgument('--json', 'Output as JSON', false);
}
protected function initialize(): void
{
// Resolve API base
$this->apiBase = $this->getArgument('--api-base')
?: getenv('GITEA_URL')
?: 'https://git.mokoconsulting.tech';
$this->apiBase = rtrim($this->apiBase, '/');
// Resolve token
$this->token = $this->getArgument('--token')
?: getenv('GH_TOKEN')
?: getenv('GITHUB_TOKEN')
?: '';
if (empty($this->token)) {
$ghToken = trim((string) @shell_exec('gh auth token 2>/dev/null'));
if (!empty($ghToken)) {
$this->token = $ghToken;
}
}
// Determine subcommand from argv
global $argv;
foreach ($argv as $arg) {
if (in_array($arg, [
'list', 'create-package', 'update-package', 'delete-package',
'issue', 'revoke', 'activate', 'renew', 'validate',
'usage', 'master-key', 'keys', 'packages',
], true)) {
$this->subcommand = $arg;
break;
}
}
}
protected function run(): int
{
if (empty($this->token)) {
$this->log('No API token found. Set GH_TOKEN or pass --token.', 'ERROR');
return 1;
}
return match ($this->subcommand) {
'packages', 'list' => $this->listPackages(),
'create-package' => $this->createPackage(),
'update-package' => $this->updatePackage(),
'delete-package' => $this->deletePackage(),
'keys' => $this->listKeys(),
'issue' => $this->issueKey(),
'revoke' => $this->revokeKey(),
'activate' => $this->activateKey(),
'renew' => $this->renewKey(),
'validate' => $this->validateKey(),
'usage' => $this->viewUsage(),
'master-key' => $this->ensureMasterKey(),
default => $this->showSubcommandHelp(),
};
}
// ── Subcommand help ──────────────────────────────────────────────────
private function showSubcommandHelp(): int
{
$this->section('License Management — Subcommands');
echo <<<HELP
Package Management:
packages List all license packages for an org
create-package Create a new license package
update-package Update a license package (--package-id required)
delete-package Delete a license package (--package-id required)
Key Management:
keys List all license keys for an org
issue Issue a new license key (--package-id required)
revoke Deactivate a license key (--key-id required)
activate Re-activate a revoked key (--key-id required)
renew Extend key expiration (--key-id, --days required)
validate Validate a raw key string (--key required)
master-key Ensure master key exists for org
Analytics:
usage View usage logs for a key (--key-id required)
Examples:
php bin/moko license packages --org MokoConsulting
php bin/moko license create-package --org MokoConsulting --name "Pro Annual" --duration 365
php bin/moko license issue --org MokoConsulting --package-id 1 --licensee "Client"
php bin/moko license validate --key MOKO-ABCD-1234-EF56-7890 --domain example.com
php bin/moko license renew --org MokoConsulting --key-id 42 --days 365
HELP;
return 0;
}
// ── Package operations ───────────────────────────────────────────────
private function listPackages(): int
{
$org = $this->requireOrg();
if ($org === null) {
return 1;
}
$result = $this->apiGet("/orgs/{$org}/license-packages");
if ($result === null) {
return 1;
}
if ($this->getArgument('--json')) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
return 0;
}
$this->section("License Packages — {$org}");
if (empty($result)) {
$this->log('No packages found.', 'WARN');
return 0;
}
foreach ($result as $pkg) {
$duration = ($pkg['duration_days'] ?? 0) === 0 ? 'lifetime' : ($pkg['duration_days'] . ' days');
$sites = ($pkg['max_sites'] ?? 0) === 0 ? 'unlimited' : (string)$pkg['max_sites'];
$active = ($pkg['is_active'] ?? true) ? 'active' : 'inactive';
$this->status(
sprintf('#%d %s', $pkg['id'] ?? 0, $pkg['name'] ?? ''),
true,
sprintf('%s | %s sites | %s', $duration, $sites, $active)
);
}
return 0;
}
private function createPackage(): int
{
$org = $this->requireOrg();
if ($org === null) {
return 1;
}
$name = $this->getArgument('--name');
if (empty($name)) {
$this->log('--name is required for create-package', 'ERROR');
return 1;
}
$channels = $this->getArgument('--channels');
if (!empty($channels) && $channels[0] !== '[') {
$channels = json_encode(explode(',', $channels));
}
$data = [
'name' => $name,
'description' => $this->getArgument('--description') ?: '',
'duration_days' => (int) $this->getArgument('--duration'),
'max_sites' => (int) $this->getArgument('--max-sites'),
'repo_scope' => $this->getArgument('--repo-scope'),
'allowed_channels' => $channels ?: '',
];
if ($this->isDryRun()) {
$this->log('Would create package: ' . json_encode($data, JSON_PRETTY_PRINT), 'DRY-RUN');
return 0;
}
$result = $this->apiPost("/orgs/{$org}/license-packages", $data);
if ($result === null) {
return 1;
}
if ($this->getArgument('--json')) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
} else {
$this->log(sprintf('Created package #%d: %s', $result['id'] ?? 0, $name), 'OK');
}
return 0;
}
private function updatePackage(): int
{
$org = $this->requireOrg();
$pkgId = $this->getArgument('--package-id');
if ($org === null || empty($pkgId)) {
$this->log('--org and --package-id are required', 'ERROR');
return 1;
}
$data = array_filter([
'name' => $this->getArgument('--name') ?: null,
'description' => $this->getArgument('--description') ?: null,
'duration_days' => $this->getArgument('--duration') !== '0' ? (int)$this->getArgument('--duration') : null,
'max_sites' => $this->getArgument('--max-sites') !== '0' ? (int)$this->getArgument('--max-sites') : null,
], fn($v) => $v !== null);
if (empty($data)) {
$this->log('No fields to update. Pass --name, --description, --duration, or --max-sites.', 'WARN');
return 1;
}
if ($this->isDryRun()) {
$this->log("Would update package #{$pkgId}: " . json_encode($data), 'DRY-RUN');
return 0;
}
$result = $this->apiPatch("/orgs/{$org}/license-packages/{$pkgId}", $data);
if ($result === null) {
return 1;
}
$this->log("Updated package #{$pkgId}", 'OK');
return 0;
}
private function deletePackage(): int
{
$org = $this->requireOrg();
$pkgId = $this->getArgument('--package-id');
if ($org === null || empty($pkgId)) {
$this->log('--org and --package-id are required', 'ERROR');
return 1;
}
if ($this->isDryRun()) {
$this->log("Would delete package #{$pkgId}", 'DRY-RUN');
return 0;
}
$result = $this->apiDelete("/orgs/{$org}/license-packages/{$pkgId}");
if ($result === null) {
return 1;
}
$this->log("Deleted package #{$pkgId}", 'OK');
return 0;
}
// ── Key operations ───────────────────────────────────────────────────
private function listKeys(): int
{
$org = $this->requireOrg();
if ($org === null) {
return 1;
}
$pkgId = $this->getArgument('--package-id');
$endpoint = $pkgId
? "/orgs/{$org}/license-packages/{$pkgId}/keys"
: "/orgs/{$org}/license-keys";
$result = $this->apiGet($endpoint);
if ($result === null) {
return 1;
}
if ($this->getArgument('--json')) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
return 0;
}
$this->section("License Keys — {$org}" . ($pkgId ? " (Package #{$pkgId})" : ''));
if (empty($result)) {
$this->log('No keys found.', 'WARN');
return 0;
}
foreach ($result as $key) {
$prefix = $key['key_prefix'] ?? '???';
$licensee = $key['licensee_name'] ?? 'N/A';
$active = ($key['is_active'] ?? true) ? 'active' : 'revoked';
$internal = ($key['is_internal'] ?? false) ? ' [MASTER]' : '';
$domains = $key['domain_restriction'] ?? '';
$expires = ($key['expires_unix'] ?? 0) > 0
? date('Y-m-d', (int) $key['expires_unix'])
: 'never';
$this->status(
sprintf('#%d %s', $key['id'] ?? 0, $prefix),
$key['is_active'] ?? true,
sprintf('%s | %s | expires: %s | domains: %s%s', $licensee, $active, $expires, $domains ?: 'any', $internal)
);
}
return 0;
}
private function issueKey(): int
{
$org = $this->requireOrg();
$pkgId = $this->getArgument('--package-id');
if ($org === null || empty($pkgId)) {
$this->log('--org and --package-id are required', 'ERROR');
return 1;
}
$data = [
'package_id' => (int) $pkgId,
'licensee_name' => $this->getArgument('--licensee') ?: '',
'licensee_email' => $this->getArgument('--email') ?: '',
'domain_restriction' => $this->getArgument('--domains') ?: '',
'max_sites' => (int) $this->getArgument('--max-sites'),
'payment_ref' => $this->getArgument('--payment-ref') ?: '',
];
$customKey = $this->getArgument('--custom-key');
if (!empty($customKey)) {
$data['custom_key'] = $customKey;
}
if ($this->isDryRun()) {
$this->log('Would issue key: ' . json_encode($data, JSON_PRETTY_PRINT), 'DRY-RUN');
return 0;
}
$result = $this->apiPost("/orgs/{$org}/license-keys", $data);
if ($result === null) {
return 1;
}
if ($this->getArgument('--json')) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
} else {
$rawKey = $result['raw_key'] ?? '';
$this->section('License Key Issued');
if (!empty($rawKey)) {
echo "\n";
$this->log("Raw Key: {$rawKey}", 'OK');
$this->log('This key will NOT be shown again. Save it now.', 'WARN');
echo "\n";
}
$this->log(sprintf('Key ID: #%d | Prefix: %s', $result['id'] ?? 0, $result['key_prefix'] ?? ''), 'INFO');
}
return 0;
}
private function revokeKey(): int
{
return $this->toggleKey(false);
}
private function activateKey(): int
{
return $this->toggleKey(true);
}
private function toggleKey(bool $activate): int
{
$org = $this->requireOrg();
$keyId = $this->getArgument('--key-id');
if ($org === null || empty($keyId)) {
$this->log('--org and --key-id are required', 'ERROR');
return 1;
}
$action = $activate ? 'activate' : 'revoke';
if ($this->isDryRun()) {
$this->log("Would {$action} key #{$keyId}", 'DRY-RUN');
return 0;
}
$result = $this->apiPatch("/orgs/{$org}/license-keys/{$keyId}", [
'is_active' => $activate,
]);
if ($result === null) {
return 1;
}
$label = $activate ? 'Activated' : 'Revoked';
$this->log("{$label} key #{$keyId}", 'OK');
return 0;
}
private function renewKey(): int
{
$org = $this->requireOrg();
$keyId = $this->getArgument('--key-id');
$days = (int) $this->getArgument('--days');
if ($org === null || empty($keyId)) {
$this->log('--org and --key-id are required', 'ERROR');
return 1;
}
if ($this->isDryRun()) {
$this->log("Would renew key #{$keyId} by {$days} days", 'DRY-RUN');
return 0;
}
$result = $this->apiPost("/orgs/{$org}/license-keys/{$keyId}/renew", [
'days' => $days,
]);
if ($result === null) {
return 1;
}
$newExpiry = isset($result['expires_unix']) && $result['expires_unix'] > 0
? date('Y-m-d', (int) $result['expires_unix'])
: 'never';
$this->log("Renewed key #{$keyId} — new expiry: {$newExpiry}", 'OK');
return 0;
}
private function validateKey(): int
{
$rawKey = $this->getArgument('--key');
if (empty($rawKey)) {
$this->log('--key is required for validate', 'ERROR');
return 1;
}
$data = ['key' => $rawKey];
$domain = $this->getArgument('--domain');
if (!empty($domain)) {
$data['domain'] = $domain;
}
$result = $this->apiPost('/license-keys/validate', $data);
if ($result === null) {
return 1;
}
if ($this->getArgument('--json')) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
return 0;
}
$valid = $result['valid'] ?? false;
if ($valid) {
$this->status('License Valid', true, sprintf(
'Package: %s | Expires: %s | Sites: %s',
$result['package_name'] ?? 'N/A',
isset($result['expires_unix']) && $result['expires_unix'] > 0
? date('Y-m-d', (int) $result['expires_unix']) : 'never',
$result['max_sites'] ?? 'unlimited'
));
return 0;
} else {
$this->status('License Invalid', false, $result['error'] ?? 'Unknown reason');
return 1;
}
}
private function viewUsage(): int
{
$org = $this->requireOrg();
$keyId = $this->getArgument('--key-id');
if ($org === null || empty($keyId)) {
$this->log('--org and --key-id are required', 'ERROR');
return 1;
}
$result = $this->apiGet("/orgs/{$org}/license-keys/{$keyId}/usage");
if ($result === null) {
return 1;
}
if ($this->getArgument('--json')) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
return 0;
}
$this->section("Usage — Key #{$keyId}");
$entries = $result['entries'] ?? $result;
if (empty($entries)) {
$this->log('No usage recorded.', 'WARN');
return 0;
}
foreach ($entries as $u) {
$date = isset($u['created_unix']) ? date('Y-m-d H:i', (int) $u['created_unix']) : 'N/A';
$domain = $u['domain'] ?? '';
$ip = $u['ip_address'] ?? '';
$from = $u['version_from'] ?? '';
$this->log(sprintf('%s | %s | %s | from %s', $date, $domain ?: 'no domain', $ip, $from ?: 'unknown'), 'INFO');
}
return 0;
}
private function ensureMasterKey(): int
{
$org = $this->requireOrg();
if ($org === null) {
return 1;
}
if ($this->isDryRun()) {
$this->log("Would ensure master key for {$org}", 'DRY-RUN');
return 0;
}
$result = $this->apiPost("/orgs/{$org}/license-keys/master", []);
if ($result === null) {
return 1;
}
if ($this->getArgument('--json')) {
echo json_encode($result, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
return 0;
}
$rawKey = $result['raw_key'] ?? '';
if (!empty($rawKey)) {
$this->section('Master Key Created');
echo "\n";
$this->log("Raw Key: {$rawKey}", 'OK');
$this->log('This key will NOT be shown again. Save it now.', 'WARN');
echo "\n";
} else {
$this->log('Master key already exists.', 'INFO');
}
return 0;
}
// ── Helpers ──────────────────────────────────────────────────────────
private function requireOrg(): ?string
{
$org = $this->getArgument('--org');
if (empty($org)) {
// Try to detect from git remote
$remote = trim((string) @shell_exec('git remote get-url origin 2>/dev/null'));
if (preg_match('#[/:]([^/]+)/[^/]+?(?:\.git)?$#', $remote, $m)) {
$org = $m[1];
}
}
if (empty($org)) {
$this->log('--org is required (or must be detectable from git remote)', 'ERROR');
return null;
}
return $org;
}
private function apiGet(string $path): ?array
{
return $this->apiRequest('GET', $path);
}
private function apiPost(string $path, array $data): ?array
{
return $this->apiRequest('POST', $path, $data);
}
private function apiPatch(string $path, array $data): ?array
{
return $this->apiRequest('PATCH', $path, $data);
}
private function apiDelete(string $path): ?array
{
return $this->apiRequest('DELETE', $path);
}
private function apiRequest(string $method, string $path, ?array $data = null): ?array
{
$url = $this->apiBase . '/api/v1' . $path;
$ch = curl_init();
curl_setopt_array($ch, [
CURLOPT_URL => $url,
CURLOPT_RETURNTRANSFER => true,
CURLOPT_CUSTOMREQUEST => $method,
CURLOPT_HTTPHEADER => [
'Authorization: token ' . $this->token,
'Content-Type: application/json',
'Accept: application/json',
],
CURLOPT_TIMEOUT => 30,
]);
if ($data !== null && in_array($method, ['POST', 'PUT', 'PATCH'], true)) {
curl_setopt($ch, CURLOPT_POSTFIELDS, json_encode($data));
}
if ($this->getArgument('--verbose')) {
$this->log("{$method} {$url}", 'DEBUG');
}
$response = curl_exec($ch);
$httpCode = curl_getinfo($ch, CURLINFO_HTTP_CODE);
$error = curl_error($ch);
curl_close($ch);
if (!empty($error)) {
$this->log("API error: {$error}", 'ERROR');
return null;
}
if ($httpCode === 404) {
$this->log("API endpoint not found: {$path}", 'ERROR');
$this->log('The licensing API may not be deployed yet. Check MokoGitea version.', 'WARN');
return null;
}
if ($httpCode === 204) {
return []; // success, no content
}
if ($httpCode >= 400) {
$body = json_decode((string) $response, true);
$msg = $body['message'] ?? $response;
$this->log("API error ({$httpCode}): {$msg}", 'ERROR');
return null;
}
$decoded = json_decode((string) $response, true);
if ($decoded === null && !empty($response)) {
$this->log('Failed to parse API response', 'ERROR');
return null;
}
return $decoded ?? [];
}
}
$app = new LicenseManage();
exit($app->execute());
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/manifest_read.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Parse .manifest.xml and output requested field(s) for CI consumption
*/
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/release_cascade.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: DEPRECATED — cascade behavior removed. Each release stream is independent.
*/
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/release_publish.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Publish a release and create copies for all lesser stability streams.
*/
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/scaffold_client.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Scaffold a new client-waas repo from Template-Client-WaaS with pre-configured settings
*/
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/updates_xml_sync.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Sync updates.xml to target branches via Gitea API
* NOTE: Called by pre-release and auto-release workflows after updates.xml
* is modified on the current branch. Pushes the file to other branches
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/version_auto_bump.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Auto patch-bump, set stability suffix, and commit single CLI replacing inline workflow bash
*/
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/version_check.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Validate version consistency across README, manifests, and sub-packages
*/
+1 -1
View File
@@ -9,7 +9,7 @@
* INGROUP: moko-platform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /cli/wiki_sync.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Sync select wiki pages from moko-platform to all template repos
*/
+2 -2
View File
@@ -1,8 +1,8 @@
{
"name": "mokoconsulting-tech/enterprise",
"description": "MokoStandards Enterprise API \u2014 PHP implementation",
"description": "moko-platform Enterprise API \u2014 PHP implementation",
"type": "library",
"version": "09.01.00",
"version": "09.22.00",
"license": "GPL-3.0-or-later",
"authors": [
{
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /deploy/backup-before-deploy.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Snapshot Joomla directories before deployment for rollback capability
*/
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /deploy/deploy-dolibarr.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Deploy Dolibarr module files to a remote server via SFTP/rsync
*/
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /deploy/health-check.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Post-deploy health check verify a Joomla site is responding correctly
*/
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /deploy/rollback-joomla.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Rollback a Joomla deployment by restoring from a pre-deploy snapshot
*/
+1 -1
View File
@@ -11,7 +11,7 @@
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /deploy/sync-joomla.php
* VERSION: 09.21.07
* VERSION: 09.22.00
* BRIEF: Sync Joomla site directories between two servers via rsync over SSH
*/
+25 -39
View File
@@ -7,57 +7,43 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Scripts.Fix
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Scripts.Fix
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /fix/fix_line_endings.php
* BRIEF: CLI script to fix line endings (CRLF LF) in tracked files
* BRIEF: CLI script to normalise CRLF/CR to LF in tracked source files
*/
declare(strict_types=1);
require_once __DIR__ . '/../lib/CliBase.php';
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
use MokoEnterprise\CliFramework;
use MokoEnterprise\FileFixUtility;
/**
* CLI wrapper that delegates line-ending fixes to FileFixUtility.
*/
class FixLineEndings extends CliBase
class FixLineEndings extends CliFramework
{
/**
* Print usage information.
*/
protected function showHelp(): void
{
echo "Usage: {$this->scriptName} [--path DIR] [--dry-run] [--help]\n\n";
echo "Fixes CRLF line endings to LF in all tracked source files.\n\n";
echo "OPTIONS:\n";
echo " --path DIR Repository root (default: current directory)\n";
echo " --dry-run Show what would be changed without modifying files\n";
echo " --help Show this help message\n";
}
protected function configure(): void
{
$this->setDescription('Normalise CRLF/CR to LF in tracked source files');
$this->addArgument('--path', 'Repository root (default: current directory)', '.');
}
/**
* Run the line-ending fix via FileFixUtility.
*
* @return int Exit code: 0 on success.
*/
protected function execute(): int
{
$path = (string) ($this->getOption('path') ?? '.');
$files = FileFixUtility::fixLineEndings($path, $this->dryRun);
protected function run(): int
{
$path = (string) $this->getArgument('--path');
$files = FileFixUtility::fixLineEndings($path, $this->dryRun);
foreach ($files as $f) {
$this->success("Fixed: {$f}");
}
foreach ($files as $f) {
$this->status(true, "Fixed: {$f}");
}
$label = $this->dryRun ? 'Would fix' : 'Fixed';
$this->log("{$label} " . count($files) . ' file(s)');
return 0;
}
$label = $this->dryRun ? 'Would fix' : 'Fixed';
$this->log("{$label} " . count($files) . ' file(s)');
return self::EXIT_SUCCESS;
}
}
$script = new FixLineEndings($argv);
exit($script->run());
$app = new FixLineEndings();
exit($app->execute());
+25 -39
View File
@@ -7,57 +7,43 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Scripts.Fix
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Scripts.Fix
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /fix/fix_permissions.php
* BRIEF: CLI script to fix file permissions (dirs 755, files 644, scripts 755)
* BRIEF: CLI script to normalise file permissions (dirs 755, files 644, scripts 755)
*/
declare(strict_types=1);
require_once __DIR__ . '/../lib/CliBase.php';
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
use MokoEnterprise\CliFramework;
use MokoEnterprise\FileFixUtility;
/**
* CLI wrapper that delegates permission fixes to FileFixUtility.
*/
class FixPermissions extends CliBase
class FixPermissions extends CliFramework
{
/**
* Print usage information.
*/
protected function showHelp(): void
{
echo "Usage: {$this->scriptName} [--path DIR] [--dry-run] [--help]\n\n";
echo "Fixes file permissions: 644 for files, 755 for dirs and *.php/*.sh scripts.\n\n";
echo "OPTIONS:\n";
echo " --path DIR Repository root (default: current directory)\n";
echo " --dry-run Show what would be changed without modifying files\n";
echo " --help Show this help message\n";
}
protected function configure(): void
{
$this->setDescription('Normalise file permissions (dirs 755, files 644, scripts 755)');
$this->addArgument('--path', 'Repository root (default: current directory)', '.');
}
/**
* Run the permissions fix via FileFixUtility.
*
* @return int Exit code: 0 on success.
*/
protected function execute(): int
{
$path = (string) ($this->getOption('path') ?? '.');
protected function run(): int
{
$path = (string) $this->getArgument('--path');
if ($this->dryRun) {
$this->warning('[DRY-RUN] Would fix permissions (dirs 755, files 644, scripts 755)');
return 0;
}
if ($this->dryRun) {
$this->log('WARNING', 'Would fix permissions (dirs 755, files 644, scripts 755)');
return self::EXIT_SUCCESS;
}
FileFixUtility::fixPermissions($path, $this->dryRun);
$this->success('[OK] Permissions fixed');
return 0;
}
FileFixUtility::fixPermissions($path, $this->dryRun);
$this->log('SUCCESS', 'Permissions fixed');
return self::EXIT_SUCCESS;
}
}
$script = new FixPermissions($argv);
exit($script->run());
$app = new FixPermissions();
exit($app->execute());
+31 -46
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Scripts.Fix
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Scripts.Fix
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /fix/fix_tabs.php
* BRIEF: CLI script to convert tabs to spaces in tracked source files
@@ -16,57 +16,42 @@
declare(strict_types=1);
require_once __DIR__ . '/../lib/CliBase.php';
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
use MokoEnterprise\CliFramework;
use MokoEnterprise\FileFixUtility;
/**
* CLI wrapper that delegates tab-to-space conversion to FileFixUtility.
*/
class FixTabs extends CliBase
class FixTabs extends CliFramework
{
/**
* Print usage information.
*/
protected function showHelp(): void
{
echo "Usage: {$this->scriptName} [--path DIR] [--type TYPE] [--dry-run] [--help]\n\n";
echo "Convert tabs to spaces in tracked source files.\n\n";
echo "OPTIONS:\n";
echo " --path DIR Repository root (default: current directory)\n";
echo " --type TYPE File type: yaml, python, shell, all (default: all)\n";
echo " --dry-run Show changes without modifying files\n";
echo " --help Show this help message\n\n";
echo "NOTE: Makefile variants are always skipped.\n";
}
protected function configure(): void
{
$this->setDescription('Convert tabs to spaces in tracked source files');
$this->addArgument('--path', 'Repository root (default: current directory)', '.');
$this->addArgument('--type', 'File type: yaml, python, shell, all', 'all');
}
/**
* Run the tab-fix via FileFixUtility.
*
* @return int Exit code: 0 on success, 2 on invalid arguments.
*/
protected function execute(): int
{
$path = (string) ($this->getOption('path') ?? '.');
$fileType = (string) ($this->getOption('type') ?? 'all');
protected function run(): int
{
$path = (string) $this->getArgument('--path');
$fileType = (string) $this->getArgument('--type');
try {
$files = FileFixUtility::fixTabs($path, $fileType, $this->dryRun);
} catch (\InvalidArgumentException $e) {
$this->log($e->getMessage(), 'ERROR');
return 2;
}
try {
$files = FileFixUtility::fixTabs($path, $fileType, $this->dryRun);
} catch (\InvalidArgumentException $e) {
$this->log('ERROR', $e->getMessage());
return self::EXIT_USAGE;
}
foreach ($files as $f) {
$this->success("Fixed: {$f}");
}
foreach ($files as $f) {
$this->status(true, "Fixed: {$f}");
}
$label = $this->dryRun ? 'Would fix' : 'Fixed';
$this->log("{$label} " . count($files) . ' file(s)');
return 0;
}
$label = $this->dryRun ? 'Would fix' : 'Fixed';
$this->log("{$label} " . count($files) . ' file(s)');
return self::EXIT_SUCCESS;
}
}
$script = new FixTabs($argv);
exit($script->run());
$app = new FixTabs();
exit($app->execute());
+31 -45
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Scripts.Fix
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Scripts.Fix
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /fix/fix_trailing_spaces.php
* BRIEF: CLI script to remove trailing whitespace from tracked source files
@@ -16,56 +16,42 @@
declare(strict_types=1);
require_once __DIR__ . '/../lib/CliBase.php';
require_once __DIR__ . '/../../vendor/autoload.php';
require_once __DIR__ . '/../vendor/autoload.php';
require_once __DIR__ . '/../lib/Enterprise/CliFramework.php';
use MokoEnterprise\CliFramework;
use MokoEnterprise\FileFixUtility;
/**
* CLI wrapper that delegates trailing-space removal to FileFixUtility.
*/
class FixTrailingSpaces extends CliBase
class FixTrailingSpaces extends CliFramework
{
/**
* Print usage information.
*/
protected function showHelp(): void
{
echo "Usage: {$this->scriptName} [--path DIR] [--type TYPE] [--dry-run] [--help]\n\n";
echo "Remove trailing whitespace from tracked source files.\n\n";
echo "OPTIONS:\n";
echo " --path DIR Repository root (default: current directory)\n";
echo " --type TYPE File type: yaml, python, shell, markdown, all (default: all)\n";
echo " --dry-run Show changes without modifying files\n";
echo " --help Show this help message\n";
}
protected function configure(): void
{
$this->setDescription('Remove trailing whitespace from tracked source files');
$this->addArgument('--path', 'Repository root (default: current directory)', '.');
$this->addArgument('--type', 'File type: yaml, python, shell, all', 'all');
}
/**
* Run the trailing-space fix via FileFixUtility.
*
* @return int Exit code: 0 on success, 2 on invalid arguments.
*/
protected function execute(): int
{
$path = (string) ($this->getOption('path') ?? '.');
$fileType = (string) ($this->getOption('type') ?? 'all');
protected function run(): int
{
$path = (string) $this->getArgument('--path');
$fileType = (string) $this->getArgument('--type');
try {
$files = FileFixUtility::fixTrailingSpaces($path, $fileType, $this->dryRun);
} catch (\InvalidArgumentException $e) {
$this->log($e->getMessage(), 'ERROR');
return 2;
}
try {
$files = FileFixUtility::fixTrailingSpaces($path, $fileType, $this->dryRun);
} catch (\InvalidArgumentException $e) {
$this->log('ERROR', $e->getMessage());
return self::EXIT_USAGE;
}
foreach ($files as $f) {
$this->success("Fixed: {$f}");
}
foreach ($files as $f) {
$this->status(true, "Fixed: {$f}");
}
$label = $this->dryRun ? 'Would fix' : 'Fixed';
$this->log("{$label} " . count($files) . ' file(s)');
return 0;
}
$label = $this->dryRun ? 'Would fix' : 'Fixed';
$this->log("{$label} " . count($files) . ' file(s)');
return self::EXIT_SUCCESS;
}
}
$script = new FixTrailingSpaces($argv);
exit($script->run());
$app = new FixTrailingSpaces();
exit($app->execute());
+2 -2
View File
@@ -2,8 +2,8 @@
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
SPDX-License-Identifier: GPL-3.0-or-later
FILE INFORMATION
DEFGROUP: MokoStandards.Index
INGROUP: MokoStandards.Fix
DEFGROUP: MokoPlatform.Index
INGROUP: MokoPlatform.Fix
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /fix/index.md
BRIEF: Fix directory index
+3 -3
View File
@@ -2,8 +2,8 @@
Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>
SPDX-License-Identifier: GPL-3.0-or-later
FILE INFORMATION
DEFGROUP: MokoStandards.Root
INGROUP: MokoStandards
DEFGROUP: MokoPlatform.Root
INGROUP: MokoPlatform
REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
PATH: /index.md
BRIEF: Scripts directory index
@@ -11,7 +11,7 @@ BRIEF: Scripts directory index
# Scripts Index
Quick navigation for MokoStandards scripts organized by function.
Quick navigation for moko-platform scripts organized by function.
## Core Categories
+2 -2
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Lib
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Lib
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/CliBase.php
* BRIEF: Standalone base CLI class for scripts that do not use CliFramework
+3 -3
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Lib
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Lib
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Common.php
* BRIEF: Common utility functions for scripts
@@ -33,7 +33,7 @@ class Common
const FALLBACK_VERSION = '04.00.00';
const REPO_URL = 'https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API';
const REPO_URL_GITHUB = 'https://git.mokoconsulting.tech/MokoConsulting/MokoStandards';
const REPO_URL_GITHUB = 'https://git.mokoconsulting.tech/MokoConsulting/moko-platform';
const COPYRIGHT = 'Copyright (C) 2026 Moko Consulting <hello@mokoconsulting.tech>';
const LICENSE = 'GPL-3.0-or-later';
+3 -3
View File
@@ -9,8 +9,8 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/AbstractProjectPlugin.php
* BRIEF: Abstract base class for project plugins
@@ -23,7 +23,7 @@ namespace MokoEnterprise;
*
* Provides common functionality for all project type plugins
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 1.0.0
*/
abstract class AbstractProjectPlugin implements ProjectPluginInterface
+5 -5
View File
@@ -9,8 +9,8 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.API
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.API
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/ApiClient.php
* BRIEF: HTTP API client library
@@ -31,9 +31,9 @@ declare(strict_types=1);
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
*/
@@ -138,7 +138,7 @@ class ApiClient
'circuit_breaker_trips' => 0,
];
public const VERSION = '04.06.00';
public const VERSION = '09.22.00';
/**
* Initialize API client.
+5 -5
View File
@@ -22,15 +22,15 @@ declare(strict_types=1);
* (at your option) any later version.
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Audit
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Audit
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/AuditLogger.php
* BRIEF: Enterprise audit logging
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
*/
@@ -91,7 +91,7 @@ class AuditLogger
private array $transactionStack = [];
/** @var string Version constant */
public const VERSION = '04.06.00';
public const VERSION = '09.22.00';
/**
* Initialize audit logger.
+5 -5
View File
@@ -10,15 +10,15 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Checkpoint
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Checkpoint
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/CheckpointManager.php
* BRIEF: Checkpoint manager for resumable operations
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
*/
@@ -48,7 +48,7 @@ class CheckpointManager
{
private string $checkpointDir;
public const VERSION = '04.06.00';
public const VERSION = '09.22.00';
/**
* Initialize checkpoint manager.
+254 -684
View File
@@ -7,13 +7,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.CLI
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.CLI
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/CliFramework.php
* BRIEF: CLI base classes CliFramework (current) and CLIApp (legacy)
* NOTE: All new scripts must extend CliFramework, not CLIApp.
* CLIApp remains for backward-compatibility with existing scripts.
* BRIEF: CliFramework unified base class for all moko-platform CLI scripts
*/
declare(strict_types=1);
@@ -24,689 +22,12 @@ use DateTime;
use DateTimeZone;
use Exception;
/**
* Base class for CLI applications with common functionality
*/
abstract class CLIApp
{
private const VERSION = '04.06.00';
protected string $name;
protected string $description;
protected string $version;
protected array $options = [];
protected array $arguments = [];
protected bool $verbose = false;
protected bool $quiet = false;
protected bool $dryRun = false;
protected bool $jsonOutput = false;
// Enterprise features
protected ?MetricsCollector $metrics = null;
protected ?object $auditLogger = null;
public function __construct(string $name, string $description = '', string $version = self::VERSION)
{
$this->name = $name;
$this->description = $description ?: "{$name} - MokoStandards CLI Tool";
$this->version = $version;
}
/**
* Setup script-specific arguments
*
* Return an associative array where keys are option specs and values are descriptions.
* Option spec format: 'name:' for required value, 'name::' for optional value, 'name' for flag
*
* @return array<string, string> Option specifications and descriptions
*/
abstract protected function setupArguments(): array;
/**
* Main execution logic
*
* @return int Exit code (0 for success, non-zero for error)
*/
abstract protected function run(): int;
/**
* Get common CLI options
*
* @return array<string, string> Common options
*/
protected function getCommonOptions(): array
{
return [
'version' => 'Display version information',
'verbose' => 'Enable verbose output',
'v' => 'Alias for --verbose',
'quiet' => 'Suppress non-error output',
'q' => 'Alias for --quiet',
'dry-run' => 'Perform dry run without making changes',
'json' => 'Output results in JSON format',
'metrics' => 'Collect and display metrics',
'help' => 'Display this help message',
'h' => 'Alias for --help',
];
}
/**
* Parse command line arguments
*/
protected function parseArguments(): void
{
$shortOpts = 'vqh';
$longOpts = [
'version',
'verbose',
'quiet',
'dry-run',
'json',
'metrics',
'help',
];
// Add custom options
$customOpts = $this->setupArguments();
foreach (array_keys($customOpts) as $opt) {
if (str_ends_with($opt, '::')) {
$longOpts[] = rtrim($opt, ':') . '::';
} elseif (str_ends_with($opt, ':')) {
$longOpts[] = rtrim($opt, ':') . ':';
} else {
$longOpts[] = $opt;
}
}
// Use $GLOBALS['argv'] instead of getopt() so that bin/moko's in-process
// dispatch (via require) is respected. PHP's getopt() reads from the C-level
// argv set at process start and ignores runtime changes to $argv/$_SERVER['argv'].
$this->options = $this->parseArgv($GLOBALS['argv'] ?? [], $longOpts, $shortOpts);
$this->arguments = array_slice($GLOBALS['argv'] ?? [], 1);
// Handle common flags
if (isset($this->options['version'])) {
echo "{$this->name} v{$this->version}\n";
exit(0);
}
if (isset($this->options['help']) || isset($this->options['h'])) {
$this->printHelp();
exit(0);
}
$this->verbose = isset($this->options['verbose']) || isset($this->options['v']);
$this->quiet = isset($this->options['quiet']) || isset($this->options['q']);
$this->dryRun = isset($this->options['dry-run']);
$this->jsonOutput = isset($this->options['json']);
}
/**
* Parse an argv array using getopt-compatible option specs.
*
* Replaces PHP's getopt() so callers can inject a custom argv (e.g. bin/moko
* in-process dispatch sets $GLOBALS['argv'] before require-ing a script).
*
* @param list<string> $argv Full argv including $argv[0] (script path)
* @param list<string> $longOpts Long option specs, e.g. ['verbose', 'repos:', 'path::']
* @param string $shortOpts Short option chars, e.g. 'vqh'
* @return array<string, string|false|list<string>> Parsed options (same shape as getopt())
*/
private function parseArgv(array $argv, array $longOpts, string $shortOpts): array
{
$result = [];
$tokens = array_slice($argv, 1);
// Build lookup: option-name → 0=flag, 1=required-value, 2=optional-value
$specs = [];
foreach ($longOpts as $spec) {
if (str_ends_with($spec, '::')) {
$specs[rtrim($spec, ':')] = 2;
} elseif (str_ends_with($spec, ':')) {
$specs[rtrim($spec, ':')] = 1;
} else {
$specs[$spec] = 0;
}
}
for ($i = 0, $len = strlen($shortOpts); $i < $len; $i++) {
$c = $shortOpts[$i];
if ($c === ':') {
continue;
}
$mode = 0;
if (isset($shortOpts[$i + 1]) && $shortOpts[$i + 1] === ':') {
$mode = isset($shortOpts[$i + 2]) && $shortOpts[$i + 2] === ':' ? 2 : 1;
}
$specs[$c] = $mode;
}
for ($i = 0, $n = count($tokens); $i < $n; $i++) {
$tok = $tokens[$i];
if ($tok === '--') {
break; // end of options
}
if (str_starts_with($tok, '--')) {
$name = substr($tok, 2);
$val = null;
if (str_contains($name, '=')) {
[$name, $val] = explode('=', $name, 2);
}
$mode = $specs[$name] ?? -1;
if ($mode === -1) {
continue; // unknown option
}
if ($mode === 1 && $val === null) {
$val = $tokens[++$i] ?? false;
} elseif ($mode === 0) {
$val = false;
} elseif ($mode === 2 && $val === null) {
$val = false;
}
// Support repeated options as arrays (matches getopt() behaviour)
if (array_key_exists($name, $result)) {
$result[$name] = array_merge((array) $result[$name], [$val]);
} else {
$result[$name] = $val;
}
} elseif (str_starts_with($tok, '-') && strlen($tok) > 1) {
$chars = substr($tok, 1);
for ($j = 0, $jn = strlen($chars); $j < $jn; $j++) {
$c = $chars[$j];
$mode = $specs[$c] ?? -1;
if ($mode === -1) {
continue;
}
$val = false;
if ($mode === 1) {
$rest = substr($chars, $j + 1);
if ($rest !== '') {
$val = $rest;
$j = $jn; // consumed rest of cluster
} else {
$val = $tokens[++$i] ?? false;
}
}
$result[$c] = $val;
}
}
}
return $result;
}
/**
* Print help message
*/
protected function printHelp(): void
{
echo "{$this->description}\n\n";
echo "Usage: {$this->name} [options]\n\n";
echo "Options:\n";
$allOpts = array_merge($this->getCommonOptions(), $this->setupArguments());
foreach ($allOpts as $opt => $desc) {
$optName = rtrim($opt, ':');
$hasValue = str_ends_with($opt, ':');
$optDisplay = strlen($optName) === 1 ? "-{$optName}" : "--{$optName}";
if ($hasValue) {
$optDisplay .= ' <value>';
}
echo sprintf(" %-30s %s\n", $optDisplay, $desc);
}
echo "\n";
}
/**
* Setup logging
*/
protected function setupLogging(): void
{
if ($this->quiet) {
error_reporting(E_ERROR);
} elseif ($this->verbose) {
error_reporting(E_ALL);
}
}
/**
* Setup enterprise features
*/
protected function setupEnterpriseFeatures(): void
{
if (isset($this->options['metrics'])) {
try {
$this->metrics = new MetricsCollector($this->name);
$this->log("Metrics collection enabled", 'INFO');
} catch (Exception $e) {
$this->log("Metrics collection unavailable: " . $e->getMessage(), 'WARNING');
}
}
}
/**
* Execute the CLI application
*
* @return int Exit code
*/
public function execute(): int
{
try {
$this->parseArguments();
$this->setupLogging();
$this->setupEnterpriseFeatures();
$this->log("Starting {$this->name} v{$this->version}", 'INFO');
if ($this->dryRun) {
$this->log("DRY RUN MODE - No changes will be made", 'INFO');
}
$startTime = microtime(true);
if ($this->metrics !== null) {
$timer = $this->metrics->startTimer('main_execution');
$exitCode = $this->run();
$timer->stop($exitCode === 0);
} else {
$exitCode = $this->run();
}
$duration = microtime(true) - $startTime;
$this->log(sprintf("Completed {$this->name} with exit code %d (%.2fs)", $exitCode, $duration), 'INFO');
if ($this->metrics !== null && !$this->quiet) {
$this->metrics->printSummary();
}
return $exitCode;
} catch (Exception $e) {
$this->log("Unhandled exception: " . $e->getMessage(), 'ERROR');
if ($this->verbose) {
$this->log($e->getTraceAsString(), 'ERROR');
}
return 1;
}
}
/**
* Get option value
*
* @param string $name Option name
* @param mixed $default Default value if not set
* @return mixed Option value
*/
protected function getOption(string $name, $default = null)
{
return $this->options[$name] ?? $default;
}
/**
* Check if option is set
*
* @param string $name Option name
* @return bool True if option is set
*/
protected function hasOption(string $name): bool
{
return isset($this->options[$name]);
}
/**
* Log a message
*
* @param string $message Message to log
* @param string $level Log level (INFO, WARNING, ERROR)
*/
protected function log(string $message, string $level = 'INFO'): void
{
if ($this->quiet && $level !== 'ERROR') {
return;
}
if (!$this->verbose && $level === 'DEBUG') {
return;
}
$timestamp = (new DateTime('now', new DateTimeZone('UTC')))->format('Y-m-d H:i:s');
$formatted = "[{$timestamp}] {$level}: {$message}\n";
if ($level === 'ERROR') {
fwrite(STDERR, $formatted);
} else {
echo $formatted;
}
}
/**
* Print result in appropriate format
*
* @param mixed $result Result to print
*/
protected function printResult($result): void
{
if ($this->jsonOutput) {
echo json_encode($result, JSON_PRETTY_PRINT) . "\n";
} else {
if (is_array($result)) {
echo var_export($result, true) . "\n";
} else {
echo $result . "\n";
}
}
}
/**
* Ask for user confirmation
*
* @param string $message Confirmation message
* @param bool $default Default response
* @return bool True if user confirms
*/
protected function confirm(string $message, bool $default = false): bool
{
if ($this->dryRun) {
$this->log("[DRY RUN] Would ask: {$message}", 'INFO');
return false;
}
$suffix = $default ? ' [Y/n]' : ' [y/N]';
echo $message . $suffix . ': ';
$handle = fopen('php://stdin', 'r');
$response = trim(fgets($handle));
fclose($handle);
if (empty($response)) {
return $default;
}
return in_array(strtolower($response), ['y', 'yes'], true);
}
/**
* Print colored output (if terminal supports it)
*
* @param string $text Text to print
* @param string $color Color name (red, green, yellow, blue, cyan, gray, bold, dim)
*/
protected function printColored(string $text, string $color): void
{
$colors = [
'red' => "\033[31m",
'green' => "\033[32m",
'yellow' => "\033[33m",
'blue' => "\033[34m",
'cyan' => "\033[36m",
'gray' => "\033[90m",
'bold' => "\033[1m",
'dim' => "\033[2m",
'reset' => "\033[0m",
];
if (isset($colors[$color]) && $this->isColorEnabled()) {
echo $colors[$color] . $text . $colors['reset'];
} else {
echo $text;
}
}
// =========================================================================
// Console graphics — visual primitives added to CLIApp
// =========================================================================
/**
* Return whether ANSI colour output is enabled.
*
* Disabled when --no-color is passed, NO_COLOR env var is set, or
* stdout is not an interactive terminal.
*/
protected function isColorEnabled(): bool
{
static $cache = null;
if ($cache !== null) {
return $cache;
}
if (in_array('--no-color', $_SERVER['argv'] ?? [], true) || getenv('NO_COLOR') !== false) {
return $cache = false;
}
return $cache = stream_isatty(STDOUT);
}
/**
* Return the terminal width (defaults to 80).
*/
protected function termWidth(): int
{
$cols = (int) getenv('COLUMNS');
return ($cols > 40) ? $cols : 80;
}
/**
* Wrap text in an ANSI code; returns plain text when colour is off.
*/
protected function colorize(string $code, string $text): string
{
if (!$this->isColorEnabled()) {
return $text;
}
return $code . $text . "\033[0m";
}
/**
* Print a script header banner.
*
* @param string $name Script name (defaults to $this->name).
* @param string $desc One-line description.
* @param string $ver Version string (defaults to $this->version).
*/
protected function printBanner(string $name = '', string $desc = '', string $ver = ''): void
{
$name = $name ?: $this->name;
$ver = $ver ?: $this->version;
$w = min($this->termWidth(), 70);
$inner = $w - 2;
$titlePad = str_pad(" {$name} v{$ver}", $inner);
$descPad = ($desc !== '') ? str_pad(" {$desc}", $inner) : null;
echo "\n";
echo $this->colorize(
"\033[36m",
"\u{250C}" . str_repeat("\u{2500}", $inner) . "\u{2510}"
) . "\n";
echo $this->colorize("\033[36m", "\u{2502}")
. $this->colorize("\033[1m", $titlePad)
. $this->colorize("\033[36m", "\u{2502}") . "\n";
if ($descPad !== null) {
echo $this->colorize("\033[36m", "\u{2502}")
. $this->colorize("\033[2m", $descPad)
. $this->colorize("\033[36m", "\u{2502}") . "\n";
}
echo $this->colorize(
"\033[36m",
"\u{2514}" . str_repeat("\u{2500}", $inner) . "\u{2518}"
) . "\n\n";
}
/**
* Print a section header rule.
*
* Output example: ── Section Title ──────────────────────────
*/
protected function section(string $title): void
{
$w = $this->termWidth();
$text = " {$title} ";
$fill = max(0, $w - strlen($text) - 4);
echo "\n";
echo $this->colorize(
"\033[36m",
str_repeat("\u{2500}", 2) . $text . str_repeat("\u{2500}", $fill)
) . "\n\n";
}
/**
* Print a plain horizontal divider.
*/
protected function printDivider(): void
{
echo $this->colorize("\033[2m", str_repeat("\u{2500}", $this->termWidth())) . "\n";
}
/**
* Print a single pass/fail status line.
*
* @param bool $passed Whether the check passed.
* @param string $label Check description.
* @param string $detail Optional detail in dim text.
*/
protected function statusLine(bool $passed, string $label, string $detail = ''): void
{
[$icon, $color] = $passed
? ["\u{2713}", "\033[32m"]
: ["\u{2717}", "\033[31m"];
$suffix = ($detail !== '')
? ' ' . $this->colorize("\033[2m", "{$detail}")
: '';
echo ' ' . $this->colorize($color . "\033[1m", $icon) . ' ' . $label . $suffix . "\n";
}
/**
* Render an in-place progress bar.
*
* @param int $current Items done.
* @param int $total Total items.
* @param string $label Optional trailing label.
* @param bool $newline Finish bar with newline.
*/
protected function progress(int $current, int $total, string $label = '', bool $newline = false): void
{
$barWidth = min(30, $this->termWidth() - 22);
$filled = ($total > 0) ? (int) round($barWidth * $current / $total) : 0;
$pct = ($total > 0) ? (int) round(100 * $current / $total) : 0;
$bar = $this->colorize("\033[32m", str_repeat("\u{2588}", $filled))
. $this->colorize("\033[2m", str_repeat("\u{2591}", $barWidth - $filled));
$line = sprintf(
' [%s] %s %s%s',
$bar,
$this->colorize("\033[1m", sprintf('%3d%%', $pct)),
$this->colorize("\033[2m", "({$current}/{$total})"),
($label !== '') ? " {$label}" : ''
);
echo $newline ? "\r{$line}\n" : "\r{$line}";
}
/**
* Print a bordered summary box.
*
* @param array<string, string|int|float> $rows Label => value pairs.
* @param bool|null $passed Border colour: green/red/cyan.
*/
protected function printSummaryBox(array $rows, ?bool $passed = null): void
{
$color = match ($passed) {
true => "\033[32m",
false => "\033[31m",
default => "\033[36m",
};
$maxKey = max(array_map('strlen', array_keys($rows)));
$inner = $maxKey + 20;
echo "\n";
echo $this->colorize($color, "\u{250C}" . str_repeat("\u{2500}", $inner) . "\u{2510}") . "\n";
foreach ($rows as $label => $value) {
$valStr = (string) $value;
$padding = $inner - strlen($label) - strlen($valStr) - 4;
$row = ' ' . $this->colorize("\033[1m", $label)
. str_repeat(' ', max(1, $padding)) . $valStr . ' ';
echo $this->colorize($color, "\u{2502}") . $row . $this->colorize($color, "\u{2502}") . "\n";
}
echo $this->colorize($color, "\u{2514}" . str_repeat("\u{2500}", $inner) . "\u{2518}") . "\n\n";
}
public function getVersion(): string
{
return $this->version;
}
}
/**
* CLI for validation operations
*/
class ValidationCLI extends CLIApp
{
protected function setupArguments(): array
{
return [
'check:' => 'Type of validation (all, paths, markdown, licenses, workflows, security)',
'dir:' => 'Directory to validate (default: current directory)',
];
}
protected function run(): int
{
$check = $this->getOption('check', 'all');
$dir = $this->getOption('dir', '.');
$this->log("Running validation: {$check}", 'INFO');
try {
$validator = new UnifiedValidator();
if (in_array($check, ['all', 'paths'], true)) {
$validator->addPlugin(new PathValidatorPlugin());
}
if (in_array($check, ['all', 'markdown'], true)) {
$validator->addPlugin(new MarkdownValidatorPlugin());
}
$context = [
'paths' => [$dir],
'scan_dir' => $dir,
];
$results = $validator->validateAll($context);
if (!$this->jsonOutput) {
$validator->printSummary();
} else {
$resultData = array_map(function ($r) {
return [
'plugin' => $r->pluginName,
'passed' => $r->passed,
'message' => $r->message,
'details' => $r->details,
];
}, $results);
$this->printResult($resultData);
}
return $validator->allPassed() ? 0 : 1;
} catch (Exception $e) {
$this->log("Validation error: " . $e->getMessage(), 'ERROR');
return 1;
}
}
}
// =============================================================================
// CliFramework — current base class for all MokoStandards CLI scripts
// CliFramework — current base class for all moko-platform CLI scripts
// =============================================================================
/**
* Base class for MokoStandards CLI scripts.
* Base class for moko-platform CLI scripts.
*
* Provides argument parsing, a structured lifecycle, and a full console
* graphics system (banners, coloured log levels, progress bars, status
@@ -757,6 +78,25 @@ abstract class CliFramework
protected const BAR_FILL = "\u{2588}"; // █
protected const BAR_EMPTY = "\u{2591}"; // ░
// -------------------------------------------------------------------------
// Standard exit codes (#237)
// -------------------------------------------------------------------------
/** Process completed successfully. */
public const EXIT_SUCCESS = 0;
/** General failure (assertion, business logic, validation). */
public const EXIT_FAILURE = 1;
/** Usage / argument error (wrong flags, missing required args). */
public const EXIT_USAGE = 2;
/** Resource not found (file, repo, API object). */
public const EXIT_NOT_FOUND = 3;
/** Permission or authentication error. */
public const EXIT_PERMISSION = 4;
// -------------------------------------------------------------------------
// Script properties (set by configure())
// -------------------------------------------------------------------------
@@ -1458,4 +798,234 @@ abstract class CliFramework
}
return $text . str_repeat(' ', max(0, $width - $visibleLength));
}
// =========================================================================
// JSON output (#241) — standard envelope for --json mode
// =========================================================================
/**
* Whether --json mode is active.
*/
protected function isJsonMode(): bool
{
return $this->hasRawArg('--json');
}
/**
* Emit a standardised JSON envelope and exit.
*
* Envelope format:
* {
* "command": "check:syntax",
* "status": "pass|fail|error",
* "exit_code": 0,
* "data": { ... },
* "errors": [],
* "warnings": [],
* "metadata": { "duration_ms": 123, "timestamp": "..." }
* }
*
* @param string $status One of "pass", "fail", "error".
* @param mixed $data Arbitrary payload.
* @param string[] $errors Error messages.
* @param string[] $warnings Warning messages.
* @param int $exitCode Process exit code.
* @return int The exit code (for use with `return $this->jsonOutput(...)`).
*/
protected function jsonOutput(
string $status,
mixed $data = null,
array $errors = [],
array $warnings = [],
int $exitCode = -1
): int {
if ($exitCode < 0) {
$exitCode = ($status === 'pass') ? self::EXIT_SUCCESS : self::EXIT_FAILURE;
}
$envelope = [
'command' => $this->scriptName,
'status' => $status,
'exit_code' => $exitCode,
'data' => $data,
'errors' => $errors,
'warnings' => $warnings,
'metadata' => [
'duration_ms' => (int) round($this->elapsed() * 1000),
'timestamp' => gmdate('Y-m-d\TH:i:s\Z'),
],
];
echo json_encode($envelope, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n";
return $exitCode;
}
// =========================================================================
// Interactive prompts (#240)
// =========================================================================
/**
* Ask a yes/no confirmation question.
*
* Returns the default value when stdin is not interactive.
*
* @param string $message Question to display.
* @param bool $default Default answer when user presses Enter.
*/
protected function confirm(string $message, bool $default = false): bool
{
if (!stream_isatty(STDIN)) {
return $default;
}
$hint = $default ? '[Y/n]' : '[y/N]';
fwrite(STDOUT, "{$message} {$hint}: ");
$answer = strtolower(trim((string) fgets(STDIN)));
if ($answer === '') {
return $default;
}
return in_array($answer, ['y', 'yes'], true);
}
/**
* Prompt the user for free-text input.
*
* Returns the default value when stdin is not interactive (piped mode).
*
* @param string $prompt Question to display.
* @param string $default Default value shown in brackets.
*/
protected function input(string $prompt, string $default = ''): string
{
if (!stream_isatty(STDIN)) {
return $default;
}
$hint = $default !== '' ? " [{$default}]" : '';
fwrite(STDOUT, "{$prompt}{$hint}: ");
$line = trim((string) fgets(STDIN));
return $line !== '' ? $line : $default;
}
/**
* Present a numbered list and return the selected option.
*
* Returns the first option when stdin is not interactive.
*
* @param string $prompt Question to display.
* @param string[] $options List of choices.
* @return string The chosen option value.
*/
protected function select(string $prompt, array $options): string
{
if (empty($options)) {
return '';
}
if (!stream_isatty(STDIN)) {
return $options[0];
}
echo "{$prompt}\n";
foreach ($options as $i => $opt) {
printf(" %s%d%s) %s\n", self::C_CYAN, $i + 1, self::C_RESET, $opt);
}
fwrite(STDOUT, "Choice [1]: ");
$choice = trim((string) fgets(STDIN));
$index = ($choice !== '' ? (int) $choice : 1) - 1;
return $options[$index] ?? $options[0];
}
/**
* Render a simple ASCII table.
*
* @param string[] $headers Column headers.
* @param string[][] $rows Row data (each row is an array of cell strings).
*/
protected function table(array $headers, array $rows): void
{
if ($this->quiet) {
return;
}
// Calculate column widths.
$widths = array_map('strlen', $headers);
foreach ($rows as $row) {
foreach ($row as $i => $cell) {
$widths[$i] = max($widths[$i] ?? 0, strlen((string) $cell));
}
}
// Build separator line.
$sep = '+';
foreach ($widths as $w) {
$sep .= str_repeat('-', $w + 2) . '+';
}
// Header.
echo $sep . "\n";
$headerLine = '|';
foreach ($headers as $i => $h) {
$headerLine .= ' ' . $this->c(self::C_BOLD, str_pad($h, $widths[$i])) . ' |';
}
echo $headerLine . "\n";
echo $sep . "\n";
// Rows.
foreach ($rows as $row) {
$line = '|';
foreach ($row as $i => $cell) {
$line .= ' ' . str_pad((string) $cell, $widths[$i]) . ' |';
}
echo $line . "\n";
}
echo $sep . "\n";
}
}
// =============================================================================
// CLIApp — deprecated compatibility shim
// =============================================================================
/**
* @deprecated CLIApp has been consolidated into CliFramework. Use CliFramework instead.
* This stub prevents fatal errors if client repos still reference CLIApp.
*/
abstract class CLIApp extends CliFramework
{
public function __construct(string $name = '', string $description = '', string $version = '04.06.00')
{
parent::__construct($name, $version);
}
protected function configure(): void
{
// CLIApp subclasses use setupArguments() — bridge it.
$args = $this->setupArguments();
foreach ($args as $spec => $desc) {
$name = '--' . rtrim($spec, ':');
$default = str_ends_with($spec, ':') ? '' : false;
$this->addArgument($name, $desc, $default);
}
}
/** @return array<string,string> */
protected function setupArguments(): array
{
return [];
}
/** Bridge: CLIApp used getOption(), CliFramework uses getArgument(). */
protected function getOption(string $name, mixed $default = null): mixed
{
return $this->getArgument('--' . $name, $default);
}
/** Bridge: CLIApp used hasOption(). */
protected function hasOption(string $name): bool
{
$val = $this->getArgument('--' . $name);
return $val !== null && $val !== false && $val !== '';
}
}
+5 -5
View File
@@ -9,8 +9,8 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Config
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Config
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Config.php
* BRIEF: Configuration manager
@@ -32,9 +32,9 @@ declare(strict_types=1);
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
*/
@@ -120,7 +120,7 @@ class Config
/** @var array<string, mixed> Runtime override data */
private array $overrideData = [];
public const VERSION = '04.06.00';
public const VERSION = '09.22.00';
/**
* Constructor.
+2 -2
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/ConfigValidator.php
* BRIEF: Validate project config against plugin JSON schema
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/EnterpriseReadinessValidator.php
* BRIEF: Enterprise readiness validation library
+4 -4
View File
@@ -17,15 +17,15 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Recovery
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Recovery
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/ErrorRecovery.php
* BRIEF: Error recovery framework
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
* @deprecated Individual class files should be used instead
*/
+2 -2
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise
* INGROUP: MokoStandards.Lib
* DEFGROUP: MokoPlatform.Enterprise
* INGROUP: MokoPlatform.Lib
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/FileFixUtility.php
* BRIEF: Utility class for fixing file formatting issues (line endings, permissions, tabs, trailing spaces)
+3 -3
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Platform
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Platform
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/GitHubAdapter.php
* BRIEF: GitHub implementation of GitPlatformAdapter
@@ -31,7 +31,7 @@ use RuntimeException;
* - Topics: PUT with {"names": [...]}
* - Workflow dir: .github/workflows
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @since 04.06.10
* @see GitPlatformAdapter
*/
+4 -4
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Platform
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Platform
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/GitPlatformAdapter.php
* BRIEF: Interface defining all git platform operations for GitHub/Gitea abstraction
@@ -21,11 +21,11 @@ namespace MokoEnterprise;
/**
* Git Platform Adapter Interface
*
* Defines all platform operations required by MokoStandards automation.
* Defines all platform operations required by moko-platform automation.
* Implementations exist for GitHub (GitHubAdapter) and Gitea (MokoGiteaAdapter),
* allowing scripts to work against either platform transparently.
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.06.10
*/
interface GitPlatformAdapter
+7 -7
View File
@@ -9,8 +9,8 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Validation
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Validation
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/InputValidator.php
* BRIEF: Input validation library
@@ -31,9 +31,9 @@ declare(strict_types=1);
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
*/
@@ -75,7 +75,7 @@ class ValidationError extends RuntimeException
*/
class InputValidator
{
public const VERSION = '04.06.00';
public const VERSION = '09.22.00';
/**
* Validate and sanitize file paths to prevent path traversal.
@@ -161,11 +161,11 @@ class InputValidator
break;
case 'moko':
// MokoStandards format: XX.YY.ZZ
// moko-platform format: XX.YY.ZZ
$pattern = '/^\d{2}\.\d{2}\.\d{2}$/';
if (!preg_match($pattern, $version)) {
throw new ValidationError(
"Invalid MokoStandards version format: {$version}. Expected: XX.YY.ZZ"
"Invalid moko-platform version format: {$version}. Expected: XX.YY.ZZ"
);
}
break;
+6 -6
View File
@@ -9,15 +9,15 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Metrics
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Metrics
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/MetricsCollector.php
* BRIEF: Metrics collection framework
*/
/**
* Metrics Collector for MokoStandards
* Metrics Collector for moko-platform
*
* Provides observability and monitoring capabilities:
* - Execution time tracking with timers
@@ -46,9 +46,9 @@ declare(strict_types=1);
*
* SPDX-License-Identifier: GPL-3.0-or-later
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
*/
@@ -97,7 +97,7 @@ class MetricsTimer
*/
class MetricsCollector
{
private const VERSION = '04.06.00';
private const VERSION = '09.22.00';
private string $serviceName;
private array $counters = [];
+3 -3
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Platform
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Platform
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/MokoGiteaAdapter.php
* BRIEF: Gitea implementation of GitPlatformAdapter
@@ -33,7 +33,7 @@ use RuntimeException;
* - Branch protection: flat API (not rulesets)
* - Workflow dir: .mokogitea/workflows
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @since 04.06.10
* @see GitPlatformAdapter
*/
+14 -14
View File
@@ -8,11 +8,11 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/MokoStandardsParser.php
* BRIEF: Parser for the XML-based .mokostandards repository manifest
* BRIEF: Parser for the XML-based manifest.xml repository manifest
*/
declare(strict_types=1);
@@ -25,17 +25,17 @@ use SimpleXMLElement;
/**
* MokoStandards Parser
*
* Reads, writes, and validates the .mokostandards repository manifest.
* The file uses XML format (no file extension) and lives at .mokogitea/.mokostandards.
* Reads, writes, and validates the manifest.xml repository manifest.
* The file uses XML format (no file extension) and lives at .mokogitea/manifest.xml.
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.07.00
*/
class MokoStandardsParser
{
public const SCHEMA_VERSION = '1.0';
public const NAMESPACE_URI = 'https://git.mokoconsulting.tech/MokoConsulting/MokoStandards-API';
public const STANDARDS_SOURCE = 'https://git.mokoconsulting.tech/MokoConsulting/MokoStandards';
public const NAMESPACE_URI = 'https://standards.mokoconsulting.tech/moko-platform/1.0';
public const STANDARDS_SOURCE = 'https://git.mokoconsulting.tech/MokoConsulting/moko-platform';
/** Valid platform slugs — must match Template-* repo names. */
public const VALID_PLATFORMS = [
@@ -180,7 +180,7 @@ class MokoStandardsParser
* @type string $name Repository name (required)
* @type string $org Organization (required)
* @type string $platform Platform slug (required)
* @type string $standards_version MokoStandards version
* @type string $standards_version moko-platform version
* @type string $description Repo description
* @type string $license SPDX license identifier
* @type list<string> $topics Repo topics
@@ -205,7 +205,7 @@ class MokoStandardsParser
// Add comment header
$dom->appendChild($dom->createComment(
"\n MokoStandards Repository Manifest\n"
. " Auto-generated by MokoStandards bulk sync.\n"
. " Auto-generated by moko-platform bulk sync.\n"
. " Manual edits to <governance> and <last-synced> may be overwritten.\n"
. " See: docs/standards/mokostandards-file-spec.md\n"
));
@@ -316,7 +316,7 @@ class MokoStandardsParser
{
$id = $xml->identity ?? null;
if ($id === null) {
throw new \RuntimeException('.mokostandards: missing required <identity> element');
throw new \RuntimeException('manifest.xml: missing required <identity> element');
}
$result = [
@@ -325,7 +325,7 @@ class MokoStandardsParser
];
if ($result['name'] === '') {
throw new \RuntimeException('.mokostandards: <identity><name> is required');
throw new \RuntimeException('manifest.xml: <identity><name> is required');
}
if (isset($id->description)) {
@@ -352,7 +352,7 @@ class MokoStandardsParser
{
$gov = $xml->governance ?? null;
if ($gov === null) {
throw new \RuntimeException('.mokostandards: missing required <governance> element');
throw new \RuntimeException('manifest.xml: missing required <governance> element');
}
$result = [
@@ -362,7 +362,7 @@ class MokoStandardsParser
];
if ($result['platform'] === '') {
throw new \RuntimeException('.mokostandards: <governance><platform> is required');
throw new \RuntimeException('manifest.xml: <governance><platform> is required');
}
if (isset($gov->{'last-synced'})) {
+2 -2
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise
* INGROUP: MokoStandards.Lib
* DEFGROUP: MokoPlatform.Enterprise
* INGROUP: MokoPlatform.Lib
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/PackageBuilder.php
* BRIEF: Builds release packages for generic, Dolibarr module, and Joomla component projects
+3 -3
View File
@@ -7,8 +7,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Platform
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Platform
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/PlatformAdapterFactory.php
* BRIEF: Factory for creating platform-specific GitPlatformAdapter instances
@@ -33,7 +33,7 @@ use RuntimeException;
* $repos = $adapter->listOrgRepos('mokoconsulting-tech');
* ```
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.06.10
*
* @since 04.00.00
+3 -3
View File
@@ -9,8 +9,8 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/PluginFactory.php
* BRIEF: Plugin factory for project type detection
@@ -23,7 +23,7 @@ namespace MokoEnterprise;
*
* Provides convenient methods for plugin instantiation with dependency injection
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 1.0.0
*/
class PluginFactory
+3 -3
View File
@@ -9,8 +9,8 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/PluginRegistry.php
* BRIEF: Plugin registry for available project plugins
@@ -35,7 +35,7 @@ use MokoEnterprise\Plugins\McpServerPlugin;
*
* Manages plugin discovery, registration, and lifecycle
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 1.0.0
*/
class PluginRegistry
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/ApiPlugin.php
* BRIEF: Enterprise plugin for API/Microservices projects
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/DocumentationPlugin.php
* BRIEF: Enterprise plugin for documentation projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/DolibarrPlugin.php
* BRIEF: Enterprise plugin for Dolibarr modules
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/GenericPlugin.php
* BRIEF: Enterprise plugin for generic projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/JoomlaPlugin.php
* BRIEF: Enterprise plugin for Joomla projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/McpServerPlugin.php
* BRIEF: Enterprise plugin for MCP (Model Context Protocol) server projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/MobilePlugin.php
* BRIEF: Enterprise plugin for mobile app projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/NodeJsPlugin.php
* BRIEF: Enterprise plugin for Node.js/TypeScript projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/PythonPlugin.php
* BRIEF: Enterprise plugin for Python projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/TerraformPlugin.php
* BRIEF: Enterprise plugin for Terraform projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/Plugins/WordPressPlugin.php
* BRIEF: Enterprise plugin for WordPress projects
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.ProjectTypes
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.ProjectTypes
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/ProjectConfigValidator.php
* BRIEF: Enterprise library for validating project configurations
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.ProjectTypes
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.ProjectTypes
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/ProjectMetricsCollector.php
* BRIEF: Enterprise library for collecting project-specific metrics
+3 -3
View File
@@ -9,8 +9,8 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Plugins
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Plugins
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/ProjectPluginInterface.php
* BRIEF: Interface for project type plugins
@@ -24,7 +24,7 @@ namespace MokoEnterprise;
* Each project type (Joomla, Node.js, Python, etc.) implements this interface
* to provide type-specific validation, metrics, and management capabilities.
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 1.0.0
*/
interface ProjectPluginInterface
+2 -2
View File
@@ -8,8 +8,8 @@
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.ProjectTypes
* INGROUP: MokoStandards
* DEFGROUP: MokoPlatform.Enterprise.ProjectTypes
* INGROUP: MokoPlatform
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/ProjectTypeDetector.php
* BRIEF: Enterprise library for detecting project types
+4 -4
View File
@@ -10,15 +10,15 @@ declare(strict_types=1);
* SPDX-License-Identifier: GPL-3.0-or-later
*
* FILE INFORMATION
* DEFGROUP: MokoStandards.Enterprise.Recovery
* INGROUP: MokoStandards.Enterprise
* DEFGROUP: MokoPlatform.Enterprise.Recovery
* INGROUP: MokoPlatform.Enterprise
* REPO: https://git.mokoconsulting.tech/MokoConsulting/moko-platform
* PATH: /lib/Enterprise/RecoveryError.php
* BRIEF: Recovery error exception class
*
* @package MokoStandards\Enterprise
* @package MokoPlatform\Enterprise
* @version 04.00.04
* @author MokoStandards Team
* @author moko-platform Team
* @license GPL-3.0-or-later
*/

Some files were not shown because too many files have changed in this diff Show More