protected function xautoload_InjectedAPI_hookXautoload::processDir in X Autoload 7.4
Same name and namespace in other branches
- 7.5 legacy/lib/InjectedAPI/hookXautoload.php \xautoload_InjectedAPI_hookXautoload::processDir()
- 7.2 lib/InjectedAPI/hookXautoload.php \xautoload_InjectedAPI_hookXautoload::processDir()
- 7.3 lib/InjectedAPI/hookXautoload.php \xautoload_InjectedAPI_hookXautoload::processDir()
Process a given directory to make it relative to Drupal root, instead of relative to the current extension dir.
Parameters
string $dir: The directory path that we want to make absolute.
boolean $relative: If TRUE, the $dir will be transformed from relative to absolute. If FALSE, the $dir is assumed to already be absolute, and remain unchanged.
Return value
string The modified (absolute) directory path.
4 calls to xautoload_InjectedAPI_hookXautoload::processDir()
- xautoload_InjectedAPI_hookXautoload::namespaceDeep in legacy/
lib/ InjectedAPI/ hookXautoload.php - Register an additional namespace for this module. Note: Drupal\<module name>\ is already registered for <module dir>/lib.
- xautoload_InjectedAPI_hookXautoload::namespaceRoot in legacy/
lib/ InjectedAPI/ hookXautoload.php - Register an additional namespace for this module. Note: Drupal\<module name>\ is already registered for <module dir>/lib.
- xautoload_InjectedAPI_hookXautoload::prefixDeep in legacy/
lib/ InjectedAPI/ hookXautoload.php - Register an additional namespace for this module. Note: Drupal\<module name>\ is already registered for <module dir>/lib.
- xautoload_InjectedAPI_hookXautoload::prefixRoot in legacy/
lib/ InjectedAPI/ hookXautoload.php - Register an additional prefix for this module. Note: Drupal\<module name>\ is already registered for <module dir>/lib.
File
- legacy/
lib/ InjectedAPI/ hookXautoload.php, line 214
Class
- xautoload_InjectedAPI_hookXautoload
- An instance of this class is passed around to implementations of hook_xautoload(). It acts as a wrapper around the ClassFinder, to register stuff.
Code
protected function processDir($dir, $relative) {
if (!isset($dir)) {
return $this->localDirectory . 'lib/';
}
$dir = strlen($dir) ? rtrim($dir, '/') . '/' : '';
return $relative ? $this->localDirectory . $dir : $dir;
}