ConsoleKit\Utils::join PHP Method

join() public static method

Joins paths together
public static join ( string $path1, string $path2 ) : string
$path1 string
$path2 string
return string
    public static function join($path1, $path2)
    {
        $ds = DIRECTORY_SEPARATOR;
        return str_replace("{$ds}{$ds}", $ds, implode($ds, array_filter(func_get_args())));
    }

Usage Example

Esempio n. 1
0
 public function testJoin()
 {
     $path = "foo" . DIRECTORY_SEPARATOR . "bar";
     $this->assertEquals($path, Utils::join('foo', 'bar'));
 }