Skip to content

Reduce unrelated changes comparing to original #7

New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merged
merged 1 commit into from
Dec 29, 2017
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
23 changes: 12 additions & 11 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@
| Hannes Magnusson <bjori@php.net> |
| Gwynne Raskind <gwynne@php.net> |
+----------------------------------------------------------------------+

$Id$
*/

Expand All @@ -31,7 +31,7 @@
function usage() // {{{
{
global $acd;

echo <<<HELPCHUNK
configure.php configures this package to adapt to many kinds of systems, and PhD
builds too.
Expand Down Expand Up @@ -66,7 +66,7 @@ function usage() // {{{
--with-php=PATH Path to php CLI executable [detect]
--with-lang=LANG Language to build [{$acd['LANG']}]
--with-partial=my-xml-id Root ID to build (e.g. <book xml:id="MY-ID">) [{$acd['PARTIAL']}]
--disable-broken-file-listing Do not ignore translated files in
--disable-broken-file-listing Do not ignore translated files in
broken-files.txt
--redirect-stderr-to-stdout Redirect STDERR to STDOUT. Use STDOUT as the
standard output for XML errors [{$acd['STDERR_TO_STDOUT']}]
Expand Down Expand Up @@ -97,7 +97,7 @@ function is_windows() {
function checking($for) // {{{
{
global $ac;

if ($ac['quiet'] != 'yes') {
echo "Checking {$for}... ";
flush();
Expand All @@ -107,7 +107,7 @@ function checking($for) // {{{
function checkerror($msg) // {{{
{
global $ac;

if ($ac['quiet'] != 'yes') {
echo "\n";
}
Expand All @@ -118,7 +118,7 @@ function checkerror($msg) // {{{
function checkvalue($v) // {{{
{
global $ac;

if ($ac['quiet'] != 'yes') {
echo "{$v}\n";
}
Expand Down Expand Up @@ -315,7 +315,7 @@ function print_xml_errors($details = true) {
} else {
continue;
}

$overridden_settings[] = strtoupper($o);
switch ($o) {
case 'h':
Expand Down Expand Up @@ -399,7 +399,7 @@ function print_xml_errors($details = true) {
case 'basedir':
$ac['basedir'] = $v;
break;

case 'output':
$ac['OUTPUT_FILENAME'] = $v;
break;
Expand All @@ -414,7 +414,7 @@ function print_xml_errors($details = true) {
case 'stderr-to-stdout':
$ac['STDERR_TO_STDOUT'] = $v;
break;

case '':
break;

Expand Down Expand Up @@ -676,7 +676,7 @@ function print_xml_errors($details = true) {
echo "done.\n";
echo "Partial manual saved to {$filename}. To build it, run 'phd -d {$filename}'\n";
exit(0);
} // }}}
} // }}}

$mxml = $ac["OUTPUT_FILENAME"];
if ($dom->validate()) {
Expand Down Expand Up @@ -722,7 +722,7 @@ function print_xml_errors($details = true) {
echo "\nThe document didn't validate, ";

// Allow the .manual.xml file to be created, even if it is not valid.
if ($ac['FORCE_DOM_SAVE'] == 'yes') {
if ($ac['FORCE_DOM_SAVE'] == 'yes') {
printf("writing %s anyway, and ", basename($ac["OUTPUT_FILENAME"]));
if ($ac["SEGFAULT_SPEED"] == "yes") {
$t = $dom->doctype;
Expand Down Expand Up @@ -757,3 +757,4 @@ function print_xml_errors($details = true) {
errors_are_bad(1); // Tell the shell that this script finished with an error.
}
?>

15 changes: 8 additions & 7 deletions scripts/revcheck.php
Original file line number Diff line number Diff line change
Expand Up @@ -142,10 +142,10 @@ function get_original_info($file, $hash)
// Grabs the revision tag and stores credits from the file given
function get_tags($file, $val = "en-rev") {

global $LANG, $DOCDIR;
$basefile = substr($file, strlen($LANG) + 3);
global $LANG, $DOCDIR;
$basefile = substr($file, strlen($LANG) + 3);

// Read the first 500 chars. The comment should be at
// Read the first 500 chars. The comment should be at
// the begining of the file

$fp = @fopen($file, "r") or die ("Unable to read $file.");
Expand All @@ -155,8 +155,8 @@ function get_tags($file, $val = "en-rev") {
// Check for English SVN revision tag (. is for $ in the preg!),
// Return if this was needed (it should be there)
if ($val == "en-rev") {
exec('cd ' . $DOCDIR . '/' . $LANG . ' && git log -1 --pretty=format:"%h %at" ' . $basefile, $result, $output);
return new DateTimeImmutable('@' . explode(' ', $result[0])[1]);
exec('cd ' . $DOCDIR . '/' . $LANG . ' && git log -1 --pretty=format:"%h %at" ' . $basefile, $result, $output);
return new DateTimeImmutable('@' . explode(' ', $result[0])[1]);
}

// Handle credits (only if no maintainer is specified)
Expand Down Expand Up @@ -207,8 +207,8 @@ function get_tags($file, $val = "en-rev") {
preg_match (
"'<!--\s*EN-Revision:\s*(n/a)\s*Maintainer:\s*("
. $val . ")\s*Status:\s*(.+)\s*-->'U",
$line,
$match
$line,
$match
);
}

Expand Down Expand Up @@ -382,6 +382,7 @@ function get_dir_status($dir) {

// Walk through all names in the directory
while ($file = @readdir($handle)) {

if (
(!is_dir($dir.'/' .$file) && !in_array(substr($file, -3), array('xml','ent')) && substr($file, -13) != 'PHPEditBackup' )
|| strpos($file, 'entities.') === 0
Expand Down