Skip to content

HTTPS clone URL

Subversion checkout URL

You can clone with
or
.
Download ZIP
Browse files

converted file_exists calls to either is_file or is_dir where it make…

…s sense
  • Loading branch information...
commit c6336b856eeb548848e5cb3fc15009ac7f5d3516 1 parent 33066c1
@fabpot fabpot authored
Showing with 7 additions and 7 deletions.
  1. +3 −3 ClassCollectionLoader.php
  2. +4 −4 UniversalClassLoader.php
View
6 ClassCollectionLoader.php
@@ -55,7 +55,7 @@ static public function load($classes, $cacheDir, $name, $autoReload, $adaptive =
$reload = false;
if ($autoReload) {
$metadata = $cacheDir.'/'.$name.$extension.'.meta';
- if (!file_exists($metadata) || !file_exists($cache)) {
+ if (!is_file($metadata) || !is_file($cache)) {
$reload = true;
} else {
$time = filemtime($cache);
@@ -65,7 +65,7 @@ static public function load($classes, $cacheDir, $name, $autoReload, $adaptive =
$reload = true;
} else {
foreach ($meta[0] as $resource) {
- if (!file_exists($resource) || filemtime($resource) > $time) {
+ if (!is_file($resource) || filemtime($resource) > $time) {
$reload = true;
break;
@@ -75,7 +75,7 @@ static public function load($classes, $cacheDir, $name, $autoReload, $adaptive =
}
}
- if (!$reload && file_exists($cache)) {
+ if (!$reload && is_file($cache)) {
require_once $cache;
return;
View
8 UniversalClassLoader.php
@@ -227,7 +227,7 @@ public function findFile($class)
foreach ($dirs as $dir) {
$className = substr($class, $pos + 1);
$file = $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $namespace).DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $className).'.php';
- if (file_exists($file)) {
+ if (is_file($file)) {
return $file;
}
}
@@ -235,7 +235,7 @@ public function findFile($class)
foreach ($this->namespaceFallbacks as $dir) {
$file = $dir.DIRECTORY_SEPARATOR.str_replace('\\', DIRECTORY_SEPARATOR, $class).'.php';
- if (file_exists($file)) {
+ if (is_file($file)) {
return $file;
}
}
@@ -248,7 +248,7 @@ public function findFile($class)
foreach ($dirs as $dir) {
$file = $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
- if (file_exists($file)) {
+ if (is_file($file)) {
return $file;
}
}
@@ -256,7 +256,7 @@ public function findFile($class)
foreach ($this->prefixFallbacks as $dir) {
$file = $dir.DIRECTORY_SEPARATOR.str_replace('_', DIRECTORY_SEPARATOR, $class).'.php';
- if (file_exists($file)) {
+ if (is_file($file)) {
return $file;
}
}
Please sign in to comment.
Something went wrong with that request. Please try again.