Project

General

Profile

Bug #21550 ยป 12591.diff

Administrator Admin, 2009-11-14 13:07

View differences:

t3lib/class.t3lib_div.php (working copy)
// Check file-reference prefix; if found, require_once() the file (should be library of code)
if (strpos($classRef,':') !== false) {
list($file,$class) = t3lib_div::revExplode(':',$classRef,2);
$requireFile = t3lib_div::getFileAbsFileName($file);
if ($requireFile) t3lib_div::requireOnce($requireFile);
$class = self::getClassNameAndLoadClassFile($classRef);
} else {
$class = $classRef;
}
......
}
// Check if class exists:
if (class_exists($class)) {
if (class_exists($class)) {
$classObj = t3lib_div::makeInstance($class);
// If persistent object should be created, set reference:
......
// holds references of singletons
static $instances = array();
// Check file-reference prefix; if found, require_once() the file (should be library of code)
if (strpos($className, ':') !== false) {
$className = self::getClassNameAndLoadClassFile($className);
}
// Get final classname
$className = self::getClassName($className);
......
}
/**
* Returns the class name and loads the file if the syntax is given by EXT:extkexy/path_to_file:classname
* class-extension API.
*
* @param string Definition of class with extkey, classfile and classname
* @return string Final class name to instantiate with "new [classname]"
*/
public function getClassNameAndLoadClassFile($className) {
list($file,$class) = t3lib_div::revExplode(':', $className, 2);
$requireFile = t3lib_div::getFileAbsFileName($file);
if ($requireFile) {
t3lib_div::requireOnce($requireFile);
}
return $class;
}
/**
* Find the best service and check if it works.
* Returns object of the service class.
*
    (1-1/1)