diff --git a/CLAUDE.md b/CLAUDE.md index de1910e145..1e435030d8 100644 --- a/CLAUDE.md +++ b/CLAUDE.md @@ -229,15 +229,22 @@ fogproject/ │ │ ├── init.php # Initiator class: autoloader, session, sanitization │ │ ├── schema.php # DB schema (CREATE TABLE as PHP arrays) │ │ └── text.php # $foglang[] translation strings -│ ├── lib/ -│ │ ├── fog/ # 121 core *.class.php files (models, managers, utilities) -│ │ ├── pages/ # 20 *.page.php UI page classes -│ │ ├── hooks/ # *.hook.php hook classes -│ │ ├── events/ # *.event.php event classes -│ │ ├── reports/ # *.report.php report classes -│ │ ├── db/ # PDODB, DatabaseManager -│ │ ├── router/ # AltoRouter-based API routing -│ │ └── plugins/ # 15 plugin directories +│ ├── src/ # ALL core classes: PSR-4, FOG\\ +│ │ ├── Items/ # 67 models (Host, Image, Snapin, ...) +│ │ ├── Managers/ # 66 collection/query classes +│ │ ├── Base/ # 18 FOGBase, FOGController, FOGPage, managers +│ │ ├── Pages/ # 28 UI page classes +│ │ ├── Reports/ # 13 report classes +│ │ ├── Hooks/ # 10 hook classes +│ │ ├── Events/ # 1 event class +│ │ └── Audit,Auth,Boot,Client,Db,Exception,Net,Router,Service, +│ │ # TaskHandling,Util +│ ├── lib/ # only two things live here now +│ │ ├── router/ # altorouter/altotransformer — a FORK, kept +│ │ │ # under upstream's name and MIT license +│ │ │ # (ADR 0013 §3); everything else moved to src/ +│ │ └── plugins/ # installed plugin artifacts, NOT repo source +│ │ # (ADR 0009) — gitignored, root-owned │ └── management/ # Apache/Nginx document root │ ├── index.php # Main UI entry point │ ├── js/fog/ # FOG-specific JS (fog.js, fog.common.js, entity subdirs) @@ -531,8 +538,8 @@ badly — `ou` and `windowskey` become "Ou" and "Windowskey" without it. | `packages/web/commons/init.php` | Autoloader, session config, `Initiator` class | | `packages/web/commons/base.inc.php` | Security headers, output buffering setup | | `packages/web/commons/schema.php` | DB schema definitions | -| `packages/web/lib/fog/fogbase.class.php` | Root of the class hierarchy (~2900 lines) | -| `packages/web/lib/fog/loadglobals.class.php` | Bootstraps all global singletons | +| `packages/web/src/Base/FOGBase.php` | Root of the class hierarchy (~2900 lines) | +| `packages/web/src/Base/LoadGlobals.php` | Bootstraps all global singletons | | `packages/web/commons/config.class.php` | **Not in git** — generated by the installer, beside `fogpaths.php`. Was `lib/fog/config.class.php`; that directory is gone | --- diff --git a/bin/psr4-scan.php b/bin/psr4-scan.php index ed14d5adf7..a0c6e61211 100644 --- a/bin/psr4-scan.php +++ b/bin/psr4-scan.php @@ -201,6 +201,16 @@ 'FOGController' => 'Items', 'FOGService' => 'Service', 'FOGClient' => 'Client', + // The four discovery kinds. Ancestry rather than 52 TABLE rows because + // the parent IS the definition of the kind -- a class extending FOGPage + // is a page, and there is no way to write one that belongs elsewhere. + // ReportManagement before FOGPage: a report extends ReportManagement, + // which extends FOGPage, so the more specific ancestor has to be asked + // first or every report buckets as a page. + 'ReportManagement' => 'Reports', + 'FOGPage' => 'Pages', + 'Hook' => 'Hooks', + 'Event' => 'Events', ]; const SRC = 'packages/web/src/'; diff --git a/docs/adr/0013-flat-fog-namespace-and-the-reverse-alias-abi.md b/docs/adr/0013-flat-fog-namespace-and-the-reverse-alias-abi.md index 85474c3b29..2990cf166a 100644 --- a/docs/adr/0013-flat-fog-namespace-and-the-reverse-alias-abi.md +++ b/docs/adr/0013-flat-fog-namespace-and-the-reverse-alias-abi.md @@ -4,6 +4,72 @@ accepted +## Amended 2026-08-30 — the last flat classes are bucketed, and the flat namespace is gone + +**There is no `namespace FOG;` in core any more.** The 52 discovery-named +classes — 28 pages, 10 hooks, 13 reports, 1 event — that the 2026-08-27 +amendment below kept flat under `lib/` are now PSR-4 files under +`src/{Pages,Hooks,Reports,Events}`, declaring `FOG\Pages\HostManagement`, +`FOG\Hooks\BootItem`, `FOG\Reports\Audit_Report`, `FOG\Events\HostList`. +Their `class_alias` trailers are deleted with them. `lib/` now holds only the +two AltoRouter files and the plugin roots. + +**The reason they stayed is gone, and it was never the reason it looked +like.** The amendment below says PSR-4 "does not do discovery", which is true +and is not the constraint. The constraint was that the three discovery sites +derived a **bare** class name from `basename($file)` and resolved it from the +global namespace — so the files needed an alias, and an alias is what the rest +of the migration was retiring. Discovery had to learn a second file shape +before the classes could move; it had not been taught one. That is a property +of the loader, not of PSR-4. + +**What discovery does now.** Each site reads two sources and merges them: + +| Site | Core | Plugins | +|---|---|---| +| `FOGPageManager::loadPageClasses()` | `FOGBase::coreitems('Pages')` | `fileitems('.page.php', 'pages')` | +| `EventManager::load()` (and `HookManager`) | `coreitems($this->fileBucket)` | `fileitems($ext, $dir)` | +| `ReportManagement::loadCustomReports()` | `coreitems('Reports')` | `fileitems('.report.php', 'reports')` | + +`coreitems()` filters `Initiator::srcFileList()`, which is already built and +already cached, so this costs no extra walk. The name is then derived by +`FOGBase::classFromDiscoveredFile()`, which strips the discovery extension if +the file carries one and `.php` otherwise, then hands the result to +`qualify()`. That one call spans both shapes without branching on provenance: +`qualify()` maps a name `src/` declares onto its FQCN and passes anything else +through, so a core class resolves under the only name it now has and a +plugin's global-namespace class resolves exactly as it always did. + +**Nothing changes for plugins.** They keep the +`//..php` shape, keep the global namespace (ADR +0009), and a namespaced plugin page still requires its own `class_alias` — +`fileitems()` and the bare-name derivation are still what find it. The one +edit a plugin needs is to any reference to a class that moved, and in +`fog-plugins` that was a single name in eight files: `\FOG\ReportManagement` +became `\FOG\Pages\ReportManagement`. + +**The bridge's job is now empty, and it is kept anyway.** +`Initiator::_bridgeNamespaced()` existed to answer the flat `FOG\` for +the 52. With them bucketed, `srcClassMap()` holds every one, so the bridge's +first arm refuses the flat spelling with an error naming the correct FQCN +instead of resolving it. That refusal is the whole remaining value — a plugin +still spelling `\FOG\ReportManagement` gets a log line telling it what to +write, rather than a bare class-not-found at the call site. + +**One user-visible contract had to be preserved by hand.** A report's filename +was lowercase (`audit_report.report.php`) and three things read it as such: the +menu label, the base64 `f` URL parameter, and the keys of +`Authorization::REPORT_NODES`, which is a permission gate. The PSR-4 filename +is `Audit_Report.php`, so `loadCustomReports()` now lowercases what it used to +get lowercased for free. Without that one call the same report answers to a +different URL and a different permission node than it did before — a silent +authorization change, not a cosmetic one. + +**What is gated.** `bin/psr4-scan.php` gained four `RULES` entries deriving the +bucket from ancestry — `ReportManagement => Reports` before `FOGPage => Pages`, +since a report's chain reaches both — so `tests/psr4-layout.test.php` now +covers all 272 classes rather than 220 with 52 excluded by extension. + ## Amended 2026-08-27 — decisions 1 and 2 are both superseded **Decision 1 (a flat `FOG\` namespace) no longer holds.** Every class under diff --git a/docs/composer-psr4-plan.md b/docs/composer-psr4-plan.md index e6097ac864..cac0bc95eb 100644 --- a/docs/composer-psr4-plan.md +++ b/docs/composer-psr4-plan.md @@ -304,6 +304,17 @@ re-litigate: ### The 46 discovery-named files join by namespace only +> **Superseded 2026-08-30.** They moved. All 52 of them (the count grew after +> this was written) are PSR-4 files under `src/{Pages,Hooks,Reports,Events}` +> with bucketed namespaces and no aliases. The "HARD constraint" below is +> restated accurately in ADR 0013's 2026-08-30 amendment: the blocker was that +> discovery derived a **bare** name and resolved it globally, which is a +> property of the loader and was fixable, not a property of PSR-4. Discovery +> now reads core from `src/` and plugins from the old shape, and merges them. +> The paragraph below is kept because its reasoning about *why the filename +> was a contract* is still correct — and for reports it is still load-bearing, +> which is why `loadCustomReports()` now lowercases explicitly. + `FOG\Pages` (26), `FOG\Hooks` (10), `FOG\Reports` (9), `FOG\Events` (1). `VERIFIED` — this is inside the HARD constraint, because **the discovery @@ -414,7 +425,7 @@ Commit 1 does not preclude it. |---|---|---| | Move | **202** | `lib/{fog,db,client,service,reg-task,router}/*.class.php` → `src//.php`, `System` included | | Stay — ADR 0013 exclusions | 2 | `lib/router/altorouter.class.php`, `altotransformer.class.php` — upstream name, authorship, MIT license | -| Stay — HARD, discovery-named | 46 | 26 `.page.php`, 10 `.hook.php`, 9 `.report.php`, 1 `.event.php` | +| ~~Stay — HARD, discovery-named~~ **moved 2026-08-30** | 46 → 52 | 28 `.page.php`, 10 `.hook.php`, 13 `.report.php`, 1 `.event.php`, now `src/{Pages,Hooks,Reports,Events}` | | Stay — generated | 1 | `lib/fog/config.class.php` | `VERIFIED` — the 46 discovery-named files are reached only through diff --git a/docs/plugin-development.md b/docs/plugin-development.md index 4d2052dde2..0361d79a88 100644 --- a/docs/plugin-development.md +++ b/docs/plugin-development.md @@ -556,8 +556,11 @@ not imported — nothing ever writes their name in a `use` statement. So if you put one in your own namespace, the class FOG looks for does not exist and your page silently never registers. -If you want a namespace, end each such file the way core's own `lib/pages/` -files do: +This is a rule about **plugin** files, and core is no longer an example of it. +Core's pages, hooks, reports and events moved to `src/{Pages,Hooks,Reports, +Events}` and dropped their aliases: they are found by their bucketed namespace +now, not by basename. Your files keep the discovered shape, so they still need +the alias. If you want a namespace, end each such file like this: ```php namespace Vendor\HelloWorld; diff --git a/packages/web/src/Base/EventManager.php b/packages/web/src/Base/EventManager.php index 3820f03c08..a0ea3e8c3d 100644 --- a/packages/web/src/Base/EventManager.php +++ b/packages/web/src/Base/EventManager.php @@ -47,6 +47,17 @@ class EventManager extends FOGBase * @var string */ protected $fileDirectory = 'events'; + /** + * The src/ bucket core listeners of this kind live in. + * + * Distinct from $fileDirectory, which now names the PLUGIN directory + * only: core moved to src/Events and src/Hooks, where the directory is + * StudlyCaps because it is a namespace segment rather than a path + * fragment matched case-sensitively by fileitems(). + * + * @var string + */ + protected $fileBucket = 'Events'; /** * Items log level. * @@ -341,24 +352,18 @@ public function notify($event, $eventData = []) * Truthiness, not identity, so this agrees with the check * HookManager::processEvent() makes at dispatch. One notion of active. * - * @param string $file Absolute path to the .hook.php/.event.php file. - * @param int $strlen Negative length of the extension, as load() has it. + * @param string $file Absolute path to the discovered file. + * @param string $extension The discovery extension, as load() has it. * * @return bool */ - private static function _declaresActive($file, $strlen) + private static function _declaresActive($file, $extension) { - $className = str_replace( - ["\t","\n",' '], - '_', - substr( - basename($file), - 0, - $strlen - ) - ); // class-name consumer: handed to class_exists() and ReflectionClass, // both of which resolve a namespaced name and a global one alike. + // classFromDiscoveredFile() is what decides which of the two this is + // -- a core hook under src/Hooks answers only to FOG\Hooks\. + $className = self::classFromDiscoveredFile($file, $extension); if (!class_exists($className)) { return false; } @@ -375,15 +380,23 @@ public function load() // Each manager says what it loads; see $fileExtension. $extension = $this->fileExtension; $dirpath = $this->fileDirectory; - $strlen = -strlen($extension); - list( - $normalfiles, - $pluginfiles - ) = self::fileitems( + // Core hooks and events are PSR-4 files under src/Hooks and + // src/Events; only the plugin roots still carry the *.hook.php / + // *.event.php shape, so fileitems() now returns the plugin half + // alone and coreitems() supplies the other. $normalfiles keeps its + // meaning -- the set that must opt in through $active -- and only + // its source changed. + $normalfiles = self::coreitems($this->fileBucket); + // Only the plugin half is taken; the non-plugin half fileitems() + // returns is empty now that no core listener carries the discovery + // extension. Indexed rather than destructured with a skipped element, + // which is both easier to read and not a shape formatters disagree + // about. + $pluginfiles = self::fileitems( $extension, $dirpath, true - ); + )[1]; // Non-plugin files opt in through $active. Ask the class, not the // file: this used to be a line-by-line regex for the literal text // `$active = true;`, which decided whether a hook ran on its @@ -394,7 +407,7 @@ public function load() // was active. $startfiles = []; foreach ($normalfiles as &$file) { - if (self::_declaresActive($file, $strlen)) { + if (self::_declaresActive($file, $extension)) { $startfiles[] = $file; } unset($file); @@ -405,6 +418,6 @@ public function load() $startfiles ); unset($pluginfiles); - self::startClassFromFiles($startfiles, $strlen); + self::startClassFromFiles($startfiles, $extension); } } diff --git a/packages/web/src/Base/FOGBase.php b/packages/web/src/Base/FOGBase.php index ec39fb4679..3580631ac7 100644 --- a/packages/web/src/Base/FOGBase.php +++ b/packages/web/src/Base/FOGBase.php @@ -4675,30 +4675,22 @@ public static function randWait() /** * Starts the class based on the filename passed. * - * @param array $files The array of files. - * @param int $strlen How much of file to strip off end to get classname. + * @param array $files The array of files. + * @param string $extension The discovery extension, e.g. '.hook.php'. * * @return void */ - public static function startClassFromFiles($files, $strlen) + public static function startClassFromFiles($files, $extension) { foreach ($files as &$file) { - $className = str_replace( - ["\t","\n",' '], - '_', - substr( - basename($file), - 0, - $strlen - ) - ); - // qualify()d: this is a "have we loaded this file's class - // already" short circuit, and a core class loaded under its - // namespaced name does not answer to its bare basename now that - // the global aliases are gone. Left bare it is merely wasteful - // rather than wrong -- the include below is include_once -- but - // it would stop short-circuiting for every core file in the list. - if (class_exists(self::qualify($className), false)) { + // Derives the FQCN for a core file under src/ and the bare name + // for a plugin's, which is what the two shapes respectively + // answer to. This is also the short circuit -- a core class + // loaded under its namespaced name does not answer to its bare + // basename now that the global aliases are gone, so deriving it + // bare here would stop short-circuiting for every core file. + $className = self::classFromDiscoveredFile($file, $extension); + if (class_exists($className, false)) { continue; } // The file list is a TTL-cached snapshot (Initiator:: @@ -4798,6 +4790,70 @@ public static function checkauth() } } } + /** + * Every core class file in one src/ bucket. + * + * The core half of discovery. Pages, hooks, reports and events used to be + * found by fileitems() like everything else, because they sat under + * lib// with a *..php name that both the scan regex in + * Initiator::_scanClassFiles() and fileitems()' own path regex could see. + * They are PSR-4 files under src//.php now, so neither + * regex matches them and fileitems() cannot return them at all -- it is + * left serving the plugin roots, which is the only place that shape still + * exists (ADR 0009). + * + * Read off Initiator::srcFileList() rather than by walking the bucket: + * that map is already built, already cached on its own TTL and already + * invalidated by forgetClassFileList(), so this adds no stat to a request + * and cannot disagree with what qualify() will resolve. + * + * @param string $bucket The src/ subdirectory, e.g. 'Pages'. + * + * @return string[] Absolute file paths. + */ + public static function coreitems(string $bucket): array + { + $files = []; + foreach (\Initiator::srcFileList() as $path) { + if (basename(dirname($path)) === $bucket) { + $files[] = $path; + } + } + @natcasesort($files); + return $files; + } + /** + * The name of the class a discovered file declares. + * + * Two file shapes reach discovery now and they answer to different names. + * A core class is src//.php and, since the global aliases + * were retired, answers ONLY to its namespaced name. A plugin class is + * //..php, is global-namespace by design and + * answers to its bare basename. + * + * qualify() spans both without a branch on where the file came from: it + * maps a name src/ declares onto its FQCN and passes anything else + * through untouched. So a plugin keeps resolving exactly as it did, and + * core resolves under the only name it now has. + * + * @param string $file Absolute path to the discovered file. + * @param string $extension The discovery extension, e.g. '.page.php'. + * + * @return string FQCN for a core class, bare name for a plugin's. + */ + public static function classFromDiscoveredFile( + string $file, + string $extension + ): string { + $base = basename($file); + $strlen = -strlen($extension); + $short = substr($base, $strlen) === $extension + ? substr($base, 0, $strlen) + : basename($base, '.php'); + return self::qualify( + str_replace(["\t","\n",' '], '_', $short) + ); + } /** * Get the file items. * diff --git a/packages/web/src/Base/FOGPage.php b/packages/web/src/Base/FOGPage.php index f5f0b79019..87f1c79092 100644 --- a/packages/web/src/Base/FOGPage.php +++ b/packages/web/src/Base/FOGPage.php @@ -20,7 +20,7 @@ use FOG\Items\Image; use FOG\Items\Site; use FOG\Items\Snapin; -use FOG\ReportManagement; +use FOG\Pages\ReportManagement; use FOG\Router\HTTPResponseCodes; use FOG\Router\Route; diff --git a/packages/web/src/Base/FOGPageManager.php b/packages/web/src/Base/FOGPageManager.php index e1e91f8e04..76bcb1fa5b 100644 --- a/packages/web/src/Base/FOGPageManager.php +++ b/packages/web/src/Base/FOGPageManager.php @@ -282,26 +282,32 @@ public function loadPageClasses() { global $node; $extension = '.page.php'; - $strlen = -strlen($extension); - $files = self::fileitems( - $extension, - 'pages' + // Core pages are PSR-4 files under src/Pages; plugin pages keep the + // /pages/.page.php shape fileitems() reads. Two sources + // because there are now two file shapes, not because core is special. + $files = self::fastmerge( + self::coreitems('Pages'), + self::fileitems( + $extension, + 'pages' + ) ); foreach ($files as &$file) { - $elementsub = substr($file, $strlen); - if (!in_array($elementsub, ['.page.php','.report.php'], true)) { - continue; - } - $className = substr(basename($file), 0, $strlen); + $className = self::classFromDiscoveredFile($file, $extension); if ($node == 'report') { $f = filter_input(INPUT_GET, 'f'); if ($f) { - $className = str_replace( - ' ', - '_', - base64_decode( - $f + // The report name off the URL is a bare, user-supplied + // string; qualify() is what turns it into the namespaced + // core report it names, and leaves a plugin's alone. + $className = self::qualify( + str_replace( + ' ', + '_', + base64_decode( + $f + ) ) ); } @@ -358,14 +364,17 @@ public function loadPageClasses() sprintf( 'FOG loadPageClasses: %s does not declare %s, so its' . ' page cannot be registered. A page file must' - . ' declare a class named after the file, reachable' - . ' under that bare name -- a namespaced class needs' + . ' declare a class named after the file: a core page' + . ' is src/Pages/.php declaring' + . ' FOG\Pages\, and a plugin page is' + . ' /pages/.page.php declaring the bare' + . ' -- a namespaced plugin page needs' . ' class_alias(__NAMESPACE__ . \'\\%s\', \'%s\');' . ' see ADR 0013.', $file, $className, - $className, - $className + basename($file, '.php'), + basename($file, '.php') ) ); continue; diff --git a/packages/web/src/Base/HookManager.php b/packages/web/src/Base/HookManager.php index 976b2ae00b..8ddeaf3e0c 100644 --- a/packages/web/src/Base/HookManager.php +++ b/packages/web/src/Base/HookManager.php @@ -40,6 +40,12 @@ class HookManager extends EventManager * @var string */ protected $fileDirectory = 'hooks'; + /** + * The src/ bucket core hooks live in. + * + * @var string + */ + protected $fileBucket = 'Hooks'; /** * Log level if needed. * diff --git a/packages/web/lib/events/hostlist.event.php b/packages/web/src/Events/HostList.php similarity index 78% rename from packages/web/lib/events/hostlist.event.php rename to packages/web/src/Events/HostList.php index de11629e9d..55409e0e7b 100644 --- a/packages/web/lib/events/hostlist.event.php +++ b/packages/web/src/Events/HostList.php @@ -12,7 +12,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Events; use FOG\Base\Event; @@ -60,11 +60,3 @@ public function __construct() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\HostList', 'HostList'); diff --git a/packages/web/lib/hooks/bootitem.hook.php b/packages/web/src/Hooks/BootItem.php similarity index 94% rename from packages/web/lib/hooks/bootitem.hook.php rename to packages/web/src/Hooks/BootItem.php index 9a4711fbcd..e79a8c82fc 100644 --- a/packages/web/lib/hooks/bootitem.hook.php +++ b/packages/web/src/Hooks/BootItem.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; use FOG\Router\Route; @@ -183,11 +183,3 @@ public function tweakmenu($arguments) } } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\BootItem', 'BootItem'); diff --git a/packages/web/lib/hooks/boottask.hook.php b/packages/web/src/Hooks/BootTask.php similarity index 88% rename from packages/web/lib/hooks/boottask.hook.php rename to packages/web/src/Hooks/BootTask.php index 888d0dcc50..e41ccab950 100644 --- a/packages/web/lib/hooks/boottask.hook.php +++ b/packages/web/src/Hooks/BootTask.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -64,7 +64,7 @@ public function __construct() * @param mixed $arguments The items to alter. * * @return void - * @throws Exception + * @throws \Exception */ public function changeTask($arguments) { @@ -102,11 +102,3 @@ public function changeTask($arguments) )->save(); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\BootTask', 'BootTask'); diff --git a/packages/web/lib/hooks/changehostname.hook.php b/packages/web/src/Hooks/ChangeHostname.php similarity index 85% rename from packages/web/lib/hooks/changehostname.hook.php rename to packages/web/src/Hooks/ChangeHostname.php index d9cd9058ab..a3fe1b8825 100644 --- a/packages/web/lib/hooks/changehostname.hook.php +++ b/packages/web/src/Hooks/ChangeHostname.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -84,11 +84,3 @@ public function hostData($arguments) } } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ChangeHostname', 'ChangeHostname'); diff --git a/packages/web/lib/hooks/hookdebugger.hook.php b/packages/web/src/Hooks/HookDebugger.php similarity index 86% rename from packages/web/lib/hooks/hookdebugger.hook.php rename to packages/web/src/Hooks/HookDebugger.php index 637b05eb79..5f8dbcad54 100644 --- a/packages/web/lib/hooks/hookdebugger.hook.php +++ b/packages/web/src/Hooks/HookDebugger.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; use FOG\Router\Route; @@ -106,11 +106,3 @@ public function run($arguments) ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\HookDebugger', 'HookDebugger'); diff --git a/packages/web/lib/hooks/hostaddvnclink.hook.php b/packages/web/src/Hooks/HostAddVNCLink.php similarity index 85% rename from packages/web/lib/hooks/hostaddvnclink.hook.php rename to packages/web/src/Hooks/HostAddVNCLink.php index 044c4bcaa0..ab2fce66b7 100644 --- a/packages/web/lib/hooks/hostaddvnclink.hook.php +++ b/packages/web/src/Hooks/HostAddVNCLink.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -89,11 +89,3 @@ public function hostData($arguments) } } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\HostAddVNCLink', 'HostAddVNCLink'); diff --git a/packages/web/lib/hooks/logviewerhook.hook.php b/packages/web/src/Hooks/LogViewerHook.php similarity index 90% rename from packages/web/lib/hooks/logviewerhook.hook.php rename to packages/web/src/Hooks/LogViewerHook.php index cb85886429..53eabf04ee 100644 --- a/packages/web/lib/hooks/logviewerhook.hook.php +++ b/packages/web/src/Hooks/LogViewerHook.php @@ -20,7 +20,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -120,11 +120,3 @@ public function logFolderAdd($arguments) $arguments['folders'][] = '/var/log/'; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\LogViewerHook', 'LogViewerHook'); diff --git a/packages/web/lib/hooks/mainmenudata.hook.php b/packages/web/src/Hooks/MainMenuData.php similarity index 85% rename from packages/web/lib/hooks/mainmenudata.hook.php rename to packages/web/src/Hooks/MainMenuData.php index 847a1be93f..f0c1533518 100644 --- a/packages/web/lib/hooks/mainmenudata.hook.php +++ b/packages/web/src/Hooks/MainMenuData.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -93,11 +93,3 @@ public function addToMainMenu($arguments) ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\MainMenuData', 'MainMenuData'); diff --git a/packages/web/lib/hooks/setsnapintaskstate.hook.php b/packages/web/src/Hooks/SetSnapinTaskState.php similarity index 89% rename from packages/web/lib/hooks/setsnapintaskstate.hook.php rename to packages/web/src/Hooks/SetSnapinTaskState.php index f741d2b26e..5fafb31d7a 100644 --- a/packages/web/lib/hooks/setsnapintaskstate.hook.php +++ b/packages/web/src/Hooks/SetSnapinTaskState.php @@ -12,7 +12,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -132,11 +132,3 @@ public function setStateWidth($arguments) ]; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\SetSnapinTaskState', 'SetSnapinTaskState'); diff --git a/packages/web/lib/hooks/submenudata.hook.php b/packages/web/src/Hooks/SubMenuData.php similarity index 92% rename from packages/web/lib/hooks/submenudata.hook.php rename to packages/web/src/Hooks/SubMenuData.php index 78eaee4015..b3cceb6ea3 100644 --- a/packages/web/lib/hooks/submenudata.hook.php +++ b/packages/web/src/Hooks/SubMenuData.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -135,11 +135,3 @@ public function subMenu($arguments) } } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\SubMenuData', 'SubMenuData'); diff --git a/packages/web/lib/hooks/template.hook.php b/packages/web/src/Hooks/Template.php similarity index 82% rename from packages/web/lib/hooks/template.hook.php rename to packages/web/src/Hooks/Template.php index 03122a5482..0fb59847d3 100644 --- a/packages/web/lib/hooks/template.hook.php +++ b/packages/web/src/Hooks/Template.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Hooks; use FOG\Base\Hook; @@ -75,11 +75,3 @@ public function hostData($arguments) ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Template', 'Template'); diff --git a/packages/web/lib/pages/activitymanagement.page.php b/packages/web/src/Pages/ActivityManagement.php similarity index 97% rename from packages/web/lib/pages/activitymanagement.page.php rename to packages/web/src/Pages/ActivityManagement.php index 53e30818c2..00dd8ea1d6 100644 --- a/packages/web/lib/pages/activitymanagement.page.php +++ b/packages/web/src/Pages/ActivityManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Authorization; use FOG\Base\FOGPage; @@ -313,11 +313,3 @@ public function getList() exit; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ActivityManagement', 'ActivityManagement'); diff --git a/packages/web/lib/pages/apidocumentation.page.php b/packages/web/src/Pages/ApiDocumentation.php similarity index 93% rename from packages/web/lib/pages/apidocumentation.page.php rename to packages/web/src/Pages/ApiDocumentation.php index c863bd1ef3..d4e71aa126 100644 --- a/packages/web/lib/pages/apidocumentation.page.php +++ b/packages/web/src/Pages/ApiDocumentation.php @@ -14,7 +14,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Router\Route; @@ -148,11 +148,3 @@ public function index(...$args) echo ''; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ApiDocumentation', 'ApiDocumentation'); diff --git a/packages/web/lib/pages/auditmanagement.page.php b/packages/web/src/Pages/AuditManagement.php similarity index 96% rename from packages/web/lib/pages/auditmanagement.page.php rename to packages/web/src/Pages/AuditManagement.php index 89a72f4a65..989a78842e 100644 --- a/packages/web/lib/pages/auditmanagement.page.php +++ b/packages/web/src/Pages/AuditManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Router\HTTPResponseCodes; @@ -232,11 +232,3 @@ public function getChanges() exit; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\AuditManagement', 'AuditManagement'); diff --git a/packages/web/lib/pages/clientmanagement.page.php b/packages/web/src/Pages/ClientManagement.php similarity index 92% rename from packages/web/lib/pages/clientmanagement.page.php rename to packages/web/src/Pages/ClientManagement.php index aed98c568b..afd23db3fc 100644 --- a/packages/web/lib/pages/clientmanagement.page.php +++ b/packages/web/src/Pages/ClientManagement.php @@ -14,7 +14,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; @@ -154,11 +154,3 @@ public function index(...$args) echo ''; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ClientManagement', 'ClientManagement'); diff --git a/packages/web/lib/pages/dashboardpage.page.php b/packages/web/src/Pages/DashboardPage.php similarity index 98% rename from packages/web/lib/pages/dashboardpage.page.php rename to packages/web/src/Pages/DashboardPage.php index e91af30ee3..2ce5a58cca 100644 --- a/packages/web/lib/pages/dashboardpage.page.php +++ b/packages/web/src/Pages/DashboardPage.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Audit\ImagingStats; use FOG\Auth\Authorization; @@ -848,11 +848,3 @@ private static function _userTrackingRetentionNotice() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\DashboardPage', 'DashboardPage'); diff --git a/packages/web/lib/pages/fogconfigurationpage.page.php b/packages/web/src/Pages/FOGConfigurationPage.php similarity index 99% rename from packages/web/lib/pages/fogconfigurationpage.page.php rename to packages/web/src/Pages/FOGConfigurationPage.php index e4415b34a3..3779ea1501 100644 --- a/packages/web/lib/pages/fogconfigurationpage.page.php +++ b/packages/web/src/Pages/FOGConfigurationPage.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Audit\Retention; use FOG\Auth\Authorization; @@ -3646,11 +3646,3 @@ public function getSettingsList() )); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\FOGConfigurationPage', 'FOGConfigurationPage'); diff --git a/packages/web/lib/pages/groupmanagement.page.php b/packages/web/src/Pages/GroupManagement.php similarity index 99% rename from packages/web/lib/pages/groupmanagement.page.php rename to packages/web/src/Pages/GroupManagement.php index efc3744f18..463e657301 100644 --- a/packages/web/lib/pages/groupmanagement.page.php +++ b/packages/web/src/Pages/GroupManagement.php @@ -13,7 +13,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Authorization; use FOG\Base\FOGPage; @@ -3666,11 +3666,3 @@ public function groupSitePost() $this->siteTabPost('group', $this->obj); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\GroupManagement', 'GroupManagement'); diff --git a/packages/web/lib/pages/hostmanagement.page.php b/packages/web/src/Pages/HostManagement.php similarity index 99% rename from packages/web/lib/pages/hostmanagement.page.php rename to packages/web/src/Pages/HostManagement.php index 77b1863f48..f3b7f8deab 100644 --- a/packages/web/lib/pages/hostmanagement.page.php +++ b/packages/web/src/Pages/HostManagement.php @@ -13,7 +13,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Authorization; use FOG\Base\FOGPage; @@ -5097,11 +5097,3 @@ public function hostSitePost() $this->siteTabPost('host', $this->obj); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\HostManagement', 'HostManagement'); diff --git a/packages/web/lib/pages/imagemanagement.page.php b/packages/web/src/Pages/ImageManagement.php similarity index 99% rename from packages/web/lib/pages/imagemanagement.page.php rename to packages/web/src/Pages/ImageManagement.php index 6b225e1b57..9019cdd16a 100644 --- a/packages/web/lib/pages/imagemanagement.page.php +++ b/packages/web/src/Pages/ImageManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Db\DatabaseManager; @@ -2214,11 +2214,3 @@ public function getImagePrimaryStoragegroups() )); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ImageManagement', 'ImageManagement'); diff --git a/packages/web/lib/pages/impersonatemanagement.page.php b/packages/web/src/Pages/ImpersonateManagement.php similarity index 97% rename from packages/web/lib/pages/impersonatemanagement.page.php rename to packages/web/src/Pages/ImpersonateManagement.php index 007f019c76..34df2c26ee 100644 --- a/packages/web/lib/pages/impersonatemanagement.page.php +++ b/packages/web/src/Pages/ImpersonateManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Identity; use FOG\Base\FOGPage; @@ -335,10 +335,3 @@ public function endPost(...$args) $this->end(...$args); } } -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ImpersonateManagement', 'ImpersonateManagement'); diff --git a/packages/web/lib/pages/ipxemanagement.page.php b/packages/web/src/Pages/IpxeManagement.php similarity index 97% rename from packages/web/lib/pages/ipxemanagement.page.php rename to packages/web/src/Pages/IpxeManagement.php index a9baec4758..e7603f8147 100644 --- a/packages/web/lib/pages/ipxemanagement.page.php +++ b/packages/web/src/Pages/IpxeManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; @@ -560,11 +560,3 @@ function (&$serverFault) { ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\IpxeManagement', 'IpxeManagement'); diff --git a/packages/web/lib/pages/logviewermanagement.page.php b/packages/web/src/Pages/LogViewerManagement.php similarity index 98% rename from packages/web/lib/pages/logviewermanagement.page.php rename to packages/web/src/Pages/LogViewerManagement.php index 7ffc341e4d..425f9d9632 100644 --- a/packages/web/lib/pages/logviewermanagement.page.php +++ b/packages/web/src/Pages/LogViewerManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Router\Route; @@ -522,8 +522,3 @@ public function index(...$args) echo ''; } } - -// The autoloader resolves a page by its BARE class name (ADR 0013), so a -// namespaced page needs this or FOGPageManager logs "does not declare" and -// the node 404s. -class_alias(__NAMESPACE__ . '\\LogViewerManagement', 'LogViewerManagement'); diff --git a/packages/web/lib/pages/modulemanagement.page.php b/packages/web/src/Pages/ModuleManagement.php similarity index 97% rename from packages/web/lib/pages/modulemanagement.page.php rename to packages/web/src/Pages/ModuleManagement.php index 66b86affa8..42be97d1da 100644 --- a/packages/web/lib/pages/modulemanagement.page.php +++ b/packages/web/src/Pages/ModuleManagement.php @@ -13,7 +13,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; @@ -451,11 +451,3 @@ public function getHostsList() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ModuleManagement', 'ModuleManagement'); diff --git a/packages/web/lib/pages/pluginmanagement.page.php b/packages/web/src/Pages/PluginManagement.php similarity index 98% rename from packages/web/lib/pages/pluginmanagement.page.php rename to packages/web/src/Pages/PluginManagement.php index 48a3157039..544d4ec447 100644 --- a/packages/web/lib/pages/pluginmanagement.page.php +++ b/packages/web/src/Pages/PluginManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Authorization; use FOG\Base\FOGPage; @@ -497,7 +497,7 @@ public function installArchiveCommitPost() * * @param array $plugins the posted plugin ids * - * @throws Exception when any of them is blocked + * @throws \Exception when any of them is blocked * * @return void */ @@ -1104,11 +1104,3 @@ public function sidebarAjax() exit; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\PluginManagement', 'PluginManagement'); diff --git a/packages/web/lib/pages/printermanagement.page.php b/packages/web/src/Pages/PrinterManagement.php similarity index 98% rename from packages/web/lib/pages/printermanagement.page.php rename to packages/web/src/Pages/PrinterManagement.php index 82cda3d86c..5ee38a22f2 100644 --- a/packages/web/lib/pages/printermanagement.page.php +++ b/packages/web/src/Pages/PrinterManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Router\HTTPResponseCodes; @@ -382,7 +382,7 @@ private function _printerFormSections(array $values) * * @param string $config the raw submitted printertype * - * @throws Exception when the type is empty or unknown + * @throws \Exception when the type is empty or unknown * * @return string the canonical type (Local|Cups|iPrint|Network) */ @@ -955,11 +955,3 @@ function (&$serverFault) { ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\PrinterManagement', 'PrinterManagement'); diff --git a/packages/web/lib/pages/processlogin.page.php b/packages/web/src/Pages/ProcessLogin.php similarity index 97% rename from packages/web/lib/pages/processlogin.page.php rename to packages/web/src/Pages/ProcessLogin.php index 0d926aca79..5516199c05 100644 --- a/packages/web/lib/pages/processlogin.page.php +++ b/packages/web/src/Pages/ProcessLogin.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Items\User; @@ -363,11 +363,3 @@ public static function loginProviders() . implode('', $buttons); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ProcessLogin', 'ProcessLogin'); diff --git a/packages/web/lib/pages/reportmanagement.page.php b/packages/web/src/Pages/ReportManagement.php similarity index 94% rename from packages/web/lib/pages/reportmanagement.page.php rename to packages/web/src/Pages/ReportManagement.php index d5181d21dc..b19447f32d 100644 --- a/packages/web/lib/pages/reportmanagement.page.php +++ b/packages/web/src/Pages/ReportManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Router\HTTPResponseCodes; @@ -41,16 +41,35 @@ class ReportManagement extends FOGPage public static function loadCustomReports() { $extension = '.report.php'; - $files = self::fileitems( - $extension, - 'reports' + // Core reports are PSR-4 files under src/Reports; plugin reports keep + // the /reports/.report.php shape. + $files = self::fastmerge( + self::coreitems('Reports'), + self::fileitems( + $extension, + 'reports' + ) ); $strlen = -strlen($extension); foreach ($files as $i => &$file) { - $files[$i] = str_replace( - '_', - ' ', - substr(basename($file), 0, $strlen) + $base = basename($file); + $base = substr($base, $strlen) === $extension + ? substr($base, 0, $strlen) + : basename($base, '.php'); + // Lowercased because this name is a contract in three directions + // and every one of them is lowercase: the menu label, the base64 + // `f` parameter loadPageClasses() decodes back into a class name, + // and the keys of Authorization::REPORT_NODES. It used to come + // out lowercase for free -- the file was audit_report.report.php. + // The PSR-4 filename is Audit_Report.php, so the case has to be + // normalized here or the same report answers to a different URL + // and a different permission node than it did before. + $files[$i] = strtolower( + str_replace( + '_', + ' ', + $base + ) ); unset($file); } @@ -631,11 +650,3 @@ public function upload() echo ''; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ReportManagement', 'ReportManagement'); diff --git a/packages/web/lib/pages/rolemanagement.page.php b/packages/web/src/Pages/RoleManagement.php similarity index 98% rename from packages/web/lib/pages/rolemanagement.page.php rename to packages/web/src/Pages/RoleManagement.php index 03afd0c664..99d8f90ef5 100644 --- a/packages/web/lib/pages/rolemanagement.page.php +++ b/packages/web/src/Pages/RoleManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Authorization; use FOG\Auth\SiteScope; @@ -891,11 +891,3 @@ public function getUserGroupsList() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\RoleManagement', 'RoleManagement'); diff --git a/packages/web/lib/pages/schemaupdaterpage.page.php b/packages/web/src/Pages/SchemaUpdaterPage.php similarity index 98% rename from packages/web/lib/pages/schemaupdaterpage.page.php rename to packages/web/src/Pages/SchemaUpdaterPage.php index eaa19e2c8f..84b4d02f6b 100644 --- a/packages/web/lib/pages/schemaupdaterpage.page.php +++ b/packages/web/src/Pages/SchemaUpdaterPage.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Db\DatabaseManager; @@ -576,11 +576,3 @@ public function indexPost() $this->jsonSend($code, $msg); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\SchemaUpdaterPage', 'SchemaUpdaterPage'); diff --git a/packages/web/lib/pages/serverinfo.page.php b/packages/web/src/Pages/ServerInfo.php similarity index 97% rename from packages/web/lib/pages/serverinfo.page.php rename to packages/web/src/Pages/ServerInfo.php index add93e0cc0..280d869d35 100644 --- a/packages/web/lib/pages/serverinfo.page.php +++ b/packages/web/src/Pages/ServerInfo.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Items\MACAddress; @@ -347,11 +347,3 @@ public function index(...$args) echo ''; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ServerInfo', 'ServerInfo'); diff --git a/packages/web/lib/pages/serviceconfigurationpage.page.php b/packages/web/src/Pages/ServiceConfigurationPage.php similarity index 98% rename from packages/web/lib/pages/serviceconfigurationpage.page.php rename to packages/web/src/Pages/ServiceConfigurationPage.php index e0421e41cb..3c5b87ff00 100644 --- a/packages/web/lib/pages/serviceconfigurationpage.page.php +++ b/packages/web/src/Pages/ServiceConfigurationPage.php @@ -12,7 +12,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Router\HTTPResponseCodes; @@ -764,11 +764,3 @@ public function editPost() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\ServiceConfigurationPage', 'ServiceConfigurationPage'); diff --git a/packages/web/lib/pages/sitemanagement.page.php b/packages/web/src/Pages/SiteManagement.php similarity index 98% rename from packages/web/lib/pages/sitemanagement.page.php rename to packages/web/src/Pages/SiteManagement.php index e8250fa2e5..80ec87f372 100644 --- a/packages/web/lib/pages/sitemanagement.page.php +++ b/packages/web/src/Pages/SiteManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; @@ -791,11 +791,3 @@ public function getGrantUserGroupsList() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\SiteManagement', 'SiteManagement'); diff --git a/packages/web/lib/pages/snapinmanagement.page.php b/packages/web/src/Pages/SnapinManagement.php similarity index 99% rename from packages/web/lib/pages/snapinmanagement.page.php rename to packages/web/src/Pages/SnapinManagement.php index ec6b2c20e1..d562836bdb 100644 --- a/packages/web/lib/pages/snapinmanagement.page.php +++ b/packages/web/src/Pages/SnapinManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Exception\SnapinSaveException; @@ -1629,11 +1629,3 @@ public function getSnapinPrimaryStoragegroups() )); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\SnapinManagement', 'SnapinManagement'); diff --git a/packages/web/lib/pages/storagegroupmanagement.page.php b/packages/web/src/Pages/StorageGroupManagement.php similarity index 98% rename from packages/web/lib/pages/storagegroupmanagement.page.php rename to packages/web/src/Pages/StorageGroupManagement.php index 2539444a23..cc2a625a2a 100644 --- a/packages/web/lib/pages/storagegroupmanagement.page.php +++ b/packages/web/src/Pages/StorageGroupManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Items\StorageNode; @@ -1050,11 +1050,3 @@ public function getStoragegroupMasterStoragenodes() )); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\StorageGroupManagement', 'StorageGroupManagement'); diff --git a/packages/web/lib/pages/storagenodemanagement.page.php b/packages/web/src/Pages/StorageNodeManagement.php similarity index 99% rename from packages/web/lib/pages/storagenodemanagement.page.php rename to packages/web/src/Pages/StorageNodeManagement.php index 6b07d6009c..f0eaab4365 100644 --- a/packages/web/lib/pages/storagenodemanagement.page.php +++ b/packages/web/src/Pages/StorageNodeManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGPage; use FOG\Router\HTTPResponseCodes; @@ -1438,11 +1438,3 @@ public function editPost() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\StorageNodeManagement', 'StorageNodeManagement'); diff --git a/packages/web/lib/pages/taskmanagement.page.php b/packages/web/src/Pages/TaskManagement.php similarity index 99% rename from packages/web/lib/pages/taskmanagement.page.php rename to packages/web/src/Pages/TaskManagement.php index 444d1bc08a..5c8e0d9fa0 100644 --- a/packages/web/lib/pages/taskmanagement.page.php +++ b/packages/web/src/Pages/TaskManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Base\FOGManagerController; use FOG\Base\FOGPage; @@ -1543,11 +1543,3 @@ public function activescheduleddelsPost() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\TaskManagement', 'TaskManagement'); diff --git a/packages/web/lib/pages/usergroupmanagement.page.php b/packages/web/src/Pages/UserGroupManagement.php similarity index 98% rename from packages/web/lib/pages/usergroupmanagement.page.php rename to packages/web/src/Pages/UserGroupManagement.php index 0076a8faaf..c549df37f8 100644 --- a/packages/web/lib/pages/usergroupmanagement.page.php +++ b/packages/web/src/Pages/UserGroupManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Authorization; use FOG\Auth\SiteScope; @@ -646,11 +646,3 @@ public function getSitesList() ); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\UserGroupManagement', 'UserGroupManagement'); diff --git a/packages/web/lib/pages/usermanagement.page.php b/packages/web/src/Pages/UserManagement.php similarity index 99% rename from packages/web/lib/pages/usermanagement.page.php rename to packages/web/src/Pages/UserManagement.php index 813fffb704..70af390dd1 100644 --- a/packages/web/lib/pages/usermanagement.page.php +++ b/packages/web/src/Pages/UserManagement.php @@ -11,7 +11,7 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Pages; use FOG\Auth\Authorization; use FOG\Base\FOGPage; @@ -1763,11 +1763,3 @@ public function userSitePost() $this->siteTabPost('user', $this->obj); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\UserManagement', 'UserManagement'); diff --git a/packages/web/lib/reports/audit_report.report.php b/packages/web/src/Reports/Audit_Report.php similarity index 97% rename from packages/web/lib/reports/audit_report.report.php rename to packages/web/src/Reports/Audit_Report.php index 5ca5db862d..9d3a61649e 100644 --- a/packages/web/lib/reports/audit_report.report.php +++ b/packages/web/src/Reports/Audit_Report.php @@ -11,10 +11,11 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Audit\AuditStats; use FOG\Audit\ReportWindow; +use FOG\Pages\ReportManagement; /** * Who changed what, who was refused, and when. @@ -294,11 +295,3 @@ private static function _subject(array $row) return $type . ': ' . $label; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Audit_Report', 'Audit_Report'); diff --git a/packages/web/lib/reports/file_deleter.report.php b/packages/web/src/Reports/File_Deleter.php similarity index 86% rename from packages/web/lib/reports/file_deleter.report.php rename to packages/web/src/Reports/File_Deleter.php index f0809dc099..c79ed53d68 100644 --- a/packages/web/lib/reports/file_deleter.report.php +++ b/packages/web/src/Reports/File_Deleter.php @@ -11,8 +11,9 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; +use FOG\Pages\ReportManagement; use FOG\Router\Route; /** @@ -92,11 +93,3 @@ protected function reportRows() return (array) json_decode(Route::getData(), true); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\File_Deleter', 'File_Deleter'); diff --git a/packages/web/lib/reports/fleet_report.report.php b/packages/web/src/Reports/Fleet_Report.php similarity index 96% rename from packages/web/lib/reports/fleet_report.report.php rename to packages/web/src/Reports/Fleet_Report.php index 50af05ac33..240805a93f 100644 --- a/packages/web/lib/reports/fleet_report.report.php +++ b/packages/web/src/Reports/Fleet_Report.php @@ -11,10 +11,11 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Audit\FleetStats; use FOG\Audit\ReportWindow; +use FOG\Pages\ReportManagement; /** * How current the fleet is, and which machines have fallen behind. @@ -255,11 +256,3 @@ private static function _orNever($value, $never) return self::validDate($value) ? (string)$value : $never; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Fleet_Report', 'Fleet_Report'); diff --git a/packages/web/lib/reports/hardware_report.report.php b/packages/web/src/Reports/Hardware_Report.php similarity index 97% rename from packages/web/lib/reports/hardware_report.report.php rename to packages/web/src/Reports/Hardware_Report.php index 513e6fd151..e6d36fa12f 100644 --- a/packages/web/lib/reports/hardware_report.report.php +++ b/packages/web/src/Reports/Hardware_Report.php @@ -11,10 +11,11 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Audit\InventoryStats; use FOG\Audit\ReportWindow; +use FOG\Pages\ReportManagement; use FOG\Router\Route; /** @@ -325,11 +326,3 @@ private static function _pie($label, array $slices) ]; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Hardware_Report', 'Hardware_Report'); diff --git a/packages/web/lib/reports/history_report.report.php b/packages/web/src/Reports/History_Report.php similarity index 90% rename from packages/web/lib/reports/history_report.report.php rename to packages/web/src/Reports/History_Report.php index be2318689f..3b03e6b9d4 100644 --- a/packages/web/lib/reports/history_report.report.php +++ b/packages/web/src/Reports/History_Report.php @@ -11,9 +11,10 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Auth\Authorization; +use FOG\Pages\ReportManagement; use FOG\Router\Route; /** @@ -101,11 +102,3 @@ protected function reportRows() return (array) json_decode(Route::getData(), true); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\History_Report', 'History_Report'); diff --git a/packages/web/lib/reports/hosts_and_users.report.php b/packages/web/src/Reports/Hosts_And_Users.php similarity index 85% rename from packages/web/lib/reports/hosts_and_users.report.php rename to packages/web/src/Reports/Hosts_And_Users.php index 928c5a8b19..9f846c9a1e 100644 --- a/packages/web/lib/reports/hosts_and_users.report.php +++ b/packages/web/src/Reports/Hosts_And_Users.php @@ -11,8 +11,9 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; +use FOG\Pages\ReportManagement; use FOG\Router\Route; /** @@ -77,11 +78,3 @@ protected function reportRows() return (array) json_decode(Route::getData(), true); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Hosts_And_Users', 'Hosts_And_Users'); diff --git a/packages/web/lib/reports/imaging_report.report.php b/packages/web/src/Reports/Imaging_Report.php similarity index 96% rename from packages/web/lib/reports/imaging_report.report.php rename to packages/web/src/Reports/Imaging_Report.php index 72fabe0430..9346dd67a9 100644 --- a/packages/web/lib/reports/imaging_report.report.php +++ b/packages/web/src/Reports/Imaging_Report.php @@ -11,11 +11,12 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Audit\ImagingStats; use FOG\Audit\ReportWindow; use FOG\Items\TaskState; +use FOG\Pages\ReportManagement; /** * How much imaging happened, of what, and to how many machines. @@ -262,11 +263,3 @@ protected function reportRows() ]; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Imaging_Report', 'Imaging_Report'); diff --git a/packages/web/lib/reports/pending_mac_list.report.php b/packages/web/src/Reports/Pending_MAC_List.php similarity index 85% rename from packages/web/lib/reports/pending_mac_list.report.php rename to packages/web/src/Reports/Pending_MAC_List.php index 2cdbef5ad3..7dcb01d735 100644 --- a/packages/web/lib/reports/pending_mac_list.report.php +++ b/packages/web/src/Reports/Pending_MAC_List.php @@ -11,8 +11,9 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; +use FOG\Pages\ReportManagement; use FOG\Router\Route; /** @@ -77,11 +78,3 @@ protected function reportRows() return (array) json_decode(Route::getData(), true); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Pending_MAC_List', 'Pending_MAC_List'); diff --git a/packages/web/lib/reports/product_keys.report.php b/packages/web/src/Reports/Product_Keys.php similarity index 85% rename from packages/web/lib/reports/product_keys.report.php rename to packages/web/src/Reports/Product_Keys.php index cf632badaa..e7a5870020 100644 --- a/packages/web/lib/reports/product_keys.report.php +++ b/packages/web/src/Reports/Product_Keys.php @@ -11,8 +11,9 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; +use FOG\Pages\ReportManagement; use FOG\Router\Route; /** @@ -77,11 +78,3 @@ protected function reportRows() return (array) json_decode(Route::getData(), true); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Product_Keys', 'Product_Keys'); diff --git a/packages/web/lib/reports/run_history.report.php b/packages/web/src/Reports/Run_History.php similarity index 97% rename from packages/web/lib/reports/run_history.report.php rename to packages/web/src/Reports/Run_History.php index bb0a31cc7e..58ef628f0d 100644 --- a/packages/web/lib/reports/run_history.report.php +++ b/packages/web/src/Reports/Run_History.php @@ -11,10 +11,11 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Audit\ActivityWindow; use FOG\Audit\ReportWindow; +use FOG\Pages\ReportManagement; /** * What ran, and when it started and finished. @@ -284,11 +285,3 @@ protected function reportRows() ]; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Run_History', 'Run_History'); diff --git a/packages/web/lib/reports/snapin_list.report.php b/packages/web/src/Reports/Snapin_List.php similarity index 85% rename from packages/web/lib/reports/snapin_list.report.php rename to packages/web/src/Reports/Snapin_List.php index 0153363f98..754427d118 100644 --- a/packages/web/lib/reports/snapin_list.report.php +++ b/packages/web/src/Reports/Snapin_List.php @@ -11,8 +11,9 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; +use FOG\Pages\ReportManagement; use FOG\Router\Route; /** @@ -83,11 +84,3 @@ protected function reportRows() return (array) json_decode(Route::getData(), true); } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Snapin_List', 'Snapin_List'); diff --git a/packages/web/lib/reports/snapin_report.report.php b/packages/web/src/Reports/Snapin_Report.php similarity index 96% rename from packages/web/lib/reports/snapin_report.report.php rename to packages/web/src/Reports/Snapin_Report.php index b82e30fa53..1479419da3 100644 --- a/packages/web/lib/reports/snapin_report.report.php +++ b/packages/web/src/Reports/Snapin_Report.php @@ -11,10 +11,11 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Audit\ReportWindow; use FOG\Audit\SnapinStats; +use FOG\Pages\ReportManagement; /** * Which snapins ran, where, and whether they worked. @@ -246,11 +247,3 @@ protected function reportRows() ]; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Snapin_Report', 'Snapin_Report'); diff --git a/packages/web/lib/reports/storage_report.report.php b/packages/web/src/Reports/Storage_Report.php similarity index 97% rename from packages/web/lib/reports/storage_report.report.php rename to packages/web/src/Reports/Storage_Report.php index 18dfdead8f..4c1f091a16 100644 --- a/packages/web/lib/reports/storage_report.report.php +++ b/packages/web/src/Reports/Storage_Report.php @@ -11,10 +11,11 @@ * @link https://fogproject.org */ -namespace FOG; +namespace FOG\Reports; use FOG\Audit\ReportWindow; use FOG\Audit\StorageStats; +use FOG\Pages\ReportManagement; /** * How much the image estate weighs, and where it is meant to live. @@ -283,11 +284,3 @@ protected function reportRows() ]; } } - -/* - * Compatibility alias. Every consumer of this class' name -- core, - * bundled plugins and third-party plugins alike -- keeps working - * unqualified through this, so no call site had to be edited. - * Supported for all of 1.6; see docs/adr/0013. - */ -class_alias(__NAMESPACE__ . '\\Storage_Report', 'Storage_Report'); diff --git a/packages/web/vendor/composer/LICENSE b/packages/web/vendor/composer/LICENSE index f27399a042..62ecfd8d00 100644 --- a/packages/web/vendor/composer/LICENSE +++ b/packages/web/vendor/composer/LICENSE @@ -1,4 +1,3 @@ - Copyright (c) Nils Adermann, Jordi Boggiano Permission is hereby granted, free of charge, to any person obtaining a copy @@ -18,4 +17,3 @@ AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE. - diff --git a/packages/web/vendor/composer/autoload_classmap.php b/packages/web/vendor/composer/autoload_classmap.php index 6a7ea257da..fd5a0e0693 100644 --- a/packages/web/vendor/composer/autoload_classmap.php +++ b/packages/web/vendor/composer/autoload_classmap.php @@ -9,10 +9,19 @@ 'Composer\\InstalledVersions' => $vendorDir . '/composer/InstalledVersions.php', 'FOG\\Audit\\ActivityWindow' => $baseDir . '/src/Audit/ActivityWindow.php', 'FOG\\Audit\\Audit' => $baseDir . '/src/Audit/Audit.php', + 'FOG\\Audit\\AuditStats' => $baseDir . '/src/Audit/AuditStats.php', 'FOG\\Audit\\Blame' => $baseDir . '/src/Audit/Blame.php', + 'FOG\\Audit\\FleetStats' => $baseDir . '/src/Audit/FleetStats.php', + 'FOG\\Audit\\ImagingStats' => $baseDir . '/src/Audit/ImagingStats.php', + 'FOG\\Audit\\InventoryStats' => $baseDir . '/src/Audit/InventoryStats.php', + 'FOG\\Audit\\ReportWindow' => $baseDir . '/src/Audit/ReportWindow.php', 'FOG\\Audit\\Retention' => $baseDir . '/src/Audit/Retention.php', + 'FOG\\Audit\\SnapinStats' => $baseDir . '/src/Audit/SnapinStats.php', + 'FOG\\Audit\\StorageStats' => $baseDir . '/src/Audit/StorageStats.php', + 'FOG\\Audit\\WindowedStats' => $baseDir . '/src/Audit/WindowedStats.php', 'FOG\\Auth\\Authorization' => $baseDir . '/src/Auth/Authorization.php', 'FOG\\Auth\\CSRF' => $baseDir . '/src/Auth/CSRF.php', + 'FOG\\Auth\\Identity' => $baseDir . '/src/Auth/Identity.php', 'FOG\\Auth\\Redaction' => $baseDir . '/src/Auth/Redaction.php', 'FOG\\Auth\\SiteScope' => $baseDir . '/src/Auth/SiteScope.php', 'FOG\\Base\\Event' => $baseDir . '/src/Base/Event.php', @@ -31,10 +40,12 @@ 'FOG\\Base\\LoadGlobals' => $baseDir . '/src/Base/LoadGlobals.php', 'FOG\\Base\\Page' => $baseDir . '/src/Base/Page.php', 'FOG\\Base\\PluginTask' => $baseDir . '/src/Base/PluginTask.php', + 'FOG\\Base\\StorageEpoch' => $baseDir . '/src/Base/StorageEpoch.php', 'FOG\\Base\\System' => $baseDir . '/src/Base/System.php', 'FOG\\Boot\\BootMenuBase' => $baseDir . '/src/Boot/BootMenuBase.php', 'FOG\\Boot\\IpxeBootMenu' => $baseDir . '/src/Boot/IpxeBootMenu.php', 'FOG\\Boot\\Registration' => $baseDir . '/src/Boot/Registration.php', + 'FOG\\Boot\\SecureBootState' => $baseDir . '/src/Boot/SecureBootState.php', 'FOG\\Boot\\UbootBootMenu' => $baseDir . '/src/Boot/UbootBootMenu.php', 'FOG\\Boot\\WakeOnLan' => $baseDir . '/src/Boot/WakeOnLan.php', 'FOG\\Client\\Autologout' => $baseDir . '/src/Client/Autologout.php', @@ -48,12 +59,24 @@ 'FOG\\Client\\ServiceModule' => $baseDir . '/src/Client/ServiceModule.php', 'FOG\\Client\\SnapinClient' => $baseDir . '/src/Client/SnapinClient.php', 'FOG\\Client\\UserTrack' => $baseDir . '/src/Client/UserTrack.php', + 'FOG\\Db\\ConstraintViolation' => $baseDir . '/src/Db/ConstraintViolation.php', 'FOG\\Db\\DatabaseManager' => $baseDir . '/src/Db/DatabaseManager.php', 'FOG\\Db\\Mysqldump' => $baseDir . '/src/Db/Mysqldump.php', 'FOG\\Db\\PDODB' => $baseDir . '/src/Db/PDODB.php', 'FOG\\Db\\SchemaReconciler' => $baseDir . '/src/Db/SchemaReconciler.php', + 'FOG\\Events\\HostList' => $baseDir . '/src/Events/HostList.php', 'FOG\\Exception\\SnapinSaveException' => $baseDir . '/src/Exception/SnapinSaveException.php', 'FOG\\Exception\\UploadException' => $baseDir . '/src/Exception/UploadException.php', + 'FOG\\Hooks\\BootItem' => $baseDir . '/src/Hooks/BootItem.php', + 'FOG\\Hooks\\BootTask' => $baseDir . '/src/Hooks/BootTask.php', + 'FOG\\Hooks\\ChangeHostname' => $baseDir . '/src/Hooks/ChangeHostname.php', + 'FOG\\Hooks\\HookDebugger' => $baseDir . '/src/Hooks/HookDebugger.php', + 'FOG\\Hooks\\HostAddVNCLink' => $baseDir . '/src/Hooks/HostAddVNCLink.php', + 'FOG\\Hooks\\LogViewerHook' => $baseDir . '/src/Hooks/LogViewerHook.php', + 'FOG\\Hooks\\MainMenuData' => $baseDir . '/src/Hooks/MainMenuData.php', + 'FOG\\Hooks\\SetSnapinTaskState' => $baseDir . '/src/Hooks/SetSnapinTaskState.php', + 'FOG\\Hooks\\SubMenuData' => $baseDir . '/src/Hooks/SubMenuData.php', + 'FOG\\Hooks\\Template' => $baseDir . '/src/Hooks/Template.php', 'FOG\\Items\\APIToken' => $baseDir . '/src/Items/APIToken.php', 'FOG\\Items\\Architecture' => $baseDir . '/src/Items/Architecture.php', 'FOG\\Items\\AuditChange' => $baseDir . '/src/Items/AuditChange.php', @@ -93,6 +116,7 @@ 'FOG\\Items\\RolePermission' => $baseDir . '/src/Items/RolePermission.php', 'FOG\\Items\\RoleUserAssociation' => $baseDir . '/src/Items/RoleUserAssociation.php', 'FOG\\Items\\RoleUserGroupAssociation' => $baseDir . '/src/Items/RoleUserGroupAssociation.php', + 'FOG\\Items\\SavedFilter' => $baseDir . '/src/Items/SavedFilter.php', 'FOG\\Items\\ScheduledTask' => $baseDir . '/src/Items/ScheduledTask.php', 'FOG\\Items\\Schema' => $baseDir . '/src/Items/Schema.php', 'FOG\\Items\\Setting' => $baseDir . '/src/Items/Setting.php', @@ -118,6 +142,7 @@ 'FOG\\Items\\UserAuth' => $baseDir . '/src/Items/UserAuth.php', 'FOG\\Items\\UserGroup' => $baseDir . '/src/Items/UserGroup.php', 'FOG\\Items\\UserGroupMember' => $baseDir . '/src/Items/UserGroupMember.php', + 'FOG\\Items\\UserPref' => $baseDir . '/src/Items/UserPref.php', 'FOG\\Items\\UserTracking' => $baseDir . '/src/Items/UserTracking.php', 'FOG\\Managers\\APITokenManager' => $baseDir . '/src/Managers/APITokenManager.php', 'FOG\\Managers\\ArchitectureManager' => $baseDir . '/src/Managers/ArchitectureManager.php', @@ -157,6 +182,7 @@ 'FOG\\Managers\\RolePermissionManager' => $baseDir . '/src/Managers/RolePermissionManager.php', 'FOG\\Managers\\RoleUserAssociationManager' => $baseDir . '/src/Managers/RoleUserAssociationManager.php', 'FOG\\Managers\\RoleUserGroupAssociationManager' => $baseDir . '/src/Managers/RoleUserGroupAssociationManager.php', + 'FOG\\Managers\\SavedFilterManager' => $baseDir . '/src/Managers/SavedFilterManager.php', 'FOG\\Managers\\ScheduledTaskManager' => $baseDir . '/src/Managers/ScheduledTaskManager.php', 'FOG\\Managers\\SchemaManager' => $baseDir . '/src/Managers/SchemaManager.php', 'FOG\\Managers\\SettingManager' => $baseDir . '/src/Managers/SettingManager.php', @@ -182,12 +208,54 @@ 'FOG\\Managers\\UserGroupManager' => $baseDir . '/src/Managers/UserGroupManager.php', 'FOG\\Managers\\UserGroupMemberManager' => $baseDir . '/src/Managers/UserGroupMemberManager.php', 'FOG\\Managers\\UserManager' => $baseDir . '/src/Managers/UserManager.php', + 'FOG\\Managers\\UserPrefManager' => $baseDir . '/src/Managers/UserPrefManager.php', 'FOG\\Managers\\UserTrackingManager' => $baseDir . '/src/Managers/UserTrackingManager.php', 'FOG\\Net\\FOGFTP' => $baseDir . '/src/Net/FOGFTP.php', 'FOG\\Net\\FOGRollingURL' => $baseDir . '/src/Net/FOGRollingURL.php', 'FOG\\Net\\FOGSSH' => $baseDir . '/src/Net/FOGSSH.php', 'FOG\\Net\\FOGURLRequests' => $baseDir . '/src/Net/FOGURLRequests.php', 'FOG\\Net\\Ping' => $baseDir . '/src/Net/Ping.php', + 'FOG\\Pages\\ActivityManagement' => $baseDir . '/src/Pages/ActivityManagement.php', + 'FOG\\Pages\\ApiDocumentation' => $baseDir . '/src/Pages/ApiDocumentation.php', + 'FOG\\Pages\\AuditManagement' => $baseDir . '/src/Pages/AuditManagement.php', + 'FOG\\Pages\\ClientManagement' => $baseDir . '/src/Pages/ClientManagement.php', + 'FOG\\Pages\\DashboardPage' => $baseDir . '/src/Pages/DashboardPage.php', + 'FOG\\Pages\\FOGConfigurationPage' => $baseDir . '/src/Pages/FOGConfigurationPage.php', + 'FOG\\Pages\\GroupManagement' => $baseDir . '/src/Pages/GroupManagement.php', + 'FOG\\Pages\\HostManagement' => $baseDir . '/src/Pages/HostManagement.php', + 'FOG\\Pages\\ImageManagement' => $baseDir . '/src/Pages/ImageManagement.php', + 'FOG\\Pages\\ImpersonateManagement' => $baseDir . '/src/Pages/ImpersonateManagement.php', + 'FOG\\Pages\\IpxeManagement' => $baseDir . '/src/Pages/IpxeManagement.php', + 'FOG\\Pages\\LogViewerManagement' => $baseDir . '/src/Pages/LogViewerManagement.php', + 'FOG\\Pages\\ModuleManagement' => $baseDir . '/src/Pages/ModuleManagement.php', + 'FOG\\Pages\\PluginManagement' => $baseDir . '/src/Pages/PluginManagement.php', + 'FOG\\Pages\\PrinterManagement' => $baseDir . '/src/Pages/PrinterManagement.php', + 'FOG\\Pages\\ProcessLogin' => $baseDir . '/src/Pages/ProcessLogin.php', + 'FOG\\Pages\\ReportManagement' => $baseDir . '/src/Pages/ReportManagement.php', + 'FOG\\Pages\\RoleManagement' => $baseDir . '/src/Pages/RoleManagement.php', + 'FOG\\Pages\\SchemaUpdaterPage' => $baseDir . '/src/Pages/SchemaUpdaterPage.php', + 'FOG\\Pages\\ServerInfo' => $baseDir . '/src/Pages/ServerInfo.php', + 'FOG\\Pages\\ServiceConfigurationPage' => $baseDir . '/src/Pages/ServiceConfigurationPage.php', + 'FOG\\Pages\\SiteManagement' => $baseDir . '/src/Pages/SiteManagement.php', + 'FOG\\Pages\\SnapinManagement' => $baseDir . '/src/Pages/SnapinManagement.php', + 'FOG\\Pages\\StorageGroupManagement' => $baseDir . '/src/Pages/StorageGroupManagement.php', + 'FOG\\Pages\\StorageNodeManagement' => $baseDir . '/src/Pages/StorageNodeManagement.php', + 'FOG\\Pages\\TaskManagement' => $baseDir . '/src/Pages/TaskManagement.php', + 'FOG\\Pages\\UserGroupManagement' => $baseDir . '/src/Pages/UserGroupManagement.php', + 'FOG\\Pages\\UserManagement' => $baseDir . '/src/Pages/UserManagement.php', + 'FOG\\Reports\\Audit_Report' => $baseDir . '/src/Reports/Audit_Report.php', + 'FOG\\Reports\\File_Deleter' => $baseDir . '/src/Reports/File_Deleter.php', + 'FOG\\Reports\\Fleet_Report' => $baseDir . '/src/Reports/Fleet_Report.php', + 'FOG\\Reports\\Hardware_Report' => $baseDir . '/src/Reports/Hardware_Report.php', + 'FOG\\Reports\\History_Report' => $baseDir . '/src/Reports/History_Report.php', + 'FOG\\Reports\\Hosts_And_Users' => $baseDir . '/src/Reports/Hosts_And_Users.php', + 'FOG\\Reports\\Imaging_Report' => $baseDir . '/src/Reports/Imaging_Report.php', + 'FOG\\Reports\\Pending_MAC_List' => $baseDir . '/src/Reports/Pending_MAC_List.php', + 'FOG\\Reports\\Product_Keys' => $baseDir . '/src/Reports/Product_Keys.php', + 'FOG\\Reports\\Run_History' => $baseDir . '/src/Reports/Run_History.php', + 'FOG\\Reports\\Snapin_List' => $baseDir . '/src/Reports/Snapin_List.php', + 'FOG\\Reports\\Snapin_Report' => $baseDir . '/src/Reports/Snapin_Report.php', + 'FOG\\Reports\\Storage_Report' => $baseDir . '/src/Reports/Storage_Report.php', 'FOG\\Router\\HTTPResponseCodes' => $baseDir . '/src/Router/HTTPResponseCodes.php', 'FOG\\Router\\OpenAPI' => $baseDir . '/src/Router/OpenAPI.php', 'FOG\\Router\\Route' => $baseDir . '/src/Router/Route.php', diff --git a/packages/web/vendor/composer/autoload_static.php b/packages/web/vendor/composer/autoload_static.php index a195a73156..80ceaf8393 100644 --- a/packages/web/vendor/composer/autoload_static.php +++ b/packages/web/vendor/composer/autoload_static.php @@ -37,10 +37,19 @@ class ComposerStaticInitf1e42438574b3ce50c0c9ee957f57472 'Composer\\InstalledVersions' => __DIR__ . '/..' . '/composer/InstalledVersions.php', 'FOG\\Audit\\ActivityWindow' => __DIR__ . '/../..' . '/src/Audit/ActivityWindow.php', 'FOG\\Audit\\Audit' => __DIR__ . '/../..' . '/src/Audit/Audit.php', + 'FOG\\Audit\\AuditStats' => __DIR__ . '/../..' . '/src/Audit/AuditStats.php', 'FOG\\Audit\\Blame' => __DIR__ . '/../..' . '/src/Audit/Blame.php', + 'FOG\\Audit\\FleetStats' => __DIR__ . '/../..' . '/src/Audit/FleetStats.php', + 'FOG\\Audit\\ImagingStats' => __DIR__ . '/../..' . '/src/Audit/ImagingStats.php', + 'FOG\\Audit\\InventoryStats' => __DIR__ . '/../..' . '/src/Audit/InventoryStats.php', + 'FOG\\Audit\\ReportWindow' => __DIR__ . '/../..' . '/src/Audit/ReportWindow.php', 'FOG\\Audit\\Retention' => __DIR__ . '/../..' . '/src/Audit/Retention.php', + 'FOG\\Audit\\SnapinStats' => __DIR__ . '/../..' . '/src/Audit/SnapinStats.php', + 'FOG\\Audit\\StorageStats' => __DIR__ . '/../..' . '/src/Audit/StorageStats.php', + 'FOG\\Audit\\WindowedStats' => __DIR__ . '/../..' . '/src/Audit/WindowedStats.php', 'FOG\\Auth\\Authorization' => __DIR__ . '/../..' . '/src/Auth/Authorization.php', 'FOG\\Auth\\CSRF' => __DIR__ . '/../..' . '/src/Auth/CSRF.php', + 'FOG\\Auth\\Identity' => __DIR__ . '/../..' . '/src/Auth/Identity.php', 'FOG\\Auth\\Redaction' => __DIR__ . '/../..' . '/src/Auth/Redaction.php', 'FOG\\Auth\\SiteScope' => __DIR__ . '/../..' . '/src/Auth/SiteScope.php', 'FOG\\Base\\Event' => __DIR__ . '/../..' . '/src/Base/Event.php', @@ -59,10 +68,12 @@ class ComposerStaticInitf1e42438574b3ce50c0c9ee957f57472 'FOG\\Base\\LoadGlobals' => __DIR__ . '/../..' . '/src/Base/LoadGlobals.php', 'FOG\\Base\\Page' => __DIR__ . '/../..' . '/src/Base/Page.php', 'FOG\\Base\\PluginTask' => __DIR__ . '/../..' . '/src/Base/PluginTask.php', + 'FOG\\Base\\StorageEpoch' => __DIR__ . '/../..' . '/src/Base/StorageEpoch.php', 'FOG\\Base\\System' => __DIR__ . '/../..' . '/src/Base/System.php', 'FOG\\Boot\\BootMenuBase' => __DIR__ . '/../..' . '/src/Boot/BootMenuBase.php', 'FOG\\Boot\\IpxeBootMenu' => __DIR__ . '/../..' . '/src/Boot/IpxeBootMenu.php', 'FOG\\Boot\\Registration' => __DIR__ . '/../..' . '/src/Boot/Registration.php', + 'FOG\\Boot\\SecureBootState' => __DIR__ . '/../..' . '/src/Boot/SecureBootState.php', 'FOG\\Boot\\UbootBootMenu' => __DIR__ . '/../..' . '/src/Boot/UbootBootMenu.php', 'FOG\\Boot\\WakeOnLan' => __DIR__ . '/../..' . '/src/Boot/WakeOnLan.php', 'FOG\\Client\\Autologout' => __DIR__ . '/../..' . '/src/Client/Autologout.php', @@ -76,12 +87,24 @@ class ComposerStaticInitf1e42438574b3ce50c0c9ee957f57472 'FOG\\Client\\ServiceModule' => __DIR__ . '/../..' . '/src/Client/ServiceModule.php', 'FOG\\Client\\SnapinClient' => __DIR__ . '/../..' . '/src/Client/SnapinClient.php', 'FOG\\Client\\UserTrack' => __DIR__ . '/../..' . '/src/Client/UserTrack.php', + 'FOG\\Db\\ConstraintViolation' => __DIR__ . '/../..' . '/src/Db/ConstraintViolation.php', 'FOG\\Db\\DatabaseManager' => __DIR__ . '/../..' . '/src/Db/DatabaseManager.php', 'FOG\\Db\\Mysqldump' => __DIR__ . '/../..' . '/src/Db/Mysqldump.php', 'FOG\\Db\\PDODB' => __DIR__ . '/../..' . '/src/Db/PDODB.php', 'FOG\\Db\\SchemaReconciler' => __DIR__ . '/../..' . '/src/Db/SchemaReconciler.php', + 'FOG\\Events\\HostList' => __DIR__ . '/../..' . '/src/Events/HostList.php', 'FOG\\Exception\\SnapinSaveException' => __DIR__ . '/../..' . '/src/Exception/SnapinSaveException.php', 'FOG\\Exception\\UploadException' => __DIR__ . '/../..' . '/src/Exception/UploadException.php', + 'FOG\\Hooks\\BootItem' => __DIR__ . '/../..' . '/src/Hooks/BootItem.php', + 'FOG\\Hooks\\BootTask' => __DIR__ . '/../..' . '/src/Hooks/BootTask.php', + 'FOG\\Hooks\\ChangeHostname' => __DIR__ . '/../..' . '/src/Hooks/ChangeHostname.php', + 'FOG\\Hooks\\HookDebugger' => __DIR__ . '/../..' . '/src/Hooks/HookDebugger.php', + 'FOG\\Hooks\\HostAddVNCLink' => __DIR__ . '/../..' . '/src/Hooks/HostAddVNCLink.php', + 'FOG\\Hooks\\LogViewerHook' => __DIR__ . '/../..' . '/src/Hooks/LogViewerHook.php', + 'FOG\\Hooks\\MainMenuData' => __DIR__ . '/../..' . '/src/Hooks/MainMenuData.php', + 'FOG\\Hooks\\SetSnapinTaskState' => __DIR__ . '/../..' . '/src/Hooks/SetSnapinTaskState.php', + 'FOG\\Hooks\\SubMenuData' => __DIR__ . '/../..' . '/src/Hooks/SubMenuData.php', + 'FOG\\Hooks\\Template' => __DIR__ . '/../..' . '/src/Hooks/Template.php', 'FOG\\Items\\APIToken' => __DIR__ . '/../..' . '/src/Items/APIToken.php', 'FOG\\Items\\Architecture' => __DIR__ . '/../..' . '/src/Items/Architecture.php', 'FOG\\Items\\AuditChange' => __DIR__ . '/../..' . '/src/Items/AuditChange.php', @@ -121,6 +144,7 @@ class ComposerStaticInitf1e42438574b3ce50c0c9ee957f57472 'FOG\\Items\\RolePermission' => __DIR__ . '/../..' . '/src/Items/RolePermission.php', 'FOG\\Items\\RoleUserAssociation' => __DIR__ . '/../..' . '/src/Items/RoleUserAssociation.php', 'FOG\\Items\\RoleUserGroupAssociation' => __DIR__ . '/../..' . '/src/Items/RoleUserGroupAssociation.php', + 'FOG\\Items\\SavedFilter' => __DIR__ . '/../..' . '/src/Items/SavedFilter.php', 'FOG\\Items\\ScheduledTask' => __DIR__ . '/../..' . '/src/Items/ScheduledTask.php', 'FOG\\Items\\Schema' => __DIR__ . '/../..' . '/src/Items/Schema.php', 'FOG\\Items\\Setting' => __DIR__ . '/../..' . '/src/Items/Setting.php', @@ -146,6 +170,7 @@ class ComposerStaticInitf1e42438574b3ce50c0c9ee957f57472 'FOG\\Items\\UserAuth' => __DIR__ . '/../..' . '/src/Items/UserAuth.php', 'FOG\\Items\\UserGroup' => __DIR__ . '/../..' . '/src/Items/UserGroup.php', 'FOG\\Items\\UserGroupMember' => __DIR__ . '/../..' . '/src/Items/UserGroupMember.php', + 'FOG\\Items\\UserPref' => __DIR__ . '/../..' . '/src/Items/UserPref.php', 'FOG\\Items\\UserTracking' => __DIR__ . '/../..' . '/src/Items/UserTracking.php', 'FOG\\Managers\\APITokenManager' => __DIR__ . '/../..' . '/src/Managers/APITokenManager.php', 'FOG\\Managers\\ArchitectureManager' => __DIR__ . '/../..' . '/src/Managers/ArchitectureManager.php', @@ -185,6 +210,7 @@ class ComposerStaticInitf1e42438574b3ce50c0c9ee957f57472 'FOG\\Managers\\RolePermissionManager' => __DIR__ . '/../..' . '/src/Managers/RolePermissionManager.php', 'FOG\\Managers\\RoleUserAssociationManager' => __DIR__ . '/../..' . '/src/Managers/RoleUserAssociationManager.php', 'FOG\\Managers\\RoleUserGroupAssociationManager' => __DIR__ . '/../..' . '/src/Managers/RoleUserGroupAssociationManager.php', + 'FOG\\Managers\\SavedFilterManager' => __DIR__ . '/../..' . '/src/Managers/SavedFilterManager.php', 'FOG\\Managers\\ScheduledTaskManager' => __DIR__ . '/../..' . '/src/Managers/ScheduledTaskManager.php', 'FOG\\Managers\\SchemaManager' => __DIR__ . '/../..' . '/src/Managers/SchemaManager.php', 'FOG\\Managers\\SettingManager' => __DIR__ . '/../..' . '/src/Managers/SettingManager.php', @@ -210,12 +236,54 @@ class ComposerStaticInitf1e42438574b3ce50c0c9ee957f57472 'FOG\\Managers\\UserGroupManager' => __DIR__ . '/../..' . '/src/Managers/UserGroupManager.php', 'FOG\\Managers\\UserGroupMemberManager' => __DIR__ . '/../..' . '/src/Managers/UserGroupMemberManager.php', 'FOG\\Managers\\UserManager' => __DIR__ . '/../..' . '/src/Managers/UserManager.php', + 'FOG\\Managers\\UserPrefManager' => __DIR__ . '/../..' . '/src/Managers/UserPrefManager.php', 'FOG\\Managers\\UserTrackingManager' => __DIR__ . '/../..' . '/src/Managers/UserTrackingManager.php', 'FOG\\Net\\FOGFTP' => __DIR__ . '/../..' . '/src/Net/FOGFTP.php', 'FOG\\Net\\FOGRollingURL' => __DIR__ . '/../..' . '/src/Net/FOGRollingURL.php', 'FOG\\Net\\FOGSSH' => __DIR__ . '/../..' . '/src/Net/FOGSSH.php', 'FOG\\Net\\FOGURLRequests' => __DIR__ . '/../..' . '/src/Net/FOGURLRequests.php', 'FOG\\Net\\Ping' => __DIR__ . '/../..' . '/src/Net/Ping.php', + 'FOG\\Pages\\ActivityManagement' => __DIR__ . '/../..' . '/src/Pages/ActivityManagement.php', + 'FOG\\Pages\\ApiDocumentation' => __DIR__ . '/../..' . '/src/Pages/ApiDocumentation.php', + 'FOG\\Pages\\AuditManagement' => __DIR__ . '/../..' . '/src/Pages/AuditManagement.php', + 'FOG\\Pages\\ClientManagement' => __DIR__ . '/../..' . '/src/Pages/ClientManagement.php', + 'FOG\\Pages\\DashboardPage' => __DIR__ . '/../..' . '/src/Pages/DashboardPage.php', + 'FOG\\Pages\\FOGConfigurationPage' => __DIR__ . '/../..' . '/src/Pages/FOGConfigurationPage.php', + 'FOG\\Pages\\GroupManagement' => __DIR__ . '/../..' . '/src/Pages/GroupManagement.php', + 'FOG\\Pages\\HostManagement' => __DIR__ . '/../..' . '/src/Pages/HostManagement.php', + 'FOG\\Pages\\ImageManagement' => __DIR__ . '/../..' . '/src/Pages/ImageManagement.php', + 'FOG\\Pages\\ImpersonateManagement' => __DIR__ . '/../..' . '/src/Pages/ImpersonateManagement.php', + 'FOG\\Pages\\IpxeManagement' => __DIR__ . '/../..' . '/src/Pages/IpxeManagement.php', + 'FOG\\Pages\\LogViewerManagement' => __DIR__ . '/../..' . '/src/Pages/LogViewerManagement.php', + 'FOG\\Pages\\ModuleManagement' => __DIR__ . '/../..' . '/src/Pages/ModuleManagement.php', + 'FOG\\Pages\\PluginManagement' => __DIR__ . '/../..' . '/src/Pages/PluginManagement.php', + 'FOG\\Pages\\PrinterManagement' => __DIR__ . '/../..' . '/src/Pages/PrinterManagement.php', + 'FOG\\Pages\\ProcessLogin' => __DIR__ . '/../..' . '/src/Pages/ProcessLogin.php', + 'FOG\\Pages\\ReportManagement' => __DIR__ . '/../..' . '/src/Pages/ReportManagement.php', + 'FOG\\Pages\\RoleManagement' => __DIR__ . '/../..' . '/src/Pages/RoleManagement.php', + 'FOG\\Pages\\SchemaUpdaterPage' => __DIR__ . '/../..' . '/src/Pages/SchemaUpdaterPage.php', + 'FOG\\Pages\\ServerInfo' => __DIR__ . '/../..' . '/src/Pages/ServerInfo.php', + 'FOG\\Pages\\ServiceConfigurationPage' => __DIR__ . '/../..' . '/src/Pages/ServiceConfigurationPage.php', + 'FOG\\Pages\\SiteManagement' => __DIR__ . '/../..' . '/src/Pages/SiteManagement.php', + 'FOG\\Pages\\SnapinManagement' => __DIR__ . '/../..' . '/src/Pages/SnapinManagement.php', + 'FOG\\Pages\\StorageGroupManagement' => __DIR__ . '/../..' . '/src/Pages/StorageGroupManagement.php', + 'FOG\\Pages\\StorageNodeManagement' => __DIR__ . '/../..' . '/src/Pages/StorageNodeManagement.php', + 'FOG\\Pages\\TaskManagement' => __DIR__ . '/../..' . '/src/Pages/TaskManagement.php', + 'FOG\\Pages\\UserGroupManagement' => __DIR__ . '/../..' . '/src/Pages/UserGroupManagement.php', + 'FOG\\Pages\\UserManagement' => __DIR__ . '/../..' . '/src/Pages/UserManagement.php', + 'FOG\\Reports\\Audit_Report' => __DIR__ . '/../..' . '/src/Reports/Audit_Report.php', + 'FOG\\Reports\\File_Deleter' => __DIR__ . '/../..' . '/src/Reports/File_Deleter.php', + 'FOG\\Reports\\Fleet_Report' => __DIR__ . '/../..' . '/src/Reports/Fleet_Report.php', + 'FOG\\Reports\\Hardware_Report' => __DIR__ . '/../..' . '/src/Reports/Hardware_Report.php', + 'FOG\\Reports\\History_Report' => __DIR__ . '/../..' . '/src/Reports/History_Report.php', + 'FOG\\Reports\\Hosts_And_Users' => __DIR__ . '/../..' . '/src/Reports/Hosts_And_Users.php', + 'FOG\\Reports\\Imaging_Report' => __DIR__ . '/../..' . '/src/Reports/Imaging_Report.php', + 'FOG\\Reports\\Pending_MAC_List' => __DIR__ . '/../..' . '/src/Reports/Pending_MAC_List.php', + 'FOG\\Reports\\Product_Keys' => __DIR__ . '/../..' . '/src/Reports/Product_Keys.php', + 'FOG\\Reports\\Run_History' => __DIR__ . '/../..' . '/src/Reports/Run_History.php', + 'FOG\\Reports\\Snapin_List' => __DIR__ . '/../..' . '/src/Reports/Snapin_List.php', + 'FOG\\Reports\\Snapin_Report' => __DIR__ . '/../..' . '/src/Reports/Snapin_Report.php', + 'FOG\\Reports\\Storage_Report' => __DIR__ . '/../..' . '/src/Reports/Storage_Report.php', 'FOG\\Router\\HTTPResponseCodes' => __DIR__ . '/../..' . '/src/Router/HTTPResponseCodes.php', 'FOG\\Router\\OpenAPI' => __DIR__ . '/../..' . '/src/Router/OpenAPI.php', 'FOG\\Router\\Route' => __DIR__ . '/../..' . '/src/Router/Route.php', diff --git a/phpstan-baseline.neon b/phpstan-baseline.neon index bf60518a39..dd24ba55a5 100644 --- a/phpstan-baseline.neon +++ b/phpstan-baseline.neon @@ -133,1126 +133,1126 @@ parameters: path: packages/web/commons/schema.php - - message: '#^PHPDoc type string of property FOG\\HostList\:\:\$active is not covariant with PHPDoc type bool of overridden property FOG\\Base\\Event\:\:\$active\.$#' + message: '#^PHPDoc type string of property FOG\\Events\\HostList\:\:\$active is not covariant with PHPDoc type bool of overridden property FOG\\Base\\Event\:\:\$active\.$#' identifier: property.phpDocType count: 1 - path: packages/web/lib/events/hostlist.event.php + path: packages/web/src/Events/HostList.php - - message: '#^Property FOG\\HostList\:\:\$active \(string\) does not accept default value of type false\.$#' + message: '#^Property FOG\\Events\\HostList\:\:\$active \(string\) does not accept default value of type false\.$#' identifier: property.defaultValue count: 1 - path: packages/web/lib/events/hostlist.event.php + path: packages/web/src/Events/HostList.php - message: '#^PHPDoc tag @var has invalid value \(\$name\)\: Unexpected token "\$name", expected type at offset 53 on line 4$#' identifier: phpDoc.parseError count: 1 - path: packages/web/lib/hooks/bootitem.hook.php + path: packages/web/src/Hooks/BootItem.php - message: '#^PHPDoc tag @throws with type FOG\\Exception is not subtype of Throwable$#' identifier: throws.notThrowable count: 1 - path: packages/web/lib/hooks/boottask.hook.php + path: packages/web/src/Hooks/BootTask.php - message: '#^Parameter \#1 \$txt of static method FOG\\Base\\Hook\:\:log\(\) expects string, true given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/hookdebugger.hook.php + path: packages/web/src/Hooks/HookDebugger.php - message: '#^Parameter \#2 \$return of function print_r expects bool, int given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/hookdebugger.hook.php + path: packages/web/src/Hooks/HookDebugger.php - message: '#^Parameter \#3 \$logfile of static method FOG\\Base\\Hook\:\:log\(\) expects int, bool given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/hookdebugger.hook.php + path: packages/web/src/Hooks/HookDebugger.php - message: '#^Parameter \#4 \$logbrow of static method FOG\\Base\\Hook\:\:log\(\) expects int, bool given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/hookdebugger.hook.php + path: packages/web/src/Hooks/HookDebugger.php - message: '#^Parameter \#1 \$txt of static method FOG\\Base\\Hook\:\:log\(\) expects string, true given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/template.hook.php + path: packages/web/src/Hooks/Template.php - message: '#^Parameter \#2 \$return of function print_r expects bool, int given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/template.hook.php + path: packages/web/src/Hooks/Template.php - message: '#^Parameter \#3 \$logfile of static method FOG\\Base\\Hook\:\:log\(\) expects int, false given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/template.hook.php + path: packages/web/src/Hooks/Template.php - message: '#^Parameter \#4 \$logbrow of static method FOG\\Base\\Hook\:\:log\(\) expects int, true given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/hooks/template.hook.php + path: packages/web/src/Hooks/Template.php - - message: '#^Constructor of class FOG\\ActivityManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ActivityManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/activitymanagement.page.php + path: packages/web/src/Pages/ActivityManagement.php - - message: '#^Constructor of class FOG\\ApiDocumentation has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ApiDocumentation has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/apidocumentation.page.php + path: packages/web/src/Pages/ApiDocumentation.php - - message: '#^Constructor of class FOG\\AuditManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\AuditManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/auditmanagement.page.php + path: packages/web/src/Pages/AuditManagement.php - - message: '#^Constructor of class FOG\\ClientManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ClientManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/clientmanagement.page.php + path: packages/web/src/Pages/ClientManagement.php - message: '#^Call to function unset\(\) contains undefined variable \$SystemUptime\.$#' identifier: unset.variable count: 1 - path: packages/web/lib/pages/dashboardpage.page.php + path: packages/web/src/Pages/DashboardPage.php - message: '#^Call to function unset\(\) contains undefined variable \$fields\.$#' identifier: unset.variable count: 1 - path: packages/web/lib/pages/dashboardpage.page.php + path: packages/web/src/Pages/DashboardPage.php - message: '#^Call to function unset\(\) contains undefined variable \$tftp\.$#' identifier: unset.variable count: 2 - path: packages/web/lib/pages/dashboardpage.page.php + path: packages/web/src/Pages/DashboardPage.php - - message: '#^Constructor of class FOG\\DashboardPage has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\DashboardPage has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/dashboardpage.page.php + path: packages/web/src/Pages/DashboardPage.php - - message: '#^Static property FOG\\DashboardPage\:\:\$_tftp is never read, only written\.$#' + message: '#^Static property FOG\\Pages\\DashboardPage\:\:\$_tftp is never read, only written\.$#' identifier: property.onlyWritten count: 1 - path: packages/web/lib/pages/dashboardpage.page.php + path: packages/web/src/Pages/DashboardPage.php - message: '#^Variable \$pendingMACs might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/dashboardpage.page.php + path: packages/web/src/Pages/DashboardPage.php - message: '#^Call to function unset\(\) contains undefined variable \$findWhere\.$#' identifier: unset.variable count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Call to function unset\(\) contains undefined variable \$setWhere\.$#' identifier: unset.variable count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Call to function unset\(\) contains undefined variable \$val\.$#' identifier: unset.variable count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Cannot access property \$name on null\.$#' identifier: property.nonObject count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - - message: '#^Constructor of class FOG\\FOGConfigurationPage has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\FOGConfigurationPage has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Offset ''FOG_PXE_HIDDENMENU…''\|''FOG_PXE_MENU_TIMEOUT'' on array\{FOG_PXE_HIDDENMENU_TIMEOUT\: true, FOG_PXE_MENU_TIMEOUT\: true\} in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Offset ''refresh'' does not exist on array\{checkbox\: array, numeric\: array, ip\: array\}\.$#' identifier: offsetAccess.notFound count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Parameter \#2 \$whereItems of static method FOG\\Router\\Route\:\:getIds\(\) expects array, false given\.$#' identifier: argument.type count: 2 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Ternary operator condition is always true\.$#' identifier: ternary.alwaysTrue count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Unreachable statement \- code above always terminates\.$#' identifier: deadCode.unreachable count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Variable \$ip might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Variable \$objGetter might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - message: '#^Variable \$set might not be defined\.$#' identifier: variable.undefined count: 11 - path: packages/web/lib/pages/fogconfigurationpage.page.php + path: packages/web/src/Pages/FOGConfigurationPage.php - - message: '#^Constructor of class FOG\\GroupManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\GroupManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - - message: '#^Method FOG\\GroupManagement\:\:_groupAssocList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\GroupManagement\:\:_groupAssocList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - - message: '#^Method FOG\\GroupManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\GroupManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - - message: '#^Method FOG\\GroupManagement\:\:getModulesList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\GroupManagement\:\:getModulesList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - - message: '#^Method FOG\\GroupManagement\:\:getPrintersList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\GroupManagement\:\:getPrintersList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - - message: '#^Method FOG\\GroupManagement\:\:getSnapinsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\GroupManagement\:\:getSnapinsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - message: '#^Parameter \#1 \$array \(array\, mixed\>\) to function array_filter does not contain falsy values, the array will always stay the same\.$#' identifier: arrayFilter.same count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - message: '#^Parameter \#2 \$whereItems of static method FOG\\Router\\Route\:\:getIds\(\) expects array, false given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - message: '#^Parameter \#3 \$body of static method FOG\\Base\\FOGPage\:\:makeModal\(\) expects string, null given\.$#' identifier: argument.type count: 2 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:newPMDisplay\(\) \(void\) is used\.$#' identifier: method.void count: 2 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - - message: '#^Result of method FOG\\GroupManagement\:\:_groupAssocList\(\) \(void\) is used\.$#' + message: '#^Result of method FOG\\Pages\\GroupManagement\:\:_groupAssocList\(\) \(void\) is used\.$#' identifier: method.void count: 3 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - message: '#^Variable \$printers might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - message: '#^Variable \$val might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/groupmanagement.page.php + path: packages/web/src/Pages/GroupManagement.php - - message: '#^Access to an undefined property FOG\\HostManagement\:\:\$exitEfi\.$#' + message: '#^Access to an undefined property FOG\\Pages\\HostManagement\:\:\$exitEfi\.$#' identifier: property.notFound count: 5 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Access to an undefined property FOG\\HostManagement\:\:\$exitNorm\.$#' + message: '#^Access to an undefined property FOG\\Pages\\HostManagement\:\:\$exitNorm\.$#' identifier: property.notFound count: 5 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Call to function is_numeric\(\) with int will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Constructor of class FOG\\HostManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\HostManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:getGroupsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:getGroupsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:getModulesList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:getModulesList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:getPrintersList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:getPrintersList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:getSnapinsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:getSnapinsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:pending\(\) should return false but empty return statement found\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:pending\(\) should return false but empty return statement found\.$#' identifier: return.empty count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:pending\(\) should return false but return statement is missing\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:pending\(\) should return false but return statement is missing\.$#' identifier: return.missing count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:pendingMacs\(\) should return false but empty return statement found\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:pendingMacs\(\) should return false but empty return statement found\.$#' identifier: return.empty count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - - message: '#^Method FOG\\HostManagement\:\:pendingMacs\(\) should return false but return statement is missing\.$#' + message: '#^Method FOG\\Pages\\HostManagement\:\:pendingMacs\(\) should return false but return statement is missing\.$#' identifier: return.missing count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Parameter \#3 \$body of static method FOG\\Base\\FOGPage\:\:makeModal\(\) expects string, null given\.$#' identifier: argument.type count: 2 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 3 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:newPMDisplay\(\) \(void\) is used\.$#' identifier: method.void count: 2 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Variable \$code might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Variable \$msg might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Variable \$val might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/hostmanagement.page.php + path: packages/web/src/Pages/HostManagement.php - message: '#^Binary operation "\*" between array\|string and 60 results in an error\.$#' identifier: binaryOp.invalid count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - - message: '#^Constructor of class FOG\\ImpersonateManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ImpersonateManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/impersonatemanagement.page.php + path: packages/web/src/Pages/ImpersonateManagement.php - - message: '#^Constructor of class FOG\\ImageManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ImageManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - message: '#^Expression on left side of \?\? is not nullable\.$#' identifier: nullCoalesce.expr count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - - message: '#^Method FOG\\ImageManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\ImageManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - - message: '#^Method FOG\\ImageManagement\:\:getSessionsList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\ImageManagement\:\:getSessionsList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - - message: '#^Method FOG\\ImageManagement\:\:getStoragegroupsList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\ImageManagement\:\:getStoragegroupsList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - message: '#^Parameter \#2 \$whereItems of static method FOG\\Router\\Route\:\:getIds\(\) expects array, false given\.$#' identifier: argument.type count: 2 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - message: '#^Variable \$msgSuccess might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - message: '#^Variable \$storagegroups might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - message: '#^Variable \$titleFail might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - message: '#^Variable \$titleSuccess might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/imagemanagement.page.php + path: packages/web/src/Pages/ImageManagement.php - - message: '#^Constructor of class FOG\\IpxeManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\IpxeManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/ipxemanagement.page.php + path: packages/web/src/Pages/IpxeManagement.php - - message: '#^Constructor of class FOG\\ModuleManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ModuleManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/modulemanagement.page.php + path: packages/web/src/Pages/ModuleManagement.php - - message: '#^Method FOG\\ModuleManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\ModuleManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/modulemanagement.page.php + path: packages/web/src/Pages/ModuleManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/pages/modulemanagement.page.php + path: packages/web/src/Pages/ModuleManagement.php - - message: '#^Constructor of class FOG\\PluginManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\PluginManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/pluginmanagement.page.php + path: packages/web/src/Pages/PluginManagement.php - message: '#^PHPDoc tag @return has invalid value \(false;\)\: Unexpected token ";", expected TOKEN_HORIZONTAL_WS at offset 121 on line 6$#' identifier: phpDoc.parseError count: 1 - path: packages/web/lib/pages/pluginmanagement.page.php + path: packages/web/src/Pages/PluginManagement.php - message: '#^PHPDoc tag @throws with type FOG\\Exception is not subtype of Throwable$#' identifier: throws.notThrowable count: 1 - path: packages/web/lib/pages/pluginmanagement.page.php + path: packages/web/src/Pages/PluginManagement.php - message: '#^Parameter \#1 \$main of static method FOG\\Base\\FOGPage\:\:buildMainMenuItems\(\) expects array, string given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/pages/pluginmanagement.page.php + path: packages/web/src/Pages/PluginManagement.php - message: '#^Parameter \#1 \(array\) of echo cannot be converted to string\.$#' identifier: echo.nonString count: 1 - path: packages/web/lib/pages/pluginmanagement.page.php + path: packages/web/src/Pages/PluginManagement.php - message: '#^Parameter \#2 \$hookMain of static method FOG\\Base\\FOGPage\:\:buildMainMenuItems\(\) expects array, string given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/pages/pluginmanagement.page.php + path: packages/web/src/Pages/PluginManagement.php - message: '#^Ternary operator condition is always false\.$#' identifier: ternary.alwaysFalse count: 3 - path: packages/web/lib/pages/pluginmanagement.page.php + path: packages/web/src/Pages/PluginManagement.php - - message: '#^Constructor of class FOG\\PrinterManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\PrinterManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/printermanagement.page.php + path: packages/web/src/Pages/PrinterManagement.php - - message: '#^Method FOG\\PrinterManagement\:\:getHostsDefaultList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\PrinterManagement\:\:getHostsDefaultList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/printermanagement.page.php + path: packages/web/src/Pages/PrinterManagement.php - - message: '#^Method FOG\\PrinterManagement\:\:getHostsList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\PrinterManagement\:\:getHostsList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/printermanagement.page.php + path: packages/web/src/Pages/PrinterManagement.php - message: '#^PHPDoc tag @throws with type FOG\\Exception is not subtype of Throwable$#' identifier: throws.notThrowable count: 1 - path: packages/web/lib/pages/printermanagement.page.php + path: packages/web/src/Pages/PrinterManagement.php - - message: '#^Property FOG\\PrinterManagement\:\:\$_config is unused\.$#' + message: '#^Property FOG\\Pages\\PrinterManagement\:\:\$_config is unused\.$#' identifier: property.unused count: 1 - path: packages/web/lib/pages/printermanagement.page.php + path: packages/web/src/Pages/PrinterManagement.php - message: '#^Call to function is_array\(\) with \*NEVER\* will always evaluate to true\.$#' identifier: function.alreadyNarrowedType count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^Empty array passed to foreach\.$#' identifier: foreach.emptyArray count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^If condition is always true\.$#' identifier: if.alwaysTrue count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - - message: '#^Method FOG\\ProcessLogin\:\:processMainLogin\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\ProcessLogin\:\:processMainLogin\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 3 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^Offset ''icon'' on \*NEVER\* in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^Offset ''label'' on \*NEVER\* in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^Offset ''url'' on \*NEVER\* in isset\(\) always exists and is not nullable\.$#' identifier: isset.offset count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - - message: '#^Property FOG\\ProcessLogin\:\:\$_langMenu is unused\.$#' + message: '#^Property FOG\\Pages\\ProcessLogin\:\:\$_langMenu is unused\.$#' identifier: property.unused count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - - message: '#^Result of static method FOG\\ProcessLogin\:\:mainLoginForm\(\) \(void\) is used\.$#' + message: '#^Result of static method FOG\\Pages\\ProcessLogin\:\:mainLoginForm\(\) \(void\) is used\.$#' identifier: staticMethod.void count: 3 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^Strict comparison using \=\=\= between 0 and 0 will always evaluate to true\.$#' identifier: identical.alwaysTrue count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^Unreachable statement \- code above always terminates\.$#' identifier: deadCode.unreachable count: 1 - path: packages/web/lib/pages/processlogin.page.php + path: packages/web/src/Pages/ProcessLogin.php - message: '#^Argument of an invalid type string supplied for foreach, only iterables are supported\.$#' identifier: foreach.nonIterable count: 1 - path: packages/web/lib/pages/reportmanagement.page.php + path: packages/web/src/Pages/ReportManagement.php - message: '#^Call to function _\(\) on a separate line has no effect\.$#' identifier: function.resultUnused count: 15 - path: packages/web/lib/pages/reportmanagement.page.php + path: packages/web/src/Pages/ReportManagement.php - - message: '#^Constructor of class FOG\\ReportManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ReportManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/reportmanagement.page.php + path: packages/web/src/Pages/ReportManagement.php - - message: '#^Static method FOG\\ReportManagement\:\:_reportNamesForTranslation\(\) is unused\.$#' + message: '#^Static method FOG\\Pages\\ReportManagement\:\:_reportNamesForTranslation\(\) is unused\.$#' identifier: method.unused count: 1 - path: packages/web/lib/pages/reportmanagement.page.php + path: packages/web/src/Pages/ReportManagement.php - - message: '#^Constructor of class FOG\\RoleManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\RoleManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/rolemanagement.page.php + path: packages/web/src/Pages/RoleManagement.php - - message: '#^Method FOG\\RoleManagement\:\:getSitesList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\RoleManagement\:\:getSitesList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/rolemanagement.page.php + path: packages/web/src/Pages/RoleManagement.php - - message: '#^Method FOG\\RoleManagement\:\:getUserGroupsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\RoleManagement\:\:getUserGroupsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/rolemanagement.page.php + path: packages/web/src/Pages/RoleManagement.php - - message: '#^Method FOG\\RoleManagement\:\:getUsersList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\RoleManagement\:\:getUsersList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/rolemanagement.page.php + path: packages/web/src/Pages/RoleManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 3 - path: packages/web/lib/pages/rolemanagement.page.php + path: packages/web/src/Pages/RoleManagement.php - - message: '#^Access to an undefined property FOG\\SchemaUpdaterPage\:\:\$schema\.$#' + message: '#^Access to an undefined property FOG\\Pages\\SchemaUpdaterPage\:\:\$schema\.$#' identifier: property.notFound count: 4 - path: packages/web/lib/pages/schemaupdaterpage.page.php + path: packages/web/src/Pages/SchemaUpdaterPage.php - message: '#^Constant FOG_SCHEMA_INSTALL_TOKEN not found\.$#' identifier: constant.notFound count: 1 - path: packages/web/lib/pages/schemaupdaterpage.page.php + path: packages/web/src/Pages/SchemaUpdaterPage.php - message: '#^Left side of && is always true\.$#' identifier: booleanAnd.leftAlwaysTrue count: 1 - path: packages/web/lib/pages/schemaupdaterpage.page.php + path: packages/web/src/Pages/SchemaUpdaterPage.php - message: '#^Negated boolean expression is always false\.$#' identifier: booleanNot.alwaysFalse count: 1 - path: packages/web/lib/pages/schemaupdaterpage.page.php + path: packages/web/src/Pages/SchemaUpdaterPage.php - message: '#^Parameter \#2 \$return of function print_r expects bool, int given\.$#' identifier: argument.type count: 4 - path: packages/web/lib/pages/schemaupdaterpage.page.php + path: packages/web/src/Pages/SchemaUpdaterPage.php - message: '#^Path in include\(\) "/commons/schema\.php" is not a file or it does not exist\.$#' identifier: include.fileNotFound count: 1 - path: packages/web/lib/pages/schemaupdaterpage.page.php + path: packages/web/src/Pages/SchemaUpdaterPage.php - - message: '#^Constructor of class FOG\\ServerInfo has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ServerInfo has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Parameter \#1 \$size of static method FOG\\Base\\FOGBase\:\:formatByteSize\(\) expects float\|int, string given\.$#' identifier: argument.type count: 2 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICDro might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICDropInfo might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICErr might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICErrInfo might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICMac might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICRec might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICRecSized might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICTrans might not be defined\.$#' identifier: variable.undefined count: 2 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - message: '#^Variable \$NICTransSized might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/serverinfo.page.php + path: packages/web/src/Pages/ServerInfo.php - - message: '#^Constructor of class FOG\\ServiceConfigurationPage has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\ServiceConfigurationPage has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/serviceconfigurationpage.page.php + path: packages/web/src/Pages/ServiceConfigurationPage.php - message: '#^Parameter \#2 \$obj of static method FOG\\Base\\FOGPage\:\:tabFields\(\) expects int\|object, false given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/pages/serviceconfigurationpage.page.php + path: packages/web/src/Pages/ServiceConfigurationPage.php - message: '#^Parameter \#2 \$value of static method FOG\\Base\\FOGBase\:\:setSetting\(\) expects string, int given\.$#' identifier: argument.type count: 4 - path: packages/web/lib/pages/serviceconfigurationpage.page.php + path: packages/web/src/Pages/ServiceConfigurationPage.php - message: '#^Variable \$Module might not be defined\.$#' identifier: variable.undefined count: 4 - path: packages/web/lib/pages/serviceconfigurationpage.page.php + path: packages/web/src/Pages/ServiceConfigurationPage.php - - message: '#^Constructor of class FOG\\SiteManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\SiteManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - - message: '#^Method FOG\\SiteManagement\:\:getGrantRolesList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SiteManagement\:\:getGrantRolesList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - - message: '#^Method FOG\\SiteManagement\:\:getGrantUserGroupsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SiteManagement\:\:getGrantUserGroupsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - - message: '#^Method FOG\\SiteManagement\:\:getGroupsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SiteManagement\:\:getGroupsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - - message: '#^Method FOG\\SiteManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SiteManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - - message: '#^Method FOG\\SiteManagement\:\:getUserGroupsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SiteManagement\:\:getUserGroupsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - - message: '#^Method FOG\\SiteManagement\:\:getUsersList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SiteManagement\:\:getUsersList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 6 - path: packages/web/lib/pages/sitemanagement.page.php + path: packages/web/src/Pages/SiteManagement.php - - message: '#^Method FOG\\SnapinManagement\:\:_maker\(\) with return type void returns string\|false but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SnapinManagement\:\:_maker\(\) with return type void returns string\|false but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - - message: '#^Method FOG\\SnapinManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SnapinManagement\:\:getHostsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - - message: '#^Method FOG\\SnapinManagement\:\:getStoragegroupsList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\SnapinManagement\:\:getStoragegroupsList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - message: '#^Parameter \#2 \$whereItems of static method FOG\\Router\\Route\:\:getIds\(\) expects array, false given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - - message: '#^Result of method FOG\\SnapinManagement\:\:_maker\(\) \(void\) is used\.$#' + message: '#^Result of method FOG\\Pages\\SnapinManagement\:\:_maker\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - message: '#^Static property FOG\\Base\\FOGBase\:\:\$selected \(bool\|int\) does not accept string\.$#' identifier: assign.propertyType count: 3 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - - message: '#^Static property FOG\\SnapinManagement\:\:\$_template2 \(string\) does not accept null\.$#' + message: '#^Static property FOG\\Pages\\SnapinManagement\:\:\$_template2 \(string\) does not accept null\.$#' identifier: assign.propertyType count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - message: '#^Variable \$storagegroups might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/snapinmanagement.page.php + path: packages/web/src/Pages/SnapinManagement.php - - message: '#^Constructor of class FOG\\StorageGroupManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\StorageGroupManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/storagegroupmanagement.page.php + path: packages/web/src/Pages/StorageGroupManagement.php - - message: '#^Method FOG\\StorageGroupManagement\:\:getImagesList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\StorageGroupManagement\:\:getImagesList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/storagegroupmanagement.page.php + path: packages/web/src/Pages/StorageGroupManagement.php - - message: '#^Method FOG\\StorageGroupManagement\:\:getSnapinsList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\StorageGroupManagement\:\:getSnapinsList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/storagegroupmanagement.page.php + path: packages/web/src/Pages/StorageGroupManagement.php - - message: '#^Method FOG\\StorageGroupManagement\:\:getStorageNodesList\(\) with return type void returns mixed but should not return anything\.$#' + message: '#^Method FOG\\Pages\\StorageGroupManagement\:\:getStorageNodesList\(\) with return type void returns mixed but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/storagegroupmanagement.page.php + path: packages/web/src/Pages/StorageGroupManagement.php - message: '#^Variable \$StorageGroup might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/storagegroupmanagement.page.php + path: packages/web/src/Pages/StorageGroupManagement.php - message: '#^Variable \$storagenodes might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/storagegroupmanagement.page.php + path: packages/web/src/Pages/StorageGroupManagement.php - - message: '#^Constructor of class FOG\\StorageNodeManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\StorageNodeManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/storagenodemanagement.page.php + path: packages/web/src/Pages/StorageNodeManagement.php - message: '#^If condition is always false\.$#' identifier: if.alwaysFalse count: 1 - path: packages/web/lib/pages/storagenodemanagement.page.php + path: packages/web/src/Pages/StorageNodeManagement.php - - message: '#^Method FOG\\StorageNodeManagement\:\:storagenodeGeneralPost\(\) with return type void returns string but should not return anything\.$#' + message: '#^Method FOG\\Pages\\StorageNodeManagement\:\:storagenodeGeneralPost\(\) with return type void returns string but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/storagenodemanagement.page.php + path: packages/web/src/Pages/StorageNodeManagement.php - message: '#^Parameter \#2 \$whereItems of static method FOG\\Router\\Route\:\:getIds\(\) expects array, false given\.$#' identifier: argument.type count: 3 - path: packages/web/lib/pages/storagenodemanagement.page.php + path: packages/web/src/Pages/StorageNodeManagement.php - - message: '#^Result of method FOG\\StorageNodeManagement\:\:storagenodeGeneralPost\(\) \(void\) is used\.$#' + message: '#^Result of method FOG\\Pages\\StorageNodeManagement\:\:storagenodeGeneralPost\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/pages/storagenodemanagement.page.php + path: packages/web/src/Pages/StorageNodeManagement.php - message: '#^Variable \$StorageNode might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/storagenodemanagement.page.php + path: packages/web/src/Pages/StorageNodeManagement.php - message: '#^Variable \$warning might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/storagenodemanagement.page.php + path: packages/web/src/Pages/StorageNodeManagement.php - - message: '#^Constructor of class FOG\\TaskManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\TaskManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/taskmanagement.page.php + path: packages/web/src/Pages/TaskManagement.php - message: '#^Parameter \#2 \$obj of static method FOG\\Base\\FOGPage\:\:tabFields\(\) expects int\|object, false given\.$#' identifier: argument.type count: 1 - path: packages/web/lib/pages/taskmanagement.page.php + path: packages/web/src/Pages/TaskManagement.php - message: '#^Unreachable statement \- code above always terminates\.$#' identifier: deadCode.unreachable count: 1 - path: packages/web/lib/pages/taskmanagement.page.php + path: packages/web/src/Pages/TaskManagement.php - message: '#^Variable \$columns might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/taskmanagement.page.php + path: packages/web/src/Pages/TaskManagement.php - - message: '#^Constructor of class FOG\\UserGroupManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\UserGroupManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/usergroupmanagement.page.php + path: packages/web/src/Pages/UserGroupManagement.php - - message: '#^Method FOG\\UserGroupManagement\:\:getRolesList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\UserGroupManagement\:\:getRolesList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/usergroupmanagement.page.php + path: packages/web/src/Pages/UserGroupManagement.php - - message: '#^Method FOG\\UserGroupManagement\:\:getSitesList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\UserGroupManagement\:\:getSitesList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/usergroupmanagement.page.php + path: packages/web/src/Pages/UserGroupManagement.php - - message: '#^Method FOG\\UserGroupManagement\:\:getUsersList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\UserGroupManagement\:\:getUsersList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/usergroupmanagement.page.php + path: packages/web/src/Pages/UserGroupManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 3 - path: packages/web/lib/pages/usergroupmanagement.page.php + path: packages/web/src/Pages/UserGroupManagement.php - - message: '#^Constructor of class FOG\\UserManagement has an unused parameter \$name\.$#' + message: '#^Constructor of class FOG\\Pages\\UserManagement has an unused parameter \$name\.$#' identifier: constructor.unusedParameter count: 1 - path: packages/web/lib/pages/usermanagement.page.php + path: packages/web/src/Pages/UserManagement.php - - message: '#^Method FOG\\UserManagement\:\:__construct\(\) with return type void returns \$this\(FOG\\UserManagement\) but should not return anything\.$#' + message: '#^Method FOG\\Pages\\UserManagement\:\:__construct\(\) with return type void returns \$this\(FOG\\Pages\\UserManagement\) but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/usermanagement.page.php + path: packages/web/src/Pages/UserManagement.php - - message: '#^Method FOG\\UserManagement\:\:getGroupsList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\UserManagement\:\:getGroupsList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/usermanagement.page.php + path: packages/web/src/Pages/UserManagement.php - - message: '#^Method FOG\\UserManagement\:\:getRolesList\(\) with return type void returns null but should not return anything\.$#' + message: '#^Method FOG\\Pages\\UserManagement\:\:getRolesList\(\) with return type void returns null but should not return anything\.$#' identifier: return.void count: 1 - path: packages/web/lib/pages/usermanagement.page.php + path: packages/web/src/Pages/UserManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:assocItemsList\(\) \(void\) is used\.$#' identifier: method.void count: 2 - path: packages/web/lib/pages/usermanagement.page.php + path: packages/web/src/Pages/UserManagement.php - message: '#^Variable \$User might not be defined\.$#' identifier: variable.undefined count: 1 - path: packages/web/lib/pages/usermanagement.page.php + path: packages/web/src/Pages/UserManagement.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:render\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/reports/file_deleter.report.php + path: packages/web/src/Reports/File_Deleter.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:render\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/reports/history_report.report.php + path: packages/web/src/Reports/History_Report.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:render\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/reports/hosts_and_users.report.php + path: packages/web/src/Reports/Hosts_And_Users.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:render\(\) \(void\) is used\.$#' @@ -1264,19 +1264,19 @@ parameters: message: '#^Result of method FOG\\Base\\FOGPage\:\:render\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/reports/product_keys.report.php + path: packages/web/src/Reports/Product_Keys.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:render\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/reports/run_history.report.php + path: packages/web/src/Reports/Run_History.php - message: '#^Result of method FOG\\Base\\FOGPage\:\:render\(\) \(void\) is used\.$#' identifier: method.void count: 1 - path: packages/web/lib/reports/snapin_list.report.php + path: packages/web/src/Reports/Snapin_List.php - message: '#^Call to function is_array\(\) with array will always evaluate to true\.$#' diff --git a/phpstan-tests-baseline.neon b/phpstan-tests-baseline.neon index 916f9e0b36..d2bc679245 100644 --- a/phpstan-tests-baseline.neon +++ b/phpstan-tests-baseline.neon @@ -935,3 +935,57 @@ parameters: identifier: identical.alwaysTrue count: 1 path: tests/imaging-report.test.php + + - + message: '#^Strict comparison using \=\=\= between ''\-30 days'' and ''\-30 days'' will always evaluate to true\.$#' + identifier: identical.alwaysTrue + count: 1 + path: tests/audit-report.test.php + + - + message: '#^Ternary operator condition is always false\.$#' + identifier: ternary.alwaysFalse + count: 1 + path: tests/autoload.test.php + + - + message: '#^Strict comparison using \=\=\= between ''\-90 days'' and ''\-90 days'' will always evaluate to true\.$#' + identifier: identical.alwaysTrue + count: 1 + path: tests/fleet-report.test.php + + - + message: '#^Result of && is always true\.$#' + identifier: booleanAnd.alwaysTrue + count: 1 + path: tests/hardware-report.test.php + + - + message: '#^Strict comparison using \=\=\= between ''\-90 days'' and ''\-90 days'' will always evaluate to true\.$#' + identifier: identical.alwaysTrue + count: 2 + path: tests/hardware-report.test.php + + - + message: '#^Strict comparison using \=\=\= between ''\-30 days'' and ''\-30 days'' will always evaluate to true\.$#' + identifier: identical.alwaysTrue + count: 1 + path: tests/imaging-report.test.php + + - + message: '#^Call to function is_subclass_of\(\) with ''FOG\\\\Reports\\\\Run…'' and ''FOG\\\\Pages…'' will always evaluate to true\.$#' + identifier: function.alreadyNarrowedType + count: 1 + path: tests/run-history-report.test.php + + - + message: '#^Strict comparison using \=\=\= between ''\-30 days'' and ''\-30 days'' will always evaluate to true\.$#' + identifier: identical.alwaysTrue + count: 1 + path: tests/snapin-report.test.php + + - + message: '#^Strict comparison using \=\=\= between ''\-365 days'' and ''\-365 days'' will always evaluate to true\.$#' + identifier: identical.alwaysTrue + count: 1 + path: tests/storage-report.test.php diff --git a/tests/activity-sources.test.php b/tests/activity-sources.test.php index 4af30e5d46..69d97ee00c 100644 --- a/tests/activity-sources.test.php +++ b/tests/activity-sources.test.php @@ -83,7 +83,7 @@ function grant(array $perms) */ function activity($method) { - $m = new \ReflectionMethod('FOG\ActivityManagement', $method); + $m = new \ReflectionMethod('FOG\Pages\ActivityManagement', $method); $m->setAccessible(true); return $m->invoke(null); } diff --git a/tests/api-only-users.test.php b/tests/api-only-users.test.php index 47c0aaca60..287482fd4c 100644 --- a/tests/api-only-users.test.php +++ b/tests/api-only-users.test.php @@ -58,7 +58,7 @@ $schemaSrc = file_get_contents($web . '/commons/schema.php'); $manifestSrc = file_get_contents($web . '/commons/schema-expected.php'); $sysSrc = file_get_contents($web . '/src/Base/System.php'); -$pageSrc = file_get_contents($web . '/lib/pages/usermanagement.page.php'); +$pageSrc = file_get_contents($web . '/src/Pages/UserManagement.php'); // --------------------------------------------------------------------------- // 0. The column exists and the model can read it. diff --git a/tests/api-token-store.test.php b/tests/api-token-store.test.php index fcb0cbe2ff..78058fe236 100644 --- a/tests/api-token-store.test.php +++ b/tests/api-token-store.test.php @@ -62,7 +62,7 @@ $modelSrc = file_get_contents($web . '/src/Items/APIToken.php'); $routeSrc = file_get_contents($web . '/src/Router/Route.php'); $schemaSrc = file_get_contents($web . '/commons/schema.php'); -$pageSrc = file_get_contents($web . '/lib/pages/usermanagement.page.php'); +$pageSrc = file_get_contents($web . '/src/Pages/UserManagement.php'); // --------------------------------------------------------------------------- // 1. Bearer accepts APIToken and nothing else. @@ -377,7 +377,7 @@ // --------------------------------------------------------------------------- $authSrc = file_get_contents($web . '/src/Auth/Authorization.php'); $configSrc = file_get_contents( - $web . '/lib/pages/fogconfigurationpage.page.php' + $web . '/src/Pages/FOGConfigurationPage.php' ); $auditSrc = file_get_contents($web . '/src/Audit/Audit.php'); $paneJs = file_get_contents( @@ -519,7 +519,7 @@ // WHERE THE MENU ENTRY HAS TO LIVE, which is the defect this pins. // // There are TWO copies of the 'about' sub-menu list. SubMenuData::subMenu() -// in lib/hooks/submenudata.hook.php reads like the obvious place and NEVER +// in src/Hooks/SubMenuData.php reads like the obvious place and NEVER // RUNS: the hook sets $active = false and HookManager only force-activates // files under plugins/. The list the sidebar is actually built from is the // switch in FOGPage::_buildSubMenuItems(). An entry added only to the hook @@ -531,7 +531,7 @@ // about it. Both files are checked so the two lists cannot drift apart // again. $subMenuLive = file_get_contents($web . '/src/Base/FOGPage.php'); -$subMenuHook = file_get_contents($web . '/lib/hooks/submenudata.hook.php'); +$subMenuHook = file_get_contents($web . '/src/Hooks/SubMenuData.php'); $t->check( "the API Tokens entry is in FOGPage::_buildSubMenuItems(), the list the " . "sidebar actually builds from", diff --git a/tests/apionly-password-and-validation.test.php b/tests/apionly-password-and-validation.test.php index 4154ed9438..94de41dfcd 100644 --- a/tests/apionly-password-and-validation.test.php +++ b/tests/apionly-password-and-validation.test.php @@ -48,7 +48,7 @@ $web = dirname(__DIR__) . '/packages/web'; $commonSrc = file_get_contents($web . '/management/js/fog/fog.common.js'); $addJsSrc = file_get_contents($web . '/management/js/fog/user/fog.user.add.js'); -$pageSrc = file_get_contents($web . '/lib/pages/usermanagement.page.php'); +$pageSrc = file_get_contents($web . '/src/Pages/UserManagement.php'); $sysSrc = file_get_contents($web . '/src/Base/System.php'); // Comments carry the words this file is looking for, so every source check diff --git a/tests/apitoken-grid-and-scope.test.php b/tests/apitoken-grid-and-scope.test.php index 1fdac787ab..631e3f7345 100644 --- a/tests/apitoken-grid-and-scope.test.php +++ b/tests/apitoken-grid-and-scope.test.php @@ -44,8 +44,8 @@ $web = dirname(__DIR__) . '/packages/web'; $mgrSrc = file_get_contents($web . '/src/Managers/APITokenManager.php'); $tokSrc = file_get_contents($web . '/src/Items/APIToken.php'); -$cfgSrc = file_get_contents($web . '/lib/pages/fogconfigurationpage.page.php'); -$usrSrc = file_get_contents($web . '/lib/pages/usermanagement.page.php'); +$cfgSrc = file_get_contents($web . '/src/Pages/FOGConfigurationPage.php'); +$usrSrc = file_get_contents($web . '/src/Pages/UserManagement.php'); $authSrc = file_get_contents($web . '/src/Auth/Authorization.php'); $jsSrc = file_get_contents( $web . '/management/js/fog/about/fog.about.apitokens.js' @@ -294,7 +294,7 @@ // Asserted by REFLECTION, not by grepping for the word 'function'. The // question is exactly the one the dispatcher asks. // --------------------------------------------------------------------------- -$cfgPage = $web . '/lib/pages/fogconfigurationpage.page.php'; +$cfgPage = $web . '/src/Pages/FOGConfigurationPage.php'; $postSubs = []; if (preg_match_all( '/public function ([A-Za-z][A-Za-z0-9_]*)Post\(/', diff --git a/tests/arch-compatibility.test.php b/tests/arch-compatibility.test.php index 1b10a97d18..ee9ddb9f9f 100644 --- a/tests/arch-compatibility.test.php +++ b/tests/arch-compatibility.test.php @@ -216,7 +216,7 @@ // --- the three regressions found on a live server 2026-08-25 ------------- // All three were invisible to CI: a fresh install creates the columns, so // only an UPGRADE showed them. -$paneSrc = (string)file_get_contents($web . '/lib/pages/imagemanagement.page.php'); +$paneSrc = (string)file_get_contents($web . '/src/Pages/ImageManagement.php'); $listJs = (string)file_get_contents( $web . '/management/js/fog/image/fog.image.list.js' ); diff --git a/tests/audit-invariants.test.php b/tests/audit-invariants.test.php index ade83294e9..d373ff9fcb 100644 --- a/tests/audit-invariants.test.php +++ b/tests/audit-invariants.test.php @@ -200,7 +200,7 @@ function ($f) { } $checks++; $auditPage = (string) file_get_contents( - $web . '/lib/pages/auditmanagement.page.php' + $web . '/src/Pages/AuditManagement.php' ); if (false === strpos($auditPage, 'acSubjectLabel') || false === strpos($auditPage, "'subjectLabel' =>") diff --git a/tests/audit-report.test.php b/tests/audit-report.test.php index a836b0418a..23392c0d51 100644 --- a/tests/audit-report.test.php +++ b/tests/audit-report.test.php @@ -64,7 +64,7 @@ } $t->check( 'this report defaults to a month', - '-30 days' === constant('FOG\Audit_Report::DEFAULT_WINDOW') + '-30 days' === constant('FOG\Reports\Audit_Report::DEFAULT_WINDOW') ); /* diff --git a/tests/autoload.test.php b/tests/autoload.test.php index 5f82a9e9a9..dbb6f1af46 100644 --- a/tests/autoload.test.php +++ b/tests/autoload.test.php @@ -39,8 +39,10 @@ * * Four things are checked: * 1. A representative class from each scan root resolves, by the name its - * own file declares -- namespaced for core under src/, bare for the - * discovery-named files under lib/ and for plugins. + * own file declares -- namespaced for core under src/, including the 52 + * discovery-named page/hook/report/event classes now bucketed there + * too; bare only for plugins, which still declare `namespace FOG;` with + * their own class_alias under lib/. * 2. Composer's autoloader is registered and reaches vendor/. Mysqldump * is the proof: it is a FOG class whose parent lives in a package, so * it cannot resolve unless both loaders are in the chain and in the @@ -61,23 +63,24 @@ */ /* - * Flipped by the commit that added the FOG\ bridge to Initiator::autoload(), - * and kept because the bridge is still there and still load-bearing -- just - * for a narrower job than it started with. - * - * It began as a shim: nothing was namespaced, so `FOG\Host` was answered by - * finding host.class.php and aliasing it. Core is now PSR-4 under src/ and - * Composer answers FOG\Items\Host directly. What is left for the bridge is - * the 46 discovery-named classes under lib/ -- pages, hooks, reports, the one - * event -- which declare a FLAT `namespace FOG;` and stay there, because - * FOGPageManager::loadPageClasses() derives the class name from - * basename($file) and PSR-4 does not do discovery. Composer maps FOG\ onto - * src/, so a core file's `use FOG\ReportManagement;` has no other answer. + * Flipped false by the same change that bucketed the last 52 discovery-named + * classes -- 28 pages, 10 hooks, 13 reports, 1 event -- out of a flat + * `namespace FOG;` under lib/ and into src/{Pages,Hooks,Reports,Events} + * (ADR 0013, amended 2026-08-30). Every one of them is in srcClassMap() now, + * so the bridge's first arm refuses the flat spelling with a diagnostic + * instead of resolving it -- the same refusal every other core class has + * always gotten from Initiator::_bridgeNamespaced(). What is left for the + * bridge to actually RESOLVE is a lib/ file that still declares a flat + * `namespace FOG;` with its own class_alias() -- which no core file does any + * more, only a plugin's own page/hook/report class can (ADR 0009), and + * nothing under this checkout is one. * * This constant existing rather than the assertion simply being deleted is - * the point: the flip is the bridge's regression test. + * the point: the flip is the bridge's regression test. It goes back to true + * only if a discovery-named class is deliberately moved back under a flat + * lib/ namespace. */ -const EXPECT_BRIDGE = true; +const EXPECT_BRIDGE = false; // An explicit path means "probe that tree", which is a different job from // "check this checkout" -- see the header. Compared by realpath so that @@ -201,22 +204,24 @@ function () use ($tmp) { // Named as each file names ITSELF. Core moved to src/ under a namespace per // bucket and no longer re-exports itself globally (ADR 0013 §2), so the bare // spellings this list used to carry now resolve to nothing -- which is the -// decision, not a regression. The discovery-named classes under lib/ keep -// their own class_alias and so keep answering bare, because -// FOGPageManager::loadPageClasses() looks them up that way. +// decision, not a regression. That now includes the 52 discovery-named +// classes: they left their flat lib/ files and their class_alias trailers +// behind when they were bucketed into src/Pages, src/Hooks, src/Reports and +// src/Events (ADR 0013, amended 2026-08-30), so they resolve only by their +// namespaced spelling, the same as any other core class. $sample = [ - 'FOG\\Items\\Host' => 'class', // src/Items - 'FOG\\Managers\\HostManager' => 'class', // src/Managers - 'FOG\\Base\\FOGBase' => 'class', // src/Base, root of the hierarchy - 'FOG\\Base\\FOGController' => 'class', - 'FOG\\Base\\FOGPagePost' => 'trait', // src/Base, mixed-case filename - 'HostManagement' => 'class', // lib/pages, discovery-named - 'UserGroupManagement' => 'class', // lib/pages, mixed-case filename - 'FOG\\Db\\PDODB' => 'class', // src/Db - 'FOG\\Router\\Route' => 'class', // src/Router - 'FOG\\Client\\FOGClient' => 'class', // src/Client - 'FOG\\Service\\TaskScheduler' => 'class', // src/Service - 'FOG\\Boot\\Registration' => 'class', // src/Boot + 'FOG\\Items\\Host' => 'class', // src/Items + 'FOG\\Managers\\HostManager' => 'class', // src/Managers + 'FOG\\Base\\FOGBase' => 'class', // src/Base, root of the hierarchy + 'FOG\\Base\\FOGController' => 'class', + 'FOG\\Base\\FOGPagePost' => 'trait', // src/Base, mixed-case filename + 'FOG\\Pages\\HostManagement' => 'class', // src/Pages, discovery-named + 'FOG\\Pages\\UserGroupManagement' => 'class', // src/Pages, mixed-case filename + 'FOG\\Db\\PDODB' => 'class', // src/Db + 'FOG\\Router\\Route' => 'class', // src/Router + 'FOG\\Client\\FOGClient' => 'class', // src/Client + 'FOG\\Service\\TaskScheduler' => 'class', // src/Service + 'FOG\\Boot\\Registration' => 'class', // src/Boot ]; foreach ($sample as $name => $kind) { $exists = $kind === 'trait' ? trait_exists($name) : class_exists($name); @@ -228,7 +233,8 @@ function () use ($tmp) { // 1b. And the bare spellings of the core ones do NOT resolve. Without this // every check above would pass just as happily with the aliases restored, // which is the state this whole pass exists to leave behind. -foreach (['Host', 'HostManager', 'FOGBase', 'PDODB', 'Route'] as $bare) { +foreach (['Host', 'HostManager', 'FOGBase', 'PDODB', 'Route', + 'HostManagement', 'UserGroupManagement'] as $bare) { if (class_exists($bare)) { $failures[] = "bare $bare resolved; core is aliased into the global " . 'namespace again (ADR 0013 §2 retired those aliases), so a ' @@ -295,58 +301,51 @@ function () use ($tmp) { // make the diagnostic mode useless. // // Probed with a discovery-named class, not with a model. FOG\Items\Host is -// Composer's job now and proves nothing about the bridge; FOG\HostManagement -// is the flat spelling only the bridge can serve. +// Composer's job now and proves nothing about the bridge. FOG\HostManagement +// is the flat spelling ADR 0013's 2026-08-30 amendment retired: +// HostManagement moved out of a flat lib/ file into src/Pages/, so it is now +// IN srcClassMap() and the bridge's first arm refuses the flat spelling with +// a diagnostic instead of resolving it, exactly like every other core class. $bridged = class_exists('FOG\HostManagement'); if (!$diagnostic && $bridged !== EXPECT_BRIDGE) { $failures[] = EXPECT_BRIDGE ? 'FOG\HostManagement did not resolve; Initiator::_bridgeNamespaced() ' - . 'is missing or no longer answers the flat FOG\ spelling ' - . 'the 46 discovery-named classes under lib/ are declared with. ' - . 'Every core file carrying a `use FOG\;` import for one of ' - . 'them is broken by that' - : 'FOG\HostManagement resolved unexpectedly; if the bridge has landed, ' - . 'flip EXPECT_BRIDGE at the top of this file'; + . 'is missing or no longer answers a flat FOG\ spelling for ' + . 'a class that has been deliberately moved back under a flat ' + . 'lib/ namespace' + : 'FOG\HostManagement resolved; Initiator::_bridgeNamespaced() is ' + . 'answering a flat spelling for a class srcClassMap() already ' + . 'knows about instead of refusing it, which reopens the ' + . 'shadowing hole ADR 0013 closed'; } -if ($bridged) { - // The flat name and the bare one are one class entry, because the lib/ - // file's own class_alias() makes them so -- that alias is what - // FOGPageManager::loadPageClasses() resolves and is NOT among the 202 - // retired by ADR 0013 §2. - $refFlat = new \ReflectionClass('FOG\HostManagement'); - $refShort = new \ReflectionClass('HostManagement'); - if ($refFlat->getName() !== $refShort->getName()) { - $failures[] = 'FOG\HostManagement resolves to a different class entry ' - . 'than HostManagement (' . $refFlat->getName() . ' vs ' - . $refShort->getName() . '); it should be an alias, not a copy'; - } - if (!trait_exists('FOG\Base\FOGPagePost')) { - $failures[] = 'Composer does not carry traits'; - } - if (!class_exists('fog\HostManagement')) { - $failures[] = 'the bridge is case-sensitive on the namespace prefix; ' - . 'PHP class names are not'; - } - if (class_exists('FOG\NoSuchThingHere')) { - $failures[] = 'the bridge invented FOG\NoSuchThingHere'; - } - if (class_exists('FOG\Model\Host')) { - $failures[] = 'the bridge resolved a nested name (FOG\Model\Host); ' - . 'it must only answer for flat FOG\'; - } - if (class_exists('Vendor\Host')) { - $failures[] = 'the bridge answered for a foreign namespace; a ' - . 'plugin\'s Vendor\Host must not silently become core Host'; - } - // A flat FOG\ for a class that lives in a BUCKET under src/ is a - // wrong spelling, not a name to bridge. Answering it would put core back - // within reach of a name no file declares, and -- because core is absent - // from the classMap -- would hand the key to any plugin shipping - // class/host.class.php. - if (class_exists('FOG\Host')) { - $failures[] = 'the bridge answered FOG\Host; core is namespaced per ' - . 'bucket, so only FOG\Items\Host names that class'; - } +// The refusal has to be a refusal, not a silent no-op: the namespaced +// spelling the diagnostic points to still has to resolve. +if (!class_exists('FOG\Pages\HostManagement')) { + $failures[] = 'FOG\Pages\HostManagement did not resolve; refusing the ' + . 'flat spelling is only correct if the bucketed one still answers'; +} +// The rest hold regardless of what HostManagement does: the bridge must not +// invent classes, resolve a nested name it does not own, or answer for a +// foreign namespace. +if (class_exists('FOG\NoSuchThingHere')) { + $failures[] = 'the bridge invented FOG\NoSuchThingHere'; +} +if (class_exists('FOG\Model\Host')) { + $failures[] = 'the bridge resolved a nested name (FOG\Model\Host); ' + . 'it must only answer for flat FOG\'; +} +if (class_exists('Vendor\Host')) { + $failures[] = 'the bridge answered for a foreign namespace; a ' + . 'plugin\'s Vendor\Host must not silently become core Host'; +} +// A flat FOG\ for a class that lives in a BUCKET under src/ is a wrong +// spelling, not a name to bridge -- the general case FOG\HostManagement above +// is one instance of. Answering it would put core back within reach of a +// name no file declares, and -- because core is absent from the classMap -- +// would hand the key to any plugin shipping class/host.class.php. +if (class_exists('FOG\Host')) { + $failures[] = 'the bridge answered FOG\Host; core is namespaced per ' + . 'bucket, so only FOG\Items\Host names that class'; } // In diagnostic mode say WHICH FOG was probed. "the bridge is missing" is diff --git a/tests/fleet-report.test.php b/tests/fleet-report.test.php index d6e28a3696..207a36306a 100644 --- a/tests/fleet-report.test.php +++ b/tests/fleet-report.test.php @@ -63,7 +63,7 @@ } $t->check( 'this report defaults to a quarter', - '-90 days' === constant('FOG\Fleet_Report::DEFAULT_WINDOW') + '-90 days' === constant('FOG\Reports\Fleet_Report::DEFAULT_WINDOW') ); /* diff --git a/tests/hardware-report.test.php b/tests/hardware-report.test.php index 63dd8eff08..c01b1f9b8f 100644 --- a/tests/hardware-report.test.php +++ b/tests/hardware-report.test.php @@ -65,9 +65,9 @@ } $t->check( 'this report defaults to a quarter, matching Fleet Report', - '-90 days' === constant('FOG\Hardware_Report::DEFAULT_WINDOW') - && constant('FOG\Fleet_Report::DEFAULT_WINDOW') - === constant('FOG\Hardware_Report::DEFAULT_WINDOW') + '-90 days' === constant('FOG\Reports\Hardware_Report::DEFAULT_WINDOW') + && constant('FOG\Reports\Fleet_Report::DEFAULT_WINDOW') + === constant('FOG\Reports\Hardware_Report::DEFAULT_WINDOW') ); $t->check( 'the page says what the range means here', @@ -131,13 +131,13 @@ ); $t->check( 'the retired report is gone rather than left as a second door', - !file_exists($web . '/lib/reports/inventory_report.report.php') + !file_exists($web . '/src/Reports/Inventory_Report.php') ); $t->check( 'and its menu label went with it', false === strpos( (string)file_get_contents( - $web . '/lib/pages/reportmanagement.page.php' + $web . '/src/Pages/ReportManagement.php' ), "_('Inventory Report');" ) diff --git a/tests/history-untranslated-and-bounded.test.php b/tests/history-untranslated-and-bounded.test.php index d6440bae00..a250efbdfd 100644 --- a/tests/history-untranslated-and-bounded.test.php +++ b/tests/history-untranslated-and-bounded.test.php @@ -175,7 +175,7 @@ function methodBody($file, $sig) // its place on the dashboard; the activity grid is the reader that remains. // Pinned so the card cannot come back reading `hText` raw -- the untranslated // column this whole test exists about. -$dash = file_get_contents($web . '/lib/pages/dashboardpage.page.php'); +$dash = file_get_contents($web . '/src/Pages/DashboardPage.php'); $t->check( 'the dashboard does not read the history table at all', false === strpos($dash, '`history`') diff --git a/tests/hook-event-contract.test.php b/tests/hook-event-contract.test.php index 056e8abd4c..475d225353 100644 --- a/tests/hook-event-contract.test.php +++ b/tests/hook-event-contract.test.php @@ -328,7 +328,7 @@ class CharManager extends \FOG\Base\HookManager } // The one shipped core event does not override it, which is what made the // default reachable from code we ship. -if ((new \ReflectionMethod('FOG\HostList', 'onEvent'))->getDeclaringClass() +if ((new \ReflectionMethod('FOG\Events\HostList', 'onEvent'))->getDeclaringClass() ->getName() !== 'FOG\Base\Event' ) { $fails[] = 'HostList now defines onEvent(); the note above is stale'; @@ -491,7 +491,7 @@ class CharManager extends \FOG\Base\HookManager . " public function fire(\$a) {}\n}\n" ); require $path; - if ($decl->invoke(null, $path, -strlen('.hook.php')) !== $active) { + if ($decl->invoke(null, $path, '.hook.php') !== $active) { $fails[] = sprintf( 'activation verdict for %s is wrong; the property says %s', '' === $line ? 'a file declaring no $active' : var_export($line, true), @@ -504,7 +504,7 @@ class CharManager extends \FOG\Base\HookManager // name nothing declares throws, and load() runs inside LoadGlobals, so an // unresolvable file here would be a 500 rather than one hook not starting. try { - if (false !== $decl->invoke(null, $tmp . '/hooks/charnosuch.hook.php', -strlen('.hook.php'))) { + if (false !== $decl->invoke(null, $tmp . '/hooks/charnosuch.hook.php', '.hook.php')) { $fails[] = 'a hook file with no resolvable class is treated as active'; } } catch (\Throwable $t) { diff --git a/tests/imaging-report.test.php b/tests/imaging-report.test.php index d70eaee291..665c8a67bd 100644 --- a/tests/imaging-report.test.php +++ b/tests/imaging-report.test.php @@ -76,7 +76,7 @@ */ $t->check( 'this report defaults to a month', - '-30 days' === constant('FOG\Imaging_Report::DEFAULT_WINDOW') + '-30 days' === constant('FOG\Reports\Imaging_Report::DEFAULT_WINDOW') ); /* diff --git a/tests/imaging-stats.test.php b/tests/imaging-stats.test.php index 6e403aa55d..98de3ca7ae 100644 --- a/tests/imaging-stats.test.php +++ b/tests/imaging-stats.test.php @@ -351,7 +351,7 @@ * page no longer contains one. */ $page = (string)file_get_contents( - $root . '/lib/pages/dashboardpage.page.php' + $root . '/src/Pages/DashboardPage.php' ); $t->check( 'the dashboard calls the rollup', diff --git a/tests/impersonation-picker-is-wired.test.php b/tests/impersonation-picker-is-wired.test.php index e32e7edad8..3d35d21769 100644 --- a/tests/impersonation-picker-is-wired.test.php +++ b/tests/impersonation-picker-is-wired.test.php @@ -97,7 +97,7 @@ function stripPhpComments($src) $web = dirname(__DIR__) . '/packages/web'; $php = stripPhpComments( (string)file_get_contents( - $web . '/lib/pages/impersonatemanagement.page.php' + $web . '/src/Pages/ImpersonateManagement.php' ) ); $js = (string)file_get_contents( diff --git a/tests/impersonation-refuses-api-only-accounts.test.php b/tests/impersonation-refuses-api-only-accounts.test.php index d364112618..5e40571d99 100644 --- a/tests/impersonation-refuses-api-only-accounts.test.php +++ b/tests/impersonation-refuses-api-only-accounts.test.php @@ -252,7 +252,7 @@ function stripPhpComments($src) ); $page = stripPhpComments( (string)file_get_contents( - $web . '/lib/pages/impersonatemanagement.page.php' + $web . '/src/Pages/ImpersonateManagement.php' ) ); diff --git a/tests/impersonation-start-gate-asks-the-real-user.test.php b/tests/impersonation-start-gate-asks-the-real-user.test.php index 5310bb05c5..66bff9a22b 100644 --- a/tests/impersonation-start-gate-asks-the-real-user.test.php +++ b/tests/impersonation-start-gate-asks-the-real-user.test.php @@ -185,7 +185,7 @@ function fakeUser($id, $name) $web = dirname(__DIR__) . '/packages/web'; $files = [ 'the page shell' => $web . '/management/other/index.php', - 'the impersonate page' => $web . '/lib/pages/impersonatemanagement.page.php', + 'the impersonate page' => $web . '/src/Pages/ImpersonateManagement.php', ]; foreach ($files as $label => $path) { $src = stripPhpComments((string)file_get_contents($path)); diff --git a/tests/insertbatch-required-columns.test.php b/tests/insertbatch-required-columns.test.php index fb01d7d004..f4d4a77967 100644 --- a/tests/insertbatch-required-columns.test.php +++ b/tests/insertbatch-required-columns.test.php @@ -217,7 +217,7 @@ function check($what, $ok, &$failures, &$checks) * that has to be created rather than a blank one. */ $page = (string) file_get_contents( - "$root/packages/web/lib/pages/fogconfigurationpage.page.php" + "$root/packages/web/src/Pages/FOGConfigurationPage.php" ); check( 'both settings savers name description and category', diff --git a/tests/installer-schema-deploy.test.php b/tests/installer-schema-deploy.test.php index 82e7f9bc62..f79b1ef0f0 100644 --- a/tests/installer-schema-deploy.test.php +++ b/tests/installer-schema-deploy.test.php @@ -45,7 +45,7 @@ $fails = []; $indexFile = 'packages/web/management/index.php'; -$schemaFile = 'packages/web/lib/pages/schemaupdaterpage.page.php'; +$schemaFile = 'packages/web/src/Pages/SchemaUpdaterPage.php'; /** * Source text with comments and whitespace stripped. diff --git a/tests/lib/report-wiring.php b/tests/lib/report-wiring.php index e962718209..f379e388cd 100644 --- a/tests/lib/report-wiring.php +++ b/tests/lib/report-wiring.php @@ -2,7 +2,7 @@ /** * The wiring every ADR 0030 report has to get right, checked once. * - * A report is discovered by FILENAME. lib/reports/*.report.php becomes a + * A report is discovered by FILENAME. src/Reports/*.php becomes a * menu entry with underscores turned into spaces, so the file name, the * class name, the `f` parameter the JS switches on, the REPORT_NODES key * and the xgettext registration all have to agree -- and any one of them @@ -54,7 +54,7 @@ public static function check( $tableId, array $opts = [] ) { - $report = $web . '/lib/reports/' . $slug . '.report.php'; + $report = $web . '/src/Reports/' . $class . '.php'; $t->check("$slug: the report file exists", is_readable($report)); $src = is_readable($report) ? file_get_contents($report) : ''; @@ -75,14 +75,14 @@ public static function check( } $label = str_replace('_', ' ', $slug); - $fq = 'FOG\\' . $class; + $fq = 'FOG\\Reports\\' . $class; $t->check( "$slug: the class name matches the file name, so the autoloader finds it", class_exists($fq) ); $t->check( "$slug: it extends ReportManagement, so it appears in the menu at all", - class_exists($fq) && is_subclass_of($fq, 'FOG\ReportManagement') + class_exists($fq) && is_subclass_of($fq, 'FOG\Pages\ReportManagement') ); $js = (string)@file_get_contents( @@ -99,7 +99,7 @@ class_exists($fq) && is_subclass_of($fq, 'FOG\ReportManagement') // the class reads its own $this->title back out of that same map -- // so this checks BOTH halves: that the row exists, and that the // page did not go back to hardcoding a literal beside it. - $titles = \FOG\ReportManagement::reportTitles(); + $titles = \FOG\Pages\ReportManagement::reportTitles(); $t->check( "$slug: it has a label in ReportManagement::reportTitles()", isset($titles[$label]) && '' !== trim((string)$titles[$label]) diff --git a/tests/list-pages-registered.test.php b/tests/list-pages-registered.test.php index bb4311e315..0181e7e4cb 100644 --- a/tests/list-pages-registered.test.php +++ b/tests/list-pages-registered.test.php @@ -82,7 +82,7 @@ */ function self_serves_index($webroot, $node) { - foreach (glob($webroot . '/lib/pages/*.page.php') as $page) { + foreach (glob($webroot . '/src/Pages/*.php') as $page) { $src = file_get_contents($page); if (!preg_match('/public \$node\s*=\s*\'' . $node . '\';/', $src)) { continue; diff --git a/tests/logviewer-is-its-own-node.test.php b/tests/logviewer-is-its-own-node.test.php index 347624d87b..25c5b34bab 100644 --- a/tests/logviewer-is-its-own-node.test.php +++ b/tests/logviewer-is-its-own-node.test.php @@ -12,8 +12,10 @@ * * - the page class exists and answers for the node, or FOGPageManager finds * nothing and the node 404s; - * - the class is reachable under its BARE name, or the autoloader logs - * "does not declare" and takes the same route (ADR 0013); + * - the class is reachable under its QUALIFIED name, or FOGPageManager + * logs "does not declare" and takes the same route (ADR 0013 -- core + * pages under src/ are no longer bare-name aliased; only a plugin page + * still needs class_alias()); * - the permission alias is present and matches `about`'s, or the move * silently changes who can read the logs; * - the sidebar group lists it, or it is a node nobody can navigate to; @@ -35,12 +37,12 @@ // [passed, what it means], classified in one pass at the end. $results = []; -$page = $web . 'lib/pages/logviewermanagement.page.php'; +$page = $web . 'src/Pages/LogViewerManagement.php'; $src = is_file($page) ? (string)file_get_contents($page) : ''; $results[] = [ '' !== $src, - 'the page file exists at lib/pages/logviewermanagement.page.php', + 'the page file exists at src/Pages/LogViewerManagement.php', ]; $results[] = [ (bool)preg_match('#class\s+LogViewerManagement\s+extends\s+FOGPage#', $src), @@ -50,12 +52,16 @@ (bool)preg_match('#public\s+\$node\s*=\s*\'logviewer\'#', $src), 'and answers for node "logviewer"', ]; -// The autoloader resolves a page by its bare global name. A namespaced page -// without this loads as nothing and the node 404s -- with only an error_log -// line to say why. +// FOGPageManager::loadPageClasses() derives FOG\Pages\LogViewerManagement +// straight from the file path and checks class_exists() against THAT name -- +// core pages under src/ stopped being bare-name aliased with the rest of the +// 202-alias retirement (ADR 0013 SS2). A missing or wrong namespace here is +// what class_exists() would catch, so pin the namespace directly rather than +// a class_alias() call that core pages no longer make. $results[] = [ - false !== strpos($src, "class_alias(__NAMESPACE__ . '\\\\LogViewerManagement'"), - 'and is aliased to its bare name for the autoloader (ADR 0013)', + (bool)preg_match('#^namespace\s+FOG\\\\Pages;#m', $src), + 'and is declared under FOG\\Pages, the namespace loadPageClasses() ' + . 'resolves it by', ]; $results[] = [ (bool)preg_match('#public\s+function\s+index\(\.\.\.\$args\)#', $src), @@ -96,7 +102,7 @@ false === strpos($fogpage, "'logviewer' => self::\$foglang['LogViewer']"), 'it is gone from the About sub-menu in FOGPage', ]; -$submenu = (string)file_get_contents($web . 'lib/hooks/submenudata.hook.php'); +$submenu = (string)file_get_contents($web . 'src/Hooks/SubMenuData.php'); $results[] = [ false === strpos($submenu, "'logviewer' => self::\$foglang['LogViewer']"), 'and from the second copy in SubMenuData::subMenu()', @@ -106,7 +112,7 @@ // years, so it is in bookmarks and in documentation -- same reasoning as // History_Report, which ADR 0023 item 4 kept alive as a redirect. $conf = (string)file_get_contents( - $web . 'lib/pages/fogconfigurationpage.page.php' + $web . 'src/Pages/FOGConfigurationPage.php' ); $results[] = [ (bool)preg_match( diff --git a/tests/node-signature-auth.test.php b/tests/node-signature-auth.test.php index 66e5e99f79..1f6665cac7 100644 --- a/tests/node-signature-auth.test.php +++ b/tests/node-signature-auth.test.php @@ -408,7 +408,7 @@ function nodeSigPresent($method, $uri, array $headers) // ...and the UI has to say where to run it, or the value is a dead end. $nodePage = (string)file_get_contents( - 'packages/web/lib/pages/storagenodemanagement.page.php' + 'packages/web/src/Pages/StorageNodeManagement.php' ); if (false === strpos($nodePage, 'fog-node-key.php')) { $fails[] = 'the storage node page no longer tells the administrator how' @@ -583,7 +583,7 @@ function nodeSigPresent($method, $uri, array $headers) . ' shared node secret would be readable over REST'; } $configPage = (string)file_get_contents( - 'packages/web/lib/pages/fogconfigurationpage.page.php' + 'packages/web/src/Pages/FOGConfigurationPage.php' ); if (false === strpos($configPage, 'NODE_API_KEY_SETTING')) { $fails[] = 'the FOG Configuration page no longer drops the node key' diff --git a/tests/page-objects-registered.test.php b/tests/page-objects-registered.test.php index 1dc30b1d5c..c4db85d82e 100644 --- a/tests/page-objects-registered.test.php +++ b/tests/page-objects-registered.test.php @@ -31,7 +31,7 @@ */ $webroot = dirname(__DIR__) . '/packages/web'; -$pageDir = $webroot . '/lib/pages'; +$pageDir = $webroot . '/src/Pages'; $pageBase = $webroot . '/src/Base/FOGPage.php'; foreach ([$pageDir, $pageBase] as $needed) { @@ -67,7 +67,7 @@ $failures = []; $checks = 0; -foreach (glob($pageDir . '/*.page.php') as $file) { +foreach (glob($pageDir . '/*.php') as $file) { $pageSrc = file_get_contents($file); if (false === strpos($pageSrc, '$this->obj->')) { continue; diff --git a/tests/plugin-extension-points.test.php b/tests/plugin-extension-points.test.php index 1c38d6fd05..6e3b0aafcc 100644 --- a/tests/plugin-extension-points.test.php +++ b/tests/plugin-extension-points.test.php @@ -306,7 +306,7 @@ public function processEvent($event, $arguments = []) ['label' => '', 'url' => '/fog/ext/ok'], ['label' => 'Bad icon', 'url' => '/fog/ext/ok2', 'icon' => '" onmouseover="alert(1)'], ]; -$html = \FOG\ProcessLogin::loginProviders(); +$html = \FOG\Pages\ProcessLogin::loginProviders(); foreach (['javascript:', 'data:text/html', 'http://idp.example', '//evil.example'] as $bad) { if (false !== strpos($html, $bad)) { @@ -325,7 +325,7 @@ public function processEvent($event, $arguments = []) $fails[] = 'provider-supplied markup reached the page unescaped'; } $stub->providers = []; -if ('' !== \FOG\ProcessLogin::loginProviders()) { +if ('' !== \FOG\Pages\ProcessLogin::loginProviders()) { $fails[] = 'the login form grew a divider with no providers behind it'; } diff --git a/tests/psr4-bridge.test.php b/tests/psr4-bridge.test.php index dc2a04cadb..386bae3292 100644 --- a/tests/psr4-bridge.test.php +++ b/tests/psr4-bridge.test.php @@ -127,6 +127,22 @@ function () use ($tmp) { . "class_alias(__NAMESPACE__ . '\\ProbeDiscovered', 'ProbeDiscovered');\n" ); +/* + * A SECOND one, used only to prove the bridge's prefix match is + * case-insensitive (strncasecmp). It needs its own file because the check has + * to be the FIRST request for the class: once any spelling has been loaded, + * PHP's own class table answers every other casing without consulting an + * autoloader at all, so asserting against an already-loaded probe passes + * whatever the bridge does. That is exactly how the version of this check + * that used to live in autoload.test.php was a fake gate -- verified by + * mutating strncasecmp to strncmp, which it did not catch. + */ +file_put_contents( + $tmp . '/lib/pages/probecased.page.php', + "check( basename($file) . ': its class loads', class_exists($class) @@ -100,7 +102,7 @@ class_exists($class) * A spreadsheet does not, so the raw value would put `` in * the cell. Driven, not grepped. */ -$cell = new \ReflectionMethod('FOG\ReportManagement', '_exportCell'); +$cell = new \ReflectionMethod('FOG\Pages\ReportManagement', '_exportCell'); $cell->setAccessible(true); $t->check( 'a link column exports as the text a person was reading', @@ -175,7 +177,7 @@ class_exists($class) // makes one method name thirteen different files. $name = function (array $payload, $written) { return FogTestHarness::callStatic( - 'FOG\Fleet_Report', + 'FOG\Reports\Fleet_Report', '_exportFilename', [$payload, $written] ); @@ -286,10 +288,10 @@ class_exists($class) false !== strpos($src, "'truncated'") ); } -foreach (['fleet_report', 'storage_report', 'audit_report', 'imaging_report', - 'snapin_report'] as $report) { +foreach (['Fleet_Report', 'Storage_Report', 'Audit_Report', 'Imaging_Report', + 'Snapin_Report'] as $report) { $src = (string) file_get_contents( - $web . '/lib/reports/' . $report . '.report.php' + $web . '/src/Reports/' . $report . '.php' ); $t->check( "$report: shows the cap banner from the shared helper", diff --git a/tests/report-menu-groups.test.php b/tests/report-menu-groups.test.php index 3cd4c09922..2aa5c18991 100644 --- a/tests/report-menu-groups.test.php +++ b/tests/report-menu-groups.test.php @@ -31,7 +31,7 @@ FogTestHarness::boot('report-menu-groups'); -use FOG\ReportManagement; +use FOG\Pages\ReportManagement; $t = new FogChecks(); $root = dirname(__DIR__); @@ -41,9 +41,9 @@ * 1. Every entry is placed, and placed once. */ $onDisk = []; -foreach (glob($web . '/lib/reports/*.report.php') as $file) { +foreach (glob($web . '/src/Reports/*.php') as $file) { $onDisk[] = strtolower( - str_replace('_', ' ', basename($file, '.report.php')) + str_replace('_', ' ', basename($file, '.php')) ); } sort($onDisk); diff --git a/tests/report-title-hook.test.php b/tests/report-title-hook.test.php index 32bef4e6a7..29111d9a08 100644 --- a/tests/report-title-hook.test.php +++ b/tests/report-title-hook.test.php @@ -35,7 +35,7 @@ FogTestHarness::boot('report-title-hook'); FogTestHarness::fakeDb(); -use FOG\ReportManagement; +use FOG\Pages\ReportManagement; $t = new FogChecks(); diff --git a/tests/report-titles.test.php b/tests/report-titles.test.php index 3c3c518349..92a45a5a9d 100644 --- a/tests/report-titles.test.php +++ b/tests/report-titles.test.php @@ -33,7 +33,7 @@ // HookManager::processEvent() reads (and records) the event name. FogTestHarness::fakeDb(); -use FOG\ReportManagement; +use FOG\Pages\ReportManagement; $t = new FogChecks(); $web = dirname(__DIR__) . '/packages/web'; @@ -44,11 +44,17 @@ * 1. The map and the directory describe the same set of reports. */ $onDisk = []; -foreach ((array) glob($web . '/lib/reports/*.report.php') as $file) { - $onDisk[] = str_replace( - '_', - ' ', - basename($file, '.report.php') +foreach ((array) glob($web . '/src/Reports/*.php') as $file) { + // Lowercased for the same reason loadCustomReports() lowercases: the + // PSR-4 filename is Audit_Report.php where it used to be audit_report, + // and the label, the `f` parameter and the REPORT_NODES keys are all + // lower case. + $onDisk[] = strtolower( + str_replace( + '_', + ' ', + basename($file, '.php') + ) ); } sort($onDisk); @@ -74,7 +80,7 @@ * definitions is the state this replaced, and it is invisible until * somebody notices the sidebar and the heading disagree. */ -foreach ((array) glob($web . '/lib/reports/*.report.php') as $file) { +foreach ((array) glob($web . '/src/Reports/*.php') as $file) { $src = (string) file_get_contents($file); $name = basename($file); $t->check( diff --git a/tests/retention-default-and-login-files.test.sh b/tests/retention-default-and-login-files.test.sh index 7bb2f2908e..24d382936c 100755 --- a/tests/retention-default-and-login-files.test.sh +++ b/tests/retention-default-and-login-files.test.sh @@ -42,8 +42,8 @@ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO="$(cd "$HERE/.." && pwd)" FUNCS="$REPO/lib/common/functions.sh" INSTALLER="$REPO/bin/installfog.sh" -LOGIN="$REPO/packages/web/lib/pages/processlogin.page.php" -DASH="$REPO/packages/web/lib/pages/dashboardpage.page.php" +LOGIN="$REPO/packages/web/src/Pages/ProcessLogin.php" +DASH="$REPO/packages/web/src/Pages/DashboardPage.php" for f in "$FUNCS" "$INSTALLER" "$LOGIN" "$DASH"; do [[ -f $f ]] || { echo "ERROR: $f not found" >&2; exit 1; } diff --git a/tests/retention-registry.test.php b/tests/retention-registry.test.php index 81f1bfe1ba..da6a0a9e45 100644 --- a/tests/retention-registry.test.php +++ b/tests/retention-registry.test.php @@ -366,7 +366,7 @@ function check($label, $cond, array &$failures, &$checks) * field is not rendered without it and a post is refused without it. */ $page = (string) file_get_contents( - $webroot . '/lib/pages/fogconfigurationpage.page.php' + $webroot . '/src/Pages/FOGConfigurationPage.php' ); check( 'the settings page hides retention windows without audit.manage', diff --git a/tests/run-history-report.test.php b/tests/run-history-report.test.php index 777e56b01a..e9cc108f2c 100644 --- a/tests/run-history-report.test.php +++ b/tests/run-history-report.test.php @@ -6,7 +6,7 @@ * itself flagged as the thing most likely to let it rot. This is the caller, * and the parts of the wiring that fail SILENTLY are what this pins: * - * - the report is discovered by FILENAME. lib/reports/*.report.php becomes + * - the report is discovered by FILENAME. src/Reports/*.php becomes * a menu entry with underscores turned into spaces, so the file name, * the class name, the `f` parameter the JS switches on and the * REPORT_NODES key all have to agree. Any one of them out of step gives @@ -37,7 +37,7 @@ $t = new FogChecks(); $web = dirname(__DIR__) . '/packages/web'; -$report = $web . '/lib/reports/run_history.report.php'; +$report = $web . '/src/Reports/Run_History.php'; $t->check('the report file exists', is_readable($report)); $src = is_readable($report) ? file_get_contents($report) : ''; @@ -45,7 +45,7 @@ /* * 1. The four names that have to agree. * - * basename minus '.report.php', underscores to spaces, is the menu label + * basename minus '.php', underscores to spaces, is the menu label * and the `f` parameter; the same string underscored is the REPORT_NODES * key; the class name matches the file for the autoloader. */ @@ -53,12 +53,12 @@ $label = str_replace('_', ' ', $slug); $t->check( 'the class name matches the file name, so the autoloader finds it', - class_exists('FOG\Run_History') + class_exists('FOG\Reports\Run_History') ); $t->check( 'it extends ReportManagement, so it appears in the report menu at all', - class_exists('FOG\Run_History') - && is_subclass_of('FOG\Run_History', 'FOG\ReportManagement') + class_exists('FOG\Reports\Run_History') + && is_subclass_of('FOG\Reports\Run_History', 'FOG\Pages\ReportManagement') ); $js = file_get_contents($web . '/management/js/fog/report/fog.report.file.js'); $t->check( @@ -120,7 +120,7 @@ class_exists('FOG\Run_History') * ucwords() of the file name -- which is also what keeps the msgid in * the catalog, since a runtime-built one never reaches it. */ -$titles = \FOG\ReportManagement::reportTitles(); +$titles = \FOG\Pages\ReportManagement::reportTitles(); $t->check( 'the menu label comes from ReportManagement::reportTitles()', ($titles['run history'] ?? '') === _('Run History') diff --git a/tests/schema-executes.test.php b/tests/schema-executes.test.php index 3ac11352ee..b92c30327c 100644 --- a/tests/schema-executes.test.php +++ b/tests/schema-executes.test.php @@ -248,7 +248,7 @@ function fogParseSkipErrs($file, $varname) } $updaterSkip = fogParseSkipErrs( - $root . '/lib/pages/schemaupdaterpage.page.php', + $root . '/src/Pages/SchemaUpdaterPage.php', 'skiperrs' ); $reconcilerSkip = fogParseSkipErrs( diff --git a/tests/secureboot-enrolment-diagnostics.test.sh b/tests/secureboot-enrolment-diagnostics.test.sh index 5823b692df..7e1ecbd4b4 100644 --- a/tests/secureboot-enrolment-diagnostics.test.sh +++ b/tests/secureboot-enrolment-diagnostics.test.sh @@ -48,7 +48,7 @@ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO="$(cd "$HERE/.." && pwd)" FUNCS="$REPO/lib/common/functions.sh" MOKSH="$REPO/packages/secureboot/fog-enroll-mok.sh" -PAGE="$REPO/packages/web/lib/pages/fogconfigurationpage.page.php" +PAGE="$REPO/packages/web/src/Pages/FOGConfigurationPage.php" for f in "$FUNCS" "$MOKSH" "$PAGE"; do [[ -f $f ]] || { echo "ERROR: $f not found" >&2; exit 1; } diff --git a/tests/secureboot-enrolvia-vocabulary.test.php b/tests/secureboot-enrolvia-vocabulary.test.php index ae4b37a836..295c24365d 100644 --- a/tests/secureboot-enrolvia-vocabulary.test.php +++ b/tests/secureboot-enrolvia-vocabulary.test.php @@ -7,7 +7,7 @@ * * - `service/secureboot.report.php` maps the word FOS sends onto the word * the column stores; - * - `lib/pages/hostmanagement.page.php` whitelists what an administrator may + * - `src/Pages/HostManagement.php` whitelists what an administrator may * type into the host form. * * Neither can see the other, and the failure when they drift is silent in the @@ -35,7 +35,7 @@ $webroot = dirname(__DIR__) . '/packages/web'; $endpoint = $webroot . '/service/secureboot.report.php'; -$page = $webroot . '/lib/pages/hostmanagement.page.php'; +$page = $webroot . '/src/Pages/HostManagement.php'; /** * Print whatever went wrong and stop, or return if nothing did. @@ -101,7 +101,7 @@ function stopOnProblems(array $problems) } if (count($allowed) < 1) { $problems[] = 'could not read the sbenrollvia whitelist out of' - . ' lib/pages/hostmanagement.page.php'; + . ' src/Pages/HostManagement.php'; } stopOnProblems($problems); diff --git a/tests/site-grant-reverse-tabs.test.php b/tests/site-grant-reverse-tabs.test.php index 2c0dc9e7e2..5d8f6f1504 100644 --- a/tests/site-grant-reverse-tabs.test.php +++ b/tests/site-grant-reverse-tabs.test.php @@ -29,9 +29,9 @@ */ $root = dirname(__DIR__); -$pages = $root . '/packages/web/lib/pages'; -$roleFile = $pages . '/rolemanagement.page.php'; -$ugFile = $pages . '/usergroupmanagement.page.php'; +$pages = $root . '/packages/web/src/Pages'; +$roleFile = $pages . '/RoleManagement.php'; +$ugFile = $pages . '/UserGroupManagement.php'; $postFile = $root . '/packages/web/src/Base/FOGPagePost.php'; foreach ([$roleFile, $ugFile, $postFile] as $needed) { diff --git a/tests/site-model.test.php b/tests/site-model.test.php index 085add0cec..ee525140bf 100644 --- a/tests/site-model.test.php +++ b/tests/site-model.test.php @@ -313,12 +313,12 @@ class_exists(\FOG\Managers\SiteManager::class, true), */ check( 'SiteManagement page resolves', - class_exists('SiteManagement', true), + class_exists('FOG\Pages\SiteManagement', true), $failures, $checks ); -if (class_exists('SiteManagement', true)) { - $pref = new \ReflectionClass('SiteManagement'); +if (class_exists('FOG\Pages\SiteManagement', true)) { + $pref = new \ReflectionClass('FOG\Pages\SiteManagement'); check( 'SiteManagement page resolves to core, not to a plugin copy', false === strpos($pref->getFileName(), DIRECTORY_SEPARATOR . 'plugins'), diff --git a/tests/site-new-account-default.test.php b/tests/site-new-account-default.test.php index 686fb22a52..36a8ad6abc 100644 --- a/tests/site-new-account-default.test.php +++ b/tests/site-new-account-default.test.php @@ -174,9 +174,9 @@ * mode these two checks exist for. */ $pages = [ - 'user' => 'lib/pages/usermanagement.page.php', - 'group' => 'lib/pages/groupmanagement.page.php', - 'usergroup' => 'lib/pages/usergroupmanagement.page.php', + 'user' => 'src/Pages/UserManagement.php', + 'group' => 'src/Pages/GroupManagement.php', + 'usergroup' => 'src/Pages/UserGroupManagement.php', ]; foreach ($pages as $node => $path) { $src = $read($path); diff --git a/tests/snapin-report.test.php b/tests/snapin-report.test.php index 8b6c2e6728..d1ebf55038 100644 --- a/tests/snapin-report.test.php +++ b/tests/snapin-report.test.php @@ -54,7 +54,7 @@ } $t->check( 'this report defaults to a month', - '-30 days' === constant('FOG\Snapin_Report::DEFAULT_WINDOW') + '-30 days' === constant('FOG\Reports\Snapin_Report::DEFAULT_WINDOW') ); /* diff --git a/tests/stale-class-file-list.test.php b/tests/stale-class-file-list.test.php index bc0c1c0087..6329c2679e 100644 --- a/tests/stale-class-file-list.test.php +++ b/tests/stale-class-file-list.test.php @@ -77,7 +77,7 @@ function check($label, $cond, array &$failures, &$checks) $prevLog = ini_get('error_log'); ini_set('error_log', $errLog); try { - \FOG\Base\FOGBase::startClassFromFiles([$gone], -strlen('.hook.php')); + \FOG\Base\FOGBase::startClassFromFiles([$gone], '.hook.php'); } catch (\Throwable $e) { $threw = get_class($e) . ': ' . $e->getMessage(); } diff --git a/tests/storage-report.test.php b/tests/storage-report.test.php index 69b498967c..6a56361360 100644 --- a/tests/storage-report.test.php +++ b/tests/storage-report.test.php @@ -63,7 +63,7 @@ } $t->check( 'this report defaults to a year, because images move slowly', - '-365 days' === constant('FOG\Storage_Report::DEFAULT_WINDOW') + '-365 days' === constant('FOG\Reports\Storage_Report::DEFAULT_WINDOW') ); $t->check( 'the page says the sizes are allocation, not node usage', diff --git a/tests/storagenode-group-is-not-removable.test.sh b/tests/storagenode-group-is-not-removable.test.sh index eae3121083..ac716873e4 100644 --- a/tests/storagenode-group-is-not-removable.test.sh +++ b/tests/storagenode-group-is-not-removable.test.sh @@ -39,7 +39,7 @@ HERE="$(cd "$(dirname "${BASH_SOURCE[0]}")" && pwd)" REPO="$(cd "$HERE/.." && pwd)" WEB="$REPO/packages/web" RENDER="$WEB/src/Base/FOGPageRender.php" -PAGE="$WEB/lib/pages/storagegroupmanagement.page.php" +PAGE="$WEB/src/Pages/StorageGroupManagement.php" COMMON="$WEB/management/js/fog/fog.common.js" EDIT="$WEB/management/js/fog/storagegroup/fog.storagegroup.edit.js" diff --git a/tests/system-export-permission.test.php b/tests/system-export-permission.test.php index 6e3b314b24..bdbc3bce30 100644 --- a/tests/system-export-permission.test.php +++ b/tests/system-export-permission.test.php @@ -139,7 +139,7 @@ function exportCheck($label, $ok, $extra = '') * aliases onto `settings` -- so the map would put both on settings.edit. */ $src = (string) file_get_contents( - $webroot . '/lib/pages/fogconfigurationpage.page.php' + $webroot . '/src/Pages/FOGConfigurationPage.php' ); $results[] = exportCheck( 'the UI export branch checks system.export before dumping', diff --git a/tests/task-error-report.test.php b/tests/task-error-report.test.php index 999345e5f9..5d83a5aea4 100644 --- a/tests/task-error-report.test.php +++ b/tests/task-error-report.test.php @@ -281,7 +281,7 @@ public function processEvent($event, $data = []) // so the active pane excludes it by construction, and Task Management's // Recent pane is the only view of finished tasks there is -- if that pane // does not list Failed, the state exists and nobody can see it. -$page = file_get_contents($web . '/lib/pages/taskmanagement.page.php'); +$page = file_get_contents($web . '/src/Pages/TaskManagement.php'); if (false === strpos($page, 'self::getFailedState()')) { $fails[] = "Task Management's Recent pane does not know about the Failed" . ' state, so a failed task appears in no pane at all'; diff --git a/tests/task-log-view.test.php b/tests/task-log-view.test.php index 7917c81618..c0c827ec6d 100644 --- a/tests/task-log-view.test.php +++ b/tests/task-log-view.test.php @@ -17,7 +17,7 @@ $root = dirname(__DIR__); $web = $root . '/packages/web'; -$page = file_get_contents($web . '/lib/pages/taskmanagement.page.php'); +$page = file_get_contents($web . '/src/Pages/TaskManagement.php'); $js = file_get_contents( $web . '/management/js/fog/task/fog.task.list.js' ); diff --git a/tests/tasklog-report-retention.test.php b/tests/tasklog-report-retention.test.php index 98578fc42f..7250039af9 100644 --- a/tests/tasklog-report-retention.test.php +++ b/tests/tasklog-report-retention.test.php @@ -250,7 +250,7 @@ function retentionExec($pdo, $sql) $ins->execute($row); } -$fromMethod = new \ReflectionMethod('FOG\TaskManagement', '_logQueryFrom'); +$fromMethod = new \ReflectionMethod('FOG\Pages\TaskManagement', '_logQueryFrom'); $fromMethod->setAccessible(true); $from = sprintf($fromMethod->invoke(null), 'v'); $rows = $pdo->query( diff --git a/tests/typed-dates-are-read-in-the-viewers-zone.test.php b/tests/typed-dates-are-read-in-the-viewers-zone.test.php index 11dddeb31b..740eb91b9c 100644 --- a/tests/typed-dates-are-read-in-the-viewers-zone.test.php +++ b/tests/typed-dates-are-read-in-the-viewers-zone.test.php @@ -73,7 +73,7 @@ function vz_body($src, $name) 'the start of a report window' => ': self::viewerDate($given[\'start\']);', ], - 'lib/pages/hostmanagement.page.php' => [ + 'src/Pages/HostManagement.php' => [ 'the Secure Boot enrollment date' => '$sbEnrolled = self::viewerDate($sbEnrolled)', ], diff --git a/tests/user-list-columns.test.php b/tests/user-list-columns.test.php index 57acf66de0..c4199deafc 100644 --- a/tests/user-list-columns.test.php +++ b/tests/user-list-columns.test.php @@ -38,7 +38,7 @@ $t = new FogChecks(); $web = dirname(__DIR__) . '/packages/web'; -$pageSrc = file_get_contents($web . '/lib/pages/usermanagement.page.php'); +$pageSrc = file_get_contents($web . '/src/Pages/UserManagement.php'); $jsSrc = file_get_contents( $web . '/management/js/fog/user/fog.user.list.js' ); diff --git a/tests/user-password-tab-local-only.test.php b/tests/user-password-tab-local-only.test.php index e08ed20ea5..f21fee2c98 100644 --- a/tests/user-password-tab-local-only.test.php +++ b/tests/user-password-tab-local-only.test.php @@ -51,7 +51,7 @@ chdir($root); $fails = []; -$pageFile = 'packages/web/lib/pages/usermanagement.page.php'; +$pageFile = 'packages/web/src/Pages/UserManagement.php'; if (!is_readable($pageFile)) { echo "cannot read $pageFile -- run this from the repository\n"; exit(1); diff --git a/tests/usertracking-permission-split.test.php b/tests/usertracking-permission-split.test.php index 1772440735..073dd0d64c 100644 --- a/tests/usertracking-permission-split.test.php +++ b/tests/usertracking-permission-split.test.php @@ -185,11 +185,24 @@ function check($label, $cond, array &$failures, &$checks) /* * 5. Every REPORT_NODES key names a report that is actually on disk. The key * is filename-derived, so a rename would silently drop the gate. + * + * Matched against the LOWERCASED basename rather than stat'ing the key as + * a filename. The keys are lowercase and the PSR-4 files are not + * (`hosts_and_users` vs `Hosts_And_Users.php`), so is_readable() on the + * raw key is false for every one of them on a case-sensitive filesystem. + * Lowercasing here is not a workaround -- it is the exact transform + * ReportManagement::loadCustomReports() applies to build the name that + * reaches this gate, so this now pins the real contract rather than a + * filename that happened to already be lowercase. */ +$reportFiles = []; +foreach ((array) glob($webroot . '/src/Reports/*.php') as $reportPath) { + $reportFiles[strtolower(basename($reportPath, '.php'))] = true; +} foreach (Authorization::REPORT_NODES as $report => $node) { check( "REPORT_NODES key '$report' has a report file", - is_readable($webroot . '/lib/reports/' . $report . '.report.php'), + isset($reportFiles[$report]), $failures, $checks ); @@ -206,15 +219,15 @@ function check($label, $cond, array &$failures, &$checks) * denied reads as a broken page, not as a permission boundary. */ $tabPages = [ - 'hostmanagement' => 'host-login-history', - 'groupmanagement' => 'group-login-history', + 'HostManagement' => 'host-login-history', + 'GroupManagement' => 'group-login-history', ]; foreach ($tabPages as $page => $tabId) { $src = (string) @file_get_contents( - $webroot . '/lib/pages/' . $page . '.page.php' + $webroot . '/src/Pages/' . $page . '.php' ); check( - "$page.page.php gates its Login History tab on usertracking.view", + "$page.php gates its Login History tab on usertracking.view", false !== strpos($src, "Authorization::can('usertracking.view')") && false !== strpos($src, $tabId), $failures, diff --git a/tests/utc-storage-boundary.test.php b/tests/utc-storage-boundary.test.php index ad43859008..f4a2d9a6a7 100644 --- a/tests/utc-storage-boundary.test.php +++ b/tests/utc-storage-boundary.test.php @@ -155,11 +155,11 @@ } // Every core caller has to hand them over, or the default silently decides. foreach ([ - 'hostmanagement' => 4, - 'imagemanagement' => 1, + 'HostManagement' => 4, + 'ImageManagement' => 1, ] as $page => $expected) { $src = file_get_contents( - $root . '/packages/web/lib/pages/' . $page . '.page.php' + $root . '/packages/web/src/Pages/' . $page . '.php' ); $hinted = preg_match_all( "#dateOrNever\(\s*\\\$this->obj->get\('[a-z]+'\),\s*'[a-z]+',\s*'[A-Za-z]+'\s*\)#s", @@ -168,7 +168,7 @@ $all = preg_match_all('#self::dateOrNever\(#', $src); if ($hinted < $expected || $hinted !== $all) { $fails[] = sprintf( - '%s.page.php has %d dateOrNever() calls and %d of them name ' + '%s.php has %d dateOrNever() calls and %d of them name ' . 'their table and column; an unhinted one is assumed DATETIME', $page, $all,