| Conditions | 7 |
| Paths | 2 |
| Total Lines | 26 |
| Lines | 0 |
| Ratio | 0 % |
| Changes | 0 | ||
| 1 | <?php |
||
| 15 | public function search() |
||
| 16 | { |
||
| 17 | $phrases = []; |
||
| 18 | $files_pattern = "/.*\\.(volt|php|phtml)$/"; |
||
| 19 | $files_plugins = $this->rsearch(APPLICATION_PATH . '/plugins', $files_pattern); |
||
| 20 | $files_modules = $this->rsearch(APPLICATION_PATH . '/modules', $files_pattern); |
||
| 21 | $files_views = $this->rsearch(APPLICATION_PATH . '/views', $files_pattern); |
||
| 22 | $files = array_merge($files_plugins, $files_views, $files_modules); |
||
| 23 | if (!empty($files)) { |
||
| 24 | foreach ($files as $file) { |
||
| 25 | if (file_exists($file)) { |
||
| 26 | $contents = file_get_contents($file); |
||
| 27 | $pattern = "/translate\('(.+?)'(?:.*)\)/"; |
||
| 28 | $matchesCount = preg_match_all($pattern, $contents, $matches); |
||
| 29 | if ($matchesCount) { |
||
| 30 | foreach ($matches[1] as $match) { |
||
| 31 | if (!in_array($match, $phrases)) { |
||
| 32 | $phrases[] = $match; |
||
| 33 | } |
||
| 34 | } |
||
| 35 | } |
||
| 36 | } |
||
| 37 | } |
||
| 38 | } |
||
| 39 | return $phrases; |
||
| 40 | } |
||
| 41 | |||
| 60 |