-
Notifications
You must be signed in to change notification settings - Fork 1
Expand file tree
/
Copy pathphpman.config.php.example
More file actions
77 lines (69 loc) · 3.75 KB
/
Copy pathphpman.config.php.example
File metadata and controls
77 lines (69 loc) · 3.75 KB
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
<?php
// phpMan configuration — copy to phpman.config.php and adjust.
// Created automatically by install.sh or `make staging` / `make release`.
//
// This file lives in ~/.phpman/ (PHPMAN_HOME), NOT in webroot.
// The webroot only needs a minimal phpman.config.php with one line:
// define('PHPMAN_HOME', '/home/user/.phpman');
//
// === Minimal config (everything else uses defaults) ===
// define('PHPMAN_HOME', getenv('HOME') . '/.phpman');
// define('PHPMAN_BASE_URL', 'https://www.example.com/phpMan.php');
//
// Leave values commented to use defaults in src/config.php.
// --- PHPMAN_HOME ---
// Base directory for all phpMan local data (cache DB, logs, backups).
// PHPMAN_HOME is baked into phpMan.php at deploy time (sed-replaced like
// GIT_DESCRIBE). Uncomment below only if you need to override the baked-in
// value (rare — usually only for staging with ~/.phpman_test).
// define('PHPMAN_HOME', getenv('HOME') . '/.phpman');
// define('PHPMAN_HOME', getenv('HOME') . '/.phpman_test');
// Or override individual paths:
// define('PHPMAN_CACHE_DIR', '/path/to/custom/cache');
// define('PHPMAN_LOG_DIR', '/path/to/custom/logs');
// define('PHPMAN_BACKUP_DIR', '/path/to/custom/backups');
// --- Base URL (v4.3.3) ---
// Public web URL of this phpMan instance. Used by CLI scripts (build-index,
// build-sitemap) to generate correct links when running offline.
// Default: PHPMAN_BASE_URL env var, then 'http://localhost:8080/phpMan.php'
// define('PHPMAN_BASE_URL', 'https://www.chedong.com/phpMan.php');
// --- JSON / MCP payload size (v4.11) ---
// Section text kept when serialising a page. Very large pages (info py is
// ~19.5MB of text) would otherwise be held in memory in full just to be
// serialised, which exceeds PHP's memory_limit. Text past the budget is
// dropped, and the payload then carries content_truncated/content_bytes/
// content_lines so consumers can tell how much of each section they got.
// define('PHPMAN_JSON_MAX_CONTENT_BYTES', 1048576); // total (1MB)
// define('PHPMAN_JSON_MAX_SECTION_BYTES', 524288); // per section (512KB)
// --- Cache TTL (v4.11) ---
// Unified expiry for PageCache found entries and the TLDR cache, in months
// (1 month = 30 days). not_found entries always expire after 1 day; emoji-
// enhanced output never expires regardless of this setting.
// define('PHPMAN_CACHE_TTL_MONTHS', 7); // 7 months = 210 days
// --- Google Analytics (v4.4.4+) ---
// Set your GA4 measurement ID to enable pageview tracking.
// Leave empty to disable (default).
// define('PHPMAN_GA_ID', 'G-XXXXXXXXXX');
// --- Google AdSense (v4.9.26+) ---
// Set your AdSense publisher ID to load the adsbygoogle.js loader script.
// Leave empty to disable (default).
//
// NOTE: this only injects the loader — phpman ships no
// <ins class="adsbygoogle"> ad units. Ads therefore appear only if Auto Ads
// is enabled for the site in the AdSense console. Enabling this also widens
// the CSP automatically (script-src / connect-src / frame-src), so no CSP
// edit is needed. Do not set this on staging: serving ads from a test host
// counts as invalid traffic.
//
// Use the ca-pub-... form here — that is what the loader's client= param
// expects. ads.txt uses the bare pub-... form, without the ca- prefix.
// define('PHPMAN_ADSENSE_ID', 'ca-pub-XXXXXXXXXXXXXXXX');
// --- MCP Authentication (#97) ---
// Every POST /mcp request must carry this key in the X-Api-Key header.
// Fail-closed: while it is left empty (the default) the endpoint returns 401
// for every request, so set it to use MCP at all. A random 32-char hex value
// is generated by install.sh; `openssl rand -hex 16` makes one by hand.
// define('MCP_API_KEY', 'your-secret-key-here');
// --- Debug ---
// Set true for development/troubleshooting; false for production.
// define('PHPMAN_DEBUG', false);