PHP 8.3.30
Preview: SingleCommandApplication.php Size: 1.75 KB
/home/getspomw/.trash/vendor/symfony/console/SingleCommandApplication.php

<?php

/*
 * This file is part of the Symfony package.
 *
 * (c) Fabien Potencier <fabien@symfony.com>
 *
 * For the full copyright and license information, please view the LICENSE
 * file that was distributed with this source code.
 */

namespace Symfony\Component\Console;

use Symfony\Component\Console\Command\Command;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;

/**
 * @author Grégoire Pineau <lyrixx@lyrixx.info>
 */
class SingleCommandApplication extends Command
{
    private string $version = 'UNKNOWN';
    private bool $autoExit = true;
    private bool $running = false;

    /**
     * @return $this
     */
    public function setVersion(string $version): static
    {
        $this->version = $version;

        return $this;
    }

    /**
     * @final
     *
     * @return $this
     */
    public function setAutoExit(bool $autoExit): static
    {
        $this->autoExit = $autoExit;

        return $this;
    }

    public function run(?InputInterface $input = null, ?OutputInterface $output = null): int
    {
        if ($this->running) {
            return parent::run($input, $output);
        }

        // We use the command name as the application name
        $application = new Application($this->getName() ?: 'UNKNOWN', $this->version);
        $application->setAutoExit($this->autoExit);
        // Fix the usage of the command displayed with "--help"
        $this->setName($_SERVER['argv'][0]);
        $application->add($this);
        $application->setDefaultCommand($this->getName(), true);

        $this->running = true;
        try {
            $ret = $application->run($input, $output);
        } finally {
            $this->running = false;
        }

        return $ret;
    }
}

Directory Contents

Dirs: 23 × Files: 11

Name Size Perms Modified Actions
Attribute DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
CI DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Command DIR
- drwxrwxrwx 2026-04-19 09:04:17
Edit Download
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
- drwxrwxrwx 2026-04-19 09:06:43
Edit Download
Debug DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
- drwxrwxrwx 2026-04-19 08:26:43
Edit Download
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Event DIR
- drwxrwxrwx 2026-04-19 09:04:29
Edit Download
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Exception DIR
- drwxrwxrwx 2026-04-19 11:48:37
Edit Download
Formatter DIR
- drwxrwxrwx 2026-04-19 09:05:18
Edit Download
Helper DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Input DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Logger DIR
- drwxrwxrwx 2026-04-19 12:16:38
Edit Download
Messenger DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Output DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Question DIR
- drwxrwxrwx 2026-04-19 08:26:49
Edit Download
Resources DIR
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
- drwxrwxrwx 2025-09-17 06:53:23
Edit Download
Style DIR
- drwxrwxrwx 2026-04-19 09:06:01
Edit Download
Tester DIR
- drwxrwxrwx 2026-04-19 10:21:59
Edit Download
46.71 KB lrw-rw-rw- 2025-09-17 06:53:23
Edit Download
11.37 KB lrw-rw-rw- 2025-09-17 06:53:23
Edit Download
3.70 KB lrw-rw-rw- 2025-09-17 06:53:23
Edit Download
1.63 KB lrw-rw-rw- 2025-09-17 06:53:23
Edit Download
2.12 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
3.88 KB lrw-rw-rw- 2025-09-17 06:53:22
Edit Download
982 B lrw-r--r-- 2026-04-19 10:09:15
Edit Download
1.04 KB lrw-rw-rw- 2025-09-17 06:53:23
Edit Download
782 B lrw-rw-rw- 2025-09-17 06:53:23
Edit Download
1.75 KB lrw-rw-rw- 2025-09-17 06:53:23
Edit Download
6.61 KB lrw-rw-rw- 2025-09-17 06:53:23
Edit Download

If ZipArchive is unavailable, a .tar will be created (no compression).