Visitar URL original
Merge #20564 - Fix detection of the bundled documentation · phpmyadmin/phpmyadmin@60f122d · GitHub
Skip to content

Commit 60f122d

Browse files
committed
Merge #20564 - Fix detection of the bundled documentation
Pull-request: #20564 Signed-off-by: William Desportes <williamdes@wdes.fr>
2 parents c797aa8 + a3c0e86 commit 60f122d

5 files changed

Lines changed: 13 additions & 2 deletions

File tree

‎app/constants.php‎

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,7 @@
1616
$vendorConfig['versionCheckDefault'],
1717
$vendorConfig['localePath'],
1818
$vendorConfig['cacheDir'],
19+
$vendorConfig['docsHtmlDir'],
1920
$vendorConfig['versionSuffix'],
2021
)
2122
) {
@@ -34,6 +35,7 @@
3435
define('VERSION_CHECK_DEFAULT', (bool) $vendorConfig['versionCheckDefault']);
3536
define('LOCALE_PATH', (string) $vendorConfig['localePath']);
3637
define('CACHE_DIR', (string) $vendorConfig['cacheDir']);
38+
define('DOCS_HTML_DIR', (string) $vendorConfig['docsHtmlDir']);
3739
define('VERSION_SUFFIX', (string) $vendorConfig['versionSuffix']);
3840

3941
/**

‎app/vendor_config.php‎

Lines changed: 6 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -61,6 +61,12 @@
6161
*/
6262
'localePath' => ROOT_PATH . 'resources' . DIRECTORY_SEPARATOR . 'locale' . DIRECTORY_SEPARATOR,
6363

64+
/**
65+
* Directory with the built HTML documentation (index.html)
66+
*/
67+
'docsHtmlDir' => ROOT_PATH . 'public' . DIRECTORY_SEPARATOR . 'docs' . DIRECTORY_SEPARATOR . 'html'
68+
. DIRECTORY_SEPARATOR,
69+
6470
/**
6571
* Define the cache directory for routing cache and other cache files
6672
*/

‎phpstan-baseline.neon‎

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,7 @@ parameters:
33
-
44
message: '#^Cannot cast mixed to string\.$#'
55
identifier: cast.string
6-
count: 11
6+
count: 12
77
path: app/constants.php
88

99
-

‎src/Html/MySQLDocumentation.php‎

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -16,6 +16,8 @@
1616
use function file_exists;
1717
use function htmlspecialchars;
1818

19+
use const DOCS_HTML_DIR;
20+
1921
/**
2022
* Generate HTML for MySQL Documentation
2123
*/
@@ -105,7 +107,7 @@ public static function getDocumentationLink(string $page, string $anchor = '', s
105107
* Check if we have built local documentation, however
106108
* provide consistent URL for testsuite
107109
*/
108-
if (! defined('TESTSUITE') && @file_exists(ROOT_PATH . 'docs/html/index.html')) {
110+
if (! defined('TESTSUITE') && @file_exists(DOCS_HTML_DIR . 'index.html')) {
109111
return $pathPrefix . 'docs/html/' . $url;
110112
}
111113

‎tests/unit/ConfigTest.php‎

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -640,6 +640,7 @@ public function testVendorConfigFile(): void
640640
self::assertIsString($vendorConfig['localePath']);
641641
self::assertIsString($vendorConfig['cacheDir']);
642642
self::assertDirectoryExists($vendorConfig['cacheDir']);
643+
self::assertIsString($vendorConfig['docsHtmlDir']);
643644
self::assertIsString($vendorConfig['versionSuffix']);
644645
}
645646

0 commit comments

Comments
 (0)