ini.php 685 B

12345678910111213141516171819202122232425262728293031323334
  1. <?php
  2. namespace Fuel\Core;
  3. /**
  4. * INI Lang file parser
  5. */
  6. class Lang_Ini extends \Lang_File
  7. {
  8. protected $ext = '.ini';
  9. /**
  10. * Loads in the given file and parses it.
  11. *
  12. * @param string $file File to load
  13. * @return array
  14. */
  15. protected function load_file($file)
  16. {
  17. $contents = $this->parse_vars(file_get_contents($file));
  18. return parse_ini_string($contents, true);
  19. }
  20. /**
  21. * Returns the formatted language file contents.
  22. *
  23. * @param array $content language array
  24. * @return string formatted language file contents
  25. */
  26. protected function export_format($contents)
  27. {
  28. throw new \LangException('Saving lang to ini is not supported at this time');
  29. }
  30. }