Run controller system if application is not run in cli mode

@return void
355581
protected function run()
    {
        if (PHP_SAPI === 'cli') {
            return;
        }
        
        if ($this->ctrlRouterInfos->target === null) {
            return;
        }
        
        $this->module
            ->monolog
            ->getLogger()
            ->debug(
                'Execute current route.',
                ['target' => $this->ctrlRouterInfos->target]
            );
        
        $useClass = $this->config->getValue('useClass');
        
        if ($useClass === true) {
            $this->runObject();
        } else {
            $this->runProcedural();
        }
    }
575894
public function run()
    {
        if ($this->unRegister() && empty(static::$keys[$this->getKey()])) {
            call_user_func_array($this->callback, $this->arguments);
        }
    }
411875
public function start() {
        foreach ($this->modules as $module) {
            $module->start();
        }

        if (php_sapi_name() == "cli") {
            Commands::handleCommand();
        }
        else {
            Routes::handleRequest();
        }
    }
242029
function run()
    {
        $res = $this->resolve();

        $ctrl = isset($res['controller']) && $res['controller'] !== null ? $res['controller'] : $this->defaultController;
        $action = isset($res['action']) && $res['action'] !== null ? $res['action'] : $this->defaultAction;

        //Name format to Controller namespace
        $tmp = explode('\\', str_replace('/', '\\', $ctrl));
        $ctrl = '\\Controller';
        foreach($tmp as $tmp1){
            $ctrl .= '\\'.ucfirst($tmp1);
        }

        //instantiate the controller
        $controller = new $ctrl(['params' => $res['params'], 'request' => $this->request]);

        $this->params = $res['params'];

        if (method_exists($controller, $action))
            return $controller->$action();
        else
            return $controller->{static::$defaultAction}();
    }
844416
public static function run()
    {
        \Swoole\Runtime::enableCoroutine();
        self::$debug = new \swoole_atomic(0);
        self::$xdebug = false;
        self::$coverage = false;
        self::$leader = new \swoole_atomic(0);
        self::$xdebug_table = new \swoole_table(1);
        self::$xdebug_table->column('wid', \swoole_table::TYPE_INT, 8);
        self::$xdebug_table->column('cid', \swoole_table::TYPE_INT, 8);
        self::$xdebug_table->create();
        self::$startTime = date('Y-m-d H:i:s');
        self::$startMillisecond = getMillisecond();
        self::setProcessTitle(getServerName());
        $application = new Application();
        $input = new ArgvInput();
        $output = new ConsoleOutput();
        self::$io = new SymfonyStyle($input, $output);
        self::addDirCommand(SERVER_DIR, "Server", $application);
        self::addDirCommand(APP_DIR, "app", $application);
        $application->run($input, $output);
    }
1313156
public function run()
    {
        $default = [
            'module_name' => null,
            'action' => 'setting',
            'class' => 'form-control',
            'section' => 'main',
            'fieldset' => 'general',
            'name' => null,
            'type' => 'string',
            'value' => null,
            // '{"id":"id"}'
            'params' => null,
            'html_flags' => 'required',
        ];

        \DB::table('settings')->insert($this->getArticles($default));
        \DB::table('settings')->insert($this->getComments($default));
        \DB::table('settings')->insert($this->getFiles($default));
        \DB::table('settings')->insert($this->getSystem($default));
        \DB::table('settings')->insert($this->getTags($default));
        \DB::table('settings')->insert($this->getThemes($default));
        \DB::table('settings')->insert($this->getUsers($default));
    }
798461
public function run()
	{
		$context = $this->getContext();
		$config = $context->getConfig();
		$logger = $context->getLogger();

		/** controller/jobs/supplier/import/xml/location
		 * File or directory where the content is stored which should be imported
		 *
		 * You need to configure the XML file or directory with the XML files that
		 * should be imported. It should be an absolute path to be sure but can be
		 * relative path if you absolutely know from where the job will be executed
		 * from.
		 *
		 * @param string Absolute file or directory path
		 * @since 2019.04
		 * @category Developer
		 * @category User
		 * @see controller/jobs/supplier/import/xml/container/type
		 * @see controller/jobs/supplier/import/xml/container/content
		 * @see controller/jobs/supplier/import/xml/container/options
		 */
		$location = $config->get( 'controller/jobs/supplier/import/xml/location' );

		try
		{
			$msg = sprintf( 'Started supplier import from "%1$s" (%2$s)', $location, __CLASS__ );
			$logger->log( $msg, \Aimeos\MW\Logger\Base::INFO );

			if( !file_exists( $location ) )
			{
				$msg = sprintf( 'File or directory "%1$s" doesn\'t exist', $location );
				throw new \Aimeos\Controller\Jobs\Exception( $msg );
			}

			$files = [];

			if( is_dir( $location ) )
			{
				foreach( new \DirectoryIterator( $location ) as $entry )
				{
					if( strncmp( $entry->getFilename(), 'supplier', 8 ) === 0 && $entry->getExtension() === 'xml' ) {
						$files[] = $entry->getPathname();
					}
				}
			}
			else
			{
				$files[] = $location;
			}

			sort( $files );
			$total = 0;

			foreach( $files as $filepath ) {
				$total += $this->import( $filepath );
			}

			$msg = 'Finished supplier import from "%1$s": %2$s total (%3$s MB)';
			$mem = number_format( memory_get_peak_usage() / 1024 / 1024, 2 );

			$logger->log( sprintf( $msg, $location, $total, $mem ), \Aimeos\MW\Logger\Base::INFO );
		}
		catch( \Exception $e )
		{
			$logger->log( 'Supplier import error: ' . $e->getMessage() . "\n" . $e->getTraceAsString() );
			throw $e;
		}
	}
1197878
public function run() {
        if (!Config::config()['user']['debug']['maintenance']) {
            if ($this->_route == false) {
                $this->response->status(404);
                $this->addError('routing failed : http://' . $this->request->env('HTTP_HOST') . $this->request->env('REQUEST_URI'), __FILE__, __LINE__, ERROR_WARNING);
            }
            else {
                $this->_controller();
            }

            $this->response->run();
            $this->addErrorHr(LOG_ERROR);
            $this->addErrorHr(LOG_SYSTEM);
            $this->_setHistory('');

            if (Config::config()['user']['output']['minify'] && preg_match('#text/html#isU', $this->response->contentType())) {
                $this->response->page($this->_minifyHtml($this->response->page()));
            }

            if (Config::config()['user']['debug']['environment'] == 'development' && Config::config()['user']['debug']['profiler']) {
                $this->profiler->profiler($this->request, $this->response);
            }
        }
        else {
            $this->response->page($this->maintenance());
        }

        echo $this->response->page();
    }
710918
public function runAction()
    {
        try {
            $this->commandBus->dispatch(CreateDefaultProcessingConfigFile::in(ConfigLocation::fromPath(Definition::getSystemConfigDir())));

            $sqliteDbFile = SqliteDbFile::initializeFromDist(Definition::getEventStoreSqliteDbFile());

            $esConfigLocation = ConfigLocation::fromPath(Definition::getSystemConfigDir());

            $this->commandBus->dispatch(InitializeEventStore::setUpWithSqliteDbAdapter($sqliteDbFile, $esConfigLocation));

        } catch (\Exception $ex) {
            $this->commandBus->dispatch(UndoSystemSetUp::removeConfigs(
                Definition::getSystemConfigDir(),
                Definition::getSystemConfigDir(),
                Definition::getEventStoreSqliteDbFile()
            ));

            throw $ex;
        }

        return $this->redirect()->toRoute('prooph.link/system_config');
    }
1242267
public function run()
    {
        // Add registered command to console 
        foreach ($this->commands as $command) {
            $this->consoleApp->add($command);
        }

        $this->consoleApp->run();
    }
167300
private function runView(): void
    {
        $action = ($this->routeAction) ? $this->routeAction : 'index';

        \call_user_func([$this->view, $action]);
    }
702206
public function can_run() {
		// This handler can only run when we have an application defined
		if (class_exists('\\Skeleton\\Core\\Application') === false) {
			return false;
		}
		
		try {
			\Skeleton\Core\Application::get();
			return true;
		} catch (\Exception $e) {};

		return false;
	}
669226
public function run(): void
    {
        //attach Oserver to Subjetc
        $this->model->attach($this->view);

        //run action before controller
        $this->beforeAfterController('before');
        $this->beforeAfterControllerAction('before');

        //run controller
        $this->runController();

        //run action after controller
        $this->beforeAfterControllerAction('after');
        $this->beforeAfterController('after');

        //notify model changes to view
        $this->model->notify();

        //run view
        $this->runView();
    }
324961
public function actionRun()
    {
        Yii::$app->session->set(Installation::SESSION_KEY, 0);

        if ($this->module->userComponent !== true && empty($this->module->adminId)) {
            $this->warning(Yii::t('podium/flash', "{userComponent} is set to custom but no administrator ID has been set with {adminId} parameter. Administrator privileges will not be set.", [
                'userComponent' => '$userComponent',
                'adminId' => '$adminId'
            ]));
        }
        return $this->render('run', ['version' => $this->module->version]);
    }
1111247
public function run()
	{
		$clip=ob_get_clean();
		if($this->renderClip)
			echo $clip;
		$this->getController()->getClips()->add($this->getId(),$clip);
	}
684591
private function runRouteBinding(): void
    {
        // calculated depend of language
        $pathway = $this->getPathInfo();
        /** @var array $routing */
        $routing = App::$Properties->getAll('Routing');

        // try to work with static aliases
        if (Any::isArray($routing) && isset($routing['Alias'], $routing['Alias'][env_name])) {
            $pathway = $this->findStaticAliases($routing['Alias'][env_name], $pathway);
        }

        $this->setPathdata(explode('/', trim($pathway, '/')));

        // set default controller and action for undefined data
        if (!$this->action) {
            $this->action = 'Index';
        }

        // empty or contains backslashes? set to main
        if (!$this->controller || Str::contains('\\', $this->controller)) {
            $this->controller = 'Main';
        }

        // find callback injection in routing configs (calculated in App::run())
        if (Any::isArray($routing) && isset($routing['Callback'], $routing['Callback'][env_name])) {
            $this->findDynamicCallbacks($routing['Callback'][env_name], $this->controller);
        }
    }
775791
public function runApplication()
    {
        $routeCollection = $this->createRouteCollection();
        $dispatcher = $routeCollection->getDispatcher();

        $request = $this->createRequest();
        $response = $dispatcher->dispatch($request->getMethod(), $request->getPathInfo());
        $response->send();
    }