Shimmie

$title

$body
"); if ($code != 0) { http_response_code(500); } exit($code); } $min_php = "8.1"; if (version_compare(phpversion(), $min_php, ">=") === false) { die_nicely("Not Supported", " Shimmie does not support versions of PHP lower than $min_php (PHP reports that it is version ".phpversion()."). ", 1); } # ini_set('zend.assertions', '1'); // generate assertions ini_set('assert.exception', '1'); // throw exceptions when failed set_error_handler(function ($errNo, $errStr) { // Should we turn ALL notices into errors? PHP allows a lot of // terrible things to happen by default... if (str_starts_with($errStr, 'Use of undefined constant ')) { throw new \Exception("PHP Error#$errNo: $errStr"); } else { return false; } }); ob_start(); if (PHP_SAPI === 'cli' || PHP_SAPI == 'phpdbg') { if (isset($_SERVER['REMOTE_ADDR'])) { die("CLI with remote addr? Confused, not taking the risk."); } $_SERVER['REMOTE_ADDR'] = "0.0.0.0"; $_SERVER['HTTP_HOST'] = "cli-command"; }