kopia lustrzana https://github.com/magicbug/Cloudlog
Added some error checking that seems to stop PHP 7.2.12 from erroring while importing
rodzic
7d29679b19
commit
984cfb0c6a
|
@ -31,11 +31,22 @@ class Update extends CI_Controller {
|
|||
|
||||
$count = 0;
|
||||
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) {
|
||||
$data = array(
|
||||
|
@ -77,11 +88,19 @@ class Update extends CI_Controller {
|
|||
|
||||
$count = 0;
|
||||
foreach ($xml_data->exceptions->exception as $record) {
|
||||
$startinfo = strtotime($record->start);
|
||||
$endinfo = strtotime($record->end);
|
||||
|
||||
$start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
|
||||
$end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
|
||||
if(isset($record->start)) {
|
||||
$startinfo = strtotime($record->start);
|
||||
$start_date = date('Y-m-d H:i:s',$startinfo);
|
||||
} else {
|
||||
$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(
|
||||
'record' => (int) $record->attributes()->record,
|
||||
|
@ -97,6 +116,7 @@ class Update extends CI_Controller {
|
|||
);
|
||||
|
||||
$this->db->insert('dxcc_exceptions', $data);
|
||||
|
||||
$count += 1;
|
||||
if ($count % 10 == 0)
|
||||
$this->update_status();
|
||||
|
@ -117,11 +137,20 @@ class Update extends CI_Controller {
|
|||
|
||||
$count = 0;
|
||||
foreach ($xml_data->prefixes->prefix as $record) {
|
||||
$startinfo = strtotime($record->start);
|
||||
$endinfo = strtotime($record->end);
|
||||
|
||||
$start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
|
||||
$end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
|
||||
if(isset($record->start)) {
|
||||
$startinfo = strtotime($record->start);
|
||||
$start_date = date('Y-m-d H:i:s',$startinfo);
|
||||
} else {
|
||||
$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(
|
||||
'record' => (int) $record->attributes()->record,
|
||||
|
|
Ładowanie…
Reference in New Issue