{"id":35546629,"url":"https://github.com/pickles2/lib-plum","last_synced_at":"2026-01-04T06:03:49.945Z","repository":{"id":56984876,"uuid":"119770221","full_name":"pickles2/lib-plum","owner":"pickles2","description":null,"archived":false,"fork":false,"pushed_at":"2021-05-25T11:27:00.000Z","size":6320,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":0,"default_branch":"main","last_synced_at":"2025-08-02T05:08:44.501Z","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-02-01T02:15:48.000Z","updated_at":"2021-05-25T11:27:04.000Z","dependencies_parsed_at":"2022-08-21T12:20:23.930Z","dependency_job_id":null,"html_url":"https://github.com/pickles2/lib-plum","commit_stats":null,"previous_names":[],"tags_count":7,"template":false,"template_full_name":null,"purl":"pkg:github/pickles2/lib-plum","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-plum","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-plum/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-plum/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-plum/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pickles2","download_url":"https://codeload.github.com/pickles2/lib-plum/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Flib-plum/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28198673,"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:15.313Z","updated_at":"2026-01-04T06:03:49.940Z","avatar_url":"https://github.com/pickles2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"pickles2/lib-plum\n======================\n\nウェブプロジェクトをステージング環境へデプロイする機能を提供するライブラリです。\n\n\n## インストール - Install\n\n```\n$ composer require pickles2/lib-plum\n```\n\n\n## 導入方法 - Setup\n\n### クライアントサイド\n\n```html\n\u003clink rel=\"stylesheet\" href=\"/path/to/vendor/pickles2/lib-plum/dist/plum.css\" /\u003e\n\u003cscript src=\"/path/to/vendor/pickles2/lib-plum/dist/plum.js\"\u003e\u003c/script\u003e\n\n\n\u003cdiv id=\"plum-area\"\u003e\u003c/div\u003e\n\n\u003cscript\u003e\nvar plum = new Plum(\n\tdocument.getElementById('plum-area'),\n\t{\n\t\t'gpiBridge': function(data, callback){\n\t\t\t$.ajax({\n\t\t\t\t'url': '/api.php',\n\t\t\t\t'method': 'POST',\n\t\t\t\t'data': {\n\t\t\t\t\t'data': data\n\t\t\t\t},\n\t\t\t\t'success': function(result){\n\t\t\t\t\tcallback(result);\n\t\t\t\t}\n\t\t\t});\n\t\t}\n\t}\n);\nplum.init();\n\nwindow.addEventListener('message', function(e){\n\tplum.broadcastMessage(e.message);\n});\n\u003c/script\u003e\n```\n\n\n### サーバーサイド\n\n```php\n\u003c?php\n// 実行環境に合わせてパスを設定\nrequire_once('./vendor/autoload.php');\n\n$plum = new hk\\plum\\main(\n\tarray(\n\t\t// Plumが内部で使用するデータ保管用ディレクトリ\n\t\t// (書き込みが許可されたディレクトリを指定)\n\t\t'data_dir' =\u003e '/path/to/data_dir/',\n\n\t\t// ステージングサーバ定義\n\t\t'staging_server' =\u003e array(\n\n\t\t\t// ステージングサーバの数だけ設定する\n\t\t\t//\n\t\t\t//   string 'name':\n\t\t\t//     - ステージングサーバ名(任意)\n\t\t\t//   string 'path':\n\t\t\t//     - ステージングサーバ(デプロイ先)のパス\n\t\t\t//   string 'url':\n\t\t\t//     - ステージングサーバのURL\n\t\t\t//       Webサーバのvirtual host等で設定したURL\n\t\t\t//\n\t\t\tarray(\n\t\t\t\t'name' =\u003e 'Staging 1',\n\t\t\t\t'path' =\u003e './../repos/stg1/',\n\t\t\t\t'url' =\u003e 'http://stg1.localhost/'\n\t\t\t)\n\t\t),\n\n\t\t// Git情報定義\n\t\t'git' =\u003e array(\n\t\t\t// リモートのURL\n\t\t\t'url' =\u003e 'https://host.com/path/to.git',\n\n\t\t\t// ユーザ名\n\t\t\t// Gitリポジトリのユーザ名を設定。\n\t\t\t'username' =\u003e 'user',\n\n\t\t\t// パスワード\n\t\t\t// Gitリポジトリのパスワードを設定。\n\t\t\t'password' =\u003e 'pass'\n\t\t),\n\n\t\t// 基本認証パスワードのハッシュ生成アルゴリズム名\n\t\t// 'bcrypt'|'md5'|'sha1'|'crypt'|'plain'\n\t\t'htpasswd_hash_algorithm' =\u003e 'crypt',\n\t)\n);\n$plum-\u003eset_async_callbacks(array(\n\t'async' =\u003e function( $params ){\n\t\t/*\n\t\tasync\n\t\t非同期で実行するコールバック関数を拡張します。\n\t\tここで受け取った `$message` を、\n\t\t非同期に `$plum-\u003easync($params);` へ転送してください。\n\t\t*/\n\t},\n\t'broadcast' =\u003e function( $message ){\n\t\t/*\n\t\tメッセージをブラウザに送るコールバック関数を拡張します。\n\t\tここで受け取った `$message` を、\n\t\tフロントエンドの `plum.broadcastMessage($message);` へ転送してください。\n\t\t*/\n\t}\n));\n\n$json = $plum-\u003egpi( $_POST['data'] );\n\nheader('Content-type: application/json');\necho json_encode( $json );\n```\n\n非同期の再呼び出し\n\n```php\n\u003c?php\nrequire_once('./vendor/autoload.php');\n\n$plum = new hk\\plum\\main(\n\n\t/* 中略 */\n\n);\n\n$json = $plum-\u003easync( $params );\n```\n\n\n\n#### デプロイ先のディレクトリに書き込み権限の付与\n\n以下のディレクトリに実行ユーザの書き込み権限が無い場合は、権限を付与します。\n\n- `staging_server-\u003epath` ・・・ ステージングサーバ(デプロイ先)のパス\n- `data_dir` ・・・ データディレクトリのパス\n\n\n\n\n## 更新履歴 - Change log\n\n### pickles2/lib-plum v0.3.1 (2021年5月25日)\n\n- Gitリモートにブランチ `master` がない場合に、チェックアウトが失敗する問題を修正。\n- オプション `htpasswd_hash_algorithm` を追加。\n- その他の細かい修正。\n\n### pickles2/lib-plum v0.3.0 (2021年4月28日)\n\n- オプション `temporary_data_dir` を `data_dir` に改名した。\n- ローカルマスターリポジトリでは `git fetch` まで実行し、 `git pull` しないようにした。ディスク容量の節約のため。\n- UIの改善。各ステージング毎に詳細画面を追加した。\n- 各ステージング毎にパスワードを設定できる機能を追加した。\n- 時間がかかる処理を非同期に実行できるようになった。\n\n### pickles2/lib-plum v0.2.0 (2020年11月7日)\n\n- リモートリポジトリがローカルディスクにある場合に対応した。\n- オプション `git-\u003eprotocol`、 `git-\u003ehost`、 `git-\u003erepository`、 `_GET`、 `_POST`、 `additional_params` を廃止、 `preview_server` を `staging_server` に改名した。\n- オプション `temporary_data_dir` を追加した。\n- クライアントサイドライブラリのファイル構成を変更した。\n- CSS、JSの影響が外部に及ばないように隠蔽させた。\n- JavaScript環境を明示的に呼び出すように変更した。\n- GPIを追加。\n- その他の細かい修正。\n\n### pickles2/lib-plum v0.1.3 (2020年11月3日)\n\n- 細かい不具合と内部コードの修正。\n\n### pickles2/lib-plum v0.1.2 (2019年6月12日)\n\n- オプション `additional_params` を追加。\n- オプション `_GET`, `_POST` を省略可能とした。\n\n### pickles2/lib-plum v0.1.1 (2018年10月19日)\n\n- git リモートリポジトリ のIDとパスワードが設定されていない場合に、認証情報なしでアクセスするようになった。\n- git repository のURLを解析してコンフィグを補完するようになった。 `https://user:pass@host.com/path/to.git` のような1つの完全な URL の形で設定できる。\n- OSコマンドインジェクションの脆弱性に関する修正。\n\n### pickles2/lib-plum v0.1.0 (2018年6月7日)\n\n- Initial Release.\n\n\n## ライセンス - License\n\nCopyright (c)Kyota Hiyoshi, Tomoya Koyanagi, and Pickles Project\u003cbr /\u003e\nMIT License https://opensource.org/licenses/mit-license.php\n\n## 作者 - Author\n\n- Kyota Hiyoshi \u003chiyoshi-kyota@imjp.co.jp\u003e\n- Tomoya Koyanagi \u003ctomk79@gmail.com\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Flib-plum","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpickles2%2Flib-plum","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Flib-plum/lists"}