aboutsummaryrefslogtreecommitdiff
path: root/p/api/fever.php
diff options
context:
space:
mode:
authorGravatar Alexandre Alapetite <alexandre@alapetite.fr> 2018-10-24 13:17:28 +0200
committerGravatar GitHub <noreply@github.com> 2018-10-24 13:17:28 +0200
commita1dc5ada6742f250952929db3b5606206214f962 (patch)
tree9227408540ff2df632359685b01b137428e6ebba /p/api/fever.php
parent6a686daafa526d4b0a247d6db407edca540e5083 (diff)
Add Fever API debug (#2063)
* Add Fever API debug https://github.com/FreshRSS/FreshRSS/issues/2043 * Default without debug logging
Diffstat (limited to 'p/api/fever.php')
-rw-r--r--p/api/fever.php30
1 files changed, 30 insertions, 0 deletions
diff --git a/p/api/fever.php b/p/api/fever.php
index bf38dc662..dd54a372b 100644
--- a/p/api/fever.php
+++ b/p/api/fever.php
@@ -30,6 +30,36 @@ register_shutdown_function('session_destroy');
Minz_Session::init('FreshRSS');
// ================================================================================================
+// <Debug>
+$ORIGINAL_INPUT = file_get_contents('php://input', false, null, 0, 1048576);
+
+function debugInfo() {
+ if (function_exists('getallheaders')) {
+ $ALL_HEADERS = getallheaders();
+ } else { //nginx http://php.net/getallheaders#84262
+ $ALL_HEADERS = array();
+ foreach ($_SERVER as $name => $value) {
+ if (substr($name, 0, 5) === 'HTTP_') {
+ $ALL_HEADERS[str_replace(' ', '-', ucwords(strtolower(str_replace('_', ' ', substr($name, 5)))))] = $value;
+ }
+ }
+ }
+ global $ORIGINAL_INPUT;
+ return print_r(
+ array(
+ 'date' => date('c'),
+ 'headers' => $ALL_HEADERS,
+ '_SERVER' => $_SERVER,
+ '_GET' => $_GET,
+ '_POST' => $_POST,
+ '_COOKIE' => $_COOKIE,
+ 'INPUT' => $ORIGINAL_INPUT
+ ), true);
+}
+
+//Minz_Log::debug('----------------------------------------------------------------', API_LOG);
+//Minz_Log::debug(debugInfo(), API_LOG);
+// </Debug>
class FeverDAO extends Minz_ModelPdo
{