getFileCache( 'timeZone', 'list', array($this, '_timeZoneCacheMiss') ); // Check to see if the data is outdated $cacheTime = $cache->getCacheTime(); if ($cacheTime !== null && $cacheTime < filemtime($this->getFilename())) { $cache->flush(); } } return $cache; } function _timeZoneCacheMiss($cache, $id) { $timeZones =& Registry::get('allTimeZonesData', true, null); if ($timeZones === null) { // Reload time zone registry file $xmlDao = new XMLDAO(); $data = $xmlDao->parseStruct($this->getFilename(), array('timezones', 'entry')); $timeZones = array(); if (isset($data['timezones'])) { foreach ($data['entry'] as $timeZoneData) { $timeZones[$timeZoneData['attributes']['key']] = $timeZoneData['attributes']['name']; } } asort($timeZones); $cache->setEntireCache($timeZones); } return null; } /** * Return a list of all time zones. * @return array */ function &getTimeZones() { $cache =& $this->_getTimeZoneCache(); return $cache->getContents(); } } ?>