mirror of
https://github.com/YahnisElsts/plugin-update-checker.git
synced 2025-10-04 00:47:33 +08:00
Replace defined('__NAMESPACE__') conditions with PHP version checks.
This commit is contained in:
parent
3119408761
commit
f478379ed7
2 changed files with 2 additions and 2 deletions
|
@ -12,7 +12,7 @@ if ( !class_exists('Puc_v4p11_Autoloader', false) ):
|
|||
public function __construct() {
|
||||
$this->rootDir = dirname(__FILE__) . '/';
|
||||
|
||||
if ( defined('__NAMESPACE__') && __NAMESPACE__ ) {
|
||||
if ( version_compare(PHP_VERSION, '5.3', '>=') && __NAMESPACE__ ) {
|
||||
$namespaceWithSlash = __NAMESPACE__ . '\\';
|
||||
} else {
|
||||
$namespaceWithSlash = '';
|
||||
|
|
|
@ -337,7 +337,7 @@ if ( !class_exists('Puc_v4p11_Factory', false) ):
|
|||
*/
|
||||
public static function addVersion($generalClass, $versionedClass, $version) {
|
||||
if ( empty(self::$myMajorVersion) ) {
|
||||
$className = (defined('__NAMESPACE__') && __NAMESPACE__)
|
||||
$className = (version_compare(PHP_VERSION, '5.3', '>=') && __NAMESPACE__)
|
||||
? substr(__CLASS__, strlen(__NAMESPACE__) + 1)
|
||||
: __CLASS__;
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue