zaengle/craft-phonehome
Composer 安装命令:
composer require zaengle/craft-phonehome
包简介
Phone Home plugin for Craft CMS
关键字:
README 文档
README
Monitor the status of your #CraftCMS projects remotely
Phonehome a secure API endpoint that returns comprehensive information about a Craft CMS installation and the server environment it is installed in.
Requirements
This plugin requires Craft CMS 4.0.0+ or 5.0.0+, and PHP 8.1+.
Quickstart Installation
composer require zaengle/craft-phonehome ./craft plugin/install phonehome
then in config/phonehome.php add:
return [ 'token' => getenv('PHONEHOME_TOKEN'), // Your secure token from Zaengle Phone Home service ];
Documentation
See the full documentation online or in the docs/ directory of this repository.
API Schema
The plugin provides a JSON schema that defines the structure of the API response. The schema is located at src/schemas/PhonehomeApi.schema.json and follows semantic versioning.
You can retrieve the schema via the API endpoint:
GET /actions/phonehome/api/schema
X-Auth-Token: your-token-here
Important for contributors: When modifying the API response structure in Report::getInfo(), you must update the schema file accordingly and bump the schema version following semantic versioning rules. See CLAUDE.md for detailed schema maintenance guidelines.
Configuration
Additional Environment Variables
You can configure the plugin to include additional environment variables in the API response by setting additionalEnvKeys in your config/phonehome.php:
return [ 'token' => getenv('PHONEHOME_TOKEN'), 'additionalEnvKeys' => [ 'MY_CUSTOM_ENV_VAR', 'DEPLOYMENT_ID', 'BUILD_NUMBER', ], ];
These values will be included in the meta section of the API response, making it easy to include deployment-specific information alongside the standard system metrics.
Extensibility
Custom Status Checks
You can register custom status checks to monitor application-specific health metrics. Status checks are registered via Craft's event system:
use yii\base\Event; use zaengle\phonehome\services\Report; use zaengle\phonehome\events\RegisterStatusChecksEvent; Event::on( Report::class, Report::EVENT_REGISTER_STATUS_CHECKS, function(RegisterStatusChecksEvent $event) { $event->checks[] = MyCustomStatusCheck::class; } );
Your status check class must implement StatusCheckInterface:
use zaengle\phonehome\statuschecks\StatusCheckInterface; use zaengle\phonehome\models\StatusCheckResult; use zaengle\phonehome\enums\StatusCheck; class MyCustomStatusCheck implements StatusCheckInterface { public static function getName(): string { return 'My Custom Check'; } public static function getDescription(): string { return 'Monitors custom application metrics'; } public static function check(): StatusCheckResult { return new StatusCheckResult([ 'name' => self::getName(), 'status' => StatusCheck::OK, 'description' => self::getDescription(), 'meta' => [ 'custom_metric' => 'value', ], ]); } }
Support
For support, visit the GitHub repository.
Development
See the development guide for details on how to contribute to this project.
zaengle/craft-phonehome 适用场景与选型建议
zaengle/craft-phonehome 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 5.32k 次下载、GitHub Stars 达 0, 最近一次更新时间为 2025 年 07 月 16 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「cms」 「Craft」 「craftcms」 「craft-plugin」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 zaengle/craft-phonehome 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 zaengle/craft-phonehome 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 zaengle/craft-phonehome 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Expand, collapse, change the status of, or delete multiple blocks in a Matrix field simultaneously.
GraphQL authentication for your headless Craft CMS applications.
Set Links with a specific language parameter
Supercharged text field validation.
Integrate with Snipcart.
Restrict user registration by domain in Craft CMS, allows you to limit who can register for your site based on their email address.
统计信息
- 总下载量: 5.32k
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 13
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2025-07-16