예제 #1
0
$safeRound = getenv('SAFE');
if (!$safeRound) {
    $safeRound = isset($options['safe']) ? (int) $options['safe'] : 0;
}
if ($safeRound < 1) {
    $safeRound = 30;
}
$markerLocation = sprintf('%s/log/marker_%d/%s', CONFIG_DIR, ELASTIC_SEARCH_SCHEMA_VERSION, $gameVersion);
if (isset($options['reset'])) {
    $backup = sprintf('%s.%s', $markerLocation, date('Ymd'));
    rename($markerLocation, $backup);
    appendLog($backup);
    return;
}
dump($markerLocation);
$calendarMarker = new \Facade\CalendarDayMarker($markerLocation);
$fromDay = getenv('FROM');
if (!$fromDay) {
    $fromDay = isset($options['from']) ? $options['from'] : date('Ymd');
}
$toDay = isset($options['to']) ? $options['to'] : date('Ymd');
$logFileGetter = function ($gameVersion, $date) {
    $logDate = str_replace('-', '', $date);
    $filePath = LOG_DIR . '/' . $logDate . '/' . $gameVersion . '.supply';
    $dir = dirname($filePath);
    if (!is_dir($dir)) {
        mkdir($dir, 0755, true);
    }
    return $filePath;
};
$fromDate = date_create_from_format('Ymd', $fromDay);
예제 #2
0
    $safeRound = 30;
}
$gameVersion = getenv('GV');
if (!$gameVersion) {
    assert(isset($options['gv']), 'game version not defined');
    $gameVersion = trim($options['gv']);
}
$markerLocation = sprintf('%s/log/marker_%d_login/%s', CONFIG_DIR, ELASTIC_SEARCH_SCHEMA_VERSION, $gameVersion);
if (isset($options['reset'])) {
    $backup = sprintf('%s.%s', $markerLocation, date('Ymd'));
    rename($markerLocation, $backup);
    appendLog($backup);
    return;
}
dump($markerLocation);
$calendarMarker = new \Facade\CalendarDayMarker($markerLocation);
$fromDay = getenv('FROM');
if (!$fromDay) {
    $fromDay = isset($options['from']) ? $options['from'] : date('Ymd');
}
$toDay = isset($options['to']) ? $options['to'] : date('Ymd');
$logFileGetter = function ($gameVersion, $date) {
    $logDate = str_replace('-', '', $date);
    $filePath = LOG_DIR . '/' . $logDate . '/' . $gameVersion . '.supply';
    $dir = dirname($filePath);
    if (!is_dir($dir)) {
        mkdir($dir, 0755, true);
    }
    return $filePath;
};
$fromDate = date_create_from_format('Ymd', $fromDay);