예제 #1
0
        }
        $tmp_path = ilUpdateUtilsMailMigration::ilTempnam();
        ilUpdateUtilsMailMigration::makeDir($tmp_path);
        ilUpdateUtilsMailMigration::rename($path, $tmp_path);
        $oFSStorageMail->create();
        $new_path = $oFSStorageMail->getAbsolutePath();
        if (!@file_exists($new_path) || !@is_dir($new_path)) {
            $ilLog->write('DB Migration ' . $update_step . ': Failed: Target folder "' . $new_path . '" does not exist for mail ' . $record->mail_id);
            continue;
        } else {
            if (!@is_writeable($new_path)) {
                $ilLog->write('DB Migration ' . $update_step . ': Failed: Target folder "' . $new_path . '" is not writeable for mail ' . $record->mail_id);
                continue;
            }
        }
        ilUpdateUtilsMailMigration::rename($tmp_path, $new_path);
    }
    // Modifie existing attachment assigment
    $ilDB->manipulateF("UPDATE mail_attachment SET path = %s WHERE mail_id = %s", array('text', 'integer'), array($oFSStorageMail->getRelativePathExMailDirectory(), $record->mail_id));
    // Save success
    $ilDB->manipulateF("INSERT INTO tmp_mail_migration (mail_id, mail_passed, mail_path) VALUES (%s, %s, %s)", array('integer', 'integer', 'text'), array($record->mail_id, 1, $record->path));
}
?>
<#2500>
<?php 
if ($ilDB->tableExists('tmp_mail_migration')) {
    $ilDB->dropTable('tmp_mail_migration');
}
?>

<#2501>