Subversion Repositories oidplus

Rev

Rev 1206 | Rev 1266 | Go to most recent revision | Show entire file | Regard whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 1206 Rev 1231
Line 1033... Line 1033...
1033
                                        $count_errors++;
1033
                                        $count_errors++;
1034
                                        continue;
1034
                                        continue;
1035
                                }
1035
                                }
1036
                        }
1036
                        }
1037
 
1037
 
1038
                        OIDplus::db()->transaction_begin();
1038
                        if (OIDplus::db()->transaction_supported()) OIDplus::db()->transaction_begin();
1039
 
1039
                        try {
1040
                        $obj_test = OIDplusObject::findFitting($id);
1040
                                $obj_test = OIDplusObject::findFitting($id);
1041
                        if ($obj_test) {
1041
                                if ($obj_test) {
1042
                                if ($replaceExistingOIDs) {
1042
                                        if ($replaceExistingOIDs) {
1043
                                        OIDplus::db()->query("delete from ###objects where id = ?", array($id));
1043
                                                OIDplus::db()->query("delete from ###objects where id = ?", array($id));
1044
                                        OIDplus::db()->query("delete from ###asn1id where oid = ?", array($id));
1044
                                                OIDplus::db()->query("delete from ###asn1id where oid = ?", array($id));
Line 1052... Line 1052...
1052
                        }
1052
                                }
1053
 
1053
 
1054
                        // TODO: we can probably get the created and modified timestamp from oid-info.com XML
1054
                                // TODO: we can probably get the created and modified timestamp from oid-info.com XML
1055
                        OIDplus::db()->query("insert into ###objects (id, parent, title, description, confidential, ra_email) values (?, ?, ?, ?, ?, ?)", array($id, $parent, $title, $info, false, $ra));
1055
                                OIDplus::db()->query("insert into ###objects (id, parent, title, description, confidential, ra_email) values (?, ?, ?, ?, ?, ?)", array($id, $parent, $title, $info, false, $ra));
1056
 
1056
 
1057
                        OIDplus::db()->transaction_commit();
1057
                                if (OIDplus::db()->transaction_supported()) OIDplus::db()->transaction_commit();
-
 
1058
                        } catch (\Exception $e) {
-
 
1059
                                if (OIDplus::db()->transaction_supported()) OIDplus::db()->transaction_rollback();
-
 
1060
                                throw new $e;
-
 
1061
                        }
-
 
1062
 
1058
                        OIDplusObject::resetObjectInformationCache();
1063
                        OIDplusObject::resetObjectInformationCache();
1059
 
1064
 
1060
                        $this_oid_has_warnings = false;
1065
                        $this_oid_has_warnings = false;
1061
 
1066
 
1062
                        // ---------------------------------------------------------------------
1067
                        // ---------------------------------------------------------------------