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

Can't call run() method with params from migrate:latest #1308

Closed
HieuPT7 opened this issue Oct 11, 2018 · 1 comment
Closed

Can't call run() method with params from migrate:latest #1308

HieuPT7 opened this issue Oct 11, 2018 · 1 comment

Comments

@HieuPT7
Copy link
Contributor

HieuPT7 commented Oct 11, 2018


name: Bug report
about: Can't call run() method with params from migrate:latest

Describe the bug


<?php namespace App\Commands;

use CodeIgniter\CLI\CLI;
use CodeIgniter\CLI\BaseCommand;

class Module extends BaseCommand
{
    /**
     * A heading this command is grouped under
     * when listed via `php spark`
     */
    protected $group = 'Modules';

    /**
     * The Command's name
     *
     * @var string
     */
    protected $name = 'module';

    /**
     * The Command's short description
     *
     * @var string
     */
    protected $description = '';

    /**
     * The main entry point into the command.
     * All base logic should happen here.
     */
    public function run(array $params=[])
    {
        $name = array_shift($params);
        $this->call('migrate:latest', ['-n' => 'Modules\\'.$name.'']);
    }
}

I debug variable $namespace in \CodeIgniter\Commands\Database\MigrateLatest line 107 then it is null.
I think variable $params has not been used yet.

CodeIgniter 4 version
4.0.0 alpha.1

Affected module(s)
\CodeIgniter\Commands\Database\MigrateLatest

Context

  • OS: macOS High Sierra 10.13.6
  • Web server: apache
  • PHP version 7.1.12
@bangbangda
Copy link
Contributor

I fix 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