Removed unused function

This function was moved in DeltaCMS\Route\Router
This commit is contained in:
Florian Bouillon 2019-05-07 14:32:45 +02:00
parent d0af5fda5f
commit 67eb20dd1c
No known key found for this signature in database
GPG Key ID: B143FF27EF555D16

View File

@ -7,47 +7,6 @@ function startsWith($haystack, $needle)
return (substr($haystack, 0, $length) === $needle);
}
/**
* @param string $uri
* @param string $slug
* @param object $options options->regex &| options->setting
*
* @return bool|stdClass
*/
function slugEqualToURI($slug, $uri, $options)
{
$uri = explode("/", trim($uri, "\/"));
$slug = explode("/", trim($slug, '\/'));
$return = new stdClass();
if (count($uri) != count($slug)) {
return false;
}
foreach ($slug as $key => $value) {
if (preg_match("/{.+}/", $value)) {
$elemnt = preg_replace("/{|}/", "", $value);
if (!isset($options->$elemnt)) {
$return->$elemnt = explode("?", $uri[$key])[0];
continue;
}
$elOptions = $options->$elemnt;
if (!isset($elOptions->regex) || ($elOptions->regex != null && preg_match($elOptions->regex, $uri[$key]))) {
$return->$elemnt = explode("?", $uri[$key])[0];
continue;
} else {
return false;
}
} else {
if ($value == $uri[$key]) {
continue;
} else {
return false;
}
}
}
return $return;
}
function jsonc_decode($filename, $assoc = false, $depth = 512, $options = 0)
{
$fileContent = file_get_contents($filename);