Skip to content
Browse files

Modified Phergie_Plugin_Abstract->findDataFile() to check for a local…

… path first (versus a PEAR path) to work around an error in unit tests involving PEAR_Config assigning a new object instance by reference, which is deprecated
  • Loading branch information...
1 parent b7ec47f commit 694ecacab828b675dad258ea640afd6a2b5a2b5a @elazar elazar committed Apr 15, 2012
Showing with 6 additions and 6 deletions.
  1. +6 −6 Phergie/Plugin/Abstract.php
View
12 Phergie/Plugin/Abstract.php
@@ -290,6 +290,12 @@ public function findDataFile($filename)
{
$class = get_class($this);
+ $r = new ReflectionClass($class);
+ $path = dirname($r->getFilename()) . '/' . $this->getName() . '/' . $filename;
+ if (file_exists($path)) {
+ return $path;
+ }
+
if (class_exists('PEAR_Config')) {
$config = new PEAR_Config();
$dataDir = $config->get('data_dir');
@@ -299,12 +305,6 @@ public function findDataFile($filename)
}
}
- $r = new ReflectionClass($class);
- $path = dirname($r->getFilename()) . '/' . $this->getName() . '/' . $filename;
- if (file_exists($path)) {
- return $path;
- }
-
return null;
}

0 comments on commit 694ecac

Please sign in to comment.
Something went wrong with that request. Please try again.