Lines Matching refs:file
29 * @param string $file
32 public function processLangFile($file)
35 include $file;
46 $this->removeLangKey($file, $subkey, $key);
49 $this->removeLangKey($file, $key);
57 * @param string $file
60 public function processSettingsFile($file)
63 include $file;
67 $this->removeLangKey($file, $key);
72 * Remove the given key from the given language file
74 * @param string $file
79 protected function removeLangKey($file, $key, $sub = '')
89 if (io_deleteFromFile($file, $re, true)) {
90 $this->logger->success('{key} removed from {file}', [
92 'file' => $file,
118 function ($file) {
119 /** @var \SplFileInfo $file */
120 if ($file->isFile() && $file->getExtension() != 'php' && $file->getExtension() != 'js') return false;
121 return $file->getFilename()[0] !== '.';
127 foreach ($ite as $file) {
128 /** @var \SplFileInfo $file */
129 $path = str_replace('\\', '/', $file->getPathname());
133 if ($file->getExtension() == 'php') {
135 } elseif ($file->getExtension() == 'js') {
153 * Extract language keys from given settings file
155 * @param string $file
158 public function metaExtract($file)
161 include $file;
165 $found[$key] = $file;
169 $found[$key . '_o_' . $choice] = $file;
178 * Extract language keys from given javascript file
180 * @param string $file
181 * @return array (key => file:line)
183 public function jsExtract($file)
196 return $this->extract($file, $regex);
200 * Extract language keys from given php file
202 * @param string $file
203 * @return array (key => file:line)
205 public function phpExtract($file)
208 return $this->extract($file, $regex);
212 * Use the given regex to extract language keys from the given file
214 * @param string $file
218 private function extract($file, $regex)
221 $lines = file($file);
230 $found[$key] = $file . ':' . ($lno + 1);