This commit is contained in:
salam committed 2025-12-01 21:50:23 +01:00
1 parent 419148cd18
commit 7abcc5c56c
75 files changed
+32250 -127794

No files matched your search

+4 -4
View File
@@ -8,10 +8,10 @@ class Curl
{
public static $file;
public static function load($url)
public static function load($url, $filetype = 'json')
{
self::$file = app_path().'/Console/TestFiles/'.strtolower(str_replace(' ', '_', NuhBash::$options['name'])).'.'.NuhBash::$options['filetype'];
self::$file = app_path().'/Console/TestFiles/'.strtolower(str_replace(' ', '_', NuhBash::$options['name'])).'.'.$filetype;
$debug = NuhBash::$options['d'] ?? 0;
$save = NuhBash::$options['s'] ?? 0;
@@ -25,7 +25,7 @@ class Curl
if ($debug) {
Notice::note('data read local', 'r');
}
switch (NuhBash::$options['filetype']) {
switch ($filetype) {
case 'xml':
return simplexml_load_file(self::$file, null, LIBXML_NOCDATA);
break;
@@ -61,7 +61,7 @@ class Curl
file_put_contents(self::$file, $data);
}
if (NuhBash::$options['filetype'] == 'json') {
if ($filetype == 'json') {
return json_decode($data, true);
} else {
return $data;