Skip to content
Browse files

fix plugin overrides on db models with clean installs.

if you replace a plugin model with a new version in the app/model folder without doing an install previously the sync causes both classes to be loaded. this uses the quicker form of class exists to check for this
  • Loading branch information...
1 parent eb3b2b4 commit 8954f1dc47bb60b30a5b59b915bfd6cb02c5d3c4 charles marshall committed
Showing with 3 additions and 3 deletions.
  1. +3 −3 AutoLoader.php
View
6 AutoLoader.php
@@ -234,10 +234,10 @@ static public function recursive_register($directory, $type, $force = false) {
$dirit = new WaxRecursiveDirectoryIterator($directory), true);
foreach ( $dir as $file ) {
if(substr($fn = $file->getFilename(),0,1) != "." && strrchr($fn, ".")==".php") {
+ $classname = basename($fn, ".php");
if($force){
- require_once($file->getPathName());
- }else{
- $classname = basename($fn, ".php");
+ if(!class_exists($classname, false)) require_once($file->getPathName());
+ }else{
self::register($type, $classname, $file->getPathName());
}
}

0 comments on commit 8954f1d

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