Subversion Repositories oidplus

Rev

Rev 1116 | Rev 1130 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1116 Rev 1127
Line 1... Line 1...
1
#!/usr/bin/env php
1
#!/usr/bin/env php
2
<?php
2
<?php
3
 
3
 
4
/*
4
/*
5
 * OIDplus 2.0
5
 * OIDplus 2.0
6
 * Copyright 2019 - 2021 Daniel Marschall, ViaThinkSoft
6
 * Copyright 2019 - 2023 Daniel Marschall, ViaThinkSoft
7
 *
7
 *
8
 * Licensed under the Apache License, Version 2.0 (the "License");
8
 * Licensed under the Apache License, Version 2.0 (the "License");
9
 * you may not use this file except in compliance with the License.
9
 * you may not use this file except in compliance with the License.
10
 * You may obtain a copy of the License at
10
 * You may obtain a copy of the License at
11
 *
11
 *
Line 48... Line 48...
48
// ---
48
// ---
49
 
49
 
50
$all_strings = array();
50
$all_strings = array();
51
 
51
 
52
$it = new RecursiveDirectoryIterator($dir);
52
$it = new RecursiveDirectoryIterator($dir);
-
 
53
$it->setFlags(RecursiveDirectoryIterator::SKIP_DOTS); // DOES NOT WORK! Folders with . prefix still get evaluated!
53
foreach(new RecursiveIteratorIterator($it) as $file) {
54
foreach(new RecursiveIteratorIterator($it) as $file) {
54
        if ((strpos(str_replace('\\','/',realpath($file)),'/vendor/') !== false) && (strpos(str_replace('\\','/',realpath($file)),'/vendor/danielmarschall/') === false)) continue; // ignore third-party-code
55
        if ((strpos(str_replace('\\','/',realpath($file)),'/vendor/') !== false) && (strpos(str_replace('\\','/',realpath($file)),'/vendor/danielmarschall/') === false)) continue; // ignore third-party-code
55
        if (strpos(str_replace('\\','/',realpath($file)),'/dev/') !== false) continue; // ignore development utilities
56
        if (strpos(str_replace('\\','/',realpath($file)),'/dev/') !== false) continue; // ignore development utilities
-
 
57
 
-
 
58
        if (preg_match('@[/\\\\]\\.[^\\.]@',$file,$m)) continue; // Alternative to SKIP_DOTS
-
 
59
 
56
        if ($file->getExtension() == 'php') {
60
        if ($file->getExtension() == 'php') {
57
                $cont = file_get_contents($file);
61
                $cont = file_get_contents($file);
58
                $cont = phpRemoveComments($cont);
62
                $cont = phpRemoveComments($cont);
59
#               $cont = str_replace('function _L($str, ...$sprintfArgs) {', '', $cont);
63
#               $cont = str_replace('function _L($str, ...$sprintfArgs) {', '', $cont);
60
                $cont = str_replace('_L($', '', $cont);
64
                $cont = str_replace('_L($', '', $cont);