private function instantiateExtension($locator)
{
if (class_exists($class = $locator)) {
return new $class();
}
if (class_exists($class = $this->getFullExtensionClass($locator))) {
return new $class();
}
if (file_exists($locator)) {
return require $locator;
}
if (file_exists($path = $this->extensionsPath . DIRECTORY_SEPARATOR . $locator)) {
return require $path;
}
throw new ExtensionInitializationException(sprintf('`%s` extension file or class could not be located.', $locator), $locator);
}