{"id":35546617,"url":"https://github.com/pickles2/px2-publish-ex","last_synced_at":"2026-01-04T06:03:52.121Z","repository":{"id":57041409,"uuid":"125715553","full_name":"pickles2/px2-publish-ex","owner":"pickles2","description":"機能拡張された Pickles 2 のパブリッシュプラグイン。","archived":false,"fork":false,"pushed_at":"2025-07-12T08:10:19.000Z","size":1508,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":1,"default_branch":"main","last_synced_at":"2025-10-15T05:00:54.114Z","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,"governance":null,"roadmap":null,"authors":null,"dei":null}},"created_at":"2018-03-18T10:55:17.000Z","updated_at":"2025-07-12T08:10:15.000Z","dependencies_parsed_at":"2022-08-23T23:31:10.314Z","dependency_job_id":"f81d02fe-d95e-4185-b04f-01de8af22574","html_url":"https://github.com/pickles2/px2-publish-ex","commit_stats":{"total_commits":67,"total_committers":1,"mean_commits":67.0,"dds":0.0,"last_synced_commit":"8461d7a048ba46bac5d87dfc2deeb63e707ab154"},"previous_names":[],"tags_count":13,"template":false,"template_full_name":null,"purl":"pkg:github/pickles2/px2-publish-ex","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-publish-ex","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-publish-ex/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-publish-ex/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-publish-ex/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pickles2","download_url":"https://codeload.github.com/pickles2/px2-publish-ex/tar.gz/refs/heads/main","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fpx2-publish-ex/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28198686,"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:12.864Z","updated_at":"2026-01-04T06:03:47.697Z","avatar_url":"https://github.com/pickles2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# pickles2/px2-publish-ex\n\n機能拡張された Pickles 2 のパブリッシュプラグインです。\n\n\n## 導入手順 - Setup\n\n### 1. composer.json に pickles2/px2-publish-ex を追加\n\n```bash\n$ composer require pickles2/px2-publish-ex;\n```\n\n\n### 2. config.php に、プラグインを設定\n\n設定ファイル `config.php` (通常は `./px-files/config.php`) を編集します。\n`before_content` にある、`PX=publish` の設定を、次の例を参考に書き換えます。\n\n```php\n\u003c?php\n\n/* 中略 */\n\n/**\n * funcs: Before content\n *\n * サイトマップ読み込みの後、コンテンツ実行の前に実行するプラグインを設定します。\n */\n$conf-\u003efuncs-\u003ebefore_content = array(\n\n\t// PX=publish (px2-publish-ex)\n\t'tomk79\\pickles2\\publishEx\\publish::register()' , // オプションについては後述\n);\n```\n\n※ Pickles 2 の設定をJSON形式で編集している方は、`config.json` の該当箇所に追加してください。\n\n\n### 3. パブリッシュを実行\n\n標準的な Pickles 2 のパブリッシュと同じ手順で、パブリッシュコマンドを実行します。\n\n```\n$ php .px_execute.php /?PX=publish.run\n```\n\n\n## オプション - Options\n\n### コマンドラインオプション - CLI Options\n\n次のコマンドラインオプションが、 `PX=publish.run` と合わせて使用できます。\n\n#### `path_region`\n対象範囲とするディレクトリパスを1つ指定します。省略時はカレントディレクトリが対象になります。\n`/?PX=publish.run\u0026path_region=/a/b/` と `/a/b/?PX=publish.run` は同じ意味です。\n\n#### `paths_region`\n対象範囲を追加指定します。配列で複数指定可能です。\n\n#### `paths_ignore`\n`path_region` で指定した対象範囲のうち、パブリッシュを除外するパスを指定します。複数指定可能です。\n\n#### `keep_cache`\n1を指定し、パブリッシュ処理の初期化時に、キャッシュの削除および再生成をスキップします。\n\n#### 実行例\nオプションを設定した実行例を示します。\n\n```\n$ php .px_execute.php \"/?PX=publish.run\u0026path_region=/a/b/\u0026paths_region[]=/a/c/\u0026paths_region[]=/a/d/\u0026paths_ignore[]=/a/b/ignore1/\u0026paths_ignore[]=/a/b/ignore2/\u0026keep_cache=1\"\n```\n\nこの例では、対象範囲を `/a/b/` に絞った上で、 `/a/b/ignore1/` と `/a/b/ignore2/` を対象外に指定しています。\n\n\n### プラグインオプション - Plugin Options\n\n```php\n\u003c?php\n\n$conf-\u003efuncs-\u003ebefore_content = array(\n\n\t// PX=publish (px2-publish-ex)\n\t'tomk79\\pickles2\\publishEx\\publish::register('.json_encode(array(\n\t\t// パブリッシュ対象から常に除外するパスを設定する。\n\t\t// (ここに設定されたパスは、動的なプレビューは可能)\n\t\t// ※この設定は、 `pickles2/px-fw-2.x` に付属するオリジナルのパブリッシュ機能と互換します。\n\t\t'paths_ignore'=\u003e array(\n\t\t\t'/sample_pages/no_publish/*'\n\t\t),\n\n\t\t// パブリッシュするデバイスの情報を設定する。\n\t\t// 複数のデバイス情報を配列で指定します。\n\t\t// ここには、追加で処理したいデバイスの設定だけを記述します。\n\t\t// 本来のパブリッシュで処理される標準的なデバイスは、暗黙的に処理されます。\n\t\t// つまり、このオプションが空白でも、 1つの標準的なデバイスとしてパブリッシュされます。\n\t\t// (この挙動を変更したい場合は、次の `skip_default_device` に true を設定します)\n\t\t'devices'=\u003earray(\n\t\t\tarray(\n\t\t\t\t// USER_AGENT 文字列\n\t\t\t\t'user_agent'=\u003e'iPhone',\n\n\t\t\t\t// このデバイスが常に付加するパラメータ\n\t\t\t\t'params' =\u003e array(\n\t\t\t\t\t'LANG' =\u003e 'ja',\n\t\t\t\t),\n\n\t\t\t\t// このデバイス向けのパブリッシュ先ディレクトリ\n\t\t\t\t'path_publish_dir'=\u003e'./px-files/dist_smt/',\n\n\t\t\t\t// パスの書き換えロジック\n\t\t\t\t// 次の部品を組み合わせて、書き換え後のパスの構成規則を指定します。\n\t\t\t\t// - `{$dirname}` = 変換前のパスの、ディレクトリ部分\n\t\t\t\t// - `{$filename}` = 変換前のパスの、拡張子を除いたファイル名部分\n\t\t\t\t// - `{$ext}` = 変換前のパスの、拡張子部分\n\t\t\t\t//\n\t\t\t\t// または次のように、コールバックメソッド名を指定します。\n\t\t\t\t// \u003e 'path_rewrite_rule'=\u003e'functionNameOf::rewrite_smt',\n\t\t\t\t// コールバックメソッドには、 引数 `$path` が渡されます。\n\t\t\t\t// これを加工して、書き換え後のパスを返してください。\n\t\t\t\t'path_rewrite_rule' =\u003e '{$dirname}/{$filename}.smt.{$ext}',\n\n\t\t\t\t// このデバイス向けに出力するファイルのパス\n\t\t\t\t'paths_target' =\u003e array(\n\t\t\t\t\t'*.html',\n\t\t\t\t),\n\n\t\t\t\t// このデバイス向けには出力しないファイルのパス\n\t\t\t\t'paths_ignore'=\u003earray(\n\t\t\t\t\t'/default_only/*',\n\t\t\t\t),\n\n\t\t\t\t// リンクの書き換え方向\n\t\t\t\t// `origin2origin`、`origin2rewrited`、`rewrited2origin`、`rewrited2rewrited` のいずれかで指定します。\n\t\t\t\t// `origin` は変換前のパス、 `rewrited` は変換後のパスを意味します。\n\t\t\t\t// 変換前のパスから変換後のパスへのリンクとして書き換える場合は `origin2rewrited` のように指定します。\n\t\t\t\t'rewrite_direction'=\u003e'rewrited2rewrited',\n\t\t\t),\n\t\t\tarray(\n\t\t\t\t'user_agent'=\u003e'iPad',\n\t\t\t\t'path_publish_dir'=\u003e'./px-files/dist_tab/',\n\t\t\t\t'path_rewrite_rule'=\u003e'functionNameOf::rewriter_tab',\n\t\t\t),\n\t\t\t/* ...以下同様... */\n\t\t),\n\n\t\t// キャッシュバスターを有効にするか？ (default to `false`)\n\t\t'enable_cache_buster' =\u003e false,\n\n\t\t// 標準デバイスを出力しない (default to `false`)\n\t\t// `true` を設定すると、標準デバイスでのパブリッシュはされなくなります。\n\t\t'skip_default_device' =\u003e false,\n\n\t\t// vendor ディレクトリをパブリッシュする (default to `false`)\n\t\t'publish_vendor_dir' =\u003e false,\n\t)).')' ,\n);\n```\n\n\n## PX Commands\n\n次の PX Command が登録されます。\n\n- `PX=publish` : パブリッシュのホーム画面を表示します。\n- `PX=publish.run` : パブリッシュを実行します。\n- `PX=publish.version` : パブリッシュプラグインのバージョン番号を返します。\n\n\n## 更新履歴 - Change log\n\n### pickles2/px2-publish-ex v2.1.5 (2025年7月12日)\n\n- ヘッダー情報の送信に関する改善。\n\n### pickles2/px2-publish-ex v2.1.4 (2024年4月30日)\n\n- `enable_cache_buster` オプションを追加。\n- `X-PXFW-RELATEDLINK` によって追加された新しいパスが、キュー配列の先頭に追加されるようになった。\n- その他の細かい修正。\n\n### pickles2/px2-publish-ex v2.1.3 (2023年9月24日)\n\n- 内部で扱う時刻情報を ISO 8601 形式 に変更した。\n\n### pickles2/px2-publish-ex v2.1.2 (2023年4月22日)\n\n- `PX=publish.run` で、`path_region` を省略しても、 `paths_region` だけで対象範囲を絞れるようになった。\n\n### pickles2/px2-publish-ex v2.1.1 (2023年2月11日)\n\n- 内部コードの修正など。\n\n### pickles2/px2-publish-ex v2.1.0 (2022年1月8日)\n\n- サポートするPHPのバージョンを `\u003e=7.3.0` に変更。\n- PHP 8.1 に対応した。\n\n### pickles2/px2-publish-ex v2.0.8 (2021年8月21日)\n\n- 同梱のプラグインが、より直接的な表現で設定できるようになった。\n\n### pickles2/px2-publish-ex v2.0.7 (2021年7月10日)\n\n- デバイス設定に `params` を追加。\n- その他の細かい修正。\n\n### pickles2/px2-publish-ex v2.0.6 (2020年4月4日)\n\n- パブリッシュ時に、開始時刻と終了時刻を `timelog.txt` に記録するようになった。\n\n### pickles2/px2-publish-ex v2.0.5 (2020年1月2日)\n\n- 新しいオプション `publish_vendor_dir` を追加。\n\n### pickles2/px2-publish-ex v2.0.4 (2019年9月4日)\n\n- パブリッシュが2重に起動することがある問題を修正。\n- PHP 7.3 系で発生する不具合を修正。\n\n### pickles2/px2-publish-ex v2.0.3 (2019年6月8日)\n\n- `path_region`、`paths_region`、`paths_ignore` で、各行の先頭にスラッシュを補完するようになった。\n- CSSが参照するファイル名に `)` 記号を含められない不具合を修正。\n\n### pickles2/px2-publish-ex v2.0.2 (2019年4月19日)\n\n- パス変換時に、もとの文字セットが無視されて UTF-8 に変換されてしまう不具合を修正。\n\n### pickles2/px2-publish-ex v2.0.1 (2019年2月4日)\n\n- Windowsで、パス変換時に相対パスの階層がズレることがある不具合を修正。\n\n### pickles2/px2-publish-ex v2.0.0 (2018年8月18日)\n\n- Initial release.\n\n\n## ライセンス - License\n\nMIT License\n\n\n## 作者 - Author\n\n- Tomoya Koyanagi \u003ctomk79@gmail.com\u003e\n- website: \u003chttps://www.pxt.jp/\u003e\n- Twitter: @tomk79 \u003chttps://twitter.com/tomk79/\u003e\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Fpx2-publish-ex","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpickles2%2Fpx2-publish-ex","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Fpx2-publish-ex/lists"}