Skip to content

Commit

Permalink
Merge branch 'php:master' into LOOSE_SKIP_REVCHECK
Browse files Browse the repository at this point in the history
  • Loading branch information
alfsb authored Nov 25, 2024
2 parents c654945 + df44b2d commit f74fd14
Show file tree
Hide file tree
Showing 6 changed files with 98 additions and 138 deletions.
2 changes: 0 additions & 2 deletions configure.php
Original file line number Diff line number Diff line change
Expand Up @@ -635,8 +635,6 @@ function getFileModificationHistory(): array {
// Notice how doing it this way results in generating less than half as many files.
$infiles = array(
'manual.xml.in',
'install-unix.xml.in',
'install-win.xml.in',
'scripts/file-entities.php.in',
);

Expand Down
2 changes: 1 addition & 1 deletion entities/global.ent
Original file line number Diff line number Diff line change
Expand Up @@ -403,7 +403,7 @@
<!ENTITY url.rec-xml "http://www.w3.org/TR/1998/REC-xml-19980210">
<!ENTITY url.relaxng "http://www.relaxng.org/">
<!-- linking to specific rfcs is done like so: &url.rfc;xxxx so for example &url.rfc;2042 -->
<!ENTITY url.rfc 'http://www.faqs.org/rfcs/rfc'>
<!ENTITY url.rfc "https://datatracker.ietf.org/doc/html/rfc">
<!ENTITY url.rnp "https://www.rnpgp.org/">
<!ENTITY url.iana.system-names 'http://www.iana.org/assignments/operating-system-names'>
<!ENTITY url.rpmfind "http://www.rpmfind.net/">
Expand Down
40 changes: 0 additions & 40 deletions install-unix.xml.in

This file was deleted.

95 changes: 0 additions & 95 deletions install-win.xml.in

This file was deleted.

2 changes: 2 additions & 0 deletions scripts/qa/section-order.php
Original file line number Diff line number Diff line change
Expand Up @@ -40,6 +40,8 @@
'reference/oci8/oldaliases/ocifetchinto.xml',
/* This page uses <xi:include> tags to include the docs from the OO version */
'reference/parallel/functions/parallel.run.xml',
/* This page uses <xi:include> tags to include the docs from the OO version */
'reference/pdo/pdo/connect.xml',
/* These pages use <xi:include> tags to include the docs from the interface version */
'reference/dom/domcharacterdata/after.xml',
'reference/dom/domcharacterdata/remove.xml',
Expand Down
95 changes: 95 additions & 0 deletions scripts/translation/lib/GitLogParser.php
Original file line number Diff line number Diff line change
Expand Up @@ -107,6 +107,101 @@ static function parseDir( string $gdir , RevcheckFileList $list )
$proc->skip(); // Empty Line
}
}

static function parseDir( string $gdir , RevcheckFileList $list )
{
$gdir = escapeshellarg( $gdir );
$proc = new GitLogParserProc( "git -C $gdir log --name-only" );

$hash = "";
$date = "";
$skip = false;
$lcnt = 0;

while ( $proc->live )
{
// Hash

if ( str_starts_with( $proc->line , "commit " ) )
{
$hash = trim( substr( $proc->line , 7 ) );
$date = "";
$skip = false;
$lcnt = 0;
$proc->next();
}
else
throw new Exception( "Expected commit hash." );

// Headers

while ( $proc->live && strlen( trim( $proc->line ) ) > 0 )
{
// Date
if ( str_starts_with( $proc->line , 'Date:' ) )
{
$line = trim( substr( $proc->line , 5 ) );
$date = strtotime( $line );
$proc->next();
continue;
}
// Other headers
if ( $proc->line[0] != ' ' && strpos( $proc->line , ':' ) > 0 )
{
$proc->next();
continue;
}
break;
}

$proc->skip(); // Empty Line

// Message

while ( $proc->live && str_starts_with( $proc->line , ' ' ) )
{
if ( LOOSE_SKIP_REVCHECK ) // https://github.com/php/doc-base/pull/132
{
// Messages that contains [skip-revcheck] flags entire commit as ignored.
if ( str_contains( $proc->line , '[skip-revcheck]' ) )
$skip = true;
}
else
{
// Messages that start with [skip-revcheck] flags entire commit as ignored.
$lcnt++;
if ( $lcnt == 1 && str_starts_with( trim( $line ) , '[skip-revcheck]' ) )
$skip = true;
}
$proc->next();
}

$proc->skip(); // Empty Line

// Merge commits and empty files commits

// Merge commits are not followed with file listings.
// Some normal commits also not have file listings
// (see b73609198d4606621f57e165efc457f30e403217).

if ( str_starts_with( $proc->line , "commit " ) )
continue;

// Files

while ( $proc->live && strlen( trim( $proc->line ) ) > 0 )
{
$file = $list->get( trim( $proc->line ) );

if ( $file != null )
$file->addGitLogData( $hash , $date , $skip );

$proc->next();
}

$proc->skip(); // Empty Line
}
}
}

class GitLogParserProc
Expand Down

0 comments on commit f74fd14

Please sign in to comment.