v2.6.5 (Lyra): Dynamische pad-resolutie, WordPress-stijl docblocks, security-fix wachtwoord, git-historie schoon
- Bug: dashboard toonde 0 content (AdminPluginAPI::getContentDir() gaf relatief pad terug zonder normalisatie) - Dynamische pad-resolutie: PluginAPIInterface uitgebreid met getProjectRoot/getContentDir/getPluginsDir/getVersionInfo; CMSAPI en AdminPluginAPI implementeren deze universeel - public/index.php media-serving gebruikt $config['content_dir'] i.p.v. hardcoded /content - Navigation en Logs plugins halen paden via de API i.p.v. hardcoded dirname(__DIR__) - WordPress-stijl docblocks toegevoegd voor alle classes, methods, properties en functies (~450 docblocks, @since 2.6.5) - Security: hardcoded plaintext-wachtwoord 'admin' verwijderd uit AdminAuth.php; bij eerste installatie wordt een cryptografisch veilig wachtwoord gegenereerd (random_bytes, 16 tekens) en eenmalig op het inlogscherm getoond - Security: git-geschiedenis schoongemaakt (admin.json, admin.json.example, admin-console/config/admin.json verwijderd uit alle commits; filter-branch over alle branches + tags, gc --prune --aggressive) - README.md, README.en.md, AGENTS.md bijgewerkt - Test-scripts bijgewerkt naar clean-URL structuur + actuele ARIA-waarden - Versie verhoogd naar 2.6.5 - Tests: pentest 29/29, WCAG 25/25, functioneel 16/16, enhanced 25/25
This commit is contained in:
@@ -8,14 +8,14 @@
|
||||
* - Restore from an uploaded ZIP file
|
||||
* - Optional git-based versioning (init / commit / log / restore)
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*/
|
||||
class ContentBackup
|
||||
{
|
||||
/**
|
||||
* Pad naar de content-map.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
* @var string Pad naar de content-map.
|
||||
*/
|
||||
private string $contentDir;
|
||||
@@ -23,7 +23,7 @@ class ContentBackup
|
||||
/**
|
||||
* Pad naar de project-root.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
* @var string Pad naar de project-root.
|
||||
*/
|
||||
private string $projectRoot;
|
||||
@@ -31,7 +31,7 @@ class ContentBackup
|
||||
/**
|
||||
* Of git beschikbaar is in de content-map.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
* @var bool Of git beschikbaar is.
|
||||
*/
|
||||
private bool $gitAvailable;
|
||||
@@ -42,7 +42,7 @@ class ContentBackup
|
||||
* Stelt de content-map en project-root in en detecteert of git
|
||||
* beschikbaar is op het systeem.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $contentDir Pad naar de content-map.
|
||||
* @param string $projectRoot Optioneel. Pad naar de project-root. Default de map drie niveaus boven deze class.
|
||||
@@ -57,7 +57,7 @@ class ContentBackup
|
||||
/**
|
||||
* Controleer of git beschikbaar is en de content-map in een git-repo zit.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return bool True indien git beschikbaar is.
|
||||
*/
|
||||
@@ -72,7 +72,7 @@ class ContentBackup
|
||||
* Controleert of ZipArchive beschikbaar is en de content-map bestaat,
|
||||
* en voegt recursief alle bestanden en mappen toe aan het ZIP-archief.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $outputPath Pad waar het ZIP-bestand geschreven moet worden.
|
||||
* @return bool True bij succes, false bij falen.
|
||||
@@ -101,7 +101,7 @@ class ContentBackup
|
||||
* Pakt het ZIP-bestand uit in een tijdelijke map, maakt een backup van de
|
||||
* huidige content-map, kopieert de nieuwe content en ruimt oude backups op.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $zipPath Pad naar het geüploade ZIP-bestand.
|
||||
* @return array{success:bool,message:string} Resultaat-array met success en message.
|
||||
@@ -164,7 +164,7 @@ class ContentBackup
|
||||
* Voert `git init` uit en configureert een default identiteit (user.email
|
||||
* en user.name) zodat commits werken zonder globale git-config.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return array{success:bool,message:string} Resultaat-array met success en message.
|
||||
*/
|
||||
@@ -193,7 +193,7 @@ class ContentBackup
|
||||
* zijn via `git status --porcelain`, en commit met de opgegeven message.
|
||||
* Bij een lege message wordt een standaardmessage gegenereerd.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $message Commit message.
|
||||
* @return array{success:bool,message:string} Resultaat-array met success en message.
|
||||
@@ -236,7 +236,7 @@ class ContentBackup
|
||||
* Leest commits uit met `git log --pretty=format:%H|%h|%ai|%s` en parseert
|
||||
* deze naar een array met hash, short, date en message per commit.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param int $limit Maximum aantal entries. Default 20.
|
||||
* @return array{success:bool,commits:array<int,array{hash:string,short:string,date:string,message:string}>,message:string} Resultaat-array met success, commits en message.
|
||||
@@ -290,7 +290,7 @@ class ContentBackup
|
||||
* `git checkout <hash> -- .` uit om de bestanden van die commit
|
||||
* in de working tree te herstellen.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $commitHash Commit-hash om naar te herstellen.
|
||||
* @return array{success:bool,message:string} Resultaat-array met success en message.
|
||||
@@ -322,7 +322,7 @@ class ContentBackup
|
||||
/**
|
||||
* Controleer of de content-map een git-repository bevat.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return bool True indien een .git-map aanwezig is.
|
||||
*/
|
||||
@@ -340,7 +340,7 @@ class ContentBackup
|
||||
*
|
||||
* Voert `git --version` uit en controleert de exit-code.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return bool True indien git uitvoerbaar is.
|
||||
*/
|
||||
@@ -356,7 +356,7 @@ class ContentBackup
|
||||
* Gebruikt proc_open met aparte pipes voor stdout, stderr en stdin.
|
||||
* Alle argumenten worden via escapeshellarg ge-escaped.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param array<int,string> $args Git-commando-argumenten.
|
||||
* @param string|null $cwd Optioneel. Werkdirectory voor het git-proces.
|
||||
@@ -400,7 +400,7 @@ class ContentBackup
|
||||
* Itereert over alle entries in $dir en voegt mappen (als lege dir) en
|
||||
* bestanden toe onder de opgegeven $prefix in het ZIP-archief.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param ZipArchive $zip ZIP-archief om aan toe te voegen.
|
||||
* @param string $dir Pad naar de bronmap.
|
||||
@@ -433,7 +433,7 @@ class ContentBackup
|
||||
* Maakt de doelmap aan indien nodig en kopieert alle bestanden en
|
||||
* submappen vanuit de bronmap.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $src Pad naar de bronmap.
|
||||
* @param string $dst Pad naar de doelmap.
|
||||
@@ -471,7 +471,7 @@ class ContentBackup
|
||||
*
|
||||
* Verwijdert eerst alle bestanden en submappen, daarna de map zelf.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @param string $dir Pad naar de te verwijderen map.
|
||||
* @return void
|
||||
@@ -507,7 +507,7 @@ class ContentBackup
|
||||
* suffix, sorteert op wijzigingstijd (oudste eerst) en verwijdert alle
|
||||
* backups behalve de meest recente.
|
||||
*
|
||||
* @since 2.6.4
|
||||
* @since 2.6.5
|
||||
*
|
||||
* @return void
|
||||
*/
|
||||
|
||||
Reference in New Issue
Block a user