cvs: php4 /pear/Image Remote.php
| From: | Mika Tuupola | Date: | Sun, 13 May 2001 14:20:27 +0000 |
| Subject: | cvs: php4 /pear/Image Remote.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-136@lists.php.net to get a copy of this message | ||
tuupola Sun May 13 07:20:27 2001 EDT
Modified files:
/php4/pear/Image Remote.php
Log:
* Added error handling via PEAR_Error.
Index: php4/pear/Image/Remote.php
diff -u php4/pear/Image/Remote.php:1.3 php4/pear/Image/Remote.php:1.4
--- php4/pear/Image/Remote.php:1.3 Tue Jan 16 06:59:01 2001
+++ php4/pear/Image/Remote.php Sun May 13 07:20:27 2001
@@ -17,7 +17,7 @@
// | Authors: Mika Tuupola <tuupola@appelsiini.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Remote.php,v 1.3 2001/01/16 14:59:01 tuupola Exp $
+// $Id: Remote.php,v 1.4 2001/05/13 14:20:27 tuupola Exp $
define("GIF_SIGNATURE_LENGTH", 3);
define("GIF_VERSION_LENGTH", 3);
@@ -62,7 +62,9 @@
define("M_APP12", 0xEC); /* (we don't bother to list all 16 APPn's) */
define("M_COM", 0xFE); /* COMment */
-class Image_Remote
+require_once('PEAR.php');
+
+class Image_Remote
{
var $url; // the url we should be handling
var $purl; // parsed url
@@ -83,13 +85,17 @@
* Usage:
*
* $i = new Image_Remote("http://www.example.com/test.png");
- * $data = $i->getImageSize();
+ * if (PEAR::isError($i)) {
+ * print "ERROR: " . $ri->getMessage();
+ * } else {
+ * $data = $i->getImageSize();
+ * }
*
* @param string $input URL of the remote image. Currently supports
* only http.
*
* @author Mika Tuupola <tuupola@appelsiini.net>
- * @version $Revision: 1.3 $
+ * @version $Revision: 1.4 $
*/
function Image_Remote($input)
@@ -110,6 +116,11 @@
} else {
$this->errstr = "Only http supported.";
}
+
+ if ($this->errstr) {
+ $this = new PEAR_Error($this->errstr);
+ }
+
} // constructor