Moving strip_plugin() to Router::stripPlugin(), and enabling reverse routes

git-svn-id: https://svn.cakephp.org/repo/branches/1.2.x.x@3854 3807eeeb-6ff5-0310-8944-8be069107fe0
This commit is contained in:
nate 2006-11-10 17:08:31 +00:00
parent 3ca4762d32
commit 6ba7032e68
4 changed files with 111 additions and 72 deletions

View file

@ -1199,12 +1199,11 @@
}
}
/**
* Counts the dimensions of an array
*
* @param array $array
* @return int The number of dimensions in $array
* @deprecated
* @see Set::countDim
*/
function countdim($array) {
trigger_error('Deprecated: Use Set::countDim instead', E_USER_WARNING);
if (is_array(reset($array))) {
$return = countdim(reset($array)) + 1;
} else {
@ -1299,24 +1298,4 @@
return false;
}
}
/**
* removed the plugin name from the base url
*
* @param string $base
* @param string $plugin
* @return base url with plugin name removed if present
*/
function strip_plugin($base, $plugin){
if ($plugin != null) {
$base = preg_replace('/' . $plugin . '/', '', $base);
$base = str_replace('//', '', $base);
$pos1 = strrpos($base, '/');
$char = strlen($base) - 1;
if ($pos1 == $char) {
$base = substr($base, 0, $char);
}
}
return $base;
}
?>