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 0000000..b6ca9bf Binary files /dev/null and b/favicon.ico differ 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情報 - +