cvs: pear /Image_GIS/GIS Parser.php

From: Date: Sun, 28 Sep 2003 21:39:19 +0000
Subject: cvs: pear /Image_GIS/GIS Parser.php
Groups: php.pear.cvs 
Request: Send a blank email to pear-cvs+get-13161@lists.php.net to get a copy of this message
sebastian Sun Sep 28 17:39:19 2003 EDT Modified files: /pear/Image_GIS/GIS Parser.php Log: Hopefully fix cache handling. Index: pear/Image_GIS/GIS/Parser.php diff -u pear/Image_GIS/GIS/Parser.php:1.8 pear/Image_GIS/GIS/Parser.php:1.9 --- pear/Image_GIS/GIS/Parser.php:1.8 Sun Sep 28 17:17:44 2003 +++ pear/Image_GIS/GIS/Parser.php Sun Sep 28 17:39:18 2003 @@ -13,7 +13,7 @@ // | license@php.net so we can mail you a copy immediately. | // +------------------------------------------------------------------------+ // -// $Id: Parser.php,v 1.8 2003/09/28 21:17:44 sebastian Exp $ +// $Id: Parser.php,v 1.9 2003/09/28 21:39:18 sebastian Exp $ // require_once 'Cache/Lite.php'; @@ -22,7 +22,7 @@ /** * Parser Base Class. * -* @version $Revision: 1.8 $ +* @version $Revision: 1.9 $ * @since Image_GIS 1.0.0 */ class Image_GIS_Parser { @@ -107,14 +107,19 @@ function parse() { foreach ($this->dataFiles as $dataFile => $color) { $cacheID = md5($dataFile . '_' . $color); + $lineSet = false; if (is_object($this->cache) && $lineSet = $this->cache->get($cacheID, 'Image_GIS')) { $lineSet = unserialize($lineSet); - } else { + } + + if ($lineSet === false) { $lineSet = $this->parseFile($dataFile, $color); - $this->cache->save(serialize($lineSet), $cacheID, 'Image_GIS'); + if (is_object($this->cache)) { + $this->cache->save(serialize($lineSet), $cacheID, 'Image_GIS'); + } } $this->lineSets[] = $lineSet;

« previous php.pear.cvs (#13161) next »