diff --git a/github-checker.php b/github-checker.php index 720c6311..efb70233 100644 --- a/github-checker.php +++ b/github-checker.php @@ -1,8 +1,8 @@ filename = $this->pluginFile; $info->slug = $this->slug; $info->sections = array(); @@ -375,7 +375,7 @@ protected function getFileHeader($content) { * Copy plugin metadata from a file header to a PluginInfo object. * * @param array $fileHeader - * @param PluginInfo_2_0 $pluginInfo + * @param PluginInfo_2_1 $pluginInfo */ protected function setInfoFromHeader($fileHeader, $pluginInfo) { $headerToPropertyMap = array( diff --git a/plugin-update-checker.php b/plugin-update-checker.php index 8f021040..08a06825 100644 --- a/plugin-update-checker.php +++ b/plugin-update-checker.php @@ -1,23 +1,23 @@ debugMode); + $pluginInfo = PluginInfo_2_1::fromJson($result['body'], $this->debugMode); $pluginInfo->filename = $this->pluginFile; $pluginInfo->slug = $this->slug; } else if ( $this->debugMode ) { @@ -256,7 +256,7 @@ public function requestUpdate(){ if ( $pluginInfo == null ){ return null; } - return PluginUpdate_2_0::fromPluginInfo($pluginInfo); + return PluginUpdate_2_1::fromPluginInfo($pluginInfo); } /** @@ -419,7 +419,7 @@ public function getUpdateState() { } if ( !empty($state) && isset($state->update) && is_object($state->update) ){ - $state->update = PluginUpdate_2_0::fromObject($state->update); + $state->update = PluginUpdate_2_1::fromObject($state->update); } return $state; } @@ -854,17 +854,17 @@ public function initDebugBarPanel() { endif; -if ( !class_exists('PluginInfo_2_0', false) ): +if ( !class_exists('PluginInfo_2_1', false) ): /** * A container class for holding and transforming various plugin metadata. * * @author Janis Elsts * @copyright 2015 - * @version 2.0 + * @version 2.1 * @access public */ -class PluginInfo_2_0 { +class PluginInfo_2_1 { //Most fields map directly to the contents of the plugin's info.json file. //See the relevant docs for a description of their meaning. public $name; @@ -985,17 +985,17 @@ public function toWpFormat(){ endif; -if ( !class_exists('PluginUpdate_2_0', false) ): +if ( !class_exists('PluginUpdate_2_1', false) ): /** * A simple container class for holding information about an available update. * * @author Janis Elsts * @copyright 2015 - * @version 2.0 + * @version 2.1 * @access public */ -class PluginUpdate_2_0 { +class PluginUpdate_2_1 { public $id = 0; public $slug; public $version; @@ -1017,7 +1017,7 @@ public static function fromJson($json, $triggerErrors = false){ //Since update-related information is simply a subset of the full plugin info, //we can parse the update JSON as if it was a plugin info string, then copy over //the parts that we care about. - $pluginInfo = PluginInfo_2_0::fromJson($json, $triggerErrors); + $pluginInfo = PluginInfo_2_1::fromJson($json, $triggerErrors); if ( $pluginInfo != null ) { return self::fromPluginInfo($pluginInfo); } else { @@ -1193,23 +1193,23 @@ public static function addVersion($generalClass, $versionedClass, $version) { require_once(dirname(__FILE__) . '/github-checker.php'); //Register classes defined in this file with the factory. -PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_2_0', '2.0'); -PucFactory::addVersion('PluginUpdate', 'PluginUpdate_2_0', '2.0'); -PucFactory::addVersion('PluginInfo', 'PluginInfo_2_0', '2.0'); -PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_2_0', '2.0'); +PucFactory::addVersion('PluginUpdateChecker', 'PluginUpdateChecker_2_1', '2.1'); +PucFactory::addVersion('PluginUpdate', 'PluginUpdate_2_1', '2.1'); +PucFactory::addVersion('PluginInfo', 'PluginInfo_2_1', '2.1'); +PucFactory::addVersion('PucGitHubChecker', 'PucGitHubChecker_2_1', '2.1'); /** * Create non-versioned variants of the update checker classes. This allows for backwards * compatibility with versions that did not use a factory, and it simplifies doc-comments. */ if ( !class_exists('PluginUpdateChecker', false) ) { - class PluginUpdateChecker extends PluginUpdateChecker_2_0 { } + class PluginUpdateChecker extends PluginUpdateChecker_2_1 { } } if ( !class_exists('PluginUpdate', false) ) { - class PluginUpdate extends PluginUpdate_2_0 {} + class PluginUpdate extends PluginUpdate_2_1 {} } if ( !class_exists('PluginInfo', false) ) { - class PluginInfo extends PluginInfo_2_0 {} + class PluginInfo extends PluginInfo_2_1 {} }