Postcodify_Utility::print_usage_instructions(); } $args = Postcodify_Utility::get_terminal_args(); if ($args->command === null) { Postcodify_Utility::print_usage_instructions(); } if (in_array('--dry-run', $args->options)) { Postcodify_Utility::print_usage_instructions(); } // 필요한 클래스를 호출한다. $start_time = time(); $class_name = 'Postcodify_Indexer_' . ucfirst(str_replace('-', '_', $argv[1])); $obj = new $class_name(); $obj->start($args); // 소요된 시간을 출력한다. echo str_repeat('-', Postcodify_Utility::get_terminal_width()) . PHP_EOL; $elapsed = time() - $start_time; $elapsed_hours = floor($elapsed / 3600); $elapsed = $elapsed - $elapsed_hours * 3600; $elapsed_minutes = floor($elapsed / 60); $elapsed_seconds = $elapsed % 60; echo '작업을 모두 마쳤습니다. 경과 시간 : '; if ($elapsed_hours) { echo $elapsed_hours . '시간 '; } if ($elapsed_hours || $elapsed_minutes) { echo $elapsed_minutes . '분 '; } echo $elapsed_seconds . '초'; echo PHP_EOL; exit(0);