[DOC-CVS] [doc-base] master: Preparation to move PhD auxiliary-file generationto to php/phd (#318)

[email protected] (Louis-Arnaud via GitHub) Mon, 3 Aug 2026 14:50:12 +0000
Newsgroups php.doc.cvs
Message-ID <[email protected]>
Author: Louis-Arnaud (lacatoire)
Committer: GitHub (web-flow)
Pusher: alfsb
Date: 2026-08-03T11:50:10-03:00

Commit: https://github.com/php/doc-base/commit/e2f719c149884c149ac71a79e7f37d9c2bd945d0
Raw diff: https://github.com/php/doc-base/commit/e2f719c149884c149ac71a79e7f37d9c2bd945d0.diff

Preparation to move PhD auxiliary-file generationto to php/phd (#318)

The generation of version.xml, sources.xml and fileModHistory.php is
is to be removed (phd_acronym, php_history, phd_sources, phd_version)
and delegated in php/phd via a doc-base/temp/phd-conf.json handoff.

Also fixes the --history-file option, which set SOURCES_FILE instead of
HISTORY_FILE.

Changed paths:
  M  configure.php


Diff:

diff --git a/configure.php b/configure.php
index 1b0e8a19ba..68f2d4cbd1 100755
--- a/configure.php
+++ b/configure.php
@@ -408,7 +408,7 @@ function find_xml_files($path) // {{{
             break;
 
         case 'history-file':
-            $ac['SOURCES_FILE'] = $v;
+            $ac['HISTORY_FILE'] = $v;
             break;
 
         case 'libxml-check':
@@ -1192,13 +1192,41 @@ function xml_validate_libxml( $dom )
 php_history();
 phd_sources();
 phd_version();
+phd_conf_json();
+
+exit( 0 );
 
-exit(0); // Finished successfully.
+function phd_conf_json()
+{
+    // State used by other phd_*() functions, serialized to allow these
+    // to be moved out of configure.php into php/phd (genphdfiles.php).
 
+    global $ac;
 
+    $conf = array(
+        'rootdir'           => $ac['rootdir'],
+        'srcdir'            => $ac['srcdir'],
+        'lang'              => $ac['LANG'],
+        'enDir'             => $ac['EN_DIR'],
+        'langDir'           => $ac['LANGDIR'],
+        'generate'          => $ac['GENERATE'],
+        'xpointerReporting' => $ac['XPOINTER_REPORTING'] === 'yes',
+        'stderrToStdout'    => $ac['STDERR_TO_STDOUT'] === 'yes',
+        'outputs'           => array(
+            'version' => $ac['VERSION_FILES'] === 'yes',
+            'sources' => $ac['SOURCES_FILE'] === 'yes',
+            'history' => $ac['HISTORY_FILE'] === 'yes',
+        ),
+    );
+
+    $path = __DIR__ . '/temp/phd-conf.json';
+    file_put_contents($path, json_encode($conf, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n");
+}
 
-// TODO: Should this moved to github/php/phd?
-// Any input/state can be serialized into doc-base/temp/phd-conf.json.
+// TODO: These functions are to be erased, after moved to php/phd.
+// Then, files version.xml, sources.xml and fileModHistory.php can be
+// removed from .gitignore.
+// Depends on https://github.com/php/phd/pull/261 .
 
 function phd_acronym()
 {