mirror of
https://github.com/YahnisElsts/plugin-update-checker.git
synced 2025-10-04 02:02:05 +08:00
Rename Puc_v4_Factory to Puc_v4p3_Factory
This should fix the fatal error that happens when running PUC 4.3 together with an older 4.x release while Debug Bar is active. See #152
This commit is contained in:
parent
22fd23a32b
commit
150d3d8165
4 changed files with 18 additions and 18 deletions
|
@ -90,11 +90,11 @@ if ( !class_exists('Puc_v4p3_DebugBar_Extension', false) ):
|
|||
$absolutePath = realpath(dirname(__FILE__) . '/../../../' . ltrim($filePath, '/'));
|
||||
|
||||
//Where is the library located inside the WordPress directory structure?
|
||||
$absolutePath = Puc_v4_Factory::normalizePath($absolutePath);
|
||||
$absolutePath = Puc_v4p3_Factory::normalizePath($absolutePath);
|
||||
|
||||
$pluginDir = Puc_v4_Factory::normalizePath(WP_PLUGIN_DIR);
|
||||
$muPluginDir = Puc_v4_Factory::normalizePath(WPMU_PLUGIN_DIR);
|
||||
$themeDir = Puc_v4_Factory::normalizePath(get_theme_root());
|
||||
$pluginDir = Puc_v4p3_Factory::normalizePath(WP_PLUGIN_DIR);
|
||||
$muPluginDir = Puc_v4p3_Factory::normalizePath(WPMU_PLUGIN_DIR);
|
||||
$themeDir = Puc_v4p3_Factory::normalizePath(get_theme_root());
|
||||
|
||||
if ( (strpos($absolutePath, $pluginDir) === 0) || (strpos($absolutePath, $muPluginDir) === 0) ) {
|
||||
//It's part of a plugin.
|
||||
|
|
|
@ -1,5 +1,5 @@
|
|||
<?php
|
||||
if ( !class_exists('Puc_v4_Factory', false) ):
|
||||
if ( !class_exists('Puc_v4p3_Factory', false) ):
|
||||
|
||||
/**
|
||||
* A factory that builds update checker instances.
|
||||
|
@ -11,7 +11,7 @@ if ( !class_exists('Puc_v4_Factory', false) ):
|
|||
* At the moment it can only build instances of the UpdateChecker class. Other classes are
|
||||
* intended mainly for internal use and refer directly to specific implementations.
|
||||
*/
|
||||
class Puc_v4_Factory {
|
||||
class Puc_v4p3_Factory {
|
||||
protected static $classVersions = array();
|
||||
protected static $sorted = false;
|
||||
|
|
@ -61,7 +61,7 @@ Getting Started
|
|||
|
||||
```php
|
||||
require 'path/to/plugin-update-checker/plugin-update-checker.php';
|
||||
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
|
||||
$myUpdateChecker = Puc_v4p3_Factory::buildUpdateChecker(
|
||||
'http://example.com/path/to/details.json',
|
||||
__FILE__,
|
||||
'unique-plugin-or-theme-slug'
|
||||
|
@ -93,7 +93,7 @@ By default, the library will check the specified URL for changes every 12 hours.
|
|||
|
||||
```php
|
||||
require 'plugin-update-checker/plugin-update-checker.php';
|
||||
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
|
||||
$myUpdateChecker = Puc_v4p3_Factory::buildUpdateChecker(
|
||||
'https://github.com/user-name/repo-name/',
|
||||
__FILE__,
|
||||
'unique-plugin-or-theme-slug'
|
||||
|
@ -167,7 +167,7 @@ The library will pull update details from the following parts of a release/tag/b
|
|||
|
||||
```php
|
||||
require 'plugin-update-checker/plugin-update-checker.php';
|
||||
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
|
||||
$myUpdateChecker = Puc_v4p3_Factory::buildUpdateChecker(
|
||||
'https://bitbucket.org/user-name/repo-name',
|
||||
__FILE__,
|
||||
'unique-plugin-or-theme-slug'
|
||||
|
@ -223,7 +223,7 @@ BitBucket doesn't have an equivalent to GitHub's releases, so the process is sli
|
|||
|
||||
```php
|
||||
require 'plugin-update-checker/plugin-update-checker.php';
|
||||
$myUpdateChecker = Puc_v4_Factory::buildUpdateChecker(
|
||||
$myUpdateChecker = Puc_v4p3_Factory::buildUpdateChecker(
|
||||
'https://gitlab.com/user-name/repo-name/',
|
||||
__FILE__,
|
||||
'unique-plugin-or-theme-slug'
|
||||
|
|
|
@ -7,17 +7,17 @@
|
|||
* Released under the MIT license. See license.txt for details.
|
||||
*/
|
||||
|
||||
require dirname(__FILE__) . '/Puc/v4/Factory.php';
|
||||
require dirname(__FILE__) . '/Puc/v4p3/Factory.php';
|
||||
require dirname(__FILE__) . '/Puc/v4p3/Autoloader.php';
|
||||
new Puc_v4p3_Autoloader();
|
||||
|
||||
//Register classes defined in this file with the factory.
|
||||
Puc_v4_Factory::addVersion('Plugin_UpdateChecker', 'Puc_v4p3_Plugin_UpdateChecker', '4.3');
|
||||
Puc_v4_Factory::addVersion('Theme_UpdateChecker', 'Puc_v4p3_Theme_UpdateChecker', '4.3');
|
||||
Puc_v4p3_Factory::addVersion('Plugin_UpdateChecker', 'Puc_v4p3_Plugin_UpdateChecker', '4.3');
|
||||
Puc_v4p3_Factory::addVersion('Theme_UpdateChecker', 'Puc_v4p3_Theme_UpdateChecker', '4.3');
|
||||
|
||||
Puc_v4_Factory::addVersion('Vcs_PluginUpdateChecker', 'Puc_v4p3_Vcs_PluginUpdateChecker', '4.3');
|
||||
Puc_v4_Factory::addVersion('Vcs_ThemeUpdateChecker', 'Puc_v4p3_Vcs_ThemeUpdateChecker', '4.3');
|
||||
Puc_v4p3_Factory::addVersion('Vcs_PluginUpdateChecker', 'Puc_v4p3_Vcs_PluginUpdateChecker', '4.3');
|
||||
Puc_v4p3_Factory::addVersion('Vcs_ThemeUpdateChecker', 'Puc_v4p3_Vcs_ThemeUpdateChecker', '4.3');
|
||||
|
||||
Puc_v4_Factory::addVersion('GitHubApi', 'Puc_v4p3_Vcs_GitHubApi', '4.3');
|
||||
Puc_v4_Factory::addVersion('BitBucketApi', 'Puc_v4p3_Vcs_BitBucketApi', '4.3');
|
||||
Puc_v4_Factory::addVersion('GitLabApi', 'Puc_v4p3_Vcs_GitLabApi', '4.3');
|
||||
Puc_v4p3_Factory::addVersion('GitHubApi', 'Puc_v4p3_Vcs_GitHubApi', '4.3');
|
||||
Puc_v4p3_Factory::addVersion('BitBucketApi', 'Puc_v4p3_Vcs_BitBucketApi', '4.3');
|
||||
Puc_v4p3_Factory::addVersion('GitLabApi', 'Puc_v4p3_Vcs_GitLabApi', '4.3');
|
Loading…
Add table
Add a link
Reference in a new issue