Had to fix namespacing issue with the table api endpoint.

This commit is contained in:
Tristan Ancelet 2023-05-27 16:42:36 -05:00
parent 81533b93fe
commit e107baf3ab
2 changed files with 7 additions and 3 deletions

View File

@ -1,7 +1,7 @@
<?php <?php
namespace table;
require("class.php"); require("class.php");
use table\Table;
function get_main () { function get_main () {
$db = $GLOBALS["db"]; $db = $GLOBALS["db"];
/* /*

View File

@ -10,11 +10,15 @@ GET:
*/ */
require('../Libraries/table/get.php');
namespace table;
use SQLite3;
$root = $_SERVER['DOCUMENT_ROOT'];
$GLOBALS['db'] = new SQLite3("../../webcron.db");
require("$root/Libraries/table/get.php");
# Setting up DB connection # Setting up DB connection
$GLOBALS['db'] = new SQLite3("../../webcron.db");
switch ($_SERVER['REQUEST_METHOD']) { switch ($_SERVER['REQUEST_METHOD']) {
case 'GET': case 'GET':