TranslationsStreamWrapper.php 613 B

123456789101112131415161718192021222324252627
  1. <?php
  2. /**
  3. * @file
  4. * Definition of TranslationStreamWrapper.
  5. */
  6. /**
  7. * A Drupal interface translations (translations://) stream wrapper class.
  8. *
  9. * Supports storing translation files.
  10. */
  11. class TranslationsStreamWrapper extends DrupalLocalStreamWrapper {
  12. /**
  13. * Implements abstract public function getDirectoryPath()
  14. */
  15. public function getDirectoryPath() {
  16. return variable_get('l10n_update_download_store', L10N_UPDATE_DEFAULT_TRANSLATION_PATH);
  17. }
  18. /**
  19. * Overrides getExternalUrl().
  20. */
  21. function getExternalUrl() {
  22. throw new Exception('PO files URL should not be public.');
  23. }
  24. }