Run the Bus surface.

@param bool $lumos
@param bool $session

@return null
519923
public static function run($type = 'web', $session = true)
    {
        $lumos = $type == 'lumos' ? true : false;
        static::init($type);

        //Support Surface
        static::support();

        //Version Surface
        static::version();

        //Logging Surface
        static::logging();

        //Input Surface
        static::input();

        if ($type == 'test') {
            //Mock Surface
            static::mock();
        }

        //Config Surface
        static::config($type == 'test' ? true : false);

        //Environment Surface
        static::environment();

        //Maintenance Surface
        static::maintenance($lumos);

        //Time Surface
        static::time();

        //Initiate the Logging Surface
        static::initLogging();

        //Component Surface
        static::component();

        //Cubes Surface
        static::cubes();

        //Collections Surface
        static::collections();

        //Storage Surface
        static::storage($session);

        //Strings Surface
        static::string();

        //Access Surface
        static::access();

        //Validation Surface
        static::validation();

        //Call Faker Surface if enabled in Component surface
        if (Component::isOn('faker')) {
            static::faker();
        }

        //Cookie Surface
        static::cookie();

        //Router Surface
        static::router();

        //Caches Surface
        static::caches();

        //Security Surface
        static::security();

        //Auth Surface
        static::auth();

        //Call Database Surface if enabled in Component surface
        if (Component::isOn('database')) {
            static::database();
        }

        //HTTP Surface
        static::http();

        //Assets Surface
        static::assets();

        //HTML Surface
        static::html();

        //Hypertext Surface
        //Depracted
        static::Hypertext();

        //Translator Surface
        static::translator();

        //Model Surface
        static::model();

        //Relations Surface
        static::relations();

        //Media Surface
        static::media();

        //Views Surface
        static::view();

        //Controllers Surface
        static::controller();

        //Mail Surface
        static::mail();

        //Data Collection Surface
        static::dataCollection();

        //Files Surface
        static::file();

        //Intro Surface
        static::intro();

        //Plugins Surface
        static::plugins();

        //Lumos Surface
        static::lumos();

        //Atomium Surface
        static::atomium();

        //Proccess Surface
        static::proccess();

        //Setup Surface
        static::setup();

        //Events Surface
        static::event();

        //Tests Surface
        static::test();
    }
124776
public function run($silent=false)
	{
	    $request   = $this->getRequest();
	    
	    $this->trigger('beforeRoute');
	    $controller = $this->route($request);
	    $this->trigger('afterRoute');
	    
	    // regain request, because routing() could be rewrite request.
	    $request   = $this->getRequest(); 
	    static::trigger('beforeControll');
	    $response = $controller->handle($request, $this->getResponse());
	    $this->trigger('afterControll');
	    
	    $response = $this->finalize($response);
	    
	    // send response
	    if (!$silent) {
	        $this->trigger('beforeSend');
	        $this->send($response);
	        $this->trigger('afterSend');
	    }
	    
	    return $response;
	}
370590
public function start()
    {
        // Initialize new session if a session is not already started
        if ($this->isStarted() === false) {
            $this->initialize();
        }

        // Set data source from which session data is loaded, to which session data is saved
        if (isset($this->dataSource) === false) {
            $this->dataSource = &$_SESSION;
        }

        // Load existing session data if available
        if (isset($this->dataSource['slim.session']) === true) {
            $this->replace($this->dataSource['slim.session']);
        }
    }
695448
public function run($params = null)
    {
        $this->parser = new Parser($this->paths);

        try {
            $argc = ($params === null) ? null : count($params);
            $this->result = $this->parser->parse($argc, $params);
        } catch (\Exception $e) {
            $this->parser->displayError($e->getMessage());
        }

        $this->parse();
    }
1121062
private function startSession()
    {
        if ('' === session_id()) {
            // no session active
            session_set_cookie_params(
                $this->sessionOptions['lifetime'],
                $this->sessionOptions['path'],
                $this->sessionOptions['domain'],
                $this->sessionOptions['secure'],
                $this->sessionOptions['httponly']
            );
            session_start();
        }
    }
100167
public function start($name = null, $id = null)
    {
        if (!session_id()) {
            if ($name) {
                session_name($name);
            }
            if ($id) {
                session_id($this->id);
            }
            session_start();
            return true;
        }
        return false;
    }
1335788
public function run() {
        // Start session
        $session = $this->get('session');
        $session->start();

        // Route the request
        $uri = '';
        if (strcmp($this->mode, self::APP_MODE_DEV) == 0) {
            $uri = $_SERVER['REQUEST_URI'];
        } else {
            $uri = $_GET['url'];
        }

        // $baseUri not empty and $uri starts with $baseUri
        if (!empty($this->baseUri) && substr($uri, 0, strlen($this->baseUri)) === $this->baseUri) {
            // Extract $uri without $baseUri
            $uri = substr($uri, strlen($this->baseUri));
        }

        $this->get('router')->route($uri);
    }
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();
    }
4525
public function run() {
		// initializing
		$this->max_processes = Config::$max_processes;

		// unlocking all transactions in case the process did not stop properly
		Transaction::unlock_all();

		// initializing the processes array to free slots
		for ($i = 0; $i <= $this->max_processes; $i++) {
			$this->processes[$i] = -1;
		}

		// run forever
		while (true) {

			// counters for parallels and non-parallel transactions
			$not_parallel_free = 0;
			$parallels_free = 0;

			// cleaning processes array before to begin
			$this->clean_slots($not_parallel_free, $parallels_free);
			while ($not_parallel_free + $parallels_free == 0) {				// if all slots are used then sleep
				usleep(100000);												// for 1/10 second and see if one or
				$this->clean_slots($not_parallel_free, $parallels_free);	// more slot got freed
			}

			try {
				$transactions = Transaction::get_runnable();
			} catch (\ErrorException $e) {
				// FIXME: this doesn't work as expected, impossible to catch database server off and retry in a second
				printf("%s\n", $e->getMessage());
				sleep(1);
				continue;
			}
			if (count($transactions) == 0) {	// if there is no transaction to
				sleep(1);						// process then sleep for a second
				continue;						// and start over
			}

			// testing every slot and if empty looking for a transaction to start
			for ($i = 0; $i < $this->max_processes; $i++) {
				if ($this->is_slot_free($i)) {
					if ($i == 0) {
						$transaction = $this->get_first_transaction($transactions, false);
					} else {
						$transaction = $this->get_first_transaction($transactions, true);
					}
					if ($transaction != null) {
//printf("Slot %d -> %s (%d)\n", $i, $transaction->classname, $transaction->id);
						$sleep = 0; // as the queue of transactions is not empty, we won't sleep
						\Skeleton\Database\Database::reset();
						$pid = pcntl_fork();
						if ($pid == -1) {
							die('Could not fork');
						} else if ($pid) {
							// PARENT
							$this->lock_slot($i, $pid);
						} else {
							// CHILD
							cli_set_process_title(strtolower($transaction->classname) . ' (' . $transaction->id . ')');
							$runner = new Runner();
							$runner->run_transaction($transaction);
							$transaction->unlock();
							exit;
						}
					}
				}
			}
		}
	}
1334707
public function run()
    {
        session_start();
        self::$_app = $this;
        if (empty($this->_runtimePath)) {
            $this->_runtimePath = $this->_basePath . '/runtime';
        }
        $application = $this->getComponent('application');
        $application->runController();
    }
821629
public function run()
    {
        $this->make('Sun\Bootstrap\Provider')->registerRoute();

        $this->route->register();

        $httpMethod = $this->make('Sun\Contracts\Http\Request')->method();

        $uri = $this->make('Sun\Contracts\Routing\UrlGenerator')->getUri();

        $data = $this->route->dispatch($httpMethod, $uri);

        $this->make('Sun\Bootstrap\Provider')->dispatch();

        $this->make('Sun\Contracts\Http\Response')->html($data);
    }
1079686
public static function console($root = '', $session = true)
    {
        self::setCaseVars(true, false);
        //
        self::consoleServerVars();
        //
        self::setScreen();
        self::setRoot($root);
        // call the connector and run it
        self::consoleBus();
        Bus::run('lumos');

        self::setVersion();
        //
        self::ini(false);
        //
        self::fetcher(false);
        //
        return true;
    }
1313177
public function run()
	{
		$context = $this->getContext();
		$serviceManager = \Aimeos\MShop::create( $context, 'service' );

		$search = $serviceManager->createSearch();
		$start = 0;

		do
		{
			$serviceItems = $serviceManager->searchItems( $search );

			foreach( $serviceItems as $serviceItem )
			{
				try
				{
					$serviceManager->getProvider( $serviceItem, $serviceItem->getType() )->updateAsync();
				}
				catch( \Exception $e )
				{
					$msg = 'Executing updateAsyc() of "%1$s" failed: %2$s';
					$context->getLogger()->log( sprintf( $msg, $serviceItem->getProvider(), $e->getMessage() ) );
				}
			}

			$count = count( $serviceItems );
			$start += $count;
			$search->setSlice( $start );
		}
		while( $count >= $search->getSliceSize() );
	}
641554
public function start() {

		if(!$this->started) {

			// only non-CLI environments are supposed to provide sessions

			if(PHP_SAPI !== 'cli') {
				
				// avoid starting an already started session

				if (
					(PHP_VERSION_ID >= 50400 && session_status() === PHP_SESSION_ACTIVE) ||
					(PHP_VERSION_ID < 50400 && session_id())
				) {
					throw new \RuntimeException('Failed to start the session: Session already started.');
				}

				// allow session only when no headers have been sent

				if (headers_sent($file, $line)) {
					throw new \RuntimeException(sprintf("Cannot start session. Headers have already been sent by file '%s' at line %d.", $file, $line));
				}

				if(!session_start()) {
					throw new \RuntimeException('Session start failed.');
				}
			}

			$this->loadSession();

		}
	}
1304306
public function execute($name, $data, Session $session)
    {
        switch ($name) {
            case 'query:post':
                $this->data['time'] += $data['time_ms'];
                $data += array_pop($this->data['queries']);
            case 'query:pre':
                $this->data['queries'][] = $data;
                break;
        }

        $this->watch($name);
    }
887884
public function run()
    {
        
        $userService = tao_models_classes_UserService::singleton();
        $this->outVerbose("Connecting to TAO as '" . $this->options['user'] . "' ...");
        if ($userService->loginUser($this->options['user'], $this->options['password'])){
        	$this->outVerbose("Connected to TAO as '" . $this->options['user'] . "'.");
        	
        	$filename = $this->options['input'];
        	$action = new ImportRdf();
        	$params = array($filename);
        	
        	if (!empty($this->options['model'])){
        	    $nameSpace = common_ext_NamespaceManager::singleton()->getNamespace($this->options['model']);
        	    $params[] = $nameSpace->getModelId();
        	}
        	 
        	$report = $action->__invoke($params);
        	
            $string = helpers_Report::renderToCommandline($report);
        	foreach (explode(PHP_EOL, $string) as $line) {
        	    $this->out($line);
        	}
        }
        else{
        	$this->err("Unable to connect to TAO as '" . $this->options['user'] . "'.", true);
        }
        
    }
780694
public function run() {
		session_name( '_s' );
		session_cache_limiter( false );
		ini_set( 'session.cookie_httponly', true );
		session_start();
		register_shutdown_function( 'session_write_close' );
		$this->slim->run();
	}