mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-06-07 15:29:55 +00:00
Removed unused function
This function was moved in DeltaCMS\Route\Router
This commit is contained in:
parent
d0af5fda5f
commit
67eb20dd1c
@ -7,47 +7,6 @@ function startsWith($haystack, $needle)
|
|||||||
return (substr($haystack, 0, $length) === $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)
|
function jsonc_decode($filename, $assoc = false, $depth = 512, $options = 0)
|
||||||
{
|
{
|
||||||
$fileContent = file_get_contents($filename);
|
$fileContent = file_get_contents($filename);
|
||||||
|
Loading…
x
Reference in New Issue
Block a user