Skip to content

Commit e2f719c

Browse files
authored
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.
1 parent 3ab7300 commit e2f719c

1 file changed

Lines changed: 32 additions & 4 deletions

File tree

configure.php

Lines changed: 32 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -408,7 +408,7 @@ function find_xml_files($path) // {{{
408408
break;
409409

410410
case 'history-file':
411-
$ac['SOURCES_FILE'] = $v;
411+
$ac['HISTORY_FILE'] = $v;
412412
break;
413413

414414
case 'libxml-check':
@@ -1192,13 +1192,41 @@ function xml_validate_libxml( $dom )
11921192
php_history();
11931193
phd_sources();
11941194
phd_version();
1195+
phd_conf_json();
1196+
1197+
exit( 0 );
11951198

1196-
exit(0); // Finished successfully.
1199+
function phd_conf_json()
1200+
{
1201+
// State used by other phd_*() functions, serialized to allow these
1202+
// to be moved out of configure.php into php/phd (genphdfiles.php).
11971203

1204+
global $ac;
11981205

1206+
$conf = array(
1207+
'rootdir' => $ac['rootdir'],
1208+
'srcdir' => $ac['srcdir'],
1209+
'lang' => $ac['LANG'],
1210+
'enDir' => $ac['EN_DIR'],
1211+
'langDir' => $ac['LANGDIR'],
1212+
'generate' => $ac['GENERATE'],
1213+
'xpointerReporting' => $ac['XPOINTER_REPORTING'] === 'yes',
1214+
'stderrToStdout' => $ac['STDERR_TO_STDOUT'] === 'yes',
1215+
'outputs' => array(
1216+
'version' => $ac['VERSION_FILES'] === 'yes',
1217+
'sources' => $ac['SOURCES_FILE'] === 'yes',
1218+
'history' => $ac['HISTORY_FILE'] === 'yes',
1219+
),
1220+
);
1221+
1222+
$path = __DIR__ . '/temp/phd-conf.json';
1223+
file_put_contents($path, json_encode($conf, JSON_PRETTY_PRINT | JSON_UNESCAPED_SLASHES) . "\n");
1224+
}
11991225

1200-
// TODO: Should this moved to github/php/phd?
1201-
// Any input/state can be serialized into doc-base/temp/phd-conf.json.
1226+
// TODO: These functions are to be erased, after moved to php/phd.
1227+
// Then, files version.xml, sources.xml and fileModHistory.php can be
1228+
// removed from .gitignore.
1229+
// Depends on https://github.com/php/phd/pull/261 .
12021230

12031231
function phd_acronym()
12041232
{

0 commit comments

Comments
 (0)