These settings are no longer required as they are guaranteed through other coding standard tools. Signed-off-by: Maurício Meneghini Fauth <mauricio@fauth.dev>
37 lines
951 B
Plaintext
37 lines
951 B
Plaintext
<?php
|
|
declare(strict_types=1);
|
|
|
|
if (! defined('ROOT_PATH')) {
|
|
define('ROOT_PATH', dirname(__DIR__) . DIRECTORY_SEPARATOR);
|
|
}
|
|
|
|
$tmpDir = dirname(__FILE__) . '/../twig-templates';
|
|
$potName = 'po/phpmyadmin.pot';
|
|
$replacements = json_decode(file_get_contents($tmpDir . '/replace.json'), true);
|
|
|
|
/* Read pot file */
|
|
$pot = file_get_contents($potName);
|
|
|
|
/* Do the replacements */
|
|
$pot = preg_replace_callback(
|
|
'@(twig-templates[0-9a-f/]*.php):([0-9]*)@',
|
|
function ($matches) {
|
|
global $replacements;
|
|
$filename = $matches[1];
|
|
$line = intval($matches[2]);
|
|
$replace = $replacements[$filename];
|
|
foreach ($replace[1] as $cacheline => $result) {
|
|
if ($line >= $cacheline) {
|
|
return $replace[0] . ':' . $result;
|
|
}
|
|
}
|
|
return $replace[0] . ':0';
|
|
},
|
|
$pot
|
|
);
|
|
|
|
/* Write fixed file */
|
|
$handle = fopen($potName, 'w');
|
|
fwrite($handle, $pot);
|
|
fclose($handle);
|