Development

Changeset 6004

You must first sign up to be able to contribute.

Changeset 6004

Show
Ignore:
Timestamp:
11/14/07 07:43:37 (2 years ago)
Author:
fabien
Message:

fixed Creole (closes #2534 - fixes r6003)

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • branches/1.0/lib/vendor/creole/Creole.php

    r6003 r6004  
    370370     */ 
    371371    public static function import($class) { 
    372         if (!class_exists($class, false)) { 
     372        $pos = strrpos($class, '.'); 
     373        // get just classname ('path.to.ClassName' -> 'ClassName') 
     374        if ($pos !== false) { 
     375            $classname = substr($class, $pos + 1); 
     376        } 
     377        else 
     378        { 
     379          $classname = $class; 
     380        } 
     381        if (!class_exists($classname, false)) { 
    373382            $path = strtr($class, '.', DIRECTORY_SEPARATOR) . '.php'; 
    374383            $ret = include_once($path); 
     
    376385                throw new SQLException("Unable to load driver class: " . $class); 
    377386            } 
    378             // get just classname ('path.to.ClassName' -> 'ClassName') 
    379             $pos = strrpos($class, '.'); 
    380             if ($pos !== false) { 
    381                 $class = substr($class, $pos + 1); 
     387            if (!class_exists($classname)) { 
     388                throw new SQLException("Unable to find loaded class: $classname (Hint: make sure classname matches filename)"); 
    382389            } 
    383             if (!class_exists($class)) { 
    384                 throw new SQLException("Unable to find loaded class: $class (Hint: make sure classname matches filename)"); 
    385             } 
    386         } 
    387         return $class; 
     390        } 
     391        return $classname; 
    388392    } 
    389393 

The Sensio Labs Network

Since 1998, Sensio Labs has been promoting the Open-Source software movement by providing quality web application development, training, consulting, and supporting several large Open-Source projects.