Пример #1
0
	function __scandir($pwd,&$arFiles,$arExept = false)
	{
		$dir = scandir($pwd);
		foreach ($dir as $file)
		{
			if ($file == ".." || $file == ".")
				continue;
			if (is_dir($pwd."$file"))
			{
				if (!in_array($file,$arExept["FOLDERS"]))
					CCheckListTools::__scandir($pwd."$file/",$arFiles,$arExept);
			}
			elseif(in_array(substr(strrchr($file, '.'), 1),$arExept["EXT"])
				&& !in_array($pwd.$file,$arExept["FILES"])
				&& !in_array($file,$arExept["FILES"])
				)
			{
				$arFiles[] = $pwd."/$file";
			}
		}
	}
Пример #2
0
 public static function __scandir($pwd, &$arFiles, $arExept = false)
 {
     if (file_exists($pwd)) {
         $dir = scandir($pwd);
         foreach ($dir as $file) {
             if ($file == ".." || $file == ".") {
                 continue;
             }
             if (is_dir($pwd . "{$file}")) {
                 if (!in_array($file, $arExept["FOLDERS"])) {
                     CCheckListTools::__scandir($pwd . "{$file}/", $arFiles, $arExept);
                 }
             } elseif (in_array(substr(strrchr($file, '.'), 1), $arExept["EXT"]) && !in_array($pwd . $file, $arExept["FILES"]) && !in_array($file, $arExept["FILES"])) {
                 $arFiles[] = $pwd . "/{$file}";
             }
         }
     }
 }