取消config option 和path配置参数 目录位置固定

This commit is contained in:
thinkphp 2017-10-23 14:22:42 +08:00
parent 9666d85b1b
commit debc818a4e
3 changed files with 4 additions and 21 deletions

View File

@ -17,6 +17,8 @@ use think\facade\Config;
abstract class Command extends \think\console\Command
{
protected $config = 'database';
public function getAdapter()
{
if (isset($this->adapter)) {

View File

@ -17,7 +17,6 @@ use Phinx\Migration\AbstractMigration;
use Phinx\Migration\MigrationInterface;
use Phinx\Util\Util;
use think\console\Input;
use think\console\input\Option as InputOption;
use think\console\Output;
use think\facade\Env;
use think\migration\Command;
@ -30,27 +29,9 @@ abstract class Migrate extends Command
*/
protected $migrations;
public function __construct($name = null)
{
parent::__construct($name);
$this->addOption('--config', null, InputOption::VALUE_REQUIRED, 'The database config name', 'database');
}
/**
* 初始化
* @param Input $input An InputInterface instance
* @param Output $output An OutputInterface instance
*/
protected function initialize(Input $input, Output $output)
{
$this->config = $input->getOption('config');
}
protected function getPath()
{
return $this->getConfig('path', Env::get('root_path') . 'database') . DIRECTORY_SEPARATOR . 'migrations' . ('database' !== $this->config ? DIRECTORY_SEPARATOR . $this->config : '');
return Env::get('root_path') . 'database' . DIRECTORY_SEPARATOR . 'migrations';
}
protected function executeMigration(MigrationInterface $migration, $direction = MigrationInterface::UP)

View File

@ -27,7 +27,7 @@ abstract class Seed extends Command
protected function getPath()
{
return $this->getConfig('path', Env::get('root_path') . 'database') . DIRECTORY_SEPARATOR . 'seeds';
return Env::get('root_path') . 'database' . DIRECTORY_SEPARATOR . 'seeds';
}
public function getSeeds()