diff --git a/scripts/translation/lib/GitLogParser.php b/scripts/translation/lib/GitLogParser.php
index 0ad45b8ac..c721a75f4 100644
--- a/scripts/translation/lib/GitLogParser.php
+++ b/scripts/translation/lib/GitLogParser.php
@@ -21,75 +21,6 @@
class GitLogParser
{
- static function parseInto( string $lang , RevcheckFileList & $list )
- {
- $cwd = getcwd();
- chdir( $lang );
- $fp = popen( "git log --name-only" , "r" );
- chdir( $cwd );
-
- $hash = "";
- $date = "";
- $skip = false;
- $mcnt = 0;
-
- while ( ( $line = fgets( $fp ) ) !== false )
- {
- // new commit block
- if ( substr( $line , 0 , 7 ) == "commit " )
- {
- $hash = trim( substr( $line , 7 ) );
- $date = "";
- $skip = false;
- $mcnt = 0;
- continue;
- }
- // datetime of commit
- if ( strpos( $line , 'Date:' ) === 0 )
- {
- $line = trim( substr( $line , 5 ) );
- $date = strtotime( $line );
- continue;
- }
- // empty lines
- if ( trim( $line ) == "" )
- continue;
- // commit message
- if ( str_starts_with( $line , ' ' ) )
- {
- if ( LOOSE_SKIP_REVCHECK ) // See below, and https://github.com/php/doc-base/pull/132
- {
- // commits with [skip-revcheck] anywhere commit message flags skip
- if ( str_contains( $line, '[skip-revcheck]' ) )
- $skip = true;
- }
- else
- {
- $mcnt++;
- // [skip-revcheck] at start of first line of commit message flags a skip
- if ( $mcnt == 1 && str_starts_with( trim( $line ) , '[skip-revcheck]' ) )
- $skip = true;
- }
- continue;
- }
- // other headers
- if ( strpos( $line , ': ' ) > 0 )
- continue;
-
- // otherwise, a filename
- $filename = trim( $line );
- $info = $list->get( $filename );
-
- // untracked file (deleted, renamed)
- if ( $info == null )
- continue;
-
- $info->addGitLogData( $hash , $date , $skip );
- }
-
- pclose( $fp );
- }
-
static function parseDir( string $gdir , RevcheckFileList $list )
{
$gdir = escapeshellarg( $gdir );
@@ -142,19 +73,10 @@ static function parseDir( string $gdir , RevcheckFileList $list )
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;
- }
+ // Messages that start with [skip-revcheck] flags entire commit as ignored.
+ $lcnt++;
+ if ( $lcnt == 1 && str_starts_with( trim( $proc->line ) , '[skip-revcheck]' ) )
+ $skip = true;
$proc->next();
}
diff --git a/scripts/translation/lib/RevcheckRun.php b/scripts/translation/lib/RevcheckRun.php
index 59e412be4..5159281e2 100644
--- a/scripts/translation/lib/RevcheckRun.php
+++ b/scripts/translation/lib/RevcheckRun.php
@@ -208,7 +208,11 @@ private function parseTranslationXml() : void
$this->revData->lang = $this->targetDir;
$this->revData->date = date("r");
- $dom = XmlUtil::loadFile( $this->targetDir . '/translation.xml' );
+ $transfile = $this->targetDir . '/translation.xml';
+ if ( ! file_exists( $transfile ) )
+ throw new \Exception("Missing translation.xml file." );
+
+ $dom = XmlUtil::loadFile( $transfile );
$tag = $dom->getElementsByTagName( 'intro' )[0] ?? null;
if ( $tag == null )
diff --git a/scripts/translation/lib/all.php b/scripts/translation/lib/all.php
index 843c046bb..18c44b7d4 100644
--- a/scripts/translation/lib/all.php
+++ b/scripts/translation/lib/all.php
@@ -21,7 +21,6 @@
ini_set( 'display_startup_errors' , 1 );
error_reporting( E_ALL );
-require_once __DIR__ . '/backport.php';
require_once __DIR__ . '/CacheFile.php';
require_once __DIR__ . '/CacheUtil.php';
require_once __DIR__ . '/GitLogParser.php';
diff --git a/scripts/translation/lib/backport.php b/scripts/translation/lib/backport.php
deleted file mode 100644
index 169c781f4..000000000
--- a/scripts/translation/lib/backport.php
+++ /dev/null
@@ -1,149 +0,0 @@
-window is the base-2 log of the compression loopback window size.
-Higher values (up to 15 -- 32768 bytes) yield better compression at a cost of memory,
-while lower values (down to 9 -- 512 bytes) yield worse compression in a smaller memory footprint.
-- Default