diff --git a/src/classes/contracts/sessions_interface.php b/src/classes/contracts/sessions_interface.php index ea48219..3d24971 100644 --- a/src/classes/contracts/sessions_interface.php +++ b/src/classes/contracts/sessions_interface.php @@ -3,14 +3,14 @@ declare(strict_types=1); namespace tts\contacts; -use SessionHandlerInterface; + interface sessions_interface { public function close(): bool; public function destroy(string $session_id): bool; - public function gc(int $maxlifetime): int; + public function gc(int $max_lifetime): int; public function open(string $save_path, string $session_name): bool; diff --git a/src/classes/json.php b/src/classes/json.php deleted file mode 100644 index 735ddf6..0000000 --- a/src/classes/json.php +++ /dev/null @@ -1,46 +0,0 @@ - - * @copyright Copyright (c) 2022, Robert Strutts. - * @license https://mit-license.org/ - */ - -namespace tts; - -final class json { - - public static function do_json_headers(int $status_code = 200) { - if (!headers_sent()) { - header($_SERVER['SERVER_PROTOCOL'] . " " . $status_code); - header('Content-Type: application/json; charset=utf-8', true, intval($status_code)); - } - } - - public static function output(array $data, string $misc = '') { - $number_of_rows = \bs_tts\common::get_count($data); - - self::do_json_headers(); - - $dt = new \DateTime(); - $ds = $dt->format('Y-m-d h:i:s A'); - - echo "{ \r\n \"records_total\": {$number_of_rows}, \r\n"; - echo "\"date_stamp\": \"{$ds}\", \r\n"; - - if (! empty($misc) ) { - echo $misc; - } - - if ($number_of_rows > 0) { - echo '"data":['; - echo json_encode($data); - echo ']}'; // end JSON object - } else { - echo '"data":[]}'; // No users!!! - } - } - -} \ No newline at end of file