예제 #1
0
파일: Php.php 프로젝트: elkuku/g11n
 /**
  * Constructor.
  *
  * @param   string  $type  The input type
  *
  * @throws G11nException
  */
 public function __construct($type)
 {
     parent::__construct($type);
     self::$cacheDir = ExtensionHelper::getCacheDir() . '/' . ExtensionHelper::$langDirName;
 }
예제 #2
0
 /**
  * Test method.
  *
  * @return void
  */
 public function testSetCacheDir()
 {
     ExtensionHelper::setCacheDir(TEST_ROOT . '/tests/cache');
     $this->assertThat(ExtensionHelper::getCacheDir(), $this->equalTo(TEST_ROOT . '/tests/cache/g11n'));
 }
예제 #3
0
파일: Storage.php 프로젝트: elkuku/g11n
 /**
  * Get the path of a storage file.
  *
  * @param   string  $lang       Language tag e.g. en-GB.
  * @param   string  $extension  Extension name e.g. com_component.
  * @param   string  $domain     The domain name.
  *
  * @return string
  */
 protected function getPath($lang, $extension, $domain)
 {
     $parts = ExtensionHelper::split($extension, '.');
     $dirName = 1 == count($parts) ? $extension : $parts[0];
     return ExtensionHelper::getCacheDir() . '/' . $domain . '/' . $dirName . '/' . $lang . '.' . $extension;
 }