{"id":35546605,"url":"https://github.com/pickles2/php-px2agent","last_synced_at":"2026-01-04T06:03:45.517Z","repository":{"id":57041352,"uuid":"286667708","full_name":"pickles2/php-px2agent","owner":"pickles2","description":"Pickles 2 と PHP スクリプトを仲介するAPIを提供します。","archived":false,"fork":false,"pushed_at":"2023-06-24T15:53:17.000Z","size":710,"stargazers_count":0,"open_issues_count":0,"forks_count":0,"subscribers_count":3,"default_branch":"master","last_synced_at":"2025-10-22T10:45:11.014Z","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":"2020-08-11T06:47:04.000Z","updated_at":"2022-01-08T08:55:52.000Z","dependencies_parsed_at":"2022-08-24T00:51:00.929Z","dependency_job_id":null,"html_url":"https://github.com/pickles2/php-px2agent","commit_stats":null,"previous_names":[],"tags_count":5,"template":false,"template_full_name":null,"purl":"pkg:github/pickles2/php-px2agent","repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fphp-px2agent","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fphp-px2agent/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fphp-px2agent/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fphp-px2agent/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/pickles2","download_url":"https://codeload.github.com/pickles2/php-px2agent/tar.gz/refs/heads/master","sbom_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/pickles2%2Fphp-px2agent/sbom","scorecard":null,"host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":286080680,"owners_count":28198685,"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:10.370Z","updated_at":"2026-01-04T06:03:40.960Z","avatar_url":"https://github.com/pickles2.png","language":"PHP","funding_links":[],"categories":[],"sub_categories":[],"readme":"# php-px2agent\n__pickles2/px2agent__ は、[Pickles 2](https://pickles2.pxt.jp/)  と PHP スクリプトを仲介するAPIを提供します。\n\n\n\u003ctable\u003e\n  \u003cthead\u003e\n\t\u003ctr\u003e\n\t  \u003cth\u003e\u003c/th\u003e\n\t  \u003cth\u003eLinux\u003c/th\u003e\n\t  \u003cth\u003eWindows\u003c/th\u003e\n\t\u003c/tr\u003e\n  \u003c/thead\u003e\n  \u003ctbody\u003e\n\t\u003ctr\u003e\n\t  \u003cth\u003emaster\u003c/th\u003e\n\t  \u003ctd align=\"center\"\u003e\n\t\t\u003ca href=\"https://travis-ci.org/pickles2/php-px2agent\"\u003e\u003cimg src=\"https://secure.travis-ci.org/pickles2/php-px2agent.svg?branch=master\"\u003e\u003c/a\u003e\n\t  \u003c/td\u003e\n\t  \u003ctd align=\"center\"\u003e\n\t\t\u003ca href=\"https://ci.appveyor.com/project/tomk79/php-px2agent\"\u003e\u003cimg src=\"https://ci.appveyor.com/api/projects/status/7tbg9d7fb8yvb4ij/branch/master?svg=true\"\u003e\u003c/a\u003e\n\t  \u003c/td\u003e\n\t\u003c/tr\u003e\n\t\u003ctr\u003e\n\t  \u003cth\u003edevelop\u003c/th\u003e\n\t  \u003ctd align=\"center\"\u003e\n\t\t\u003ca href=\"https://travis-ci.org/pickles2/php-px2agent\"\u003e\u003cimg src=\"https://secure.travis-ci.org/pickles2/php-px2agent.svg?branch=develop\"\u003e\u003c/a\u003e\n\t  \u003c/td\u003e\n\t  \u003ctd align=\"center\"\u003e\n\t\t\u003ca href=\"https://ci.appveyor.com/project/tomk79/php-px2agent\"\u003e\u003cimg src=\"https://ci.appveyor.com/api/projects/status/7tbg9d7fb8yvb4ij/branch/develop?svg=true\"\u003e\u003c/a\u003e\n\t  \u003c/td\u003e\n\t\u003c/tr\u003e\n  \u003c/tbody\u003e\n\u003c/table\u003e\n\n\n\n\n## インストール - Installation\n\n```\n$ composer require pickles2/px2agent;\n```\n\n\n\n## 使い方 - Usage\n\n```php\n$px2agent = new picklesFramework2\\px2agent\\px2agent();\n$px2proj = $px2agent-\u003ecreateProject('/path/to/.px_execute.php');\n\n\n/**\n * Pickles 2 にクエリを投げて、結果を受け取る (汎用)\n */\n$data = $px2proj-\u003equery('/?PX=phpinfo', array(\n\t\"output\": \"json\",\n));\n\n/**\n * PXコマンドを実行する\n */\n$result = $px2proj-\u003epx_command(\n    'publish.run',\n    '/index.html',\n    array('path_region' =\u003e \"/region/\")\n);\n\n/**\n * バージョン番号を取得する\n */\n$value = $px2proj-\u003eget_version();\n\n\n/**\n * configデータを取得する\n */\n$value = $px2proj-\u003eget_config();\n\n/**\n * サイトマップデータを取得する\n */\n$value = $px2proj-\u003eget_sitemap();\n\n/**\n * pathまたはidからページ情報を得る\n */\n$value = $px2proj-\u003eget_page_info('/');\n\n/**\n * 親ページのIDを取得する\n */\n$value = $px2proj-\u003eget_parent('/sample_pages/');\n\n/**\n * 子階層のページの一覧を取得する\n */\n$value = $px2proj-\u003eget_children('/');\n\n/**\n * 子階層のページの一覧を、filterを無効にして取得する\n */\n$value = $px2proj-\u003eget_children('/', array('filter' =\u003e false));\n\n/**\n * 同じ階層のページの一覧を取得する\n */\n$value = $px2proj-\u003eget_bros('/sample_pages/');\n\n/**\n * 同じ階層のページの一覧を、filterを無効にして取得する\n */\n$value = $px2proj-\u003eget_bros('/sample_pages/', array('filter' =\u003e false));\n\n/**\n * 同じ階層の次のページのIDを取得する\n */\n$value = $px2proj-\u003eget_bros_next('/sample_pages/');\n\n/**\n * 同じ階層の次のページのIDを、filterを無効にして取得する\n */\n$value = $px2proj-\u003eget_bros_next('/sample_pages/', array('filter' =\u003e false));\n\n/**\n * 同じ階層の前のページのIDを取得する\n */\n$value = $px2proj-\u003eget_bros_prev('/sample_pages/');\n\n/**\n * 同じ階層の前のページのIDを、filterを無効にして取得する\n */\n$value = $px2proj-\u003eget_bros_prev('/sample_pages/', array('filter' =\u003e false));\n\n/**\n * 次のページのIDを取得する\n */\n$value = $px2proj-\u003eget_next('/sample_pages/');\n\n/**\n * 次のページのIDを、filterを無効にして取得する\n */\n$value = $px2proj-\u003eget_next('/sample_pages/', array('filter' =\u003e false));\n\n/**\n * 前のページのIDを取得する\n */\n$value = $px2proj-\u003eget_prev('/sample_pages/');\n\n/**\n * 前のページのIDを、filterを無効にして取得する\n */\n$value = $px2proj-\u003eget_prev('/sample_pages/', array('filter' =\u003e false));\n\n/**\n * パンくず配列を取得する\n */\n$value = $px2proj-\u003eget_breadcrumb_array('/sample_pages/');\n\n/**\n * ダイナミックパス情報を得る\n */\n$value = $px2proj-\u003eget_dynamic_path_info('/sample_pages/');\n\n/**\n * ダイナミックパスに値をバインドする\n */\n$value = $px2proj-\u003ebind_dynamic_path_param('/dynamicPath/{*}', array('' =\u003e 'abc.html'));\n\n/**\n * role を取得する\n */\n$role = $px2proj-\u003eget_role('/sample_pages/actor1.html');\n\n/**\n * Actor のページID一覧を取得する\n */\n$actors = $px2proj-\u003eget_actors('/sample_pages/role.html');\n\n/**\n * get home directory path\n */\n$value = $px2proj-\u003eget_realpath_homedir();\n\n/**\n * コンテンツルートディレクトリのパス(=install path) を取得する\n */\n$value = $px2proj-\u003eget_path_controot();\n\n/**\n * DOCUMENT_ROOT のパスを取得する\n */\n$value = $px2proj-\u003eget_realpath_docroot();\n\n/**\n * get content path\n */\n$value = $px2proj-\u003eget_path_content('/');\n\n/**\n * ローカルリソースディレクトリのパスを得る\n */\n$value = $px2proj-\u003epath_files('/', '/images/sample.png');\n\n/**\n * ローカルリソースディレクトリのサーバー内部パスを得る\n */\n$value = $px2proj-\u003erealpath_files('/', '/images/sample.png');\n\n/**\n * ローカルリソースのキャッシュディレクトリのパスを得る\n */\n$value = $px2proj-\u003epath_files_cache('/', '/images/sample.png');\n\n/**\n * ローカルリソースのキャッシュディレクトリのサーバー内部パスを得る\n */\n$value = $px2proj-\u003erealpath_files_cache('/', '/images/sample.png');\n\n/**\n * コンテンツ別の非公開キャッシュディレクトリのサーバー内部パスを得る\n */\n$value = $px2proj-\u003erealpath_files_private_cache('/', '/images/sample.png');\n\n/**\n * domain を取得する\n */\n$value = $px2proj-\u003eget_domain();\n\n/**\n * directory_index(省略できるファイル名) の一覧を得る\n */\n$value = $px2proj-\u003eget_directory_index();\n\n/**\n * 最も優先されるインデックスファイル名を得る\n */\n$value = $px2proj-\u003eget_directory_index_primary();\n\n/**\n * ファイルの処理方法を調べる\n */\n$value = $px2proj-\u003eget_path_proc_type('/sample_pages/');\n\n/**\n * リンク先のパスを生成する\n */\n$value = $px2proj-\u003ehref('/sample_pages/');\n\n/**\n * パスがダイナミックパスにマッチするか調べる\n */\n$value = $px2proj-\u003eis_match_dynamic_path('/sample_pages/');\n\n/**\n * ページが、パンくず内に存在しているか調べる\n */\n$value = $px2proj-\u003eis_page_in_breadcrumb('/sample_pages/', '/');\n\n/**\n * 除外ファイルか調べる\n */\n$value = $px2proj-\u003eis_ignore_path('/sample_pages/');\n\n\n/**\n * パブリッシュする\n */\n$output = $px2proj-\u003epublish( array(\n\t\"path_region\" =\u003e \"/path/region/\",\n\t\"paths_region\" =\u003e array(\n\t\t\"/path/region1/\",\n\t\t\"/path/region2/\"\n\t),\n\t\"paths_ignore\" =\u003e array(\n\t\t\"/path/region/ignored/1/\",\n\t\t\"/path/region/ignored/2/\"\n\t),\n\t\"keep_cache\" =\u003e 1,\n) );\n\n/**\n * キャッシュを削除する\n */\n$output = $px2proj-\u003eclearcache();\n```\n\n\n### PHPバイナリのパスを指定する場合 - Specifying path to PHP binary\n\n```php\n$px2agent = new picklesFramework2\\px2agent\\px2agent( array(\n    'bin' =\u003e '/path/to/php',\n    'ini' =\u003e '/path/to/php.ini',\n    'extension_dir' =\u003e '/path/to/ext/',\n) );\n$px2proj = $px2agent-\u003ecreateProject('/path/to/.px_execute.php');\n```\n\n\n## 開発者向け情報 - for developers\n\n### 開発環境セットアップ - Setting up development environment\n\n```bash\n$ cd {$project_root}\n$ composer install\n```\n\n### テスト - Test\n\n```bash\n$ composer test\n```\n\n### ドキュメント出力 - JSDoc\n\n```bash\n$ composer run-script documentation\n```\n\n\n\n## 更新履歴 - Change log\n\n### pickles2/px2agent v0.2.0 (2023年6月25日)\n\n- PHP 8.2 に対応した。\n\n### pickles2/px2agent v0.1.0 (2022年1月8日)\n\n- サポートするPHPのバージョンを `\u003e=7.3.0` に変更。\n- PHP 8.1 に対応した。\n\n### pickles2/px2agent v0.0.4 (2022年1月3日)\n\n- PHPコマンドのパスが引き回されない不具合を修正。\n\n### pickles2/px2agent v0.0.3 (2021年1月16日)\n\n- `$pj-\u003equery()` に、新しいオプション `method`、 `body`、 `body_file` を追加。\n\n### pickles2/px2agent v0.0.2 (2020年12月19日)\n\n- Windows で、コマンド中に `%` が含まれる場合に失敗する問題を修正。\n\n### pickles2/px2agent v0.0.1 (2020年8月12日)\n\n- Initial Release.\n\n\n## ライセンス - License\n\nMIT License\n\n\n## 作者 - Author\n\n- (C)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%2Fphp-px2agent","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fpickles2%2Fphp-px2agent","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fpickles2%2Fphp-px2agent/lists"}