rolled back change as it broke other stuff

这个提交包含在:
Peter Goodhall 2018-12-21 14:53:49 +00:00
父节点 d0c60f8cfb
当前提交 821ff3b8f6

查看文件

@ -31,22 +31,11 @@ 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);
if(isset($record->start)) { $endinfo = strtotime($record->end);
$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(
@ -88,19 +77,11 @@ class Update extends CI_Controller {
$count = 0; $count = 0;
foreach ($xml_data->exceptions->exception as $record) { foreach ($xml_data->exceptions->exception as $record) {
if(isset($record->start)) { $startinfo = strtotime($record->start);
$startinfo = strtotime($record->start); $endinfo = strtotime($record->end);
$start_date = date('Y-m-d H:i:s',$startinfo);
} else { $start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
$start_date = NULL; $end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
}
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,
@ -116,7 +97,6 @@ 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();
@ -137,20 +117,11 @@ class Update extends CI_Controller {
$count = 0; $count = 0;
foreach ($xml_data->prefixes->prefix as $record) { foreach ($xml_data->prefixes->prefix as $record) {
if(isset($record->start)) { $startinfo = strtotime($record->start);
$startinfo = strtotime($record->start); $endinfo = strtotime($record->end);
$start_date = date('Y-m-d H:i:s',$startinfo);
} else { $start_date = ($startinfo) ? date('Y-m-d H:i:s',$startinfo) : "";
$start_date = NULL; $end_date = ($endinfo) ? date('Y-m-d H:i:s',$endinfo) : "";
}
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,
@ -198,11 +169,6 @@ class Update extends CI_Controller {
} }
gzclose($gz); gzclose($gz);
if (!file_exists("./updates/"))
{
mkdir("./updates");
}
file_put_contents('./updates/cty.xml', $data); file_put_contents('./updates/cty.xml', $data);
// Clear the tables, ready for new data // Clear the tables, ready for new data