add scanlator and people in db

main
cynic 4 years ago
parent 7731a61f30
commit e7eef743fc
  1. 2
      db/info.json
  2. 9279
      db/test.json
  3. 2
      instance.php
  4. 4
      routes.php

@ -4,5 +4,5 @@
"operator": "cynic", "operator": "cynic",
"icon": "", "icon": "",
"description": "aaaathats4as", "description": "aaaathats4as",
"version": "0.1" "version": "0.1-php"
} }

File diff suppressed because it is too large Load Diff

@ -11,7 +11,7 @@ class ml
} }
function getManga($id) function getManga($id)
{ {
foreach ($this->db as $manga) foreach ($this->db["manga"] as $manga)
{ {
if ($manga["info"]["id"] == $id) if ($manga["info"]["id"] == $id)
{ {

@ -2,6 +2,7 @@
include_once("instance.php"); include_once("instance.php");
function route($path, $ml) function route($path, $ml)
{ {
header('Content-Type:application/json');
switch ($path) switch ($path)
{ {
case "/info": case "/info":
@ -9,7 +10,7 @@ function route($path, $ml)
break; break;
case "/manga/search": case "/manga/search":
$response = []; $response = [];
foreach ($ml->db as $manga) foreach ($ml->db["manga"] as $manga)
{ {
array_push($response, $manga["info"]); array_push($response, $manga["info"]);
} }
@ -40,7 +41,6 @@ function route($path, $ml)
break; break;
default: default:
http_response_code(404); http_response_code(404);
return("lol@".$path);
} }
} }
?> ?>
Loading…
Cancel
Save