예제 #1
0
 /**
  * Test method.
  *
  * @return void
  */
 public function testDottedExtensionPath()
 {
     $this->assertThat(ExtensionHelper::getExtensionPath('foo.bar'), $this->equalTo('foo'));
 }
예제 #2
0
파일: Storage.php 프로젝트: elkuku/g11n
 /**
  * Get the language template path.
  *
  * @param   string  $extension  Extension name.
  * @param   string  $scope      Extension scope
  *
  * @return string
  */
 public static function getTemplatePath($extension, $scope)
 {
     static $templates = array();
     if (array_key_exists($extension, $templates) && array_key_exists($scope, $templates[$extension])) {
         return $templates[$extension][$scope];
     }
     $base = ExtensionHelper::getDomainPath($scope);
     $fileName = $extension . '.pot';
     $extensionDir = ExtensionHelper::getExtensionPath($extension);
     return "{$base}/{$extensionDir}/" . ExtensionHelper::$langDirName . "/templates/{$fileName}";
 }