From 8c28d12922108ded94b0164588b44a9cd76d20e6 Mon Sep 17 00:00:00 2001 From: Pk11 Date: Sun, 31 Jul 2022 23:46:54 -0500 Subject: [PATCH] =?UTF-8?q?=E5=81=9C=E3=82=92=E3=83=87=E3=83=BC=E3=82=BF?= =?UTF-8?q?=E3=83=99=E3=83=BC=E3=82=B9=E3=81=AB=E4=BF=9D=E5=AD=98?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- .gitignore | 1 + README.md | 15 +++- favicon.ico | Bin 0 -> 4286 bytes index.php | 214 ++++++++++++++++++++++++++++++++++++----------- vars.php.example | 10 +++ 5 files changed, 191 insertions(+), 49 deletions(-) create mode 100644 .gitignore create mode 100644 favicon.ico create mode 100644 vars.php.example diff --git a/.gitignore b/.gitignore new file mode 100644 index 0000000..2dc8f9e --- /dev/null +++ b/.gitignore @@ -0,0 +1 @@ +vars.php diff --git a/README.md b/README.md index 7784b5d..52a6b0e 100644 --- a/README.md +++ b/README.md @@ -5,4 +5,17 @@ ## ホスト 1. これをインストール: - PHP (7.3.31を使う) -2. このレポをクローン、`git clone https://git.xn--rck9c.xn--tckwe/pk11/nextrip.git` + - PostgreSQL (11.14を使う) +2. このリポジトリをクローン、`git clone https://git.xn--rck9c.xn--tckwe/pk11/nextrip.git` +3. `vars.php.example`を`vars.php`にコピー +4. `vars.php`を返照 +5. 以下のテーブルを指定のデータベースに作成: + ```sql + CREATE TABLE favorites ( + fav_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, + stop INT, + priority INT, + description VARCHAR(2048), + key VARCHAR(64) + ); + ``` diff --git a/favicon.ico b/favicon.ico new file mode 100644 index 0000000000000000000000000000000000000000..b6ca9bfe27e8042338cf9ef5d9c88ffd76ba0377 GIT binary patch literal 4286 zcmeI0TdQeN6vyZJ2IuKK@5l2o&ZnVJO8bcyx0Fi~rQ_4-lW zt-j%7Zo8+gR3DxJo)(YCFBt6lS$-;&0^BPx`==i-|8O`^?QvaVeAH^c-;0{h=M&b! z%SWwRtrpcF6be!K*!4?k&WjXszrO>K$-vm literal 0 HcmV?d00001 diff --git a/index.php b/index.php index 00ef049..3b95fa0 100644 --- a/index.php +++ b/index.php @@ -25,7 +25,23 @@ * For more information, please refer to */ - // Return source code + /* + * ##### 使用前に読んでね ##### + * + * 「vars.php.example」を「vars.php」にコピーして、「<……>」を取り替えます。 + * 次に、vars.phpに指定データベースを作成して、以下のテーブルを作成します。 + * + * CREATE TABLE favorites ( + * fav_id INT GENERATED ALWAYS AS IDENTITY PRIMARY KEY, + * stop INT, + * priority INT, + * description VARCHAR(2048), + * key VARCHAR(64) + * ); + */ + require_once('vars.php'); + + // ソースコードを送信 if(isset($_GET['source'])) { header("Content-Type: text/plain"); die(file_get_contents(basename($_SERVER['PHP_SELF']))); @@ -39,10 +55,11 @@ 停留所のNexTrip情報 - +