dply/fleet-operator
Composer 安装命令:
composer require dply/fleet-operator
包简介
PHP middleware, config, and OpenAPI spec for Fleet Console operator APIs (GET …/summary and …/readme).
README 文档
README
Repository: github.com/shaferllc/fleet-operator
Composer package: dply/fleet-operator · PHP ^8.4
Shared middleware, config, and OpenAPI for applications that expose a Fleet Console–compatible operator API:
GET {prefix}/summary— JSON snapshot (see Summary fields below); extra keys are stored and can driveFLEET_ALERT_METRIC_RULESGET {prefix}/readme— JSON with requiredcontent(Markdown is typical); optionalformat,title,subtitle
Fleet Console polls summary and may open readme in the UI. Set FLEET_OPERATOR_TOKEN on this app and store the same secret for that service in Fleet Console (Console → Services → operator token for that row).
Should I use this package?
| Use it | Skip it |
|---|---|
| Many services, want one auth + contract | Single app, two routes already done |
| Want a published OpenAPI file per release | Only internal docs in a wiki |
| Semver when response/auth rules evolve | API never changes |
GitHub Actions
- On shaferllc/fleet-operator: workflow CI lives at
.github/workflows/ci.ymlon the default branch (main). Open Actions → CI — you should see runs on each push/PR. Use Run workflow if you addworkflow_dispatch(included in this repo) to run without a new commit. - Release:
.github/workflows/release.ymlcreates a GitHub Release when you push a tagv1.2.3or run the workflow with a version. That file must exist on the package repo (push it if you only see CI in the Actions sidebar). - Fleet Console monorepo: GitHub does not run YAML under
fleet-operator/.github/for the parent repo. Use the monorepo root workflowpackage-fleet-operator.yml(path filterfleet-operator/**) — or Actions → Run workflow after enablingworkflow_dispatchon that file.
Install
composer require dply/fleet-operator
Optional: publish bundled config and OpenAPI into your project when your stack supports tagged package publishing (tags fleet-operator-config and fleet-operator-openapi).
Set in .env:
FLEET_OPERATOR_TOKEN=your-long-random-secret
Wire HTTP routes (you choose the prefix)
Typical prefixes are api/operator or api/v1/operator.
Apply AuthenticateFleetOperator to the routes that serve your operator summary and readme endpoints. Example — adapt to your router and controllers:
<?php use Dply\FleetOperator\Http\Middleware\AuthenticateFleetOperator; // Pseudocode: attach AuthenticateFleetOperator::class to GET .../summary and GET .../readme
Return JSON bodies (or your framework’s JSON response type) from those handlers.
Summary fields (all optional)
Fleet Console renders these when present (still accepts any other JSON):
| Field | Type | Purpose |
|---|---|---|
app / service |
string | Service id on the card |
version |
string / number | Release label |
git_sha / commit |
string | VCS revision (short hash shown) |
runtime / php_version |
string | Runtime line |
uptime_seconds |
int | Uptime (formatted) |
region |
string or string[] | Region label(s) |
deployed_at / build_at |
string | Deploy / build time |
environment, generated_at, users, organizations |
various | Existing dashboard tiles |
notes / status_message |
string | Highlighted status strip |
links |
object | Map of label → https URL (link chips) |
dependencies |
array | { name, ok?, healthy?, detail? } rows |
metrics |
object | Extra counters (key/value grid) |
Readme JSON shape
Fleet’s README view expects JSON similar to:
{
"format": "markdown",
"title": "My product",
"subtitle": "Internal runbook",
"content": "# Hello\n\n…"
}
content must be a string (can be empty). title / subtitle override or augment the README page header in Fleet Console.
Versioning
Follow SemVer. Bump minor when adding optional JSON fields; major if auth or required response shapes break consumers.
Packagist
Install name: dply/fleet-operator — not fleetphp/fleet-operator.
If Packagist still shows the old vendor, the registry entry was never updated: Packagist package names come from maintainer actions, not from this repo alone.
- Open Submit package and submit your Git repo if
dply/fleet-operatoris missing. - If
fleetphp/fleet-operatoris your package and pointed at this same repository, either:- Abandon it on Packagist (set replacement to
dply/fleet-operator), then ensuredply/fleet-operatoris submitted; or - Contact Packagist support if you need the old name removed so the URL can attach to the new package name.
- Abandon it on Packagist (set replacement to
- Ensure the GitHub/GitLab integration (webhook or “Update”) has run so Packagist reads the current
composer.json(namemust bedply/fleet-operator).
composer.json includes "replace": { "fleetphp/fleet-operator": "*" } so projects that still list the old name can resolve the replacement when both are visible to Composer (e.g. after you abandon with a replacement, or while migrating).
Repository layout
The canonical Git remote is github.com/shaferllc/fleet-operator (this tree is the package root there).
- CI:
.github/workflows/ci.ymlruns PHPUnit on PHP 8.4 and 8.5 on pushes and PRs to that repository. - Releases: Tag
v1.2.3on shaferllc/fleet-operator (workflow Release in this package repo, or push the tag manually). Packagist reads from that Git URL.
Fleet Console (the dashboard app monorepo, if you use one) may still vendor a copy under fleet-operator/ with a Composer path repository for local development. Sync that directory from this repo when needed, or depend on dply/fleet-operator via VCS:
"repositories": [ { "type": "vcs", "url": "https://github.com/shaferllc/fleet-operator" } ], "require": { "dply/fleet-operator": "^1.0" }
License
MIT
dply/fleet-operator 适用场景与选型建议
dply/fleet-operator 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 4 次下载、GitHub Stars 达 0, 最近一次更新时间为 2026 年 03 月 25 日, 在 PHP 生态内属于活跃度较高的组件。
它主要适用于以下技术方向: 「php」 「http」 「operator」 「monitoring」 「middleware」 「openapi」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。
我们在过去多个企业项目中使用过 dply/fleet-operator 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。
基于 dply/fleet-operator 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。
线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。
承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。
与 dply/fleet-operator 相关的其它包
同方向 / 同关键字的高下载量 PHP Composer 包推荐,方便对比选型:
Empty Coalesce adds the ??? operator to Twig that will return the first thing that is defined, not null, and not empty.
repository php library
FullTextSearchQueryLike is a PHP class which transforms search strings into clever SQL conditions with the LIKE operator
eZ Publish extension which provides template operators to generate complex template logic simply. Provides many template operators and a couple of workflow events which are needed very often, yet missing in eZ Publish. Great for smart developers!
eZ Publish extension which provides function based custom template operator support to generate complex template logic increadibly simply. Provides for simple template operator implementation guide that is needed quite often, yet missing in eZ Publish. Great for smart developers!
eZ Publish Legacy extension BC Website Statistics allows a website to collect page view, web shop order and other statistics using Google Analytics. This product is a Certified eZ Publish Extension. With the BC Website Statistics you can collect web site user page view, file download and web shop or
统计信息
- 总下载量: 4
- 月度下载量: 0
- 日度下载量: 0
- 收藏数: 0
- 点击次数: 35
- 依赖项目数: 0
- 推荐数: 0
其他信息
- 授权协议: MIT
- 更新时间: 2026-03-25