PluginProbe ʕ •ᴥ•ʔ
Matomo Analytics – Powerful, Privacy-First Insights for WordPress / trunk
Matomo Analytics – Powerful, Privacy-First Insights for WordPress vtrunk
5.11.1 5.11.0 5.10.2 5.10.1 trunk 1.0.2 1.0.3 1.0.4 1.0.5 1.0.6 1.1.0 1.1.1 1.1.2 1.1.3 1.2.0 1.3.0 1.3.1 1.3.2 4.0.0 4.0.1 4.0.2 4.0.3 4.0.4 4.1.0 4.1.1 4.1.2 4.1.3 4.10.0 4.11.0 4.12.0 4.13.0 4.13.2 4.13.3 4.13.4 4.13.5 4.14.0 4.14.1 4.14.2 4.15.0 4.15.1 4.15.2 4.15.3 4.2.0 4.3.0 4.3.1 4.4.1 4.4.2 4.5.0 4.6.0 5.0.1 5.0.2 5.0.3 5.0.4 5.0.5 5.0.6 5.0.7 5.0.8 5.1.0 5.1.1 5.1.2 5.1.3 5.1.4 5.1.5 5.1.6 5.1.7 5.10.0 5.2.0 5.2.1 5.2.2 5.3.0 5.3.1 5.3.2 5.3.3 5.6.0 5.6.1 5.7.0 5.7.1 5.8.0 5.8.1 5.8.2
matomo / app / vendor / prefixed / symfony / console / SingleCommandApplication.php
matomo / app / vendor / prefixed / symfony / console Last commit date
Attribute 1 year ago CI 1 year ago Command 1 year ago CommandLoader 2 years ago Completion 1 year ago DependencyInjection 1 year ago Descriptor 1 year ago Event 1 year ago EventListener 2 years ago Exception 2 years ago Formatter 1 year ago Helper 1 year ago Input 1 year ago Logger 1 year ago Output 1 year ago Question 1 year ago Resources 1 year ago SignalRegistry 1 year ago Style 1 year ago Tester 1 year ago Application.php 1 year ago Color.php 1 year ago ConsoleEvents.php 2 years ago Cursor.php 2 years ago LICENSE 2 years ago README.md 2 years ago SingleCommandApplication.php 1 year ago Terminal.php 1 year ago
SingleCommandApplication.php
63 lines
1 <?php
2
3 /*
4 * This file is part of the Symfony package.
5 *
6 * (c) Fabien Potencier <fabien@symfony.com>
7 *
8 * For the full copyright and license information, please view the LICENSE
9 * file that was distributed with this source code.
10 */
11 namespace Matomo\Dependencies\Symfony\Component\Console;
12
13 use Matomo\Dependencies\Symfony\Component\Console\Command\Command;
14 use Matomo\Dependencies\Symfony\Component\Console\Input\InputInterface;
15 use Matomo\Dependencies\Symfony\Component\Console\Output\OutputInterface;
16 /**
17 * @author Grégoire Pineau <lyrixx@lyrixx.info>
18 */
19 class SingleCommandApplication extends Command
20 {
21 private $version = 'UNKNOWN';
22 private $autoExit = \true;
23 private $running = \false;
24 /**
25 * @return $this
26 */
27 public function setVersion(string $version) : self
28 {
29 $this->version = $version;
30 return $this;
31 }
32 /**
33 * @final
34 *
35 * @return $this
36 */
37 public function setAutoExit(bool $autoExit) : self
38 {
39 $this->autoExit = $autoExit;
40 return $this;
41 }
42 public function run(?InputInterface $input = null, ?OutputInterface $output = null) : int
43 {
44 if ($this->running) {
45 return parent::run($input, $output);
46 }
47 // We use the command name as the application name
48 $application = new Application($this->getName() ?: 'UNKNOWN', $this->version);
49 $application->setAutoExit($this->autoExit);
50 // Fix the usage of the command displayed with "--help"
51 $this->setName($_SERVER['argv'][0]);
52 $application->add($this);
53 $application->setDefaultCommand($this->getName(), \true);
54 $this->running = \true;
55 try {
56 $ret = $application->run($input, $output);
57 } finally {
58 $this->running = \false;
59 }
60 return $ret ?? 1;
61 }
62 }
63