protected function set_trunk_indexes()
 {
     $arr = Cnf::get('trunk_indexes');
     if (!empty($arr)) {
         $this->trunk_indexes = $arr;
     } else {
         Log::instance()->error("Trunk indexes is empty.");
     }
 }
Example #2
0
    $day = !empty($o['d']) ? $o['d'] : 1;
    $time_start = mktime(0, 0, 0, $o['m'], $day, $o['y']);
    if ($time_start >= $time_today) {
        return;
    }
    $period_try = !empty($o['c']) ? $o['c'] : (!empty($o['d']) ? 1 : date('t', $time_start));
    if ($time_start + $period_try * 86400 >= $time_today) {
        $period_try = ($time_today - $time_start) / 86400;
    }
} else {
    $check_pipe = Cnf::get('check_pipe');
    $period_try = Cnf::get('period_try');
    $time_start = $time_today - $period_try * 86400;
}
$y = date('Y', $time_start);
$m = date('n', $time_start);
$d = date('j', $time_start) + $period_try;
// set PipeFile object
$processed_pipe = new PipeFile(DOCROOT . Cnf::get('processed_files')['file_name']);
$processed_pipe->set_quantity_rows(Cnf::get('processed_files')['count_history']);
$pipe_data = $processed_pipe->get_data();
for ($i = $period_try; $i >= 1; $i--) {
    $date = mktime(0, 0, 0, $m, $d - $i, $y);
    $parser = new Parser((array) Cnf::get());
    if (isset($check_pipe) and $check_pipe != FALSE and in_array($date, $pipe_data)) {
        continue;
    }
    if ($parser->treat($date)) {
        $processed_pipe->add_data($date);
    }
}