Пример #1
0
                break;
        }
        if (!$bRes) {
            break;
        }
    }
    return $bRes;
}
function runJob($aJob)
{
    if (!empty($aJob['file']) && !empty($aJob['class']) && file_exists(BX_DIRECTORY_PATH_ROOT . $aJob['file'])) {
        if (!class_exists($aJob['class'])) {
            require_once BX_DIRECTORY_PATH_ROOT . $aJob['file'];
        }
        $oHandler = new $aJob['class']();
        $oHandler->processing();
    } else {
        if (!empty($aJob['eval'])) {
            require_once BX_DIRECTORY_PATH_CLASSES . 'BxDolService.php';
            eval($aJob['eval']);
        }
    }
}
$oDb = new BxDolDb();
$aJobs = $oDb->fromCache('sys_cron_jobs', 'getAll', 'SELECT * FROM `sys_cron_jobs`');
$aDate = getdate(time());
foreach ($aJobs as $aRow) {
    if (checkCronJob($aRow['time'], $aDate)) {
        runJob($aRow);
    }
}
Пример #2
0
function getMatchFields()
{
    $oDb = new BxDolDb();
    return $oDb->fromCache('sys_profile_match_fields', 'getAllWithKey', 'SELECT `ID`, `Name`, `MatchField`, `MatchPercent` FROM `sys_profile_fields` WHERE `MatchPercent` > 0', 'ID');
}