public function swapDirectoryFilter($path_or_url, $directory)
    {

        $path = $this->decomposeUrl($path_or_url);
        $path_parts = pathinfo($path['path']);
        $new_path = $directory . DIRECTORY_SEPARATOR . $path_parts['basename'];

        $output = $path['prefix'] . $new_path . $path['suffix'];
        return $output;
    }
public function swapDirectoryFilter($path_or_url, $directory)
    {

        $path = $this->decomposeUrl($path_or_url);
        $path_parts = pathinfo($path['path']);
        $new_path = $directory . DIRECTORY_SEPARATOR . $path_parts['basename'];

        $output = $path['prefix'] . $new_path . $path['suffix'];
        return $output;
    }
public function swapDirectoryFilter ( $ path_or_url , $ directory ) { $ path = $ this -> decomposeUrl ( $ path_or_url ) ; $ path_parts = pathinfo ( $ path [ 'path' ] ) ; $ new_path = $ directory . DIRECTORY_SEPARATOR . $ path_parts [ 'basename' ] ; $ output = $ path [ 'prefix' ] . $ new_path . $ path [ 'suffix' ] ; return $ output ; }
Swap the file directory on a passed url or path

@param $path_or_url
@param $directory
@return string
Swap the file directory on a passed url or path