Well, I am convinced.
The solution to my problem is iteration get_ini('include_path')for each included $fileName, conversion to absolute paths and process, respectively. Actually minimal changes in my regular class. The cool bootloader will not require any changes.
Thanks for your quick answers!
The following are the relevant updated methods from my includeer class: ($ this-> includePath is initialized by get_ini ('include_path'))
public function mayIncludeFile($fileName)
{
if(array_key_exists($fileName, $this->includeMap))
{
return TRUE;
}
if($fileName{0} == DIRECTORY_SEPARATOR)
{
if(is_file($fileName))
{
$this->includeMap[$fileName] = $fileName;
return TRUE;
}
}
else foreach($this->includePath as $index => $path)
{
$absoluteFileName = $path . DIRECTORY_SEPARATOR . $fileName;
if(is_file($absoluteFileName))
{
$this->includeMap[$fileName] = $absoluteFileName;
return TRUE;
}
}
return FALSE;
}
public function includeFile($fileName)
{
$this->validateFileName($fileName, TRUE);
if((array_key_exists($fileName, $this->includeMap) && $this->includeMap[$fileName]) ||
$this->mayIncludeFile($fileName))
{
include_once($this->includeMap[$fileName]);
}
}
source
share