Returns current \SoapClient::_stream_context resource or null
@return resource|null
195162
public function getStreamContext()
    {
        return ($this->getSoapClient() && isset($this->getSoapClient()->_stream_context) && is_resource($this->getSoapClient()->_stream_context)) ? $this->getSoapClient()->_stream_context : null;
    }
974792
public function getStream($context = null)
	{
		$this->requestBody();
		if (is_null($context)) {
			return fopen($this->bodyTempFile, 'rb', false);
		} else {
			return fopen($this->bodyTempFile, 'rb', false, $context);
		}
	}
15012
public function getReadHandler()
    {
        if (null === $this->stream) {
            $this->stream = fopen($this->uri, 'r');
        }
        return $this->stream;
    }
1242459
public function getBody()
    {
        if ($this->stream)
            return $this->stream;
        
        $stream = $this->httpMessage->getBody();

        if ($stream instanceof iStreamable)
            $stream = new StreamBridgeInPsr($stream);
        else {
            $body   = (string) $stream;
            $stream = new Stream('php://temp', 'wb+');
            $stream->write($body);
            $stream->rewind();
        }
        
        return $this->stream = $stream;
    }
93697
public function stream()
    {
        $stream = fopen($this->file, 'r');

        $stream = $stream === false ? null : $stream;

        return new Stream($stream);
    }
166860
public function setupClient()
    {
        /* Return if already set */
        if ($this->client)
            return $this;

        /* Set the options for the SOAP request */
        $sslContext = array(
            'ssl' => array(
                'allow_self_signed' => false,
                'verify_peer' => false /* Temporary fix */
            )
        );

        $soapArguments = array(
            'location' => $this->service,
            'encoding' => 'UTF-8',
            'cache_wsdl' => 'WSDL_CACHE_NONE',
            'stream_context' => stream_context_create($sslContext)
        );

        /* Start a new client */
        $this->client = new SoapClient($this->service, $soapArguments);

        /* Client configuration */
        $this->client->soap_defencoding = "utf-8";

        return $this;
    }
862103
public function getStream($context = null)
	{
		if (is_string($this->content)) {
			$stream = fopen('php://memory', 'r+');
			fwrite($stream, $this->content);
			rewind($stream);
			return $stream;
		}
		$fn = $this->streamFn;
		return $fn($context);
	}
947745
public static function getContext(&$lob) {
		if (!self::$_isRegistered) {
			stream_wrapper_register(self::WRAPPER_NAME, get_class());
			self::$_isRegistered = true;
		}

		return stream_context_create(array(self::WRAPPER_NAME => array('lob' => &$lob)));
	}
148867
protected function getRequestContext()
    {
        if (null === $this->requestContext) {
            $this->requestContext = new RequestContext();
            $this->requestContext->fromRequest($this->getRequest());
        }

        return $this->requestContext;
    }
113724
public function withLocalScope()
    {
        if ($this->isClosed()) {
            throw new \RuntimeException("The stream is closed");
        }
        
        if (!$this->isGlobal()) {
            return $this;
        }
        
        $stream = clone $this;
        
        fwrite($stream->handle, (string)$this);
        
        return $stream;
    }
1029669
protected function streamSetTimeout()
    {
        $seconds = floor($this->timeout);
        $microseconds = round(($this->timeout - $seconds) * 1e6);

        return stream_set_timeout($this->resource, $seconds, $microseconds);
    }
652099
public function read()
    {
        if (!$this->valid()) {
            return null;
        }

        // keep a local copy of the resource; the next() call could change the cached one
        $resource = $this->resource;

        $item = $this->current();
        $this->next();

        // serialize the item
        $event = new ResourceSerializeEvent($resource, $item);
        $this->eventDispatcher->dispatch(FeedEvents::RESOURCE_PRE_SERIALIZE, $event);
        $item = $this->serialize($item);
        $this->eventDispatcher->dispatch(FeedEvents::RESOURCE_POST_SERIALIZE, $event);

        return $item;
    }
154990
protected function proxy() {
        if (!$this->context) {
            $this->context = new FlexFlowContext($this->version, $this->solution['sid']);
        }

        return $this->context;
    }
562404
protected function _getStreamContext($recreate = false)
    {
        if (!isset($this->_streamContext) || true === $recreate) {
            $this->_streamContext = stream_context_create($this->_streamContextOptions);
        }

        return $this->_streamContext;
    }
537312
public function getContext()
    {
        if (!isset($this->context)) {
            $this->context = new RequestContext();
            $this->context->fromRequest($this->getRequest());
        }

        return $this->context;
    }
779871
public function getStream()
    {
        if (!$this->_stream instanceof StreamInterface) {
            if ($this->_stream === null) {
                if ($this->getError() !== UPLOAD_ERR_OK) {
                    throw new \RuntimeException('Unable to create file stream due to upload error: ' . $this->getError());
                }
                $stream = [
                    '__class' => FileStream::class,
                    'filename' => $this->tempFilename,
                    'mode' => 'r',
                ];
            } elseif ($this->_stream instanceof \Closure) {
                $stream = \call_user_func($this->_stream, $this);
            } else {
                $stream = $this->_stream;
            }

            $this->_stream = Yii::ensureObject($stream, StreamInterface::class);
        }
        return $this->_stream;
    }
190398
public static function getStream()
    {
        $tweetStore = Store::get('Tweet');

        $consumerKey = Setting::getSetting('twitter', 'consumer_key');
        $consumerSecret = Setting::getSetting('twitter', 'consumer_secret');
        $accessToken = Setting::getSetting('twitter', 'access_token');
        $accessTokenSecret = Setting::getSetting('twitter', 'access_token_secret');
        $streamSearch = Setting::getSetting('twitter', 'stream_search');

        $twitter = new Twitter($consumerKey, $consumerSecret, $accessToken, $accessTokenSecret);

        if (self::canCallAPI()) {
            self::updateLastAPICall();

            $stream = $twitter->search($streamSearch);

            foreach ($stream as $s) {
                if (!$tweetStore->getByTwitterIdForScope($s->id, 'stream')) {
                    $t = new Tweet;
                    $t->setTwitterId($s->id);
                    $t->setText($s->text);
                    $t->setHtmlText(Twitter::clickable($s));
                    $t->setScreenname($s->user->screen_name);
                    $t->setPosted($s->created_at);
                    $t->setCreatedDate(new \DateTime());
                    $t->setScope('stream');
                    $tweetStore->insert($t);
                }
            }
        }
    }