{"id":35546711,"url":"https://github.com/pickles2/lib-indigo","last_synced_at":"2026-01-04T06:04:22.496Z","repository":{"id":57041337,"uuid":"131786265","full_name":"pickles2/lib-indigo","owner":"pickles2","description":null,"archived":false,"fork":false,"pushed_at":"2021-04-27T18:06:19.000Z","size":1353,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"master","last_synced_at":"2025-07-27T11:48:12.262Z","etag":null,"topics":[],"latest_commit_sha":null,"homepage":null,"language":"PHP","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/pickles2.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null}},"created_at":"2018-05-02T02:15:52.000Z","updated_at":"2021-04-27T18:06:24.000Z","dependencies_parsed_at":"2022-08-24T00:50:53.134Z","dependency_job_id":null,"html_url":"https://github.com/pickles2/lib-indigo","commit_stats":null,"previous_names":[],"tags_count":8,"template":false,"template_full_name":null,"purl":"pkg:github/pickles2/lib-indigo","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-indigo","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-indigo/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-indigo/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-indigo/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pickles2","download_url":"https://codeload.github.com/pickles2/lib-indigo/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-indigo/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28198678,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","status":"online","status_checked_at":"2026-01-04T02:00:06.065Z","response_time":58,"last_error":null,"robots_txt_status":"success","robots_txt_updated_at":"2025-07-24T06:49:26.215Z","robots_txt_url":"https://github.com/robots.txt","online":true,"can_crawl_api":true,"host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":[],"created_at":"2026-01-04T06:02:35.662Z","updated_at":"2026-01-04T06:04:22.486Z","avatar_url":"https://github.com/pickles2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"pickles2/lib-indigo\n======================\n\n## 導入方法 - Setup\n\n### 1. `pickles2/lib-indigo` をインストール\n\n```\n$ composer require pickles2/lib-indigo;\n```\n\n\n### 2. Resourceファイルを配置する\n\nindigo を動作させる上で必要となる Resrouceファイル をプロジェクトに取込みます。\n\n#### 2-1. Resourceファイル取込用スクリプトをプロジェクトへコピーする\n\n```\n$ cp yourProject/vendor/pickles2/lib-indigo/res_install_script.php yourProject\n```\n\n#### 2-2. Resourceファイル格納用のディレクトリを作成する。\n\n```\n$ mkdir yourProject/[directoryName(ex. res)]\n```\n\n#### 2-3. スクリプトをコマンドラインで実行する\n\n```\n$ php res_install_script.php [resourceInstallPath(ex. ./res)]\n```\n\n### 3. Resourceを読み込み、フロントエンドを初期化する\n\n```html\n\u003c!-- Bootstrap --\u003e\n\u003clink rel=\"stylesheet\" href=\"/[resourceInstallPath]/bootstrap/css/bootstrap.min.css\"\u003e\n\u003cscript src=\"/[resourceInstallPath]/bootstrap/js/bootstrap.min.js\"\u003e\u003c/script\u003e\n\n\u003c!-- Indigo --\u003e\n\u003clink rel=\"stylesheet\" href=\"/[resourceInstallPath]/styles/common.css\"\u003e\n\u003cscript src=\"/[resourceInstallPath]/scripts/common.js\"\u003e\u003c/script\u003e\n\n\u003c!-- jQuery UI --\u003e\n\u003cscript src=\"//ajax.googleapis.com/ajax/libs/jquery/1.11.0/jquery.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/jquery-ui.min.js\"\u003e\u003c/script\u003e\n\u003cscript src=\"//ajax.googleapis.com/ajax/libs/jqueryui/1/i18n/jquery.ui.datepicker-ja.min.js\"\u003e\u003c/script\u003e\n\u003clink rel=\"stylesheet\" href=\"//ajax.googleapis.com/ajax/libs/jqueryui/1.12.1/themes/smoothness/jquery-ui.css\"\u003e\n\n\u003cscript\u003e\n\t// Initialize Indigo\n\twindow.addEventListener('load', function(){\n\t\tvar dateFormat = 'yy-mm-dd';\n\t\t\n\t\t$.datepicker.setDefaults($.datepicker.regional[\"ja\"]);\n\t\t\n\t\t$(\"#datepicker\").datepicker({\n\t\t\tdateFormat: dateFormat\n\t\t});\n\n\t\tvar indigo = new window.Indigo();\n\t\tindigo.init();\n\t});\n\u003c/script\u003e\n```\n\n#### フロントエンドの初期化オプション\n\n```js\nvar indigo = new window.Indigo({\n\tajaxBridge: function(data, callback){\n\t\t// バックエンドとのデータ受け渡しの方式を変更したい場合に、\n\t\t// このオプションを指定します。\n\t\tvar rtn = '';\n\t\tvar error = false;\n\t\t$.ajax ({\n\t\t\ttype: 'POST',\n\t\t\turl: '/path/to/ajax.php',\n\t\t\tdata: data,\n\t\t\tdataType: 'json',\n\t\t\tsuccess: function(data, dataType) {\n\t\t\t\trtn = data;\n\t\t\t},\n\t\t\terror: function(jqXHR, textStatus, errorThrown) {\n\t\t\t\terror = textStatus;\n\t\t\t},\n\t\t\tcomplete: function(){\n\t\t\t\tcallback(rtn, error);\n\t\t\t}\n\t\t});\n\t}\n});\nindigo.init();\n```\n\n\n### 4. indigo作業用のディレクトリを作成する。\n\n後述の6. indigoの実行パラメタ設定 にて 「 indigo作業用ディレクトリ（絶対パス）：'realpath_workdir'」 にパス設定を行うディレクトリとなります。\n\n#### 4-1. ディレクトリを作成します。\n\n```\n$ mkdir yourProject/[directoryName(ex. indigo_dir)]\n```\n\n\n#### 4-2. apache（その他）ユーザに書き込み権限を付与します。\n\n```\n$ chmod -R o+w yourProject/[directoryName(ex. indigo_dir)]\n```\n\n\n#### 5. 同期先の本番環境ディレクトリのパーミッションを変更する。\n\napache（その他）ユーザに書き込み権限を付与します。\n\n※ `-R` オプションを付けることで、指定ディレクトリ以下に存在するディレクトリ・ファイルも全て再帰的に権限変更を行います。\n\n```\n$ chmod -R o+w honbanProject/[directoryName(ex. indigo-test-project)]\n```\n\n\n\n### 6. indigoの実行パラメタ設定\n\n各種パラメータを設定します。こちらに記載したパラメタが別ファイルから呼び出されます。\n\n```php\n\u003c?php\n\nfunction call_parameter () {\n\n\t$parameter = array(\n\t\t// POST\n\t\t'_POST' =\u003e $_POST,\n\n\t\t// GET\n\t\t'_GET' =\u003e $_GET,\n\n\t\t// フォーム送信時に付加する追加のパラメータ (省略可)\n\t\t'additional_params' =\u003e array(\n\t\t\t'hoge' =\u003e 'fuga',\n\t\t),\n\n\t\t// indigo作業用ディレクトリの絶対パス\n\t\t// indigoは、このディレクトリに内部で利用する情報を書き込みます。\n\t\t'realpath_workdir' =\u003e '/var/www/html/sample-lib-indigo/', // directoryName (ex. indigo_dir)\n\n\t\t// git local のマスターデータディレクトリの絶対パス\n\t\t// 省略時は、 `realpath_workdir` 内に自動生成されます。\n\t\t'realpath_git_master_dir' =\u003e '/var/www/html/sample-lib-indigo/master_repository/',\n\n\t\t// リソースディレクトリ（ドキュメントルートからの相対パス）\n\t\t'relativepath_resourcedir'\t=\u003e './../res/', // directoryName (ex. res)\n\n\t\t// ajax呼出クラス（ドキュメントルートからの相対パス）\n\t\t'url_ajax_call' =\u003e './ajax.php',\n\t\t\n\t\t// 画面表示上のタイムゾーン\n\t\t'time_zone' =\u003e 'Asia/Tokyo',\n\n\t\t// ユーザID\n\t\t'user_id' =\u003e 'user01', // 省略可\n\n\t\t// 空間名\n\t\t'space_name' =\u003e 'project0001', // 省略可\n\n\t\t// DB設定\n\t\t'db' =\u003e array(\n\n\t\t\t// 'mysql' or 'sqlite' (省略時は SQLite を採用)\n\t\t\t'dbms' =\u003e null,\n\t\t\t'prefix' =\u003e 'indigo_', // テーブル名の接頭辞\n\t\t\t'database' =\u003e null,\n\t\t\t'host' =\u003e null,\n\t\t\t'port' =\u003e null,\n\t\t\t'username' =\u003e null,\n\t\t\t'password' =\u003e null,\n\t\t),\n\n\t\t// 予約最大件数\n\t\t'max_reserve_record' =\u003e 10,\n\n\t\t// バックアップ世代管理件数\n\t\t// ※ v0.2.0 時点では未対応\n\t\t'max_backup_generation' =\u003e 5,\n\n\t\t// 本番環境パス (同期先)\n\t\t// 複数の同期先を設定できます。\n\t\t'server' =\u003e array(\n\t\t\tarray(\n\t\t\t\t// 任意の名前\n\t\t\t\t'name' =\u003e 'server1',\n\t\t\t\t// 同期先絶対パス\n\t\t\t\t'dist' =\u003e '/path/to/document_root_01/htdocs/'\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t// 任意の名前\n\t\t\t\t'name' =\u003e 'server2',\n\t\t\t\t// 同期先絶対パス\n\t\t\t\t'dist' =\u003e '/path/to/document_root_02/htdocs/'\n\t\t\t)\n\t\t),\n\n\t\t// 同期除外ディレクトリ、またはファイル\n\t\t'ignore' =\u003e array(\n\t\t\t'.git',\n\t\t\t'.htaccess'\n\t\t),\n\n\t\t// Git情報定義\n\t\t'git' =\u003e array(\n\n\t\t\t// Gitリポジトリのurl（現在はhttpsプロトコルのみ対応）\n\t\t\t'giturl' =\u003e 'https://github.com/foo/bar.git',\n\n\t\t\t// ユーザ名\n\t\t\t// Gitリポジトリのユーザ名を設定\n\t\t\t'username' =\u003e 'hoge',\n\n\t\t\t// パスワード\n\t\t\t// Gitリポジトリのパスワードを設定\n\t\t\t'password' =\u003e 'fuga'\n\t\t)\n\t);\n\treturn $parameter;\n};\n```\n\n\n### 7. indigoの画面実行\n\n6.で作成したパラメータを引数にlib-indigoのmainクラスの呼び出しを行います。\n\n```php\n\u003c?php\n\nrequire_once('/path/to/vendor/autoload.php');\n// 6.1で作成したパラメタ記載ファイル\nrequire __DIR__ . '/parameter.php';\n\n// parameter.phpのcall_parameterメソッド\n$parameter = call_parameter();\n\n// load main class\n$indigo = new pickles2\\indigo\\main( $parameter );\n\n// 実行する\necho $indigo-\u003erun();\n```\n\n\n\n### 8. ajax呼び出しクラス\n\n6.で作成したパラメータを引数に設定し、lib-indigoのajaxクラスの呼び出しを行います。\n\n※先述の 6. 「ajax呼出クラス（絶対パス）：'url_ajax_call'」 のファイル名と一致するようにファイルを作成してください。\n\n```php\n\u003c?php\n\nrequire_once('/path/to/vendor/autoload.php');\n\n// 6.1で作成したパラメタ記載ファイル\nrequire __DIR__ . '/parameter.php';\n\n// parameter.phpのcall_parameterメソッド\n$parameter = call_parameter();\n\n// load main class\n$indigo = new pickles2\\indigo\\main( $parameter );\n\n// 実行する\necho $indigo-\u003eajax_run();\n```\n\n\n\n### 9. indigoのクーロン実行\n\n6.で作成したパラメータを引数にlib-indigoのmainクラスを呼び出し初期化を行います。\n\n```php\n\u003c?php\n\nrequire_once('/path/to/vendor/autoload.php');\n\n// 6.1で作成したパラメタ記載ファイル\nrequire __DIR__ . '/parameter.php';\n\n// parameter.phpのcall_parameterメソッド\n$parameter = call_parameter();\n\n// load main class\n$indigo = new pickles2\\indigo\\main( $parameter );\n\n// 実行する\necho $indigo-\u003ecron_run();\n```\n\n\n#### 9-3. indigo(cron)をサーバから一定の間隔で呼び出すようクーロン登録を行う\n\napache権限でクーロン登録用コマンドを実行（root権限だとindigo内の一部動作時にエラーとなる）\n\n```\n$ crontab -u apache -e\n```\n\n何分間隔で呼び出すのかを設定する。クーロン用のログも出力させる場合は、以下のようにログディレクトリ・ログファイル名を記載する。\n\n```\n$ */1 * * * * /usr/bin/php /var/www/html/sample-lib-indigo/htdocs/cron.php \u003e\u003e/var/www/html/sample-lib-indigo/indigo_dir/log/cron.log 2\u003e\u003e/var/www/html/sample-lib-indigo/indigo_dir/log/cron-err.log\n```\n\n\n## 更新履歴 - Change log\n\n### pickles2/lib-indigo v0.3.0 (2021年4月28日)\n\n- `namespace` を変更: `indigo\\*` to `pickles2\\indigo\\*`\n- 複数の本番サーバー設定を利用できるようになった。\n- 内部コードの細かい修正。\n\n### pickles2/lib-indigo v0.2.1 (2021年4月4日)\n\n- GitリモートURLの扱いに関する不具合を修正。\n\n### pickles2/lib-indigo v0.2.0 (2020年11月9日)\n\n- Gitリモートの `username` と `password` オプションを省略可能になった。\n- 設定項目名 `realpath_ajax_call` を `url_ajax_call` に名称変更。\n- 新しい設定項目 `realpath_git_master_dir` を追加。\n- 新しい設定項目 `space_name` を追加。\n- `indigo\\ajax::ajax_run()` を廃止し、`indigo\\main::ajax_run()` に統一した。\n- データベース接続設定の項目名を変更。\n- データベース接続設定に `prefix` を追加。\n- データベース接続先に `mysql` を追加。\n- データベースのプライマリキーを INT ではなく UUID を使用するように変更。\n- 出力先のパスの設定名を `real_path` から `dist` に変更。\n- 細かい不具合の修正。\n\n### pickles2/lib-indigo v0.1.4 (2019年7月1日)\n\n- オプション `additional_params` を追加。\n- オプション `_GET`, `_POST` を省略可能とした。\n- Ajaxの実行メソッド名を `ajax_run()` に変更。\n- フロントエンドの初期化スクリプト仕様を変更。\n- 配信予約日時の時制チェックに関する不具合を修正。\n- 配信予約の更新に関する不具合を修正。\n- その他いくつかの細かい修正。\n\n### pickles2/lib-indigo v0.1.3 (2018年8月31日)\n\n- エラーハンドラ登録処理の削除\n- indigo内で生成するディレクトリ名を一部修正\n- 不具合修正：グローバル関数にバックスラッシュ付与\n\n### pickles2/lib-indigo v0.1.2 (2018年8月22日)\n\n- パラメタ不足パターンの対策\n\n### pickles2/lib-indigo v0.1.1 (2018年8月21日)\n\n- SQLインジェクション対策実装\n- htmlspecialchars実装\n- 複数のエンドポイントファイルのパラメタ部分を一元管理\n- 関数戻り値受け渡し時のjson変換を廃止\n- docコメント修正\n\n### pickles2/lib-indigo v0.1.0 (2018年8月6日)\n\n- Initial Release.\n\n\n## ライセンス - License\n\nMIT License\n\n## 作者 - Author\n\n- (C) Tomoya Koyanagi \u003ctomk79@gmail.com\u003e\n- (C) Natsuki Gushikawa \u003cnatsuki.gushikawa@imjp.co.jp\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Flib-indigo","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpickles2%2Flib-indigo","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Flib-indigo/lists"}