Example #1
0
 protected function findExtensionPath($namespace)
 {
     foreach ($this->namespaces as $baseNamespace => $basePathList) {
         if (\UString::isStartWith($namespace, $baseNamespace)) {
             \UArray::doConvertToArray($basePathList);
             foreach ($basePathList as $basePath) {
                 \UString::doEndWith($basePath, DIRECTORY_SEPARATOR);
                 \UString::doNotStartWith($namespace, $baseNamespace);
                 \UString::doNotStartWith($namespace, '\\');
                 $path = str_replace('\\', DIRECTORY_SEPARATOR, $namespace);
                 $path = $basePath . $path;
                 if (is_dir($path)) {
                     return $path;
                 }
             }
         }
     }
 }
Example #2
0
 public function test_do_end_with__match()
 {
     $assertion = 'http://www.example.com/';
     \UString::doEndWith($assertion, '/');
     $this->assertEquals('http://www.example.com/', $assertion);
 }