Get a handler resource for reading

@see fopen()

@return resource
15012
public function getReadHandler()
    {
        if (null === $this->stream) {
            $this->stream = fopen($this->uri, 'r');
        }
        return $this->stream;
    }
211250
protected function read()
    {
        $n = 0;
        while ($info = curl_multi_info_read($this->mh)) {
            $n++;
            $request = $this->queue[(int)$info['handle']];
            $result = $info['result'];

            curl_multi_remove_handle($this->mh, $request->getHandle());
            unset($this->running[$request->getUID()]);
            $this->detach($request);

            $event = new Event();
            $event->request = $request;
            $event->response = new Response($request, curl_multi_getcontent($request->getHandle()));
            if ($result !== CURLE_OK) {
                $event->response->setError(new Error(curl_error($request->getHandle()), $result));
            }
            $event->queue = $this;
            $this->dispatch('complete', $event);
            $request->dispatch('complete', $event);
        }

        return $n;
    }
689261
public function getHandle()
    {
        $handle = null;

        if($this->isSupported())
        {
            $callbacks = $this->getCommandCallbacks();

            if(!empty($callbacks)) {
                $handle = parent::getHandle();
            }
        }

        return $handle;
    }
1365240
public function tell()
    {
        if ($this->_resource === null && $this->_filename) {
            $this->_resource = fopen($this->_filename, $this->_mode);
        }
        return ftell($this->_resource);
    }
1155536
public function handler()
    {
        $handler = $this->pop();

        if (null !== $handler) {
            $this->push($handler);
        }

        return $handler;
    }
833172
protected function handleGET()
    {
        if (empty($this->folderPath) && empty($this->filePath) &&
            $this->request->getParameterAsBool(ApiOptions::AS_ACCESS_LIST)
        ) {
            return ResourcesWrapper::wrapResources($this->getAccessList());
        }

        if (empty($this->filePath)) {
            //Resource is the root/container or a folder
            if ($this->request->getParameterAsBool('zip')) {
                $zipFileName = '';
                if (empty($this->container) && empty($this->folderPath)) {
                    $zipFileName = sys_get_temp_dir() . DIRECTORY_SEPARATOR . $this->getName() . '_' . time() . '.zip';
                }
                $zipFileName = $this->driver->getFolderAsZip($this->container, $this->folderPath, null, $zipFileName);
                $response = new StreamedResponse();
                $response->setCallback(function () use ($zipFileName){
                    $chunk = \Config::get('df.file_chunk_size');
                    FileUtilities::sendFile($zipFileName, true, $chunk);
                    unlink($zipFileName);
                });

                return $response;
            } elseif ($this->request->getParameterAsBool('include_properties')) {
                $result = $this->driver->getFolderProperties($this->container, $this->folderPath);
            } else {
                $search = $this->request->getParameter('search');
                if (!empty($search)) {
                    $result = $this->doSearch($search);
                } else {
                    $result = $this->driver->getFolder(
                        $this->container,
                        $this->folderPath,
                        $this->request->getParameterAsBool('include_files', true),
                        $this->request->getParameterAsBool('include_folders', true),
                        $this->request->getParameterAsBool('full_tree', false)
                    );
                }

                $asList = $this->request->getParameterAsBool(ApiOptions::AS_LIST);
                $idField = $this->request->getParameter(ApiOptions::ID_FIELD, static::getResourceIdentifier());
                $fields = $this->request->getParameter(ApiOptions::FIELDS, ApiOptions::FIELDS_ALL);

                $result = ResourcesWrapper::cleanResources($result, $asList, $idField, $fields, true);
            }
        } else {
            // Resource is a file
            // Check to see if file exists
            if (!$this->driver->fileExists($this->container, $this->filePath)) {
                throw new NotFoundException("The specified file '" . $this->filePath . "' was not found in storage.");
            }
            if ($this->request->getParameterAsBool('include_properties', false)) {
                // just properties of the file itself
                $content = $this->request->getParameterAsBool('content', false);
                $base64 = $this->request->getParameterAsBool('is_base64', true);
                $result = $this->driver->getFileProperties($this->container, $this->filePath, $content, $base64);
            } else {
                $download = $this->request->getParameterAsBool('download', false);
                // stream the file using StreamedResponse, exits processing
                $response = new StreamedResponse();
                $service = $this;
                $response->setCallback(function () use ($service, $download){
                    $service->streamFile($service->filePath, $download);
                });

                return $response;
            }
        }

        return $result;
    }
1071098
public function read()
    {
        $proxy = Helper::getOption('proxy');
        if (is_null($proxy)) {
            $protocol = substr($this->getFeedUrl(), 0, 5)=='https' ? 'https' : 'http';
            $proxy = Helper::getOption('proxy_'.$protocol);
        }

        $ch = curl_init();
        curl_setopt($ch, CURLOPT_URL, $this->getFeedUrl());
        if (!is_null($proxy)) {
            curl_setopt($ch, CURLOPT_PROXY, $proxy);
        }
        curl_setopt($ch, CURLOPT_FOLLOWLOCATION, 1);
        curl_setopt($ch, CURLOPT_RETURNTRANSFER, 1);
//        curl_setopt($ch, CURLOPT_HEADER, 1);
        $result = curl_exec($ch);
        curl_close($ch);

        if (!empty($result)) {
            $this->_init($result)->parse();
        }
    }
1289711
public function read()
    {
        if ($this->_canReadline) {
            $line = readline('');
            if (strlen($line) > 0) {
                readline_add_history($line);
            }

            return $line;
        }

        return fgets($this->_input);
    }
288684
private function getVirtualRuleReadHandler()
    {
        if ($this->virtualRuleReadHandler === null) {
            $this->virtualRuleReadHandler = $this->_universalFactory->create(VirtualRuleReadHandler::class);
        }

        return $this->virtualRuleReadHandler;
    }
790087
private function handle()
    {
        if (!$this->handle) {
            if (!($this->handle = @fopen($this->file, 'rb'))) {
                throw FileException::lastError();
            }
        }

        return $this->handle;
    }
1288443
public function readWord()
    {
        if (!is_resource($this->fp)) {
            return $this->raiseError('not connected');
        }

        $buf = @fread($this->fp, 2);

        return (ord($buf[0]) + (ord($buf[1]) << 8));
    }
1304168
public function read()
    {
        $args = array_merge(
            [$this->filename],
            [false, null],
            func_get_args()
        );

        return file_get_contents(...$args);
    }
796664
protected function getFileHandler()
    {
        if ($this->fileHandler === null) {
            $fileHandler = @fopen($this->logFile, 'r');

            if ($fileHandler === false) {
                throw new ParserException('Can not open log file.');
            }

            $this->fileHandler = $fileHandler;
        }

        return $this->fileHandler;
    }
1311418
public function read()
    {
        $configuration = new Configuration();

        $options = [
            'focus' => [$configuration, 'setFocusPattern'],
            'skip' => [$configuration, 'setSkipPattern'],
            'grep' => [$configuration, 'setGrep'],
            'no-colors' => [$configuration, 'disableColors'],
            'force-colors' => [$configuration, 'enableColorsExplicit'],
            'bail' => [$configuration, 'stopOnFailure'],
            'configuration' => [$configuration, 'setConfigurationFile']
        ];

        if ($path = $this->input->getArgument('path')) {
            $configuration->setPath($path);
        }

        foreach ($options as $option => $callable) {
            $this->callForOption($option, $callable);
        }

        return $configuration;
    }
766060
private function open()
    {
        if (null === ($this->handle = fopen($this->file, 'rb'))) {
            $this->handle = null;

            throw new RuntimeException(
                sprintf(
                    'The file "%s" could not be opened for reading.',
                    $this->file
                )
            );
        }
    }
670051
public function getHandler() {
        $rs = $this->runQuery(
            "SELECT handler FROM " . self::$jobsTable . " WHERE id = ?",
            array($this->job_id)
        );
        foreach ($rs as $r) return unserialize($r["handler"]);
        return false;
    }
444666
private function openFile($file)
    {
        if (!(is_readable($file) && is_file($file))) {
            $this->throwException('FILE_EXISTS', $file);
        }
        $handle = fopen($file, 'rb');
        if (!$handle) {
            $this->throwException('FILE_OPEN', $file);
        }
        return $handle;
    }