- Fixed ndump() source code
This commit is contained in:
parent
b88602a98b
commit
72f5341dff
@ -5,7 +5,7 @@ use function DI\autowire, DI\create, DI\get;
|
|||||||
use Negundo\Client\{ SoftwareConfig, Dump, Task, NegundoMiddleware };
|
use Negundo\Client\{ SoftwareConfig, Dump, Task, NegundoMiddleware };
|
||||||
|
|
||||||
return [
|
return [
|
||||||
SoftwareConfig::class => create(SoftwareConfig::class)->constructor(getenv('NEGUNDO_HASH'), getenv('NEGUNDO_SERVER')),
|
SoftwareConfig::class => create(SoftwareConfig::class)->constructor(getenvonce('NEGUNDO_HASH'), getenvonce('NEGUNDO_SERVER')),
|
||||||
NegundoMiddleware::class => autowire(NegundoMiddleware::class),
|
NegundoMiddleware::class => autowire(NegundoMiddleware::class),
|
||||||
Dump::class => autowire(Dump::class),
|
Dump::class => autowire(Dump::class),
|
||||||
Task::class => autowire(Task::class),
|
Task::class => autowire(Task::class),
|
||||||
|
|||||||
@ -39,10 +39,7 @@ class Curl implements TransportInterface {
|
|||||||
throw new \Exception(sprintf("HTTP code received : $code with page content : %s", $exec));
|
throw new \Exception(sprintf("HTTP code received : $code with page content : %s", $exec));
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if ($_GET['dev'] ?? false) {
|
|
||||||
echo($exec);
|
|
||||||
die();
|
|
||||||
}
|
|
||||||
curl_close($ch);
|
curl_close($ch);
|
||||||
|
|
||||||
return $exec;
|
return $exec;
|
||||||
|
|||||||
@ -20,7 +20,7 @@ class ExceptionHandler {
|
|||||||
'HTTP_HOST' => $serverData['HTTP_HOST'] ?? "",
|
'HTTP_HOST' => $serverData['HTTP_HOST'] ?? "",
|
||||||
'REQUEST_URI' => $serverData['REQUEST_URI'] ?? "",
|
'REQUEST_URI' => $serverData['REQUEST_URI'] ?? "",
|
||||||
'HTTP_USER_AGENT' => $serverData['HTTP_USER_AGENT'] ?? "# UNKNOWN #",
|
'HTTP_USER_AGENT' => $serverData['HTTP_USER_AGENT'] ?? "# UNKNOWN #",
|
||||||
'REMOTE_ADDR' => $serverData['REMOTE_ADDR'] ?? null,
|
'REMOTE_ADDR' => $server['HTTP_X_FORWARDED_FOR'] ?? $serverData['REMOTE_ADDR'] ?? null,
|
||||||
'REQUEST_METHOD' => $serverData['HTTP_X_HTTP_METHOD'] ?? $serverData['REQUEST_METHOD'] ?? null,
|
'REQUEST_METHOD' => $serverData['HTTP_X_HTTP_METHOD'] ?? $serverData['REQUEST_METHOD'] ?? null,
|
||||||
];
|
];
|
||||||
|
|
||||||
|
|||||||
@ -42,8 +42,7 @@ class SourceCodeFormatter {
|
|||||||
$content = $fileSpl->current();
|
$content = $fileSpl->current();
|
||||||
}
|
}
|
||||||
|
|
||||||
# Get code between <code></code> tags
|
$content = strip_tags($content, '<span>');
|
||||||
$content = substr($content, strpos($content, "<code>") + 6, strrpos($content, "</code>") - 6);
|
|
||||||
|
|
||||||
# Removing the added <?php tag
|
# Removing the added <?php tag
|
||||||
$content = str_replace("<?php", "", $content);
|
$content = str_replace("<?php", "", $content);
|
||||||
|
|||||||
Loading…
x
Reference in New Issue
Block a user