Example #1
0
/******************************************************************************/
Debug('[JBs core]: загрузка автозагружаемых классов и библиотек');
#-------------------------------------------------------------------------------
$HostsIDs = $GLOBALS['HOST_CONF']['HostsIDs'];
#-------------------------------------------------------------------------------
foreach (array('libs', 'classes') as $Folder) {
    #-------------------------------------------------------------------------------
    foreach ($HostsIDs as $HostID) {
        #-------------------------------------------------------------------------------
        $Path = SPrintF('%s/hosts/%s/system/%s/auto', SYSTEM_PATH, $HostID, $Folder);
        #-------------------------------------------------------------------------------
        if (!File_Exists($Path)) {
            continue;
        }
        #-------------------------------------------------------------------------------
        $Files = ScanDir($Path);
        #-------------------------------------------------------------------------------
        foreach ($Files as $File) {
            #-------------------------------------------------------------------------------
            if ($File != '.' && $File != '..' && $File != '.svn' && $File != 'plugins' && $File != 'sysplugins') {
                #-------------------------------------------------------------------------------
                $File = SPrintF('%s/%s', $Path, $File);
                #-------------------------------------------------------------------------------
                if (SubStr(BaseName($File), 0, 1) == '.') {
                    #-------------------------------------------------------------------------------
                    Debug(SPrintF('[JBs core]: пропущен системный компонент (%s)', $File));
                    #-------------------------------------------------------------------------------
                    continue;
                    #-------------------------------------------------------------------------------
                }
                #-------------------------------------------------------------------------------
Example #2
0
function IO_Scan($Path, $IsHidden = TRUE)
{
    /****************************************************************************/
    $__args_types = array('string', 'boolean');
    #-----------------------------------------------------------------------------
    $__args__ = Func_Get_Args();
    eval(FUNCTION_INIT);
    /****************************************************************************/
    $Result = array();
    #-----------------------------------------------------------------------------
    $Folder = @OpenDir($Path);
    if (!$Folder) {
        return ERROR | @Trigger_Error(SPrintF('[IO_Scan]: не возможно открыть директорию (%s)', $Path));
    }
    #-----------------------------------------------------------------------------
    $Ignored = array('.', '..');
    #-----------------------------------------------------------------------------
    if ($IsHidden) {
        $Ignored = Array_Merge($Ignored, array('.svn'));
    }
    #-----------------------------------------------------------------------------
    # ReadDir changed to ScanDir by lissyara, for JBS-335
    $Files = ScanDir($Path);
    #while($File = ReadDir($Folder)){
    foreach ($Files as $File) {
        #---------------------------------------------------------------------------
        if (In_Array($File, $Ignored)) {
            continue;
        }
        #---------------------------------------------------------------------------
        $Result[] = $File;
    }
    #-----------------------------------------------------------------------------
    CloseDir($Folder);
    #-----------------------------------------------------------------------------
    return $Result;
}