PluginProbe ʕ •ᴥ•ʔ
Independent Analytics – WordPress Analytics Plugin / 2.2.0
Independent Analytics – WordPress Analytics Plugin v2.2.0
2.15.5 2.15.4 2.15.3 2.15.2 2.15.1 2.15.0 2.14.10 trunk 1.1 1.10 1.10.1 1.11 1.12 1.13 1.14 1.15 1.16 1.17 1.17.1 1.17.2 1.17.3 1.17.4 1.18 1.18.1 1.19.0 1.19.1 1.2 1.20.0 1.21.0 1.22.0 1.22.1 1.23.0 1.23.1 1.24.0 1.24.1 1.25.0 1.25.1 1.26.0 1.27.0 1.28.0 1.28.1 1.28.2 1.28.3 1.29.0 1.3 1.30.0 1.30.1 1.4 1.5 1.6 1.7 1.8 1.9 2.0.0 2.0.1 2.1.4 2.1.5 2.1.6 2.10.0 2.10.1 2.10.2 2.10.3 2.10.4 2.11.0 2.11.1 2.11.10 2.11.2 2.11.3 2.11.4 2.11.5 2.11.6 2.11.7 2.11.8 2.11.9 2.12.0 2.12.1 2.12.2 2.13.1 2.13.2 2.13.5 2.13.6 2.14.0 2.14.1 2.14.2 2.14.4 2.14.6 2.14.7 2.14.8 2.14.9 2.2.0 2.2.1 2.3.1 2.3.2 2.4.2 2.4.3 2.5.0 2.5.1 2.6.0 2.6.1 2.6.2 2.6.3 2.6.4 2.7.0 2.7.1 2.7.2 2.7.3 2.8.2 2.8.3 2.8.4 2.8.5 2.8.6 2.8.7 2.8.8 2.8.9 2.9.2 2.9.3 2.9.4 2.9.5 2.9.6 2.9.7
independent-analytics / vendor / illuminate / database / Console / Migrations / MigrateMakeCommand.php
independent-analytics / vendor / illuminate / database / Console / Migrations Last commit date
BaseCommand.php 2 years ago FreshCommand.php 2 years ago InstallCommand.php 2 years ago MigrateCommand.php 2 years ago MigrateMakeCommand.php 2 years ago RefreshCommand.php 2 years ago ResetCommand.php 2 years ago RollbackCommand.php 2 years ago StatusCommand.php 2 years ago TableGuesser.php 2 years ago
MigrateMakeCommand.php
114 lines
1 <?php
2
3 namespace IAWP_SCOPED\Illuminate\Database\Console\Migrations;
4
5 use IAWP_SCOPED\Illuminate\Database\Migrations\MigrationCreator;
6 use IAWP_SCOPED\Illuminate\Support\Composer;
7 use IAWP_SCOPED\Illuminate\Support\Str;
8 /** @internal */
9 class MigrateMakeCommand extends BaseCommand
10 {
11 /**
12 * The console command signature.
13 *
14 * @var string
15 */
16 protected $signature = 'make:migration {name : The name of the migration}
17 {--create= : The table to be created}
18 {--table= : The table to migrate}
19 {--path= : The location where the migration file should be created}
20 {--realpath : Indicate any provided migration file paths are pre-resolved absolute paths}
21 {--fullpath : Output the full path of the migration}';
22 /**
23 * The console command description.
24 *
25 * @var string
26 */
27 protected $description = 'Create a new migration file';
28 /**
29 * The migration creator instance.
30 *
31 * @var \Illuminate\Database\Migrations\MigrationCreator
32 */
33 protected $creator;
34 /**
35 * The Composer instance.
36 *
37 * @var \Illuminate\Support\Composer
38 */
39 protected $composer;
40 /**
41 * Create a new migration install command instance.
42 *
43 * @param \Illuminate\Database\Migrations\MigrationCreator $creator
44 * @param \Illuminate\Support\Composer $composer
45 * @return void
46 */
47 public function __construct(MigrationCreator $creator, Composer $composer)
48 {
49 parent::__construct();
50 $this->creator = $creator;
51 $this->composer = $composer;
52 }
53 /**
54 * Execute the console command.
55 *
56 * @return void
57 */
58 public function handle()
59 {
60 // It's possible for the developer to specify the tables to modify in this
61 // schema operation. The developer may also specify if this table needs
62 // to be freshly created so we can create the appropriate migrations.
63 $name = Str::snake(\trim($this->input->getArgument('name')));
64 $table = $this->input->getOption('table');
65 $create = $this->input->getOption('create') ?: \false;
66 // If no table was given as an option but a create option is given then we
67 // will use the "create" option as the table name. This allows the devs
68 // to pass a table name into this option as a short-cut for creating.
69 if (!$table && \is_string($create)) {
70 $table = $create;
71 $create = \true;
72 }
73 // Next, we will attempt to guess the table name if this the migration has
74 // "create" in the name. This will allow us to provide a convenient way
75 // of creating migrations that create new tables for the application.
76 if (!$table) {
77 [$table, $create] = TableGuesser::guess($name);
78 }
79 // Now we are ready to write the migration out to disk. Once we've written
80 // the migration out, we will dump-autoload for the entire framework to
81 // make sure that the migrations are registered by the class loaders.
82 $this->writeMigration($name, $table, $create);
83 $this->composer->dumpAutoloads();
84 }
85 /**
86 * Write the migration file to disk.
87 *
88 * @param string $name
89 * @param string $table
90 * @param bool $create
91 * @return string
92 */
93 protected function writeMigration($name, $table, $create)
94 {
95 $file = $this->creator->create($name, $this->getMigrationPath(), $table, $create);
96 if (!$this->option('fullpath')) {
97 $file = \pathinfo($file, \PATHINFO_FILENAME);
98 }
99 $this->line("<info>Created Migration:</info> {$file}");
100 }
101 /**
102 * Get migration path (either specified by '--path' option or default location).
103 *
104 * @return string
105 */
106 protected function getMigrationPath()
107 {
108 if (!\is_null($targetPath = $this->input->getOption('path'))) {
109 return !$this->usingRealPath() ? $this->laravel->basePath() . '/' . $targetPath : $targetPath;
110 }
111 return parent::getMigrationPath();
112 }
113 }
114