Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[NFR] Custom commands feature #1518

Open
BeMySlaveDarlin opened this issue Aug 5, 2021 · 0 comments
Open

[NFR] Custom commands feature #1518

BeMySlaveDarlin opened this issue Aug 5, 2021 · 0 comments

Comments

@BeMySlaveDarlin
Copy link
Contributor

BeMySlaveDarlin commented Aug 5, 2021

Feature

Right now we have possibility to use custom scripts via \Phalcon\DevTools\Script::loadUserScripts(), but the way it done is outdated and legacy, requires usage of temp folder .phalcon

        if (!file_exists('.phalcon/project.ini')) {
            return;
        }

        $config = parse_ini_file('.phalcon/project.ini');

        if (!isset($config['scripts'])) {
            return;
        }

        foreach (explode(',', $config['scripts']) as $directory) {
            ...
        }

New point is to implement better and flexible behavior: for example
config.php

return [
    'database' => [
        ...
    ],
    'application' => [
        ...
    ],
    'commands' => [
        'my-custom-command' => MyCustomCommand::class,
    ],
];

Where MyCustomCommand implements \Phalcon\DevTools\Commands\CommandsInterface
And usage
user@server:/var/www/app$ phalcon my-custom-command --custom-option=1

This will require first to finish #1455

Why we need it?

Nowadays all of popular frameworks have extendable cli tools, which allows to make CI/CD much cleaner and easier.
It would be nice to have same scope in devtools

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

1 participant