镜像自地址
https://github.com/JGZYES/ParlzPackageManger.git
已同步 2026-09-11 05:42:44 +08:00
- pmm 0.6.0: 结构化错误码(见前), 站点 PMM_VERSION + install.sh 版本 + 文档版本 - ppdm 0.0.2: 新增 list/del 命令(客户端) + web/ppdm/list.php/del.php 后端 - CI: ppdm 构建版本 0.0.1 -> 0.0.2 - docs: ppdm.md 加 list/del, download/install 文档 0.5.6 -> 0.6.0 - CHANGELOG 0.6.0 增 ppdm 0.0.2 全量发布说明
30 行
1.1 KiB
PHP
30 行
1.1 KiB
PHP
<?php
|
|
/* web/ppdm/list.php — list packages owned by the current account.
|
|
* Requires a valid bearer token. Returns:
|
|
* {"ok":true,"list":"name@ver os/arch description url\n..."}
|
|
* The list field uses real newlines (the tiny C client reads it via substring
|
|
* search, so we deliberately do NOT json_encode the newlines). */
|
|
define('PMM_SITE', 1);
|
|
require __DIR__ . '/lib.php';
|
|
|
|
[$tok, $email] = pmu_require_auth_token();
|
|
|
|
$regDir = __DIR__ . '/../mirror/dists';
|
|
$out = [];
|
|
foreach (glob($regDir . '/*.json') as $f) {
|
|
if (basename($f) === 'packages.json') continue;
|
|
$m = json_decode(file_get_contents($f), true) ?: [];
|
|
if (($m['owner'] ?? '') !== $email) continue;
|
|
foreach (($m['variants'] ?? []) as $v) {
|
|
$nm = $v['name'] ?? ($m['name'] ?? '');
|
|
$ver = $v['version'] ?? ($m['version'] ?? '');
|
|
$os = $v['os'] ?? 'linux';
|
|
$arch = $v['arch'] ?? 'amd64';
|
|
$desc = $v['description'] ?? '';
|
|
$url = $v['url'] ?? '';
|
|
$out[] = sprintf("%s@%s %s/%s %s %s", $nm, $ver, $os, $arch, $desc, $url);
|
|
}
|
|
}
|
|
$text = implode("\n", $out);
|
|
echo '{"ok":true,"list":"' . $text . '"}';
|