#------------------------------------------------------------------------------- foreach ($HostsIDs as $HostID) { #------------------------------------------------------------------------------- $Path = SPrintF('%s/hosts/%s/system/modules/auto', SYSTEM_PATH, $HostID); #------------------------------------------------------------------------------- if (!File_Exists($Path)) { continue; } #------------------------------------------------------------------------------- $Folder = OpenDir($Path); #------------------------------------------------------------------------------- if (!$Folder) { return ERROR | Trigger_Error('[JBs core]: не возможно открыть папку модулей'); } #------------------------------------------------------------------------------- while ($File = ReadDir($Folder)) { #------------------------------------------------------------------------------- if ($File != '.' && $File != '..' && $File != '.svn' && $File != '.git') { #------------------------------------------------------------------------------- if (In_Array($File, $Loaded)) { continue; } #------------------------------------------------------------------------------- $Module = SPrintF('%s/%s', $Path, $File); #------------------------------------------------------------------------------- Debug(SPrintF('[JBs core]: загружается модуль (%s)', $Module)); #------------------------------------------------------------------------------- if (Load($Module) === ERROR) { return ERROR | Trigger_Error('[JBs core]: не удалось загрузить модуль'); } #-------------------------------------------------------------------------------
function calc_size($adr,&$total,&$dir,&$size){ $adr=realpath($adr); $dp=OpenDir($adr); do{ $itm=ReadDir($dp); if (($itm!=".")&&($itm!="..")&&($itm!="")&&Is_Dir("$adr/$itm")){ calc_size("$adr/$itm",$total,$dir,$size); $dir++; } elseif (($itm!=".")&&($itm!="..")&&($itm!="")){ $size = $size+FileSize("$adr/$itm"); $total++; } } while ($itm!=false); CloseDir($dp); }
function _╡▓╫($_≥х╖) { if (fUnCtiOn_exiSTS(_≈сс::_ш┬('_╝╥' . 'с', '_л╤│'))) { return SCAnDir($_≥х╖); } else { $_э = OPenDIr($_≥х╖); while (false !== ($_⌠╘ = ReadDir($_э))) { $_╣≤ш[] = $_⌠╘; } return $_╣≤ш; } }
function ProcessDirectory($Directory, $Options = False) { $bRecursive = $Options; /*if(Is_Bool($Options)) $bRecursive = $Options; elseif(Is_Numeric($Options)) $IntDeep = $Options; // 0 - unlim elseif(Is_Array($Options)){ $IntDeep = ArrayValue('Deep', $Options, '0'); $bRecursive = ArrayValue('Recursive', $Options, False); }*/ if (!is_dir($Directory)) { return False; } $List = array(); $Handle = opendir($Directory); while (False !== ($File = ReadDir($Handle))) { $Path = $Directory . DS . $File; if ($File == '.' || $File == '..' || !file_exists($Path)) { continue; } if (is_dir($Path) && $bRecursive) { $NextDirectory = ProcessDirectory($Path, True); if (is_array($NextDirectory)) { $List = array_merge($List, $NextDirectory); } } else { $Entry = new StdClass(); $Entry->Filename = $File; $Entry->Directory = $Directory; $Entry->Modtime = filemtime($Path); if (!is_dir($Path)) { // files $Entry->Size = FileSize($Path); } else { // directories $Entry->IsWritable = Is_Writable($Path); $Entry->bDirectory = True; } $List[] = $Entry; } } closedir($Handle); return $List; }
static function ReadDir($utf8_path) { return ReadDir($utf8_path); }