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

CLI with parameters is not working #422

Closed
baselbj opened this issue Mar 1, 2017 · 4 comments
Closed

CLI with parameters is not working #422

baselbj opened this issue Mar 1, 2017 · 4 comments

Comments

@baselbj
Copy link
Contributor

baselbj commented Mar 1, 2017

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 :)

@baselbj
Copy link
Contributor Author

baselbj commented Mar 2, 2017

I found the issue it was eraser than I expect. in CLI file line 675 function getURI():
change return implode(' ', static::$segments); to return implode('/', static::$segments);

@lonnieezell
Copy link
Member

Good find! That was a leftover from when I recently refactored how the whole bootstrap process worked.

@baselbj
Copy link
Contributor Author

baselbj commented Mar 7, 2017

Thank you ... I can help in many issues like this

@lonnieezell
Copy link
Member

I look forward to it!

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

No branches or pull requests

2 participants