Exemplo n.º 1
0
  function testIsAbsoluteTrue()
  {
    $this->assertTrue(Fs :: isAbsolute('/test'));

    if(Sys :: osType() == 'win32')
      $this->assertTrue(Fs :: isAbsolute('c:/test'));
  }
Exemplo n.º 2
0
  function _getFirstExistingPathIndex($path_elements, $separator)
  {
    for($i=count($path_elements); $i > 0; $i--)
    {
      $path = implode($separator, $path_elements);

      if(is_dir($path))
        return $i;

      array_pop($path_elements);
    }

    if(Fs :: isAbsolute($path))
      return false;
    else
      return 0;
  }