mirror of
https://github.com/Aviortheking/DeltaCMS.git
synced 2025-06-07 15:29:55 +00:00
Removed unused functions
This commit is contained in:
parent
3c63c139ae
commit
90a69fd16c
@ -1,10 +1,5 @@
|
|||||||
<?php
|
<?php
|
||||||
|
|
||||||
function ping()
|
|
||||||
{
|
|
||||||
return "pong";
|
|
||||||
}
|
|
||||||
|
|
||||||
function startsWith($haystack, $needle)
|
function startsWith($haystack, $needle)
|
||||||
{
|
{
|
||||||
$length = strlen($needle);
|
$length = strlen($needle);
|
||||||
@ -27,11 +22,9 @@ function slugEqualToURI($slug, $uri, $options)
|
|||||||
if (count($uri) != count($slug)) {
|
if (count($uri) != count($slug)) {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
|
|
||||||
foreach ($slug as $key => $value) {
|
foreach ($slug as $key => $value) {
|
||||||
if (preg_match("/{.+}/", $value)) {
|
if (preg_match("/{.+}/", $value)) {
|
||||||
$elemnt = preg_replace("/{|}/", "", $value);
|
$elemnt = preg_replace("/{|}/", "", $value);
|
||||||
// dd($options);
|
|
||||||
if (!isset($options->$elemnt)) {
|
if (!isset($options->$elemnt)) {
|
||||||
$return->$elemnt = explode("?", $uri[$key])[0];
|
$return->$elemnt = explode("?", $uri[$key])[0];
|
||||||
continue;
|
continue;
|
||||||
@ -43,7 +36,6 @@ function slugEqualToURI($slug, $uri, $options)
|
|||||||
} else {
|
} else {
|
||||||
return false;
|
return false;
|
||||||
}
|
}
|
||||||
//TODO: correspond with module settings
|
|
||||||
} else {
|
} else {
|
||||||
if ($value == $uri[$key]) {
|
if ($value == $uri[$key]) {
|
||||||
continue;
|
continue;
|
||||||
@ -55,25 +47,6 @@ function slugEqualToURI($slug, $uri, $options)
|
|||||||
return $return;
|
return $return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
||||||
function getModulesJSON()
|
|
||||||
{
|
|
||||||
$temp = array();
|
|
||||||
$modulesDIR = "./Modules";
|
|
||||||
$modules = array_diff(scandir($modulesDIR), array('..', '.'));
|
|
||||||
foreach ($modules as $module) {
|
|
||||||
$moduleDIR = $modulesDIR . "/" . $module;
|
|
||||||
$file = $moduleDIR . "/" . strtolower($module) . ".json";
|
|
||||||
if (is_dir($moduleDIR) && is_file($file)) {
|
|
||||||
$json = json_decode(file_get_contents($file), true);
|
|
||||||
if ($json) {
|
|
||||||
$temp[$module] = $json;
|
|
||||||
}
|
|
||||||
}
|
|
||||||
}
|
|
||||||
return $temp;
|
|
||||||
}
|
|
||||||
|
|
||||||
function jsonc_decode($filename, $assoc = false, $depth = 512, $options = 0)
|
function jsonc_decode($filename, $assoc = false, $depth = 512, $options = 0)
|
||||||
{
|
{
|
||||||
return json_decode(
|
return json_decode(
|
||||||
|
Loading…
x
Reference in New Issue
Block a user