Пример #1
0
    foreach ($olddirs as $olddir) {
        $eucaInstall->rrmdir(PaymentProcessorHandler::pp_dir() . '/' . $olddir);
    }
    // Remove old processor integrations
    foreach ($oldprocs as $proc) {
        $ppath = PaymentProcessorHandler::pp_dir() . '/' . $proc . '.php';
        if (file_exists($ppath)) {
            unlink($ppath);
        }
    }
    $customprocs = xJUtility::getFileArray(PaymentProcessorHandler::pp_dir(), false, false);
    foreach ($customprocs as $cproc) {
        if (strpos($cproc, '.php')) {
            $newdir = PaymentProcessorHandler::pp_dir() . '/' . str_replace('.php', '', $cproc);
            mkdir($newdir);
            rename(PaymentProcessorHandler::pp_dir() . '/' . $cproc, $newdir . '/' . $cproc);
        }
    }
}
$mih = new microIntegrationHandler();
$testmis = xJUtility::getFileArray($mih->mi_dir, false, false);
// Check if there are old mi files
if (count($testmis) > 5) {
    // Remove other old integration dirs
    $olddirs = array('mi_example', 'mi_htaccess');
    foreach ($olddirs as $olddir) {
        $eucaInstall->rrmdir($mih->mi_dir . '/' . $olddir);
    }
    // Try to preserve custom MIs
    foreach ($testmis as $mik) {
        $handle = str_replace(array('mi_', '.php'), '', $mik);