load-v5p0.php 1.1 KB

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace YahnisElsts\PluginUpdateChecker\v5p0;
  3. use YahnisElsts\PluginUpdateChecker\v5\PucFactory as MajorFactory;
  4. use YahnisElsts\PluginUpdateChecker\v5p0\PucFactory as MinorFactory;
  5. require __DIR__ . '/Puc/v5p0/Autoloader.php';
  6. new Autoloader();
  7. require __DIR__ . '/Puc/v5p0/PucFactory.php';
  8. require __DIR__ . '/Puc/v5/PucFactory.php';
  9. //Register classes defined in this version with the factory.
  10. foreach (
  11. array(
  12. 'Plugin\\UpdateChecker' => Plugin\UpdateChecker::class,
  13. 'Theme\\UpdateChecker' => Theme\UpdateChecker::class,
  14. 'Vcs\\PluginUpdateChecker' => Vcs\PluginUpdateChecker::class,
  15. 'Vcs\\ThemeUpdateChecker' => Vcs\ThemeUpdateChecker::class,
  16. 'GitHubApi' => Vcs\GitHubApi::class,
  17. 'BitBucketApi' => Vcs\BitBucketApi::class,
  18. 'GitLabApi' => Vcs\GitLabApi::class,
  19. )
  20. as $pucGeneralClass => $pucVersionedClass
  21. ) {
  22. MajorFactory::addVersion($pucGeneralClass, $pucVersionedClass, '5.0');
  23. //Also add it to the minor-version factory in case the major-version factory
  24. //was already defined by another, older version of the update checker.
  25. MinorFactory::addVersion($pucGeneralClass, $pucVersionedClass, '5.0');
  26. }