Processor.php 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354
  1. <?php
  2. /**
  3. * Processors read associated arrays and register
  4. * whatever is required
  5. *
  6. * @since 1.25
  7. */
  8. interface Processor {
  9. /**
  10. * Main entry point, processes the information
  11. * provided.
  12. * Callers should call "callback" after calling
  13. * this function.
  14. *
  15. * @param string $path Absolute path of JSON file
  16. * @param array $info
  17. * @param int $version manifest_version for info
  18. * @return array "credits" information to store
  19. */
  20. public function extractInfo( $path, array $info, $version );
  21. /**
  22. * @return array With following keys:
  23. * 'globals' - variables to be set to $GLOBALS
  24. * 'defines' - constants to define
  25. * 'callbacks' - functions to be executed by the registry
  26. * 'credits' - metadata to be stored by registry
  27. * 'attributes' - registration info which isn't a global variable
  28. */
  29. public function getExtractedInfo();
  30. /**
  31. * Get the requirements for the provided info
  32. *
  33. * @since 1.26
  34. * @param array $info
  35. * @return array Where keys are the name to have a constraint on,
  36. * like 'MediaWiki'. Values are a constraint string like "1.26.1".
  37. */
  38. public function getRequirements( array $info );
  39. /**
  40. * Get the path for additional autoloaders, e.g. the one of Composer.
  41. *
  42. * @param string $dir
  43. * @param array $info
  44. * @return array Containing the paths for autoloader file(s).
  45. * @since 1.27
  46. */
  47. public function getExtraAutoloaderPaths( $dir, array $info );
  48. }