Welcome Guest, Not a member yet? Register   Sign In
Problem with detecting commands when custom namespace is declared

I'm not really sure if this is a bug or not, but it seems that the Commands detection is failing when we add a custom module via $psr4 array in Autoload class and this module is placed in the app/ folder.

I downloaded myth-auth and followed the instructions regarding manual installation (it's nothing related to this package, I use it as an example). So, my autoload looks like this:

PHP Code:
$psr4 = [
    'App'         => APPPATH,                // To ensure filters, etc still found,
    APP_NAMESPACE => APPPATH,                // For custom namespace
    'Config'      => APPPATH 'Config',
    'Myth\Auth'   => APPPATH 'ThirdParty/myth-auth/src',

Command php spark list doesn't show any new commands and we also can't run any of these commands shipped with this package. Running command php spark namespaces shows that new namespace (Myth\Auth) is found.

After some digging, I discovered that Myth\Auth in qualified as an App namespace by FileLocator::findQualifiedNameFromPath().

When we change the order of the entries in $psr4 and place Myth\Auth at the beginning of the array it starts to work correctly. So, my question is... whether this is the desired behavior or not?

I too was struggling with this and i stumbled upon your post. 

Indeed changing the order seems to fix things. But is that supposed to happen? Should we just use it like that with custom namespaces on top of the array?

No, it was a small bug in the framework code.

It's already fixed in the development branch.

Ah ok, good to know.

Is there any official information on how often is the development branch going to be merged into master, or any release time schedule?

Right now updating is a huge pain Undecided

I think Lonnie is planning to release v4.0.3 on May 1.

(04-25-2020, 08:51 AM)michalsn Wrote: I think Lonnie is planning to release v4.0.3 on May 1.

Great news! Thanks for the info. Is there any chatroom and/or blog we can follow on these intentions/progreess?

You can read News & Discussion and this CI 4.0.3 is releasing soon - help wanted. There are no changelog on what's going to be released.

If you want to follow the development, you need to look at the main Github repository.

At this time there are no official release schedule.

Theme © iAndrew 2016 - Forum software by © MyBB