Update.php 710 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. if ( !class_exists('Puc_v4p11_Update', false) ):
  3. /**
  4. * A simple container class for holding information about an available update.
  5. *
  6. * @author Janis Elsts
  7. * @access public
  8. */
  9. abstract class Puc_v4p11_Update extends Puc_v4p11_Metadata {
  10. public $slug;
  11. public $version;
  12. public $download_url;
  13. public $translations = array();
  14. /**
  15. * @return string[]
  16. */
  17. protected function getFieldNames() {
  18. return array('slug', 'version', 'download_url', 'translations');
  19. }
  20. public function toWpFormat() {
  21. $update = new stdClass();
  22. $update->slug = $this->slug;
  23. $update->new_version = $this->version;
  24. $update->package = $this->download_url;
  25. return $update;
  26. }
  27. }
  28. endif;