function scan_file(SysFile $file, RuntimeContext &$shell) { set_time_limit(30); try { $file->open(SysFile::READ_ACCESS); while ($line = $file->readLine()) { $matches = array(); preg_match('~System::import\\((.[^\\*\\)]*)\\);~i', $line, $matches); if (count($matches) > 0) { $classpath = str_replace(array(' ', '\'', '"'), '', $matches[1]); if (!$shell->get('scan_results')->contains($classpath) && ereg('^System', $classpath)) { $shell->get('scan_results')->enqueue($classpath); } } } $file->close(); } catch (IOException $e) { error($e->getMessage() . ' "' . $file->getFilepath() . '"'); } }