Inheritance: extends Symfony\Component\Config\Loader\Loader
 /**
  * Tests loading a file with too many nesting levels.
  *
  * @expectedException \OutOfBoundsException
  */
 public function testTooManyLevels()
 {
     $loader = new XliffFileLoader($this->getRootDir() . '/app', false);
     $loader->load($this->getRootDir() . '/vendor/contao/test-bundle/Resources/contao/languages/en/error.xlf', 'en');
 }
Example #2
0
 /**
  * Convert an .xlf file into a PHP language file
  *
  * @param string  $strName     The name of the .xlf file
  * @param string  $strLanguage The language code
  * @param boolean $blnLoad     Add the labels to the global language array
  *
  * @return string The PHP code
  *
  * @deprecated Deprecated since Contao 4.0, to be removed in Contao 5.0.
  *             Use the Contao\CoreBundle\Config\Loader\XliffFileLoader instead.
  */
 public static function convertXlfToPhp($strName, $strLanguage, $blnLoad = false)
 {
     @trigger_error('Using System::convertXlfToPhp() has been deprecated and will no longer work in Contao 5.0. Use the Contao\\CoreBundle\\Config\\Loader\\XliffFileLoader instead.', E_USER_DEPRECATED);
     // Convert to absolute path
     if (strpos($strName, TL_ROOT . '/') === false) {
         $strName = TL_ROOT . '/' . $strName;
     }
     $loader = new XliffFileLoader(static::getContainer()->getParameter('kernel.root_dir'), $blnLoad);
     return $loader->load($strName, $strLanguage);
 }