Runs the application and returns the stream instance.

@return \Zapheus\Http\Message\StreamInterface
196321
public function run()
    {
        $request = $this->container->get(self::REQUEST);

        $response = $this->handle($request);

        return $this->emit($response)->stream();
    }
756222
public function getStream()
    {
        if ($this->stream instanceof \Closure) {
            $this->stream = $this->stream->__invoke();
        }
        if (is_resource($this->stream)) {
            $meta = stream_get_meta_data($this->stream);
            if ($meta['seekable']) {
                rewind($this->stream);
            }
        }
        return $this->stream;
    }
823803
public function run() {
        // Setup connection
        $resource = curl_init();

        // Set cURL options
        foreach ($this->settings as $option => $setting) {
            curl_setopt($resource, $option, $setting);
        }

        // Process headers
        $headers = [];
        foreach ($this->headers as $key => $value) {
            if (!empty($value)) {
                $headers[] = implode(' : ', [$key, $value]);
            }
            else {
                $this->headers[] = $key;
            }
        }

        // Add the headers
        curl_setopt($resource, CURLOPT_HTTPHEADER, $headers);

        // Execute cURL
        $response = curl_exec($resource);

        // Get the size of the header
        $header_size = curl_getinfo($resource, CURLINFO_HEADER_SIZE);

        // Get the header from the result
        $headers = substr($response, 0, $header_size);

        // Get the body from the result
        $body = substr($response, $header_size);

        // Get the HTTP response code from the result
        $responseCode = curl_getinfo($resource, CURLINFO_HTTP_CODE);

        // Close the connection
        curl_close($resource);

        // Create Result instance
        $this->result = new Result($body, $responseCode, $headers);

        return $this->result;
    }
709399
private function getStream()
    {
        if ($this->stream && get_resource_type($this->stream) === 'Unknown') {
            fclose($this->stream);
            $this->stream = null;
        }
        if (!$this->stream) {
            $this->stream = @fopen($this->streamUrl, 'a');
            if (!$this->stream) {
                LoggerPolicy::processIOError("Error open $this->streamUrl");
                $this->stream = null;
            }
        }

        return $this->stream;
    }
614765
public static function make()
    {
        $stream = new Stream();
        $source = static::getSource();
        $stream->copy($source);

        if (! static::$source) {
            fclose($source);
        }

        return $stream;
    }
1146246
public function run()
    {
        $output = Colors::RED.Colors::BG_BLACK."
  _______                  ____  __   ______
 /__  __/_____ ___  ____  / __ \/ /  / / __ \
   / /  / ___/ __ \/ __ \/ /_/ / /__/ / /_/ /
 _/ /__/ /  / /_/ / / / / .___/ ___  / .___/
/_____/_/   \____/_/ /_/_/   /_/  /_/_/
".
        $this->getWelInfo().
        Colors::BG_BLACK.Colors::WHITE;
        return $output;
    }
175821
public function run() {
		$start_time = microtime( true );

		$proc = Utils\proc_open_compat( $this->command, self::$descriptors, $pipes, $this->cwd, $this->env );

		$stdout = stream_get_contents( $pipes[1] );
		fclose( $pipes[1] );

		$stderr = stream_get_contents( $pipes[2] );
		fclose( $pipes[2] );

		$return_code = proc_close( $proc );

		$run_time = microtime( true ) - $start_time;

		if ( self::$log_run_times ) {
			if ( ! isset( self::$run_times[ $this->command ] ) ) {
				self::$run_times[ $this->command ] = array( 0, 0 );
			}
			self::$run_times[ $this->command ][0] += $run_time;
			self::$run_times[ $this->command ][1]++;
		}

		return new ProcessRun(
			array(
				'stdout'      => $stdout,
				'stderr'      => $stderr,
				'return_code' => $return_code,
				'command'     => $this->command,
				'cwd'         => $this->cwd,
				'env'         => $this->env,
				'run_time'    => $run_time,
			)
		);
	}
895850
public function run()
	{
		// Trigger event!
		$this->dispatch($this->listeners[self::LISTENER_STARTUP], [$this]);

		// Create initial request & response (PSR7!)
		$request = $this->createInitialRequest();
		$response = $this->createInitialResponse();

		try {
			// Trigger event!
			$this->dispatch($this->listeners[self::LISTENER_REQUEST], [$this, $request, $response]);

			// Right to the cycle
			$response = call_user_func(
				$this->chain,
				$request,
				$response,
				function (ServerRequestInterface $request, ResponseInterface $response): ResponseInterface {
					return $response;
				}
			);

			// Response validation check
			if (!isset($response) || $response === null) {
				throw new RuntimeException('Final response cannot be NULL or unset');
			}
		} catch (Throwable $e) {
			// Trigger event! In case of manual handling error, returned object is passed.
			$res = $this->dispatch($this->listeners[self::LISTENER_ERROR], [$this, $e, $request, $response]);
			if ($res !== null && $res !== false) {
				return $res;
			}

			// Throw exception again if it's not caught
			if ($this->catchExceptions !== true) {
				throw $e;
			}
		}

		// Trigger event! In case of manual finalizing, returned object is passed.
		$res = $this->dispatch($this->listeners[self::LISTENER_RESPONSE], [$this, $request, $response]);
		if ($res !== null && $res !== false) {
			return $res;
		}

		// Send to finalizer (simple send response)
		return $this->finalize($request, $response);
	}
219004
public function run() {
        $this->executor->setActual($this->actual);
        $this->executor->setPeticion($this->peticion);
        $this->executor->setCallback($this->configure->getConfig());
        $this->executor->exist();
        $this->executor->compare();
        $this->executor->execute();

	return $this;
    }
547293
public static function run()
    {
        if (! isset(self::$instance)) {
            self::$instance = new self();

            self::$instance->setup();
            self::$instance->execute();
            self::$instance->hooks();
            self::$instance->ajax();
        }

        return self::$instance;
    }
907855
public function run()
    {
        try {
            $response = $this->buildResponse();
        } catch (Error\Base $ex) {
            $response = $this->handleError($ex);
        }

        $this->serializer->serialize($response, $this);

        return $this;
    }
923646
public function run()
    {
        $pluginOptions = ArrayHelper::merge(
            $this->defaultOptions,
            $this->pluginOptions,
            ['videoURL' => $this->videoURL]
        );

        return $this->render('index', ['pluginOptions' => json_encode($pluginOptions)]);
    }
423721
public function run()
    {
        /*
         * Fetching Public Suffix List and parse suffixes.
         * */

        $lines = $this->httpAdapter->get(Update::PUBLIC_SUFFIX_LIST_URL);

        $parser = new Parser($lines);
        $suffixes = $parser->parse();

        /*
         * Write file with exclusive file write lock.
         * */

        $handle = @fopen($this->outputFileName, 'w+');

        if ($handle === false) {
            throw new Exceptions\IOException(error_get_last()['message']);
        }

        if (!flock($handle, LOCK_EX)) {
            throw new Exceptions\IOException(sprintf('Cannot obtain lock to output file (%s)', $this->outputFileName));
        }

        $suffixFile = '<?php' . PHP_EOL . 'return ' . var_export($suffixes, true) . ';';
        $writtenBytes = fwrite($handle, $suffixFile);

        if ($writtenBytes === false || $writtenBytes !== strlen($suffixFile)) {
            throw new Exceptions\IOException(sprintf('Write to output file (%s) failed', $this->outputFileName));
        }

        flock($handle, LOCK_UN);
        fclose($handle);
    }
334012
public function getStream()
    {
        $this->validateActive();

        if ($this->stream instanceof StreamInterface) {
            return $this->stream;
        }

        return new LazyOpenStream($this->file, 'r+');
    }
578316
public function run()
    {
        $this->init();
        try {
            $this->bootstrap();
            $this->route();
            $this->dispatch();
        } catch (Exception $e) {
            if (APPLICATION_ENV == self::ENV_DEV) {
                var_dump($e);
            } else {
                throw $e;
            }
        }
        return $this;
    }
1321856
public function run()
	{
		$this->connect();

		try
		{
			while (!$this->feof())
			{
				$data = $this->irc_read(60); // We wait 60 seconds but it's arbitrary and can be safely modified...
				if ($data === false)
				{
					continue;
				}

				$this->callListeners($data);
			}
		}
		catch (SocketDisconnectedException $e)
		{
			return $this;
		}

		return $this;
	}
713073
public function run()
    {
        $this->renderChannel();
        if ($this->dataProvider->getCount() > 0) {
            $this->renderItems();
        }
        return $this->feed;
    }