/** * @inheritDoc */ public function disable() { self::$requestCallback = null; stream_wrapper_restore('http'); stream_wrapper_restore('https'); $this->status = self::DISABLED; }
/** * Cleanup. * * @return void */ public function __destruct() { self::$requestCallback = null; }
/** * This method is called immediately after the wrapper is initialized (f.e. by fopen() and file_get_contents()). * * @link http://www.php.net/manual/en/streamwrapper.stream-open.php * @param string $path Specifies the URL that was passed to the original function. * @param string $mode The mode used to open the file, as detailed for fopen(). * @param int $options Holds additional flags set by the streams API. * @param string $opened_path If the path is opened successfully, and STREAM_USE_PATH is set. * * @return boolean Returns TRUE on success or FALSE on failure. */ public function stream_open($path, $mode, $options, &$opened_path) { $request = StreamHelper::createRequestFromStreamContext($this->context, $path); $requestCallback = self::$requestCallback; $this->response = $requestCallback($request); self::$lastResponse = $this->response; return true; }