菜谱项目

PhpFileDumper.php 848B

123456789101112131415161718192021222324252627282930313233343536373839
  1. <?php
  2. /*
  3. * This file is part of the Symfony package.
  4. *
  5. * (c) Fabien Potencier <fabien@symfony.com>
  6. *
  7. * For the full copyright and license information, please view the LICENSE
  8. * file that was distributed with this source code.
  9. */
  10. namespace Symfony\Component\Translation\Dumper;
  11. use Symfony\Component\Translation\MessageCatalogue;
  12. /**
  13. * PhpFileDumper generates PHP files from a message catalogue.
  14. *
  15. * @author Michel Salib <michelsalib@hotmail.com>
  16. */
  17. class PhpFileDumper extends FileDumper
  18. {
  19. /**
  20. * {@inheritdoc}
  21. */
  22. public function formatCatalogue(MessageCatalogue $messages, $domain, array $options = array())
  23. {
  24. return "<?php\n\nreturn ".var_export($messages->all($domain), true).";\n";
  25. }
  26. /**
  27. * {@inheritdoc}
  28. */
  29. protected function getExtension()
  30. {
  31. return 'php';
  32. }
  33. }