debug
This commit is contained in:
2
code/.gitignore
vendored
2
code/.gitignore
vendored
@@ -18,5 +18,7 @@ public/static/css/compiled/*
|
||||
public/static/js/compiled/*
|
||||
public/static/favicon/generated/*
|
||||
/public/_seo_copy_release/*
|
||||
/app/public/_admin_templates/video-metadata-missing-task-pool/*
|
||||
/app/public/_admin_templates/video-metadata-missing-workbench/*
|
||||
/data/seo_copy_published/*
|
||||
/storage/*
|
||||
|
||||
@@ -1057,7 +1057,7 @@ class Site extends BaseController
|
||||
|
||||
protected function domainExternalSeoSummaryRoot(): string
|
||||
{
|
||||
return $this->bootstrapCodeRoot() . '/public/_admin_templates/domain-seo-external/latest';
|
||||
return $this->bootstrapCodeRoot() . '/storage/external-seo/latest';
|
||||
}
|
||||
|
||||
protected function domainExternalSeoManualImportRoot(): string
|
||||
@@ -1067,12 +1067,12 @@ class Site extends BaseController
|
||||
|
||||
protected function domainExternalSeoSnapshotRunRoot(): string
|
||||
{
|
||||
return $this->bootstrapCodeRoot() . '/public/_admin_templates/domain-seo-external/snapshot-runs';
|
||||
return $this->bootstrapCodeRoot() . '/storage/external-seo/snapshot-runs';
|
||||
}
|
||||
|
||||
protected function domainExternalSeoSnapshotValidateRunRoot(): string
|
||||
{
|
||||
return $this->bootstrapCodeRoot() . '/public/_admin_templates/domain-seo-external/snapshot-validate-runs';
|
||||
return $this->bootstrapCodeRoot() . '/storage/external-seo/snapshot-validate-runs';
|
||||
}
|
||||
|
||||
protected function domainExternalSeoStorageRoot(): string
|
||||
@@ -1122,6 +1122,18 @@ class Site extends BaseController
|
||||
return $strPath;
|
||||
}
|
||||
|
||||
protected function storageRelativePath(string $strPath): string
|
||||
{
|
||||
$strStorageRoot = rtrim($this->bootstrapCodeRoot() . '/storage/', '/');
|
||||
$strPath = str_replace('\\', '/', $strPath);
|
||||
$strStorageRoot = str_replace('\\', '/', $strStorageRoot);
|
||||
if (str_starts_with($strPath, $strStorageRoot . '/')) {
|
||||
return substr($strPath, strlen($strStorageRoot . '/'));
|
||||
}
|
||||
|
||||
return $strPath;
|
||||
}
|
||||
|
||||
protected function bootstrapTemplateKey(?string $strTemplate): string
|
||||
{
|
||||
$strTemplate = strtolower(trim((string)$strTemplate));
|
||||
@@ -2180,8 +2192,8 @@ class Site extends BaseController
|
||||
$intLimit
|
||||
);
|
||||
$arrSummary = DomainExternalSeoSummaryHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
@@ -2215,8 +2227,8 @@ class Site extends BaseController
|
||||
$intLimit
|
||||
);
|
||||
$arrSummary = DomainExternalSeoTrendHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
@@ -2334,8 +2346,8 @@ class Site extends BaseController
|
||||
'mapped_hosts_count' => (int)($arrResult['mapped_hosts_count'] ?? 0),
|
||||
'provider_summary' => $arrProviderSummary,
|
||||
'real_summary_status' => (string)($arrRealSummary['status'] ?? ''),
|
||||
'summary_json_path' => $this->publicRelativePath((string)($arrRealSummary['summary_json_path'] ?? '')),
|
||||
'summary_html_path' => $this->publicRelativePath((string)($arrRealSummary['summary_html_path'] ?? '')),
|
||||
'summary_json_path' => $this->storageRelativePath((string)($arrRealSummary['summary_json_path'] ?? '')),
|
||||
'summary_html_path' => $this->storageRelativePath((string)($arrRealSummary['summary_html_path'] ?? '')),
|
||||
]);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '上传 Search Console property map 失败:' . $Throwable->getMessage());
|
||||
@@ -2348,8 +2360,8 @@ class Site extends BaseController
|
||||
$intDays = max(1, min(30, (int)$Request->get('days', 7)));
|
||||
$arrSummary = DomainExternalSeoSearchConsoleProviderPlanHelper::buildSummary($this->bootstrapCodeRoot(), $intDays);
|
||||
$arrSummary = DomainExternalSeoSearchConsoleProviderPlanHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取 Search Console provider 计划失败:' . $Throwable->getMessage());
|
||||
@@ -2362,8 +2374,8 @@ class Site extends BaseController
|
||||
$intDays = max(1, min(30, (int)$Request->get('days', 7)));
|
||||
$arrSummary = DomainExternalSeoSearchConsoleFetchHelper::buildSummary($this->bootstrapCodeRoot(), $intDays);
|
||||
$arrSummary = DomainExternalSeoSearchConsoleFetchHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取 Search Console fetch 摘要失败:' . $Throwable->getMessage());
|
||||
@@ -2375,8 +2387,8 @@ class Site extends BaseController
|
||||
try {
|
||||
$arrSummary = DomainExternalSeoBaiduProviderPlanHelper::buildSummary($this->bootstrapCodeRoot());
|
||||
$arrSummary = DomainExternalSeoBaiduProviderPlanHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取百度 provider 计划失败:' . $Throwable->getMessage());
|
||||
@@ -2389,8 +2401,8 @@ class Site extends BaseController
|
||||
$intLimit = max(1, min(200, (int)$Request->get('limit', 50)));
|
||||
$arrSummary = DomainExternalSeoBaiduPushSummaryHelper::buildSummary($this->bootstrapCodeRoot(), $intLimit);
|
||||
$arrSummary = DomainExternalSeoBaiduPushSummaryHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取百度推送观察摘要失败:' . $Throwable->getMessage());
|
||||
@@ -2439,8 +2451,8 @@ class Site extends BaseController
|
||||
$intLimit = max(1, min(300, (int)$Request->get('limit', 100)));
|
||||
$arrQueue = DomainExternalSeoBaiduPushAttentionQueueHelper::buildQueue($this->bootstrapCodeRoot(), $intLimit);
|
||||
$arrQueue = DomainExternalSeoBaiduPushAttentionQueueHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrQueue);
|
||||
$arrQueue['summary_json_path'] = $this->publicRelativePath((string)($arrQueue['summary_json_path'] ?? ''));
|
||||
$arrQueue['summary_html_path'] = $this->publicRelativePath((string)($arrQueue['summary_html_path'] ?? ''));
|
||||
$arrQueue['summary_json_path'] = $this->storageRelativePath((string)($arrQueue['summary_json_path'] ?? ''));
|
||||
$arrQueue['summary_html_path'] = $this->storageRelativePath((string)($arrQueue['summary_html_path'] ?? ''));
|
||||
return $this->success($arrQueue);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取百度推送异常队列失败:' . $Throwable->getMessage());
|
||||
@@ -2453,8 +2465,8 @@ class Site extends BaseController
|
||||
$intLimit = max(1, min(100, (int)$Request->get('limit', 20)));
|
||||
$arrSummary = DomainExternalSeoBaiduPushTrendHelper::buildSummary($this->bootstrapCodeRoot(), $intLimit);
|
||||
$arrSummary = DomainExternalSeoBaiduPushTrendHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取百度推送趋势摘要失败:' . $Throwable->getMessage());
|
||||
@@ -2467,8 +2479,8 @@ class Site extends BaseController
|
||||
$intLimit = max(1, min(100, (int)$Request->get('limit', 20)));
|
||||
$arrSummary = DomainExternalSeoBaiduFeedbackSummaryHelper::buildSummary($this->bootstrapCodeRoot(), $intLimit);
|
||||
$arrSummary = DomainExternalSeoBaiduFeedbackSummaryHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取百度反馈摘要失败:' . $Throwable->getMessage());
|
||||
@@ -2481,8 +2493,8 @@ class Site extends BaseController
|
||||
$intLimit = max(1, min(100, (int)$Request->get('limit', 20)));
|
||||
$arrSummary = DomainExternalSeoSiteQueryProbeHelper::buildSummary($this->bootstrapCodeRoot(), $intLimit);
|
||||
$arrSummary = DomainExternalSeoSiteQueryProbeHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取百度 site: 收录探测失败:' . $Throwable->getMessage());
|
||||
@@ -2509,8 +2521,8 @@ class Site extends BaseController
|
||||
$intLimit = max(1, min(300, (int)$Request->get('limit', 100)));
|
||||
$arrQueue = DomainExternalSeoAizhanKeywordAttentionQueueHelper::buildQueue($this->bootstrapCodeRoot(), $intLimit);
|
||||
$arrQueue = DomainExternalSeoAizhanKeywordAttentionQueueHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrQueue);
|
||||
$arrQueue['summary_json_path'] = $this->publicRelativePath((string)($arrQueue['summary_json_path'] ?? ''));
|
||||
$arrQueue['summary_html_path'] = $this->publicRelativePath((string)($arrQueue['summary_html_path'] ?? ''));
|
||||
$arrQueue['summary_json_path'] = $this->storageRelativePath((string)($arrQueue['summary_json_path'] ?? ''));
|
||||
$arrQueue['summary_html_path'] = $this->storageRelativePath((string)($arrQueue['summary_html_path'] ?? ''));
|
||||
return $this->success($arrQueue);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取爱站关键词异常队列失败:' . $Throwable->getMessage());
|
||||
@@ -2523,8 +2535,8 @@ class Site extends BaseController
|
||||
$intLimit = max(1, min(100, (int)$Request->get('limit', 20)));
|
||||
$arrSummary = DomainExternalSeoAizhanKeywordTrendHelper::buildSummary($this->bootstrapCodeRoot(), $intLimit);
|
||||
$arrSummary = DomainExternalSeoAizhanKeywordTrendHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取爱站关键词趋势摘要失败:' . $Throwable->getMessage());
|
||||
@@ -2568,40 +2580,40 @@ class Site extends BaseController
|
||||
$arrResult = DomainExternalSeoSnapshotHelper::ingestSnapshots((array)$arrSnapshots, $strSource);
|
||||
$strRunRoot = DomainExternalSeoSnapshotRunHelper::createRunRoot($this->domainExternalSeoSnapshotRunRoot(), 'snapshot_push');
|
||||
$arrResult = DomainExternalSeoSnapshotRunHelper::writeRunArtifacts(
|
||||
$this->bootstrapCodeRoot() . '/public',
|
||||
$this->bootstrapCodeRoot() . '/storage',
|
||||
$strRunRoot,
|
||||
$arrResult,
|
||||
(array)$arrSnapshots
|
||||
);
|
||||
$arrResult['run_root'] = $this->publicRelativePath($strRunRoot);
|
||||
$arrResult['summary_json_path'] = $this->publicRelativePath((string)($arrResult['summary_json_path'] ?? ''));
|
||||
$arrResult['summary_html_path'] = $this->publicRelativePath((string)($arrResult['summary_html_path'] ?? ''));
|
||||
$arrResult['payload_json_path'] = $this->publicRelativePath((string)($arrResult['payload_json_path'] ?? ''));
|
||||
$arrResult['run_root'] = $this->storageRelativePath($strRunRoot);
|
||||
$arrResult['summary_json_path'] = $this->storageRelativePath((string)($arrResult['summary_json_path'] ?? ''));
|
||||
$arrResult['summary_html_path'] = $this->storageRelativePath((string)($arrResult['summary_html_path'] ?? ''));
|
||||
$arrResult['payload_json_path'] = $this->storageRelativePath((string)($arrResult['payload_json_path'] ?? ''));
|
||||
$arrOverview = DomainExternalSeoCnOverviewHelper::buildOverview(14, 10);
|
||||
$arrOverview = DomainExternalSeoCnOverviewHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrOverview);
|
||||
$arrOverview['summary_json_path'] = $this->publicRelativePath((string)($arrOverview['summary_json_path'] ?? ''));
|
||||
$arrOverview['summary_html_path'] = $this->publicRelativePath((string)($arrOverview['summary_html_path'] ?? ''));
|
||||
$arrOverview['summary_json_path'] = $this->storageRelativePath((string)($arrOverview['summary_json_path'] ?? ''));
|
||||
$arrOverview['summary_html_path'] = $this->storageRelativePath((string)($arrOverview['summary_html_path'] ?? ''));
|
||||
|
||||
$arrSnapshotTrend = DomainExternalSeoSnapshotTrendHelper::buildSummary($this->domainExternalSeoSnapshotRunRoot(), 10);
|
||||
$arrSnapshotTrend = DomainExternalSeoSnapshotTrendHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSnapshotTrend);
|
||||
$arrSnapshotTrend['summary_json_path'] = $this->publicRelativePath((string)($arrSnapshotTrend['summary_json_path'] ?? ''));
|
||||
$arrSnapshotTrend['summary_html_path'] = $this->publicRelativePath((string)($arrSnapshotTrend['summary_html_path'] ?? ''));
|
||||
$arrSnapshotTrend['summary_json_path'] = $this->storageRelativePath((string)($arrSnapshotTrend['summary_json_path'] ?? ''));
|
||||
$arrSnapshotTrend['summary_html_path'] = $this->storageRelativePath((string)($arrSnapshotTrend['summary_html_path'] ?? ''));
|
||||
|
||||
$arrResult['post_ingest_overview'] = $arrOverview;
|
||||
$arrResult['post_ingest_snapshot_trend'] = $arrSnapshotTrend;
|
||||
$arrResult = DomainExternalSeoSnapshotRunHelper::writeRunArtifacts(
|
||||
$this->bootstrapCodeRoot() . '/public',
|
||||
$this->bootstrapCodeRoot() . '/storage',
|
||||
$strRunRoot,
|
||||
$arrResult,
|
||||
(array)$arrSnapshots
|
||||
);
|
||||
$arrResult['summary_json_path'] = $this->publicRelativePath((string)($arrResult['summary_json_path'] ?? ''));
|
||||
$arrResult['summary_html_path'] = $this->publicRelativePath((string)($arrResult['summary_html_path'] ?? ''));
|
||||
$arrResult['payload_json_path'] = $this->publicRelativePath((string)($arrResult['payload_json_path'] ?? ''));
|
||||
$arrResult['summary_json_path'] = $this->storageRelativePath((string)($arrResult['summary_json_path'] ?? ''));
|
||||
$arrResult['summary_html_path'] = $this->storageRelativePath((string)($arrResult['summary_html_path'] ?? ''));
|
||||
$arrResult['payload_json_path'] = $this->storageRelativePath((string)($arrResult['payload_json_path'] ?? ''));
|
||||
$arrSnapshotTrend = DomainExternalSeoSnapshotTrendHelper::buildSummary($this->domainExternalSeoSnapshotRunRoot(), 10);
|
||||
$arrSnapshotTrend = DomainExternalSeoSnapshotTrendHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSnapshotTrend);
|
||||
$arrSnapshotTrend['summary_json_path'] = $this->publicRelativePath((string)($arrSnapshotTrend['summary_json_path'] ?? ''));
|
||||
$arrSnapshotTrend['summary_html_path'] = $this->publicRelativePath((string)($arrSnapshotTrend['summary_html_path'] ?? ''));
|
||||
$arrSnapshotTrend['summary_json_path'] = $this->storageRelativePath((string)($arrSnapshotTrend['summary_json_path'] ?? ''));
|
||||
$arrSnapshotTrend['summary_html_path'] = $this->storageRelativePath((string)($arrSnapshotTrend['summary_html_path'] ?? ''));
|
||||
$arrResult['post_ingest_snapshot_trend'] = $arrSnapshotTrend;
|
||||
return $this->success($arrResult);
|
||||
} catch (\Throwable $Throwable) {
|
||||
@@ -2651,15 +2663,15 @@ class Site extends BaseController
|
||||
$arrResult = DomainExternalSeoSnapshotSchemaHelper::validateSnapshots((array)$arrSnapshots);
|
||||
$strRunRoot = DomainExternalSeoSnapshotValidateRunHelper::createRunRoot($this->domainExternalSeoSnapshotValidateRunRoot(), 'snapshot_validate');
|
||||
$arrResult = DomainExternalSeoSnapshotValidateRunHelper::writeRunArtifacts(
|
||||
$this->bootstrapCodeRoot() . '/public',
|
||||
$this->bootstrapCodeRoot() . '/storage',
|
||||
$strRunRoot,
|
||||
$arrResult,
|
||||
(array)$arrSnapshots
|
||||
);
|
||||
$arrResult['run_root'] = $this->publicRelativePath($strRunRoot);
|
||||
$arrResult['summary_json_path'] = $this->publicRelativePath((string)($arrResult['summary_json_path'] ?? ''));
|
||||
$arrResult['summary_html_path'] = $this->publicRelativePath((string)($arrResult['summary_html_path'] ?? ''));
|
||||
$arrResult['payload_json_path'] = $this->publicRelativePath((string)($arrResult['payload_json_path'] ?? ''));
|
||||
$arrResult['run_root'] = $this->storageRelativePath($strRunRoot);
|
||||
$arrResult['summary_json_path'] = $this->storageRelativePath((string)($arrResult['summary_json_path'] ?? ''));
|
||||
$arrResult['summary_html_path'] = $this->storageRelativePath((string)($arrResult['summary_html_path'] ?? ''));
|
||||
$arrResult['payload_json_path'] = $this->storageRelativePath((string)($arrResult['payload_json_path'] ?? ''));
|
||||
|
||||
return $this->success($arrResult);
|
||||
} catch (\Throwable $Throwable) {
|
||||
@@ -2944,8 +2956,8 @@ class Site extends BaseController
|
||||
$intDays = max(1, min(30, (int)$Request->get('days', 7)));
|
||||
$arrSummary = DomainExternalSeoRealSummaryHelper::buildSummary($this->bootstrapCodeRoot(), $intDays);
|
||||
$arrSummary = DomainExternalSeoRealSummaryHelper::writeArtifacts($this->domainExternalSeoSummaryRoot(), $arrSummary);
|
||||
$arrSummary['summary_json_path'] = $this->publicRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->publicRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
$arrSummary['summary_json_path'] = $this->storageRelativePath((string)($arrSummary['summary_json_path'] ?? ''));
|
||||
$arrSummary['summary_html_path'] = $this->storageRelativePath((string)($arrSummary['summary_html_path'] ?? ''));
|
||||
return $this->success($arrSummary);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '读取真实站外 summary 骨架失败:' . $Throwable->getMessage());
|
||||
@@ -3021,8 +3033,8 @@ class Site extends BaseController
|
||||
'real_metrics_available' => !empty($arrRealSummary['real_metrics_available']),
|
||||
'real_summary_provider' => (string)($arrRealSummary['provider_key'] ?? ''),
|
||||
'metrics' => (array)($arrRealSummary['metrics'] ?? []),
|
||||
'summary_json_path' => $this->publicRelativePath((string)($arrRealSummary['summary_json_path'] ?? '')),
|
||||
'summary_html_path' => $this->publicRelativePath((string)($arrRealSummary['summary_html_path'] ?? '')),
|
||||
'summary_json_path' => $this->storageRelativePath((string)($arrRealSummary['summary_json_path'] ?? '')),
|
||||
'summary_html_path' => $this->storageRelativePath((string)($arrRealSummary['summary_html_path'] ?? '')),
|
||||
]);
|
||||
} catch (\Throwable $Throwable) {
|
||||
return $this->error('9999', '导入站外手工报表失败:' . $Throwable->getMessage());
|
||||
|
||||
@@ -35,17 +35,17 @@ class SeoCollector extends BaseController
|
||||
|
||||
protected function summaryRoot(): string
|
||||
{
|
||||
return $this->publicRoot() . '/_admin_templates/domain-seo-external/latest';
|
||||
return $this->storageRoot() . '/external-seo/latest';
|
||||
}
|
||||
|
||||
protected function snapshotRunRoot(): string
|
||||
{
|
||||
return $this->publicRoot() . '/_admin_templates/domain-seo-external/snapshot-runs';
|
||||
return $this->storageRoot() . '/external-seo/snapshot-runs';
|
||||
}
|
||||
|
||||
protected function snapshotValidateRunRoot(): string
|
||||
{
|
||||
return $this->publicRoot() . '/_admin_templates/domain-seo-external/snapshot-validate-runs';
|
||||
return $this->storageRoot() . '/external-seo/snapshot-validate-runs';
|
||||
}
|
||||
|
||||
protected function spiderCrawlLatestRoot(): string
|
||||
@@ -138,15 +138,15 @@ class SeoCollector extends BaseController
|
||||
$result = DomainExternalSeoSnapshotSchemaHelper::validateSnapshots((array)$snapshots);
|
||||
$runRoot = DomainExternalSeoSnapshotValidateRunHelper::createRunRoot($this->snapshotValidateRunRoot(), 'snapshot_validate');
|
||||
$result = DomainExternalSeoSnapshotValidateRunHelper::writeRunArtifacts(
|
||||
$this->publicRoot(),
|
||||
$this->storageRoot(),
|
||||
$runRoot,
|
||||
$result,
|
||||
(array)$snapshots
|
||||
);
|
||||
$result['run_root'] = $this->publicRelativePath($runRoot);
|
||||
$result['summary_json_path'] = $this->publicRelativePath((string)($result['summary_json_path'] ?? ''));
|
||||
$result['summary_html_path'] = $this->publicRelativePath((string)($result['summary_html_path'] ?? ''));
|
||||
$result['payload_json_path'] = $this->publicRelativePath((string)($result['payload_json_path'] ?? ''));
|
||||
$result['run_root'] = $this->storageRelativePath($runRoot);
|
||||
$result['summary_json_path'] = $this->storageRelativePath((string)($result['summary_json_path'] ?? ''));
|
||||
$result['summary_html_path'] = $this->storageRelativePath((string)($result['summary_html_path'] ?? ''));
|
||||
$result['payload_json_path'] = $this->storageRelativePath((string)($result['payload_json_path'] ?? ''));
|
||||
|
||||
return $this->success($result);
|
||||
} catch (\Throwable $throwable) {
|
||||
@@ -166,37 +166,37 @@ class SeoCollector extends BaseController
|
||||
$result = DomainExternalSeoSnapshotHelper::ingestSnapshots((array)$snapshots, $source);
|
||||
$runRoot = DomainExternalSeoSnapshotRunHelper::createRunRoot($this->snapshotRunRoot(), 'snapshot_push');
|
||||
$result = DomainExternalSeoSnapshotRunHelper::writeRunArtifacts(
|
||||
$this->publicRoot(),
|
||||
$this->storageRoot(),
|
||||
$runRoot,
|
||||
$result,
|
||||
(array)$snapshots
|
||||
);
|
||||
$result['run_root'] = $this->publicRelativePath($runRoot);
|
||||
$result['summary_json_path'] = $this->publicRelativePath((string)($result['summary_json_path'] ?? ''));
|
||||
$result['summary_html_path'] = $this->publicRelativePath((string)($result['summary_html_path'] ?? ''));
|
||||
$result['payload_json_path'] = $this->publicRelativePath((string)($result['payload_json_path'] ?? ''));
|
||||
$result['run_root'] = $this->storageRelativePath($runRoot);
|
||||
$result['summary_json_path'] = $this->storageRelativePath((string)($result['summary_json_path'] ?? ''));
|
||||
$result['summary_html_path'] = $this->storageRelativePath((string)($result['summary_html_path'] ?? ''));
|
||||
$result['payload_json_path'] = $this->storageRelativePath((string)($result['payload_json_path'] ?? ''));
|
||||
|
||||
$overview = DomainExternalSeoCnOverviewHelper::buildOverview(14, 10);
|
||||
$overview = DomainExternalSeoCnOverviewHelper::writeArtifacts($this->summaryRoot(), $overview);
|
||||
$overview['summary_json_path'] = $this->publicRelativePath((string)($overview['summary_json_path'] ?? ''));
|
||||
$overview['summary_html_path'] = $this->publicRelativePath((string)($overview['summary_html_path'] ?? ''));
|
||||
$overview['summary_json_path'] = $this->storageRelativePath((string)($overview['summary_json_path'] ?? ''));
|
||||
$overview['summary_html_path'] = $this->storageRelativePath((string)($overview['summary_html_path'] ?? ''));
|
||||
|
||||
$snapshotTrend = DomainExternalSeoSnapshotTrendHelper::buildSummary($this->snapshotRunRoot(), 10);
|
||||
$snapshotTrend = DomainExternalSeoSnapshotTrendHelper::writeArtifacts($this->summaryRoot(), $snapshotTrend);
|
||||
$snapshotTrend['summary_json_path'] = $this->publicRelativePath((string)($snapshotTrend['summary_json_path'] ?? ''));
|
||||
$snapshotTrend['summary_html_path'] = $this->publicRelativePath((string)($snapshotTrend['summary_html_path'] ?? ''));
|
||||
$snapshotTrend['summary_json_path'] = $this->storageRelativePath((string)($snapshotTrend['summary_json_path'] ?? ''));
|
||||
$snapshotTrend['summary_html_path'] = $this->storageRelativePath((string)($snapshotTrend['summary_html_path'] ?? ''));
|
||||
|
||||
$result['post_ingest_overview'] = $overview;
|
||||
$result['post_ingest_snapshot_trend'] = $snapshotTrend;
|
||||
$result = DomainExternalSeoSnapshotRunHelper::writeRunArtifacts(
|
||||
$this->publicRoot(),
|
||||
$this->storageRoot(),
|
||||
$runRoot,
|
||||
$result,
|
||||
(array)$snapshots
|
||||
);
|
||||
$result['summary_json_path'] = $this->publicRelativePath((string)($result['summary_json_path'] ?? ''));
|
||||
$result['summary_html_path'] = $this->publicRelativePath((string)($result['summary_html_path'] ?? ''));
|
||||
$result['payload_json_path'] = $this->publicRelativePath((string)($result['payload_json_path'] ?? ''));
|
||||
$result['summary_json_path'] = $this->storageRelativePath((string)($result['summary_json_path'] ?? ''));
|
||||
$result['summary_html_path'] = $this->storageRelativePath((string)($result['summary_html_path'] ?? ''));
|
||||
$result['payload_json_path'] = $this->storageRelativePath((string)($result['payload_json_path'] ?? ''));
|
||||
|
||||
return $this->success($result);
|
||||
} catch (\Throwable $throwable) {
|
||||
|
||||
@@ -6,12 +6,12 @@ namespace app\common\helper;
|
||||
|
||||
class DomainExternalSeoSnapshotRunIndexHelper
|
||||
{
|
||||
protected static function publicRelativePath(string $strPath): string
|
||||
protected static function storageRelativePath(string $strPath): string
|
||||
{
|
||||
$strPublicRoot = str_replace('\\', '/', rtrim(dirname(__DIR__, 3) . '/public', '/'));
|
||||
$strStorageRoot = str_replace('\\', '/', rtrim(dirname(__DIR__, 3) . '/storage', '/'));
|
||||
$strPath = str_replace('\\', '/', $strPath);
|
||||
if (str_starts_with($strPath, $strPublicRoot . '/')) {
|
||||
return substr($strPath, strlen($strPublicRoot . '/'));
|
||||
if (str_starts_with($strPath, $strStorageRoot . '/')) {
|
||||
return substr($strPath, strlen($strStorageRoot . '/'));
|
||||
}
|
||||
|
||||
return $strPath;
|
||||
@@ -60,7 +60,7 @@ class DomainExternalSeoSnapshotRunIndexHelper
|
||||
|
||||
$arrItems[] = [
|
||||
'run_id' => basename($strRunRoot),
|
||||
'run_root_public' => self::publicRelativePath($strRunRoot),
|
||||
'run_root_public' => self::storageRelativePath($strRunRoot),
|
||||
'source' => (string)($arrSummary['source'] ?? ''),
|
||||
'received_count' => $intReceivedCount,
|
||||
'inserted_count' => (int)($arrSummary['inserted_count'] ?? 0),
|
||||
@@ -82,9 +82,9 @@ class DomainExternalSeoSnapshotRunIndexHelper
|
||||
'post_ingest_snapshot_trend' => (array)($arrSummary['post_ingest_snapshot_trend'] ?? []),
|
||||
'post_ingest_health_label' => (string)(($arrSummary['post_ingest_overview']['health_label'] ?? '')),
|
||||
'post_ingest_trend_label' => (string)(($arrSummary['post_ingest_snapshot_trend']['success_trend']['label'] ?? '')),
|
||||
'summary_json_path' => self::publicRelativePath($strSummaryPath),
|
||||
'summary_html_path' => self::publicRelativePath($strRunRoot . '/snapshot-ingest.summary.html'),
|
||||
'payload_json_path' => self::publicRelativePath($strRunRoot . '/snapshots.payload.json'),
|
||||
'summary_json_path' => self::storageRelativePath($strSummaryPath),
|
||||
'summary_html_path' => self::storageRelativePath($strRunRoot . '/snapshot-ingest.summary.html'),
|
||||
'payload_json_path' => self::storageRelativePath($strRunRoot . '/snapshots.payload.json'),
|
||||
'updated_at' => date(DATE_ATOM, (int)(filemtime($strSummaryPath) ?: time())),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -6,12 +6,12 @@ namespace app\common\helper;
|
||||
|
||||
class DomainExternalSeoSnapshotValidateRunIndexHelper
|
||||
{
|
||||
protected static function publicRelativePath(string $strPath): string
|
||||
protected static function storageRelativePath(string $strPath): string
|
||||
{
|
||||
$strPublicRoot = str_replace('\\', '/', rtrim(dirname(__DIR__, 3) . '/public', '/'));
|
||||
$strStorageRoot = str_replace('\\', '/', rtrim(dirname(__DIR__, 3) . '/storage', '/'));
|
||||
$strPath = str_replace('\\', '/', $strPath);
|
||||
if (str_starts_with($strPath, $strPublicRoot . '/')) {
|
||||
return substr($strPath, strlen($strPublicRoot . '/'));
|
||||
if (str_starts_with($strPath, $strStorageRoot . '/')) {
|
||||
return substr($strPath, strlen($strStorageRoot . '/'));
|
||||
}
|
||||
|
||||
return $strPath;
|
||||
@@ -50,7 +50,7 @@ class DomainExternalSeoSnapshotValidateRunIndexHelper
|
||||
|
||||
$arrItems[] = [
|
||||
'run_id' => basename($strRunRoot),
|
||||
'run_root_public' => self::publicRelativePath($strRunRoot),
|
||||
'run_root_public' => self::storageRelativePath($strRunRoot),
|
||||
'received_count' => $intReceivedCount,
|
||||
'valid_count' => (int)($arrSummary['valid_count'] ?? 0),
|
||||
'error_count' => $intErrorCount,
|
||||
@@ -63,9 +63,9 @@ class DomainExternalSeoSnapshotValidateRunIndexHelper
|
||||
'warnings' => (array)($arrSummary['warnings'] ?? []),
|
||||
'error_buckets' => (array)($arrSummary['error_buckets'] ?? []),
|
||||
'warning_buckets' => (array)($arrSummary['warning_buckets'] ?? []),
|
||||
'summary_json_path' => self::publicRelativePath($strSummaryPath),
|
||||
'summary_html_path' => self::publicRelativePath($strRunRoot . '/snapshot-validate.summary.html'),
|
||||
'payload_json_path' => self::publicRelativePath($strRunRoot . '/snapshots.payload.json'),
|
||||
'summary_json_path' => self::storageRelativePath($strSummaryPath),
|
||||
'summary_html_path' => self::storageRelativePath($strRunRoot . '/snapshot-validate.summary.html'),
|
||||
'payload_json_path' => self::storageRelativePath($strRunRoot . '/snapshots.payload.json'),
|
||||
'updated_at' => date(DATE_ATOM, (int)(filemtime($strSummaryPath) ?: time())),
|
||||
];
|
||||
}
|
||||
|
||||
@@ -1710,7 +1710,13 @@ class SiteStyle
|
||||
{
|
||||
if (!$domainRow) return null;
|
||||
$raw = is_array($domainRow) ? ($domainRow['t_cfg'] ?? null) : ($domainRow->t_cfg ?? null);
|
||||
return $raw ? json_decode($raw, true) : null;
|
||||
if (is_array($raw)) {
|
||||
return $raw;
|
||||
}
|
||||
if (!is_string($raw) || trim($raw) === '') {
|
||||
return null;
|
||||
}
|
||||
return json_decode($raw, true);
|
||||
}
|
||||
|
||||
private static function writeDbConfig($domainRow, array $cfg): void
|
||||
|
||||
210
code/scripts/old_tmp_domain_daily_probe.php
Normal file
210
code/scripts/old_tmp_domain_daily_probe.php
Normal file
@@ -0,0 +1,210 @@
|
||||
<?php
|
||||
|
||||
declare(strict_types=1);
|
||||
|
||||
require dirname(__DIR__) . '/vendor/autoload.php';
|
||||
|
||||
use app\common\helper\DomainImportProbeRunHelper;
|
||||
use app\model\DomainModel;
|
||||
use think\App;
|
||||
use think\facade\Db;
|
||||
|
||||
function printUsage(): void
|
||||
{
|
||||
echo "Usage:\n";
|
||||
echo " php scripts/old_tmp_domain_daily_probe.php [--templates=1001,1002,1003,1004,1005] [--run-root=/abs/path] [--format=json|text]\n\n";
|
||||
echo "Example:\n";
|
||||
echo " php scripts/old_tmp_domain_daily_probe.php --format=text\n";
|
||||
echo " php scripts/old_tmp_domain_daily_probe.php --templates=1002,1003 --format=json\n";
|
||||
}
|
||||
|
||||
function ensureAppInitialized(): void
|
||||
{
|
||||
static $initialized = false;
|
||||
if ($initialized) {
|
||||
return;
|
||||
}
|
||||
|
||||
(new App())->initialize();
|
||||
$initialized = true;
|
||||
}
|
||||
|
||||
function normalizeTemplateIds(string $raw): array
|
||||
{
|
||||
$items = array_filter(array_map('trim', explode(',', $raw)), static fn(string $v): bool => $v !== '');
|
||||
$ids = [];
|
||||
foreach ($items as $item) {
|
||||
$ids[] = (int)$item;
|
||||
}
|
||||
$ids = array_values(array_unique(array_filter($ids, static fn(int $v): bool => $v > 0)));
|
||||
sort($ids);
|
||||
|
||||
return $ids;
|
||||
}
|
||||
|
||||
function loadHosts(array $templateIds): array
|
||||
{
|
||||
ensureAppInitialized();
|
||||
|
||||
$rows = Db::name('domain')
|
||||
->whereIn('t_id', $templateIds)
|
||||
->field(['d_domain', 't_id'])
|
||||
->select()
|
||||
->toArray();
|
||||
|
||||
$hosts = [];
|
||||
$templateBuckets = [];
|
||||
foreach ($rows as $row) {
|
||||
if (!is_array($row)) {
|
||||
continue;
|
||||
}
|
||||
$host = DomainModel::normalizeHost((string)($row['d_domain'] ?? ''));
|
||||
$templateId = (int)($row['t_id'] ?? 0);
|
||||
if ($host === '') {
|
||||
continue;
|
||||
}
|
||||
$hosts[] = $host;
|
||||
if (!isset($templateBuckets[$templateId])) {
|
||||
$templateBuckets[$templateId] = [];
|
||||
}
|
||||
$templateBuckets[$templateId][] = $host;
|
||||
}
|
||||
|
||||
$hosts = array_values(array_unique($hosts));
|
||||
sort($hosts);
|
||||
ksort($templateBuckets);
|
||||
foreach ($templateBuckets as &$bucket) {
|
||||
$bucket = array_values(array_unique($bucket));
|
||||
sort($bucket);
|
||||
}
|
||||
|
||||
return [
|
||||
'hosts' => $hosts,
|
||||
'template_buckets' => $templateBuckets,
|
||||
];
|
||||
}
|
||||
|
||||
function renderText(array $summary): string
|
||||
{
|
||||
$lines = [
|
||||
'status: ' . (string)($summary['status'] ?? ''),
|
||||
'processed_count: ' . (int)($summary['processed_count'] ?? 0),
|
||||
'passed_count: ' . (int)($summary['passed_count'] ?? 0),
|
||||
'failed_count: ' . (int)($summary['failed_count'] ?? 0),
|
||||
'run_root: ' . (string)($summary['run_root'] ?? ''),
|
||||
'summary_json_path: ' . (string)($summary['summary_json_path'] ?? ''),
|
||||
'summary_html_path: ' . (string)($summary['summary_html_path'] ?? ''),
|
||||
'template_ids: ' . implode(',', (array)($summary['meta']['template_ids'] ?? [])),
|
||||
'hosts_count: ' . count((array)($summary['meta']['hosts'] ?? [])),
|
||||
'failed_hosts:',
|
||||
];
|
||||
|
||||
foreach ((array)($summary['items'] ?? []) as $item) {
|
||||
if (!empty($item['all_passed'])) {
|
||||
continue;
|
||||
}
|
||||
$lines[] = '- '
|
||||
. (string)($item['host'] ?? '')
|
||||
. ' | status=' . (string)($item['status'] ?? '')
|
||||
. ' | failed_stage=' . (string)($item['failed_stage'] ?? '')
|
||||
. ' | message=' . (string)($item['message'] ?? '');
|
||||
}
|
||||
|
||||
return implode(PHP_EOL, $lines) . PHP_EOL;
|
||||
}
|
||||
|
||||
$args = $argv;
|
||||
array_shift($args);
|
||||
|
||||
$templateIds = [1001, 1002, 1003, 1004, 1005];
|
||||
$runRoot = dirname(__DIR__) . '/storage/domain-import-runs';
|
||||
$format = 'json';
|
||||
|
||||
foreach ($args as $arg) {
|
||||
if (str_starts_with($arg, '--templates=')) {
|
||||
$parsed = normalizeTemplateIds(substr($arg, strlen('--templates=')));
|
||||
if (!empty($parsed)) {
|
||||
$templateIds = $parsed;
|
||||
}
|
||||
continue;
|
||||
}
|
||||
if (str_starts_with($arg, '--run-root=')) {
|
||||
$runRoot = rtrim(trim(substr($arg, strlen('--run-root='))), '/');
|
||||
continue;
|
||||
}
|
||||
if (str_starts_with($arg, '--format=')) {
|
||||
$format = strtolower(trim(substr($arg, strlen('--format='))));
|
||||
continue;
|
||||
}
|
||||
if (in_array($arg, ['-h', '--help'], true)) {
|
||||
printUsage();
|
||||
exit(0);
|
||||
}
|
||||
}
|
||||
|
||||
if (!in_array($format, ['json', 'text'], true)) {
|
||||
fwrite(STDERR, "Invalid format: {$format}\n");
|
||||
printUsage();
|
||||
exit(1);
|
||||
}
|
||||
|
||||
try {
|
||||
$loaded = loadHosts($templateIds);
|
||||
$hosts = (array)($loaded['hosts'] ?? []);
|
||||
$templateBuckets = (array)($loaded['template_buckets'] ?? []);
|
||||
|
||||
if (empty($hosts)) {
|
||||
$empty = [
|
||||
'status' => 'empty',
|
||||
'processed_count' => 0,
|
||||
'passed_count' => 0,
|
||||
'failed_count' => 0,
|
||||
'items' => [],
|
||||
'meta' => [
|
||||
'template_ids' => $templateIds,
|
||||
'hosts' => [],
|
||||
'template_buckets' => $templateBuckets,
|
||||
],
|
||||
'generated_at' => date(DATE_ATOM),
|
||||
];
|
||||
echo $format === 'text'
|
||||
? renderText($empty)
|
||||
: json_encode($empty, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;
|
||||
exit(0);
|
||||
}
|
||||
|
||||
$probeRunRoot = DomainImportProbeRunHelper::createRunRoot($runRoot, 'old_tmp_daily_probe');
|
||||
$summary = DomainImportProbeRunHelper::run($hosts, $probeRunRoot, [
|
||||
'template_ids' => $templateIds,
|
||||
'template_buckets' => $templateBuckets,
|
||||
'hosts' => $hosts,
|
||||
'scope' => 'old_tmp_daily_probe',
|
||||
]);
|
||||
$summary['run_root'] = $probeRunRoot;
|
||||
|
||||
echo $format === 'text'
|
||||
? renderText($summary)
|
||||
: json_encode($summary, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;
|
||||
} catch (Throwable $throwable) {
|
||||
$error = [
|
||||
'status' => 'script_failed',
|
||||
'error_class' => get_class($throwable),
|
||||
'message' => $throwable->getMessage(),
|
||||
'file' => $throwable->getFile(),
|
||||
'line' => $throwable->getLine(),
|
||||
'trace' => $throwable->getTraceAsString(),
|
||||
];
|
||||
|
||||
if ($format === 'text') {
|
||||
echo 'status: script_failed' . PHP_EOL;
|
||||
echo 'error_class: ' . $error['error_class'] . PHP_EOL;
|
||||
echo 'message: ' . $error['message'] . PHP_EOL;
|
||||
echo 'file: ' . $error['file'] . PHP_EOL;
|
||||
echo 'line: ' . $error['line'] . PHP_EOL;
|
||||
echo 'trace:' . PHP_EOL . $error['trace'] . PHP_EOL;
|
||||
} else {
|
||||
echo json_encode($error, JSON_PRETTY_PRINT | JSON_UNESCAPED_UNICODE | JSON_UNESCAPED_SLASHES) . PHP_EOL;
|
||||
}
|
||||
|
||||
exit(1);
|
||||
}
|
||||
Reference in New Issue
Block a user