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

コード例 #1
0
ファイル: UtilsTest.php プロジェクト: maximebf/consolekit
 public function testJoin()
 {
     $path = "foo" . DIRECTORY_SEPARATOR . "bar";
     $this->assertEquals($path, Utils::join('foo', 'bar'));
 }