db->autoCommit(false); $f->addToLog("app/om_filestorage_migrate.php: db->autocommit(false);", VERBOSE_MODE); // $files = array( "om_logo" => array( "pkey" => array( "field" => "om_logo", "type" => "N", ), "file_fields" => array("fichier", ), ), "plans" => array( "pkey" => array( "field" => "plans", "type" => "N", ), "file_fields" => array("fichier", ), ), "dossier" => array( "pkey" => array( "field" => "dossier", "type" => "N", ), "file_fields" => array("fichier", ), ), ); // $source_conf = array( "storage" => "deprecated", "path" => "../trs/1/", ); require_once PATH_OPENMAIRIE."om_filestorage_".$source_conf["storage"].".class.php"; $class_name = 'filestorage_'.$source_conf["storage"]; $storage_source = new $class_name($source_conf); // $destination_conf = array( "storage" => "filesystem", "path" => "../trs/1/", ); require_once PATH_OPENMAIRIE."om_filestorage_".$destination_conf["storage"].".class.php"; $class_name = 'filestorage_'.$destination_conf["storage"]; $storage_destination = new $class_name($destination_conf); // foreach ($files as $table => $params) { // $error = false; // $uids_created = array(); // $old_files_to_delete = array(); // foreach ($params["file_fields"] as $field) { // echo "

"; echo $table." => ".$field; echo "

"; // echo ""; } // if ($error === true || $error === NULL) { // $f->db->rollback(); $f->addToLog("app/om_filestorage_migrate.php: db->rollback();", VERBOSE_MODE); // foreach($uids_created as $uid_created) { // $storage_destination->delete($uid_created); } } else { // $f->db->commit(); $f->addToLog("app/om_filestorage_migrate.php: db->commit();", VERBOSE_MODE); // $old_files_to_delete = array_unique($old_files_to_delete); foreach($old_files_to_delete as $old_file_to_delete) { // $storage_source->delete($old_file_to_delete); } } } ?>