Welcome Guest, Not a member yet? Register   Sign In
Custom CLI Return "Cannot declare class name in use"
#3

(This post was last modified: 03-31-2021, 06:52 PM by simonickalexs.)

(03-31-2021, 02:54 PM)[email protected] Wrote: Assuming your app/config/Autoload.php contains this entry:
'Someone\plugins' => ROOTPATH . 'someone/plugins'

Then the namespace in your code says that your file is in:
someone/plugins/Commands folder
I've tested the above and your code works.

I don't understand your Edit: line  "I put it on the ThirdParty folder. Full path is on "ThirdParty\trydummy\src".
Your file should not be in this directory, it has to be in a 'Commands' folder

Try using php spark namespaces to check your namespaces map and can be found.

Once you have it working you could change the namespace mapping:
Eg: In app/config/Autoload.php
CustomSpark => ROOTPATH . 'someone/plugins'
and in your file:
namespace CustomSpark\Commands;

OR something even more sensible !

Thanks for your answer and sorry for misunderstanding my English is not very good. 

Quote:Assuming your app/config/Autoload.php contains this entry:

'Someone\plugins' => ROOTPATH . 'someone/plugins'

Actually, it "Someone\plugins" => APPPATH.'ThirdParty/trydummy/src' (I'm following this plugin https://github.com/lonnieezell/myth-auth...stallation).


Quote:Then the namespace in your code says that your file is in:
someone/plugins/Commands folder
I've tested the above and your code works.


My directory is looking like this
- app
   + Commands
   + Config
   + Controllers
   + Database
   + Filters
   + .....
   - ThirdParty
      - trydummy
        - src
          - Commands
             ThatCustomCommand.php
          + AnotherFolder
          + AnotherFolder
          somefile.php
   + Views
+ public


Quote:I don't understand your Edit: line  "I put it on the ThirdParty folder. Full path is on "ThirdParty\trydummy\src".

Your file should not be in this directory, it has to be in a 'Commands' folder

It's already in Commands folder like the docs said.



Quote:Once you have it working you could change the namespace mapping:
Eg: In app/config/Autoload.php
CustomSpark => ROOTPATH . 'someone/plugins'
and in your file:
namespace CustomSpark\Commands;


Should I use ROOTPATH instead of APPPATH?

Thank you!
Reply


Messages In This Thread
RE: Custom CLI Return "Cannot declare class name in use" - by simonickalexs - 03-31-2021, 06:51 PM



Theme © iAndrew 2016 - Forum software by © MyBB