diff --git a/Puc/v4/Factory.php b/Puc/v4/Factory.php index e9486be3..71f2de43 100644 --- a/Puc/v4/Factory.php +++ b/Puc/v4/Factory.php @@ -1,6 +1,6 @@ 'Puc_v4p8_Plugin_UpdateChecker', - 'Theme_UpdateChecker' => 'Puc_v4p8_Theme_UpdateChecker', - - 'Vcs_PluginUpdateChecker' => 'Puc_v4p8_Vcs_PluginUpdateChecker', - 'Vcs_ThemeUpdateChecker' => 'Puc_v4p8_Vcs_ThemeUpdateChecker', - - 'GitHubApi' => 'Puc_v4p8_Vcs_GitHubApi', - 'BitBucketApi' => 'Puc_v4p8_Vcs_BitBucketApi', - 'GitLabApi' => 'Puc_v4p8_Vcs_GitLabApi', - ) - as $pucGeneralClass => $pucVersionedClass -) { - Puc_v4_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.8'); - //Also add it to the minor-version factory in case the major-version factory - //was already defined by another, older version of the update checker. - Puc_v4p8_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.8'); -} \ No newline at end of file +endif; \ No newline at end of file diff --git a/composer.json b/composer.json index d890d942..06b5ab03 100644 --- a/composer.json +++ b/composer.json @@ -17,6 +17,7 @@ "php": ">=5.2.0" }, "autoload": { + "files": ["load-v4p8.php"], "psr-0": { "Puc_v4p8_" : "", "Puc_v4_" : "", diff --git a/load-v4p8.php b/load-v4p8.php new file mode 100644 index 00000000..175614f0 --- /dev/null +++ b/load-v4p8.php @@ -0,0 +1,28 @@ + 'Puc_v4p8_Plugin_UpdateChecker', + 'Theme_UpdateChecker' => 'Puc_v4p8_Theme_UpdateChecker', + + 'Vcs_PluginUpdateChecker' => 'Puc_v4p8_Vcs_PluginUpdateChecker', + 'Vcs_ThemeUpdateChecker' => 'Puc_v4p8_Vcs_ThemeUpdateChecker', + + 'GitHubApi' => 'Puc_v4p8_Vcs_GitHubApi', + 'BitBucketApi' => 'Puc_v4p8_Vcs_BitBucketApi', + 'GitLabApi' => 'Puc_v4p8_Vcs_GitLabApi', + ) + as $pucGeneralClass => $pucVersionedClass +) { + Puc_v4_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.8'); + //Also add it to the minor-version factory in case the major-version factory + //was already defined by another, older version of the update checker. + Puc_v4p8_Factory::addVersion($pucGeneralClass, $pucVersionedClass, '4.8'); +} + diff --git a/plugin-update-checker.php b/plugin-update-checker.php index 2d6ab859..624a01be 100644 --- a/plugin-update-checker.php +++ b/plugin-update-checker.php @@ -7,8 +7,4 @@ * Released under the MIT license. See license.txt for details. */ -require dirname(__FILE__) . '/Puc/v4p8/Autoloader.php'; -new Puc_v4p8_Autoloader(); - -require dirname(__FILE__) . '/Puc/v4p8/Factory.php'; -require dirname(__FILE__) . '/Puc/v4/Factory.php'; +require dirname(__FILE__) . '/load-v4p8.php'; \ No newline at end of file