Cake\Upgrade\Shell\UpgradeShell::all PHP Method

all() public method

All command.
public all ( ) : void
return void
    public function all()
    {
        if (!empty($this->params['dry-run'])) {
            $this->out('<warning>Dry-run mode enabled!</warning>', 1, Shell::QUIET);
        }
        $exclude = ['.git', '.svn', 'vendor', 'Vendor', 'webroot', 'tmp', 'logs'];
        if (empty($this->params['plugin']) && !empty($this->params['namespace']) && $this->params['namespace'] === 'App') {
            $exclude[] = 'plugins';
            $exclude[] = 'Plugin';
        }
        $files = $this->Stage->files($exclude);
        $actions = $this->_getActions();
        foreach ($actions as $action) {
            $this->out(sprintf('<info>*** Upgrade step %s ***</info>', $action));
            if (!empty($this->params['interactive'])) {
                $continue = $this->in('Continue with `' . $action . '`?', ['y', 'n', 'q'], 'y');
                if ($continue === 'q') {
                    return $this->error('Aborted. Changes are not commited.');
                }
                if ($continue === 'n') {
                    $this->out('Skipping this step.');
                    continue;
                }
            }
            foreach ($files as $file) {
                $this->out(sprintf('<info> * Processing %s</info>', Debugger::trimPath($file)), 1, Shell::VERBOSE);
                $this->{$action}->Stage = $this->Stage;
                $this->{$action}->process($file);
                if (!empty($this->params['interactive'])) {
                    $this->Stage->commit();
                    $this->Stage->clear();
                }
            }
        }
        if (empty($this->params['interactive'])) {
            $this->Stage->commit();
        }
    }