예제 #1
0
 /**
  * @dataProvider dataPaths
  */
 public function testIsRelative($path, $result)
 {
     if ($result['root'] === '') {
         $this->assertTrue(Path::isRelative($path));
     } else {
         $this->assertFalse(Path::isRelative($path));
     }
 }
예제 #2
0
 /**
  * Gets file path info.
  *
  * @param  string $file
  * @param  string $option
  * @return string|array
  */
 public function getPathInfo($file, $option = null)
 {
     $info = Path::parse($file);
     if ($info['protocol'] != 'file') {
         $info['url'] = $info['pathname'];
     }
     if ($adapter = $this->getAdapter($info['protocol'])) {
         $info = $adapter->getPathInfo($info);
     }
     if ($option === null) {
         return $info;
     }
     return array_key_exists($option, $info) ? $info[$option] : '';
 }