Subversion Repositories oidplus

Rev

Rev 635 | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 635 Rev 1130
Line 92... Line 92...
92
        echo "Attention: No language plugins found!\n";
92
        echo "Attention: No language plugins found!\n";
93
}
93
}
94
 
94
 
95
# ---
95
# ---
96
 
96
 
-
 
97
/**
-
 
98
 * @param string $cont
-
 
99
 * @return array
-
 
100
 */
97
function get_js_L_strings($cont) {
101
function get_js_L_strings(string $cont): array {
98
        // Works with JavaScript and PHP
102
        // Works with JavaScript and PHP
99
        $cont = preg_replace('@/\\*.+\\*/@ismU', '', $cont);
103
        $cont = preg_replace('@/\\*.+\\*/@ismU', '', $cont);
100
        $cont = str_replace('\\"', chr(1), $cont);
104
        $cont = str_replace('\\"', chr(1), $cont);
101
        $cont = str_replace("\\'", chr(2), $cont);
105
        $cont = str_replace("\\'", chr(2), $cont);
102
        $cont = str_replace("\\\\", "\\", $cont);
106
        $cont = str_replace("\\\\", "\\", $cont);
Line 107... Line 111...
107
                $x = str_replace(chr(2), "'", $x);
111
                $x = str_replace(chr(2), "'", $x);
108
        }
112
        }
109
        return $m[2];
113
        return $m[2];
110
}
114
}
111
 
115
 
-
 
116
/**
-
 
117
 * @param string $cont
-
 
118
 * @return array
-
 
119
 */
112
function get_php_L_strings($cont) {
120
function get_php_L_strings(string $cont): array {
113
        // Works only with PHP
121
        // Works only with PHP
114
        $out = array();
122
        $out = array();
115
        $tokens = token_get_all($cont);
123
        $tokens = token_get_all($cont);
116
        $activated = 0;
124
        $activated = 0;
117
        foreach ($tokens as $token) {
125
        foreach ($tokens as $token) {