include "lib/myconf.php";
GetDirectories();
$gResTitles = array();
if ($_GET['frm']) {
$gStxt = s($_GET['stxt']);
$gUrl = s($_GET['url']);
if ($gStxt) {
$l_res = array();
foreach ($gDirs as $v) {
/*
-w, --word-regexp
Select only those lines containing matches that form whole words. The test is that the matching substring
must either be at the beginning of the line, or preceded by a non-word constituent character. Similarly, it
must be either at the end of the line or followed by a non-word constituent character. Word-constituent
characters are letters, digits, and the underscore.
-E, --extended-regexp
Interpret PATTERN as an extended regular expression (see below).
-i, --ignore-case
Ignore case distinctions in both the PATTERN and the input files.
-l, --files-with-matches
Suppress normal output; instead print the name of each input file from which output would normally have been
printed. The scanning will stop on the first match.
-m NUM, --max-count=NUM
Stop reading a file after NUM matching lines. If the input is standard input from a regular file, and NUM
matching lines are output, grep ensures that the standard input is positioned to just after the last match-
ing line before exiting, regardless of the presence of trailing context lines. This enables a calling pro-
cess to resume a search. When grep stops after NUM matching lines, it outputs any trailing context lines.
When the -c or --count option is also used, grep does not output a count greater than NUM. When the -v or
--invert-match option is also used, grep stops after outputting NUM non-matching lines.
*/
$l = 'grep --include="*.htm*" -w -E -i -l -m 1 "*' . $gStxt . '*" ' . $gDocRoot . ($v ? $v . "/" : "") . "*";
unset($l_res);
if (!$v) {
// $l_tmp = 'grep -E -i -l -m 1 "*' . $gStxt . '*" ' . $gDocRoot . "index.php";
// exec($l_tmp, $l_res);
}
exec($l, $l_res);
if (getenv("REMOTE_ADDR") == "193.24.243.2") {
// echo $l . "
";
}
if (is_array($l_res)) {
foreach ($l_res as $vv) {
$s = exec('grep -m 1 \