We have moved our forum to GitHub Discussions. For questions about Phalcon v3/v4/v5 you can visit here and for Phalcon v6 here.

How to work with more than one namespace with Phalcon Cli?

Hello,

I would like to work with the Phalcon Cli tasks using a variety of namespaces to facilitate the understanding and organization of tasks.

Is there any way to do this in Phalcon Cli?

For example:

  • directories
app
|_ tasks
    |_ db
       |_ DumpDbTask.php
       |_ ImportDbTask.php
    |_ file
       |_ GenerateFileTask.php
       |_ ErraseFilesTask.php
    DbTask.php
    FileTask.php
    MainTask.php
  • namespaces:
"App\\Task"       => APP_PATH . "/app/tasks",
"App\\Task\\Db"   => APP_PATH . "/app/tasks/db",
"App\\Task\\File" => APP_PATH . "/app/tasks/file",

Thanks Wojciech! Works properly!