mirror of
https://github.com/YahnisElsts/plugin-update-checker.git
synced 2025-10-04 02:02:05 +08:00
Move code that prefixes the API class with the current namespace so that getCompatibleClassVersion() gets the unprefixed name.
Alternative fix for the problem described in #396.
This commit is contained in:
parent
4778dd3eb4
commit
4bd0a820d1
1 changed files with 4 additions and 3 deletions
|
@ -114,9 +114,6 @@ if ( !class_exists('Puc_v4p10_Factory', false) ):
|
|||
//Add the current namespace to the class name(s).
|
||||
if ( version_compare(PHP_VERSION, '5.3', '>=') ) {
|
||||
$checkerClass = __NAMESPACE__ . '\\' . $checkerClass;
|
||||
if ( isset($apiClass) ) {
|
||||
$apiClass = __NAMESPACE__ . '\\' . $apiClass;
|
||||
}
|
||||
}
|
||||
|
||||
if ( !isset($apiClass) ) {
|
||||
|
@ -134,6 +131,10 @@ if ( !class_exists('Puc_v4p10_Factory', false) ):
|
|||
return null;
|
||||
}
|
||||
|
||||
if ( version_compare(PHP_VERSION, '5.3', '>=') && (strpos($apiClass, '\\') === false) ) {
|
||||
$apiClass = __NAMESPACE__ . '\\' . $apiClass;
|
||||
}
|
||||
|
||||
return new $checkerClass(
|
||||
new $apiClass($metadataUrl),
|
||||
$id,
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue