Constructs the reader, loading parsed data from cache if available.

@return void
496591
public function initializeObject()
    {
        if ($this->cache->has('parsedFormats') && $this->cache->has('parsedFormatsIndices') && $this->cache->has('localizedLiterals')) {
            $this->parsedFormats = $this->cache->get('parsedFormats');
            $this->parsedFormatsIndices = $this->cache->get('parsedFormatsIndices');
            $this->localizedLiterals = $this->cache->get('localizedLiterals');
        }
    }
1233096
private function load()
    {
        $decoder = new JsonDecoder();
        $decoder->setObjectDecoding(JsonDecoder::ASSOC_ARRAY);

        $this->json = file_exists($this->path)
            ? $decoder->decodeFile($this->path)
            : array();

        if (!isset($this->json['keysByTypeName'])) {
            $this->json['keysByTypeName'] = array();
            $this->json['typesByKey'] = array();
            $this->json['bindingsByKey'] = array();
            $this->json['nextKey'] = 0;
        }
    }
1363
protected function onRead()
    {
        start:
        if ($this->getInputLength() < 5) {
            return;
        }
        /* @TODO: refactoring Binary::* to support direct buffer calls */
        $pct = $this->read(4096);
        $h = Binary::getDWord($pct);
        if ($h !== 0xFFFFFFFF) {
            $this->finish();
            return;
        }
        $type = Binary::getChar($pct);
        if (($type === Pool::S2A_INFO) || ($type === Pool::S2A_INFO_SOURCE)) {
            $result = self::parseInfo($pct, $type);
        } elseif ($type === Pool::S2A_PLAYER) {
            $result = self::parsePlayers($pct);
        } elseif ($type === Pool::S2A_SERVERQUERY_GETCHALLENGE) {
            $result = mb_orig_substr($pct, 0, 4);
            $pct = mb_orig_substr($pct, 5);
        } elseif ($type === Pool::S2A_PONG) {
            $result = true;
        } else {
            $result = null;
        }
        $this->onResponse->executeOne($this, $result);
        $this->checkFree();
        goto start;
    }
724335
protected function onRead()
    {
        if (!empty($this->boundary)) {
            $this->req->attrs->input->parseMultipart();
        }
        if (($this->req->attrs->contentLength <= $this->readed) && !$this->EOF) {
            $this->sendEOF();
        }
    }
1118466
public function onRead()
    {
        start:
        if ($this->state === self::STATE_ROOT) {
            $header = $this->readExact(8);

            if ($header === false) {
                return;
            }

            $this->header = unpack('Cver/Ctype/nreqid/nconlen/Cpadlen/Creserved', $header);

            if ($this->header['conlen'] > 0) {
                $this->setWatermark($this->header['conlen'], $this->header['conlen']);
            }
            $type = $this->header['type'];
            $this->header['ttype'] = isset(self::$requestTypes[$type]) ? self::$requestTypes[$type] : $type;
            $rid = $this->header['reqid'];
            $this->state = self::STATE_CONTENT;
        } else {
            $type = $this->header['type'];
            $rid = $this->header['reqid'];
        }
        if ($this->state === self::STATE_CONTENT) {
            $this->content = $this->readExact($this->header['conlen']);

            if ($this->content === false) {
                $this->setWatermark($this->header['conlen'], $this->header['conlen']);
                return;
            }

            if ($this->header['padlen'] > 0) {
                $this->setWatermark($this->header['padlen'], $this->header['padlen']);
            }

            $this->state = self::STATE_PADDING;
        }

        if ($this->state === self::STATE_PADDING) {
            $pad = $this->readExact($this->header['padlen']);

            if ($pad === false) {
                return;
            }
        }
        $this->setWatermark(8, 0xFFFFFF);
        $this->state = self::STATE_ROOT;

//        /*Daemon::log('[DEBUG] FastCGI-record ' . $this->header['ttype'] . '). Request ID: ' . $rid
//                . '. Content length: ' . $this->header['conlen'] . ' (' . mb_orig_strlen($this->content) . ') Padding length: ' . $this->header['padlen']
//                . ' (' . mb_orig_strlen($pad) . ')');*/

        if ($type === self::FCGI_BEGIN_REQUEST) {
            $u = unpack('nrole/Cflags', $this->content);

            $req = new \stdClass();
            $req->attrs = new \stdClass;
            $req->attrs->request = [];
            $req->attrs->get = [];
            $req->attrs->post = [];
            $req->attrs->cookie = [];
            $req->attrs->server = [];
            $req->attrs->files = [];
            $req->attrs->session = null;
            $req->attrs->role = self::$roles[$u['role']];
            $req->attrs->flags = $u['flags'];
            $req->attrs->id = $this->header['reqid'];
            $req->attrs->paramsDone = false;
            $req->attrs->inputDone = false;
            $req->attrs->input = new \PHPDaemon\HTTPRequest\Input();
            $req->attrs->chunked = false;
            $req->attrs->noHttpVer = true;
            $req->queueId = $rid;
            $this->requests[$rid] = $req;
        } elseif (isset($this->requests[$rid])) {
            $req = $this->requests[$rid];
        } else {
            Daemon::log('Unexpected FastCGI-record #' . $this->header['type'] . ' (' . $this->header['ttype'] . '). Request ID: ' . $rid . '.');
            return;
        }

        if ($type === self::FCGI_ABORT_REQUEST) {
            $req->abort();
        } elseif ($type === self::FCGI_PARAMS) {
            if ($this->content === '') {
                if (!isset($req->attrs->server['REQUEST_TIME'])) {
                    $req->attrs->server['REQUEST_TIME'] = time();
                }
                if (!isset($req->attrs->server['REQUEST_TIME_FLOAT'])) {
                    $req->attrs->server['REQUEST_TIME_FLOAT'] = microtime(true);
                }
                $req->attrs->paramsDone = true;

                $req = Daemon::$appResolver->getRequest($req, $this);

                if ($req instanceof \stdClass) {
                    $this->endRequest($req, 0, 0);
                    unset($this->requests[$rid]);
                } else {
                    if ($this->pool->config->sendfile->value
                        && (
                            !$this->pool->config->sendfileonlybycommand->value
                            || isset($req->attrs->server['USE_SENDFILE'])
                        )
                        && !isset($req->attrs->server['DONT_USE_SENDFILE'])
                    ) {
                        $fn = tempnam(
                            $this->pool->config->sendfiledir->value,
                            $this->pool->config->sendfileprefix->value
                        );

                        $req->sendfp = fopen($fn, 'wb');
                        $req->header('X-Sendfile: ' . $fn);
                    }

                    $this->requests[$rid] = $req;

                    $req->callInit();
                }
            } else {
                $p = 0;

                while ($p < $this->header['conlen']) {
                    if (($namelen = ord($this->content{$p})) < 128) {
                        ++$p;
                    } else {
                        $u = unpack(
                            'Nlen',
                            chr(ord($this->content{$p}) & 0x7f) . mb_orig_substr($this->content, $p + 1, 3)
                        );
                        $namelen = $u['len'];
                        $p += 4;
                    }

                    if (($vlen = ord($this->content{$p})) < 128) {
                        ++$p;
                    } else {
                        $u = unpack(
                            'Nlen',
                            chr(ord($this->content{$p}) & 0x7f) . mb_orig_substr($this->content, $p + 1, 3)
                        );
                        $vlen = $u['len'];
                        $p += 4;
                    }

                    $req->attrs->server[mb_orig_substr($this->content, $p, $namelen)] = mb_orig_substr(
                        $this->content,
                        $p + $namelen,
                        $vlen
                    );
                    $p += $namelen + $vlen;
                }
            }
        } elseif ($type === self::FCGI_STDIN) {
            if (!$req->attrs->input) {
                goto start;
            }
            if ($this->content === '') {
                $req->attrs->input->sendEOF();
            } else {
                $req->attrs->input->readFromString($this->content);
            }
        }

        if ($req->attrs->inputDone && $req->attrs->paramsDone) {
            $order = $this->pool->variablesOrder ?: 'GPC';
            for ($i = 0, $s = mb_orig_strlen($order); $i < $s; ++$i) {
                $char = $order[$i];

                if ($char === 'G' && is_array($req->attrs->get)) {
                    $req->attrs->request += $req->attrs->get;
                } elseif ($char === 'P' && is_array($req->attrs->post)) {
                    $req->attrs->request += $req->attrs->post;
                } elseif ($char === 'C' && is_array($req->attrs->cookie)) {
                    $req->attrs->request += $req->attrs->cookie;
                }
            }

            Daemon::$process->timeLastActivity = time();
        }
        goto start;
    }
1223881
protected function setupReader()
    {
        require_once 'ExcelReader/reader.php';
        $this->reader = new \Spreadsheet_Excel_Reader();
        $this->reader->setOutputEncoding( $this->encoding );
        $this->reader->read( $this->file_path );

    }
264955
protected function parse()
    {
        $formidable = $this;
        $generate = function() use ($formidable) {
            // Parses the contents
            $parser = $formidable->getFactory()->getParser($formidable->getContent());
            $formidable->isCached = false;

            return $parser;
        };

        if ($this->cache) {
            $formInfos = array(
                'path' => $this->path,
                'content' => $this->content
            );
            $cacheFile = sha1(serialize($formInfos));

            $conditions = array();
            if ($this->path !== null) {
                $conditions['younger-than'] = $this->path;
            }

            $cacheData = $this->cache->getOrCreate($cacheFile, $conditions, function($cacheFile) use ($generate) {
                $parserData = $generate();
                file_put_contents($cacheFile, serialize($parserData));
            });

            $this->originalParserData = unserialize($cacheData);
        } else {
            $this->originalParserData = $generate();
        }

        $this->reset();
    }
231796
public function loadFile()
    {
        $key = $this->getKey();

        $tags = $this->getTags();

        if (!$this->cache->has($key, $tags)) {
            $this->xmlRepo->loadFile();

            $XMLFile = $this->xmlRepo->getFile()->asXML();

            $this->cache->put($key, $XMLFile, $tags, $this->seconds);
        }
    }
914271
public function build()
    {
        $files = $this->filesystem->listFiles($this->directory, $this->recursive);

        $this->cache->clear();

        foreach ($files as $file) {
            $entity = $this->parseFile($file);
            if ($entity != null) $this->cache->put($entity->getIdentifier(), $entity);
        }
        
        $this->cache->persist();
    }
567287
public function load()
    {
        if (null === $this->loaded) {
            return;
        }

        $this->loaded = null;

        /** @var $cache StorageInterface */
        $cache      = $this->serviceLocator->get('BjyAuthorize\Cache');

        /** @var $cacheKeyGenerator callable */
        $cacheKeyGenerator  = $this->serviceLocator->get('BjyAuthorize\CacheKeyGenerator');
        $cacheKey           = $cacheKeyGenerator();

        $success    = false;
        $this->acl  = $cache->getItem($cacheKey, $success);

        if (!($this->acl instanceof Acl) || !$success) {
            $this->loadAcl();
            $cache->setItem($cacheKey, $this->acl);
        }

        $this->setIdentityProvider($this->serviceLocator->get('BjyAuthorize\Provider\Identity\ProviderInterface'));

        $parentRoles = $this->getIdentityProvider()->getIdentityRoles();

        $this->acl->addRole($this->getIdentity(), $parentRoles);
    }
359598
protected function load()
	{
		$this->rules = [];
		$rules = DiscHelper::loadFromFile($this->ruleFile);
		foreach ($rules as $name => $ruleData) {
			$this->rules[$name] = unserialize($ruleData);
		}
	}
98505
private function onReadable()
    {
        $data = @\stream_get_contents($this->socket, $this->options->getChunkSize());
        if ($data !== false && $data !== "") {
            $this->timeoutCache->renew($this->id);
            $this->parse($data);
            return;
        }

        if (!\is_resource($this->socket) || @\feof($this->socket)) {
            $this->close();
        }
    }
1215912
private function load()
    {
        // Get English version
        $english = $this->getTranslations(__DIR__, 'en');
        $languages = $this->getLanguages();

        $this->compareTranslations($english, $languages);
    }
1082523
protected function handleRead()
    {
        if ($this->paused)
        {
            return;
        }

        $data = @fread($this->resource, static::BUFFER_SIZE);

        if ($data === false || $data === '')
        {
            return;
        }

        $this->buffer .= $data;

        while ($this->buffer !== '')
        {
            if ($this->prefix !== '' && !isset($this->resources[$this->prefix]))
            {
                $this->prefix = '';
            }

            if ($this->prefix === '')
            {
                if (!preg_match('/([a-zA-Z0-9]{32})\r?\n(.*)/s', $this->buffer, $matches))
                {
                    return;
                }

                $this->prefix = $matches[1];
                $this->buffer = $matches[2];
            }

            $resource = $this->resources[$this->prefix];
            $data = '';
            $status = -1;
            $successSuffix = $resource->getSuccessSuffix();
            $failureSuffix = $resource->getFailureSuffix();

            $this->buffer = preg_replace_callback(
                sprintf('/(.*)(%s|%s):(\d*)\r?\n/s', $successSuffix, $failureSuffix),
                function($matches) use($resource, &$data, &$status) {
                    $data   = $matches[1];
                    $status = (int) $matches[3];
                    return '';
                },
                $this->buffer
            );

            if ($status === -1)
            {
                $data = $this->buffer;
                $this->buffer = '';
            }
            else
            {
                $this->removeResource($this->prefix);
                $this->prefix = '';
            }

            $parts = str_split($data, $resource->getBufferSize());
            unset($data);

            foreach ($parts as &$part)
            {
                $resource->emit('data', [ $resource, $part ]);
            }
            unset($parts);
            unset($part);

            if ($status === 0)
            {
                $resource->emit('end', [ $resource ]);
                $resource->close();
            }
            else if ($status > 0)
            {
                $resource->emit('error', [ $resource, new ReadException($status) ]);
                $resource->close();
            }
        }

        $this->handleRead();
    }
1155832
public function load()
    {
        $contents = $this->client->get($this->key);

        if ($contents !== null) {
            $this->setFromStorage($contents);
        }
    }
1300978
public function read() 
	{
		// Do we already have a session id if not we regenerate
		// the session and assign the default data.
		if ( $this->id ) 
		{
			if ( !$this->_data = $this->_driver->read( $this->id ) ) 
			{
				$this->regenerate();
				$this->_data = array();
			}
	
			if ( !is_array( $this->_data ) ) 
			{
				$this->_data = array();
			}
			
			$this->_data = array_merge( $this->_data, $this->default_data() );
		} 
		else 
		{
			$this->regenerate();
			$this->_data = $this->default_data();
		}
	}
1068569
private function load()
    {
        if (!$this->loaded && isset($this->storage)) {
            $this->data = $this->storage->load($this->id);
            $this->original = $this->data;
            $this->loaded = true;
        }
    }