/** * Create a new migration install command instance. * * @param \Illuminate\Database\Migrations\MigrationCreator $creator * @param \Illuminate\Foundation\Composer $composer * @param string $packagePath * @return void */ public function __construct(MigrationCreator $creator, Composer $composer, $packagePath) { parent::__construct(); $this->creator = $creator; $this->composer = $composer; $this->packagePath = $packagePath; }
/** * Get migration path (either specified by '--path' option or default location). * * @return string */ protected function getMigrationPath() { if (!is_null($targetPath = $this->input->getOption('path'))) { return $this->laravel->basePath() . '/' . $targetPath; } return parent::getMigrationPath(); }
/** * Create a new tenant migrations command instance. * * @param \Stillat\Database\Tenant\Migrations\TenantMigrator $migrator * @param string $packagePath * @return \Stillat\Database\Tenant\Migrations\MigrateCommand */ public function __construct(TenantMigrator $migrator, $packagePath) { parent::__construct(); $this->migrator = $migrator; $this->packagePath = $packagePath; // There is nothing special about the TenantMigrationResolver class, so let's just new up one. $this->tenantMigrationResolver = new TenantMigrationResolver(); }
protected function getFilePath($name, $forSqlFile = false, $forRollbackSqlFile = false) { $basePath = preg_replace('%[/\\\\]%', DIRECTORY_SEPARATOR, parent::getMigrationPath()) . DIRECTORY_SEPARATOR; if ($forSqlFile) { $basePath .= $this->sqlSubdir . DIRECTORY_SEPARATOR; if ($forRollbackSqlFile) { $basePath .= $this->sqlRollbackSubdir . DIRECTORY_SEPARATOR; } } if (!Folder::exist($basePath)) { Folder::add($basePath, 0775); } return $basePath . date('Y_m_d_His') . '_' . $name . ($forSqlFile ? '.sql' : '.php'); }
/** * Create a new migration rollback command instance. * * @param \Illuminate\Database\Migrations\Migrator $migrator * @return \Illuminate\Database\Console\Migrations\StatusCommand */ public function __construct(Migrator $migrator) { parent::__construct(); $this->migrator = $migrator; }
/** * Create a new migration install command instance. * * @param \Illuminate\Database\Migrations\MigrationCreator $creator * @param \Illuminate\Foundation\Composer $composer * @return void */ public function __construct(MigrationCreator $creator, Composer $composer) { parent::__construct(); $this->creator = $creator; $this->composer = $composer; }
/** * Create a new migrator instance. * * @param \Illuminate\Filesystem\Filesystem $files * @param \Illuminate\Database\Migrations\Migrator $migrator */ public function __construct(Filesystem $files, Migrator $migrator) { parent::__construct(); $this->migrator = $migrator; $this->files = $files; }
/** * Create a new command instance. * * @return void */ public function __construct(Filesystem $files) { parent::__construct(); $this->files = $files; }
/** * Create a new migration command instance. * * @param \Illuminate\Database\Migrations\Migrator $migrator * @param string $packagePath * @return void */ public function __construct(Migrator $migrator, $packagePath) { parent::__construct(); $this->migrator = $migrator; $this->packagePath = $packagePath; }
/** * Create a new migration sluggable instance. * * @param SluggableMigrationCreator $creator */ public function __construct(SluggableMigrationCreator $creator) { parent::__construct(); $this->creator = $creator; }
/** * Create a new command instance. * * @return void */ public function __construct() { parent::__construct(); $app = app(); $app['view']->addNamespace('units', substr(__DIR__, 0, -8) . 'views'); }
/** @inheritdoc */ protected function initialize(InputInterface $input, OutputInterface $output) { parent::initialize($input, $output); $this->intro(); if (empty($_path = $this->option('output-path'))) { $_path = 'database'; } try { $_path = Disk::path([base_path(), $_path], true); } catch (\Exception $_ex) { $this->error('Unable to write to output path "' . $_path . '"'); return false; } $this->destination = $_path; if ('default' == ($this->database = $this->argument('database'))) { $this->database = config('database.default'); } return true; }