From 67eb20dd1cac5338bd6bbe67c0500c47054b1ac6 Mon Sep 17 00:00:00 2001 From: Avior Date: Tue, 7 May 2019 14:32:45 +0200 Subject: [PATCH] Removed unused function This function was moved in DeltaCMS\Route\Router --- src/DeltaCMS/Functions.php | 41 -------------------------------------- 1 file changed, 41 deletions(-) diff --git a/src/DeltaCMS/Functions.php b/src/DeltaCMS/Functions.php index 815a353..8992caf 100644 --- a/src/DeltaCMS/Functions.php +++ b/src/DeltaCMS/Functions.php @@ -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);