Added some error checking that seems to stop PHP 7.2.12 from erroring while importing
这个提交包含在:
父节点
7d29679b19
当前提交
984cfb0c6a
共有 1 个文件被更改,包括 43 次插入 和 14 次删除
|
|
@ -31,11 +31,22 @@ class Update extends CI_Controller {
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($xml_data->entities->entity as $entity) {
|
foreach ($xml_data->entities->entity as $entity) {
|
||||||
$startinfo = strtotime($record->start);
|
|
||||||
$endinfo = strtotime($record->end);
|
if(isset($record->start)) {
|
||||||
|
$startinfo = strtotime($record->start);
|
||||||
|
$start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
|
||||||
|
} else {
|
||||||
|
$start_date = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($record->end)) {
|
||||||
|
$endinfo = strtotime($record->end);
|
||||||
|
$end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
|
||||||
|
} else {
|
||||||
|
$end_date = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
|
|
||||||
$end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
|
|
||||||
|
|
||||||
if(!$entity->cqz) {
|
if(!$entity->cqz) {
|
||||||
$data = array(
|
$data = array(
|
||||||
|
|
@ -77,11 +88,19 @@ class Update extends CI_Controller {
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($xml_data->exceptions->exception as $record) {
|
foreach ($xml_data->exceptions->exception as $record) {
|
||||||
$startinfo = strtotime($record->start);
|
if(isset($record->start)) {
|
||||||
$endinfo = strtotime($record->end);
|
$startinfo = strtotime($record->start);
|
||||||
|
$start_date = date('Y-m-d H:i:s',$startinfo);
|
||||||
$start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
|
} else {
|
||||||
$end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
|
$start_date = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($record->end)) {
|
||||||
|
$endinfo = strtotime($record->end);
|
||||||
|
$end_date = date('Y-m-d H:i:s',$endinfo);
|
||||||
|
} else {
|
||||||
|
$end_date = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'record' => (int) $record->attributes()->record,
|
'record' => (int) $record->attributes()->record,
|
||||||
|
|
@ -97,6 +116,7 @@ class Update extends CI_Controller {
|
||||||
);
|
);
|
||||||
|
|
||||||
$this->db->insert('dxcc_exceptions', $data);
|
$this->db->insert('dxcc_exceptions', $data);
|
||||||
|
|
||||||
$count += 1;
|
$count += 1;
|
||||||
if ($count % 10 == 0)
|
if ($count % 10 == 0)
|
||||||
$this->update_status();
|
$this->update_status();
|
||||||
|
|
@ -117,11 +137,20 @@ class Update extends CI_Controller {
|
||||||
|
|
||||||
$count = 0;
|
$count = 0;
|
||||||
foreach ($xml_data->prefixes->prefix as $record) {
|
foreach ($xml_data->prefixes->prefix as $record) {
|
||||||
$startinfo = strtotime($record->start);
|
if(isset($record->start)) {
|
||||||
$endinfo = strtotime($record->end);
|
$startinfo = strtotime($record->start);
|
||||||
|
$start_date = date('Y-m-d H:i:s',$startinfo);
|
||||||
$start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
|
} else {
|
||||||
$end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
|
$start_date = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
if (isset($record->end)) {
|
||||||
|
$endinfo = strtotime($record->end);
|
||||||
|
$end_date = date('Y-m-d H:i:s',$endinfo);
|
||||||
|
} else {
|
||||||
|
$end_date = NULL;
|
||||||
|
}
|
||||||
|
|
||||||
|
|
||||||
$data = array(
|
$data = array(
|
||||||
'record' => (int) $record->attributes()->record,
|
'record' => (int) $record->attributes()->record,
|
||||||
|
|
|
||||||
正在加载…
在新工单中引用