class DrupalExtensionUnderscoreFinderPlugin in X Autoload 7.4
Same name and namespace in other branches
- 7.5 src/ClassFinder/Plugin/DrupalExtensionUnderscoreFinderPlugin.php \Drupal\xautoload\ClassFinder\Plugin\DrupalExtensionUnderscoreFinderPlugin
Hierarchy
- class \Drupal\xautoload\ClassFinder\Plugin\DrupalExtensionNamespaceFinderPlugin implements FinderPluginInterface
- class \Drupal\xautoload\ClassFinder\Plugin\DrupalExtensionUnderscoreFinderPlugin
Expanded class hierarchy of DrupalExtensionUnderscoreFinderPlugin
1 file declares its use of DrupalExtensionUnderscoreFinderPlugin
- DrupalExtensionAdapter.php in lib/
Adapter/ DrupalExtensionAdapter.php
File
- lib/
ClassFinder/ Plugin/ DrupalExtensionUnderscoreFinderPlugin.php, line 5
Namespace
Drupal\xautoload\ClassFinder\PluginView source
class DrupalExtensionUnderscoreFinderPlugin extends DrupalExtensionNamespaceFinderPlugin {
/**
* {@inheritdoc}
*/
function findFile($api, $logical_base_path, $relative_path, $extension_name = NULL) {
$extension_file = $this->system
->drupalGetFilename($this->type, $extension_name);
if (empty($extension_file)) {
// Extension does not exist, or is not installed.
return FALSE;
}
$nspath = 'Drupal/' . $extension_name . '/';
$testpath = $nspath . 'Tests/';
$uspath = $extension_name . '/';
$lib = dirname($extension_file) . '/lib/';
$lib_psr0 = $lib . 'Drupal/' . $extension_name . '/';
// Try PEAR-Flat.
if ($api
->guessPath($lib . $relative_path)) {
// Register PEAR-Flat.
$this->prefixMap
->registerDeepPath($uspath, $lib, $this->defaultBehavior);
// Unregister the lazy plugins.
$this->namespaceMap
->unregisterDeepPath($nspath, $extension_name);
$this->prefixMap
->unregisterDeepPath($uspath, $extension_name);
// See if there are PSR-0 or PSR-4 test classes.
if (is_dir($lib_psr0 . 'Tests/')) {
$this->namespaceMap
->registerDeepPath($testpath, $lib_psr0 . 'Tests/', $this->psr0Behavior);
}
if (is_dir($lib . 'Tests/')) {
$this->namespaceMap
->registerDeepPath($testpath, $lib . 'Tests/', $this->defaultBehavior);
}
// The class was found, so return TRUE.
return TRUE;
}
}
}
Members
Name![]() |
Modifiers | Type | Description | Overrides |
---|---|---|---|---|
DrupalExtensionNamespaceFinderPlugin:: |
protected | property | ||
DrupalExtensionNamespaceFinderPlugin:: |
protected | property | ||
DrupalExtensionNamespaceFinderPlugin:: |
protected | property | ||
DrupalExtensionNamespaceFinderPlugin:: |
protected | property | ||
DrupalExtensionNamespaceFinderPlugin:: |
protected | property | ||
DrupalExtensionNamespaceFinderPlugin:: |
protected | property | E.g. 'theme' or 'module'. | |
DrupalExtensionNamespaceFinderPlugin:: |
function | |||
DrupalExtensionUnderscoreFinderPlugin:: |
function |
Find the file for a class that in PSR-0 or PEAR would be in
$psr_0_root . '/' . $path_fragment . $path_suffix Overrides DrupalExtensionNamespaceFinderPlugin:: |