Skip to content

CLI with parameters is not working #422

Description

@baselbj

Hi,

While trying to test migrations using CLI and adding parameters it will not work.

example:
run: php ci.php migrate:version 007
will get: Command 'migrate:version 007' not found

the problem is in CLI/console line 68 ($this->app->setPath("ci{$path}");) the setpath will implode all command segments.

Also line 69 (return $this->app->run();) should send command parameters this means that no parameters are passed to CLI command.

I can suggest a fix as the following:

  1. getURI should return only first command segment.
  2. CLI/CLI.php should return have function which returns command parameters
  3. return $this->app->run(); should be something like return $this->app->run(CLI::getPrams());

If this solution is ok I can make a pull request :)

Activity

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

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions