2022/11/01: Difference between revisions

From Woozle Writes Code
Jump to navigation Jump to search
(Created page with "{{page/date}} ==PHP namespace issue== So, this is just kind of weird. I don't know yet if it's a bug or just something I've overlooked. Code: <syntaxhighlight lang=php> <?php...")
(No difference)

Revision as of 13:15, 1 November 2022

Tuesday, November 1, 2022 (#305)
Monday Tuesday Wednesday

PHP namespace issue

So, this is just kind of weird. I don't know yet if it's a bug or just something I've overlooked.

Code:

<?php namespace greenmine\config;

use ferret\data as FD;

class cServerSpec extends FD\cDBServerSpec {}

class csDataSpec extends FD\csSpecs {

    static protected function GetSpec(string $sKey) : cServerSpec {

Error: "Class ferret\data\FD\cDBServerSpec was requested but is neither loaded nor registered with the Class Loader."

The major clue, I think, is that if I replace all the "FD" aliases with "\ferret\data", I get the exact same error -- which suggests that the problem is actually in some other file.