Skip to content

Commit

Permalink
Moving file_path function with file utilities
Browse files Browse the repository at this point in the history
  • Loading branch information
Fabrice Luraine committed May 28, 2009
1 parent f25a774 commit cb5748c
Showing 1 changed file with 17 additions and 17 deletions.
34 changes: 17 additions & 17 deletions lib/limonade.php
Expand Up @@ -1432,23 +1432,6 @@ function require_once_dir($path, $pattern = "*.php")
return $filenames;
}

/**
* Create a file path by concatenation of given arguments
*
* @param string $path, ...
* @return string normalized path
*/
function file_path($path)
{
$args = func_get_args();
$ds = DIRECTORY_SEPARATOR;
$n_path = count($args) > 1 ? implode($ds, $args) : $path;
$n_path = preg_replace( '/'.preg_quote($ds, $ds).'{2,}'.'/',
$ds,
$n_path);
return $n_path;
}

/**
* Converting an array to an XML document
* Pass in a multi dimensional array and this recrusively loops through and builds up an XML document.
Expand Down Expand Up @@ -1889,6 +1872,23 @@ function file_read_chunked($filename, $retbytes = true)
return $status;
}

/**
* Create a file path by concatenation of given arguments
*
* @param string $path, ...
* @return string normalized path
*/
function file_path($path)
{
$args = func_get_args();
$ds = DIRECTORY_SEPARATOR;
$n_path = count($args) > 1 ? implode($ds, $args) : $path;
$n_path = preg_replace( '/'.preg_quote($ds, $ds).'{2,}'.'/',
$ds,
$n_path);
return $n_path;
}

/**
* Returns file extension or false if none
*
Expand Down

0 comments on commit cb5748c

Please sign in to comment.