cvs: pear /Services_Weather/Weather Common.php
| From: | Alexander Wirtz | Date: | Sun, 05 Oct 2003 21:30:09 +0000 |
| Subject: | cvs: pear /Services_Weather/Weather Common.php | ||
| Groups: | php.pear.cvs | ||
| Request: | Send a blank email to pear-cvs+get-13406@lists.php.net to get a copy of this message | ||
eru Sun Oct 5 17:30:09 2003 EDT
Modified files:
/pear/Services_Weather/Weather Common.php
Log:
*Modified file-check in constructor
Index: pear/Services_Weather/Weather/Common.php
diff -u pear/Services_Weather/Weather/Common.php:1.11 pear/Services_Weather/Weather/Common.php:1.12
--- pear/Services_Weather/Weather/Common.php:1.11 Sun Oct 5 16:57:07 2003
+++ pear/Services_Weather/Weather/Common.php Sun Oct 5 17:30:08 2003
@@ -16,7 +16,7 @@
// | Authors: Alexander Wirtz <alex@pc4p.net> |
// +----------------------------------------------------------------------+
//
-// $Id: Common.php,v 1.11 2003/10/05 20:57:07 eru Exp $
+// $Id: Common.php,v 1.12 2003/10/05 21:30:08 eru Exp $
require_once "Services/Weather.php";
@@ -131,17 +131,15 @@
*/
function Services_Weather_Common()
{
+ // Ugly, but it works. Why isn't file_exists capable of searching
+ // through the include_path? *sigh*
$files = array("Cache.php");
- $incPath = get_include_path();
- $incPath = strpos($incPath, ";") ? explode(";", $incPath) :
explode(":", $incPath);
for ($i = 0; $i < sizeof($files); $i++) {
- for ($j = 0; $j < sizeof($incPath); $j++) {
- if (file_exists($incPath[$j]."/".$files[$i])) {
- $this->{"_has".basename($files[$i], ".php")} = true;
- break;
- }
+ if(($fp = @fopen($files[$i], "r", true)) !== false) {
+ $this->{"_has".basename($files[$i], ".php")} = true;
+ fclose($fp);
}
- }
+ }
}
// }}}