3 // looks for lang::r() calls and adds them to the system
7 require_once('./global.php');
9 function fetch_listing($path, $basepath = '', $unset = 1)
18 if (substr($path, (strlen($path) - 1), 1) != '/')
23 if ($handle = opendir($path))
25 while (($file = readdir($handle)) !== false
)
27 if (substr($file, 0, 1) != '.' AND $file != 'CVS')
29 if (is_dir($path . $file))
31 $filelist["$basepath"][] = "$file/";
32 fetch_listing("$path$file", "$basepath$file/", 0);
36 $filelist["$basepath"][] = $file;
45 function fetch_flat_listing($filelist)
47 foreach ($filelist AS $basepath => $files)
49 foreach ($files AS $file)
51 if (preg_match('#\.php$#', $file))
53 $flatlist[] = "./$basepath$file";
60 // ###################################################################
61 // ###################################################################
63 $listing = fetch_flat_listing(fetch_listing(getcwd()));
65 foreach ($listing AS $filename)
67 $file = file_get_contents($filename);
69 preg_match_all("#lang::r\('(.*?)'\)#", $file, $matches);
70 foreach ($matches[0] AS $matchid => $match)
72 lang
::r($matches[1]["$matchid"]);