Horde_Timezone::_extractAndParse PHP Method

_extractAndParse() protected method

Unpacks the downloaded timezone database and parses all files.
protected _extractAndParse ( )
    protected function _extractAndParse()
    {
        if (isset($this->_params['cache'])) {
            $result = @unserialize($this->_params['cache']->get('horde_timezone', $this->_params['cachettl']));
            if ($result) {
                $this->_zones = $result['zones'];
                $this->_rules = $result['rules'];
                $this->_links = $result['links'];
                return;
            }
        }
        if (!$this->_tmpfile) {
            $this->_download();
        }
        $tar = new Archive_Tar($this->_tmpfile);
        foreach ($tar->listContent() as $file) {
            if ($file['typeflag'] != 0) {
                continue;
            }
            $this->_parse($tar->extractInString($file['filename']));
        }
        if (isset($this->_params['cache'])) {
            $this->_params['cache']->set('horde_timezone', serialize(array('zones' => $this->_zones, 'rules' => $this->_rules, 'links' => $this->_links)), $this->_params['cachettl']);
        }
    }