Remove unused files
This includes a mix of deprecated content and tests.
Change-Id: Id6180be08bb838c04f680b75623f2efeb000029c
diff --git a/api_deprecated.php b/api_deprecated.php
deleted file mode 100644
index e58ca51..0000000
--- a/api_deprecated.php
+++ /dev/null
@@ -1,75 +0,0 @@
-<?php
-class api {
- private function writeJSON($array) {
- echo json_encode($array);
- }
-
- private function error($error = null) {
- self::writeJSON(["status" => "error", "error" => $error]);
- exit();
- }
-
- private function returnData($data) {
- self::writeJSON(["status" => "ok", "data" => $data]);
- exit();
- }
-
- public static function handleRequest() {
- global $_GET, $_POST;
-
- if (!isset($_GET["action"])) self::error("actionNotProvided");
-
- switch ($_GET["action"]) {
- case "linies":
- $liniesFull = tmbApi::request("transit/linies/metro");
- if ($liniesFull === false || !isset($liniesFull["features"])) self::error("unexpected");
-
- $linies = [];
- foreach ($liniesFull["features"] as $linia) {
- if (!isset($linia["properties"])) self::error("unexpected");
- $linies[] = [
- "id" => $linia["properties"]["ID_LINIA"] ?? null,
- "nom" => $linia["properties"]["NOM_LINIA"] ?? "",
- "desc" => $linia["properties"]["DESC_LINIA"] ?? "",
- "color" => $linia["properties"]["COLOR_LINIA"] ?? "000",
- "colorText" => $linia["properties"]["COLOR_TEXT_LINIA"] ?? "fff",
- "ordre" => $linia["properties"]["ORDRE_LINIA"] ?? 0
- ];
- }
-
- usort($linies, function ($a, $b) {
- return $a["ordre"] - $b["ordre"];
- });
-
- self::returnData($linies);
- break;
-
- case "estacions":
- if (!isset($_GET["linia"])) self::error("missingArguments");
- $linia = (int)$_GET["linia"];
- $estacionsFull = tmbApi::request("transit/linies/metro/".$linia."/estacions");
- if ($estacionsFull === false || !isset($estacionsFull["features"])) self::error("unexpected");
-
- $estacions = [];
- foreach ($estacionsFull["features"] as $estacio) {
- if (!isset($estacio["properties"])) self::error("unexpected");
- $estacions[] = [
- "id" => $estacio["properties"]["CODI_ESTACIO"] ?? null,
- "nom" => $estacio["properties"]["NOM_ESTACIO"] ?? "",
- "color" => $estacio["properties"]["COLOR_LINIA"] ?? "000",
- "ordre" => $estacio["properties"]["ORDRE_ESTACIO"] ?? 0
- ];
- }
-
- usort($estacions, function ($a, $b) {
- return $a["ordre"] - $b["ordre"];
- });
-
- self::returnData($estacions);
- break;
-
- default:
- self::error("actionNotImplemented");
- }
- }
-}
diff --git a/sqldeprecated.txt b/sqldeprecated.txt
deleted file mode 100644
index ffac11a..0000000
--- a/sqldeprecated.txt
+++ /dev/null
@@ -1,71 +0,0 @@
-$sql = "SELECT st.*, t.*, r.*, strftime('%Y%m%d', '22:34:12') as today, strftime('%Y%m%d', '22:34:12', '1 day') as tomorrow, time('22:34:12') as now
- FROM stop_times st
- INNER JOIN trips t
- ON st.trip_id = t.trip_id
- INNER JOIN routes r
- ON t.route_id = r.route_id
- LEFT JOIN calendar c
- ON t.service_id = c.service_id
- LEFT JOIN calendar_dates cd
- ON t.service_id = cd.service_id
- WHERE
- st.stop_id IN (".implode(", ", array_fill(0, count($stops), "?")).") AND
- (
- (
- time(now) < time('23:30:00') AND
- time(st.departure_time) BETWEEN time(now) AND time(now, '30 minutes') AND
- (
- c.service_id IS NULL OR
- (
- c.start_date <= today AND
- c.end_date >= today
- )
- ) AND
- (
- cd.service_id IS NULL OR
- cd.date = today
- )
- ) OR
- (
- time(now) >= time('23:30:00') AND
- (
- (
- time(st.departure_time) >= time(now) AND
- (
- c.service_id IS NULL OR
- (
- c.start_date <= today AND
- c.end_date >= today
- )
- ) AND
- (
- cd.service_id IS NULL OR
- cd.date = today
- )
- ) OR
- (
- time(st.departure_time) <= time(now, '30 minutes') AND
- (
- c.service_id IS NULL OR
- (
- c.start_date <= tomorrow AND
- c.end_date >= tomorrow
- )
- ) AND
- (
- cd.service_id IS NULL OR
- cd.date = tomorrow
- )
- )
- )
- )
- ) AND
- (
- c.service_id IS NULL OR
- c.$dow = ".(int)Gtfs\Calendar\CalendarDay::AVAILABLE."
- ) AND
- (
- cd.service_id IS NULL OR
- exception_type = ".(int)Gtfs\CalendarDate\ExceptionType::ADDED."
- )
- ORDER BY departure_time ASC";
diff --git a/test.php b/test.php
deleted file mode 100644
index 10aed56..0000000
--- a/test.php
+++ /dev/null
@@ -1,47 +0,0 @@
-<?php
-/*require_once("core.php");
-
-$element = "Gtfs\CalendarDate";
-
-$item = new $element([
- "service_id" => "a",
- "date" => "b",
- "exception_type" => Gtfs\CalendarDate\ExceptionType::ADDED
-]);
-
-//$feed->setServiceId(Gtfs\CalendarDate\ExceptionType::ADDED);
-
-var_dump(json_decode($item->serializeToJsonString(), true));
-*/
-?>
-
-<!DOCTYPE html>
-<html>
- <head>
- <style>
- @media (orientation: landscape) {
- :root {
- --size: 4vh;
- }
- }
-
- @media (orientation: portrait) {
- :root {
- --size: 4vw;
- }
- }
-
- .a {
- font-size: calc(4 * var(--size));
- background: cyan;
- width: 400px;
- height: 400px;
- }
- </style>
- </head>
- <body>
- <div class="a">
- Adri
- </div>
- </body>
-</html>