cvs: pear /Image_GIS GIS.php /Image_GIS/GIS Parser.php /Image_GIS/GIS/Parser E00.php
| From: | Sebastian Bergmann | Date: | Sun, 19 Jan 2003 11:28:15 +0000 |
| Subject: | cvs: pear /Image_GIS GIS.php /Image_GIS/GIS Parser.php /Image_GIS/GIS/Parser E00.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-8409@lists.php.net to get a copy of this message | ||
sebastian Sun Jan 19 06:28:15 2003 EDT
Modified files:
/pear/Image_GIS GIS.php
/pear/Image_GIS/GIS Parser.php
/pear/Image_GIS/GIS/Parser E00.php
Log:
Allow cache to be turned off.
Index: pear/Image_GIS/GIS.php
diff -u pear/Image_GIS/GIS.php:1.9 pear/Image_GIS/GIS.php:1.10
--- pear/Image_GIS/GIS.php:1.9 Sun Jan 19 06:24:18 2003
+++ pear/Image_GIS/GIS.php Sun Jan 19 06:28:14 2003
@@ -13,7 +13,7 @@
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
//
-// $Id: GIS.php,v 1.9 2003/01/19 11:24:18 sebastian Exp $
+// $Id: GIS.php,v 1.10 2003/01/19 11:28:14 sebastian Exp $
//
require_once 'Image/Color.php';
@@ -50,7 +50,7 @@
* $map->saveImage('kiel.png');
* ?>
*
-* @version $Revision: 1.9 $
+* @version $Revision: 1.10 $
* @since Image_GIS 1.0.0
*/
class Image_GIS {
@@ -82,13 +82,14 @@
* @param integer $height
* @param string $renderer
* @param string $parser
+ * @param boolean $cache
* @param boolean $debug
* @access public
*/
- function Image_GIS($width, $height = -1, $renderer = 'GD', $parser = 'E00',
$debug = false) {
+ function Image_GIS($width, $height = -1, $renderer = 'GD', $parser = 'E00',
$cache = true, $debug = false) {
$this->debug = $debug;
- $this->setParser($parser);
+ $this->setParser($parser, $cache);
$this->setRenderer($renderer, $width, $height);
}
@@ -142,10 +143,11 @@
* to parse a data file.
*
* @param string $parser
+ * @param boolean $cache
* @access public
*/
- function setParser($parser) {
- $this->parser = &Image_GIS_Parser::factory($parser, $this->debug);
+ function setParser($parser, $cache) {
+ $this->parser = &Image_GIS_Parser::factory($parser, $this->cache,
$this->debug);
}
/**
Index: pear/Image_GIS/GIS/Parser.php
diff -u pear/Image_GIS/GIS/Parser.php:1.5 pear/Image_GIS/GIS/Parser.php:1.6
--- pear/Image_GIS/GIS/Parser.php:1.5 Sun Jan 19 06:24:18 2003
+++ pear/Image_GIS/GIS/Parser.php Sun Jan 19 06:28:14 2003
@@ -13,7 +13,7 @@
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
//
-// $Id: Parser.php,v 1.5 2003/01/19 11:24:18 sebastian Exp $
+// $Id: Parser.php,v 1.6 2003/01/19 11:28:14 sebastian Exp $
//
require_once 'Cache/Lite.php';
@@ -22,7 +22,7 @@
/**
* Parser Base Class.
*
-* @version $Revision: 1.5 $
+* @version $Revision: 1.6 $
* @since Image_GIS 1.0.0
*/
class Image_GIS_Parser {
@@ -57,27 +57,32 @@
/**
* Constructor.
*
+ * @param boolean $cache
* @param boolean $debug
* @access public
*/
- function Image_GIS_Parser($debug) {
- $this->cache = new Cache_Lite;
+ function Image_GIS_Parser($cache, $debug) {
+ if ($cache) {
+ $this->cache = new Cache_Lite;
+ }
+
$this->debug = $debug;
}
/**
* Factory.
*
- * @param string $parser
- * @param boolean $debug
+ * @param string $parser
+ * @param boolean $cache
+ * @param boolean $debug
* @return object
* @access public
*/
- function &factory($parser, $debug) {
+ function &factory($parser, $cache, $debug) {
include_once 'Image/GIS/Parser/' . $parser . '.php';
$class = 'Image_GIS_Parser_' . $parser;
- return new $class($debug);
+ return new $class($cache, $debug);
}
/**
Index: pear/Image_GIS/GIS/Parser/E00.php
diff -u pear/Image_GIS/GIS/Parser/E00.php:1.6 pear/Image_GIS/GIS/Parser/E00.php:1.7
--- pear/Image_GIS/GIS/Parser/E00.php:1.6 Sun Jan 19 06:24:18 2003
+++ pear/Image_GIS/GIS/Parser/E00.php Sun Jan 19 06:28:15 2003
@@ -13,7 +13,7 @@
// | license@php.net so we can mail you a copy immediately. |
// +------------------------------------------------------------------------+
//
-// $Id: E00.php,v 1.6 2003/01/19 11:24:18 sebastian Exp $
+// $Id: E00.php,v 1.7 2003/01/19 11:28:15 sebastian Exp $
//
require_once 'Image/GIS/LineSet.php';
@@ -22,18 +22,19 @@
/**
* E00 Parser.
*
-* @version $Revision: 1.6 $
+* @version $Revision: 1.7 $
* @since Image_GIS 1.0.0
*/
class Image_GIS_Parser_E00 extends Image_GIS_Parser {
/**
* Constructor.
*
+ * @param boolean $cache
* @param boolean $debug
* @access public
*/
- function Image_GIS_Parser_E00($debug) {
- $this->Image_GIS_Parser($debug);
+ function Image_GIS_Parser_E00($cache, $debug) {
+ $this->Image_GIS_Parser($cache, $debug);
}
/**