Exemplo n.º 1
0
 function ScanDir($path)
 {
     $arRes = array();
     if (is_dir($path)) {
         if (!($dir = opendir($path))) {
             die('Cannot read ' . $path);
         }
         while (false !== ($file = readdir($dir))) {
             if ($file == '.' || $file == '..') {
                 continue;
             }
             $arRes = self::ResMerge($arRes, self::ScanDir($path . '/' . $file));
         }
         closedir($dir);
     } elseif (is_file($path) && preg_match('#\\.(php)$#', $path, $regs)) {
         return CBitrixLiveapi::ParseFile($path);
     }
     return $arRes;
 }