Advertisement
Guest User

Untitled

a guest
Oct 27th, 2016
46
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.68 KB | None | 0 0
  1. <?php
  2.  
  3. interface ClientResourceLocator
  4. {
  5. /*
  6. * Return the URL for accessing the given resource over the web
  7. *
  8. * @param string $package The full composer package name
  9. * @param string $filename The name of the resource within that package
  10. * @return string A URL. If the URL is on the same domain as the site, it may be a root-relative URL. Otherwise it will be a protocol-agnostic URL.
  11. * @throws ResourceNotAvailableException If the resource does not exist or is not accessible via the client
  12. */
  13. public function getResourceURL($package, $filename);
  14.  
  15. /*
  16. * Returns true if the given resource is available to the client
  17. *
  18. * @param string $package The full composer package name
  19. * @param string $filename The name of the resource within that package
  20. * @return boolean
  21. */
  22. public function hasClientResource($package, $filename);
  23. }
  24.  
  25. interface ServerResourceLocator
  26. {
  27. /*
  28. * Return the URL for accessing the given resource over the web
  29. *
  30. * @param string $package The full composer package name
  31. * @param string $filename The name of the resource within that package
  32. * @return string The absolute pathname of the files
  33. * @throws ResourceNotAvailableException If the resource does not exist or is private to the module
  34. */
  35. public function getResourceFilename($package, $filename);
  36.  
  37. /*
  38. * Returns true if the given resource is available to the server
  39. *
  40. * @param string $package The full composer package name
  41. * @param string $filename The name of the resource within that package
  42. * @return boolean
  43. */
  44. public function hasResource($package, $filename);
  45. }
  46.  
  47. class ResourceNotAvailableException extends LogicException
  48. {
  49. }
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement