/**
  * 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;
 }
示例#2
0
 /**
  * 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();
 }
示例#3
0
 /**
  * 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();
 }
示例#4
0
 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');
 }
示例#5
0
 /**
  * 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;
 }
示例#8
0
 /**
  * Create a new command instance.
  *
  * @return void
  */
 public function __construct(Filesystem $files)
 {
     parent::__construct();
     $this->files = $files;
 }
示例#9
0
 /**
  * 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;
 }
示例#10
0
 /**
  * Create a new migration sluggable instance.
  *
  * @param SluggableMigrationCreator $creator
  */
 public function __construct(SluggableMigrationCreator $creator)
 {
     parent::__construct();
     $this->creator = $creator;
 }
示例#11
0
 /**
  * Create a new command instance.
  *
  * @return void
  */
 public function __construct()
 {
     parent::__construct();
     $app = app();
     $app['view']->addNamespace('units', substr(__DIR__, 0, -8) . 'views');
 }
示例#12
0
 /** @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;
 }