public function add_current_system_information()
 {
     $this->xml_writer->addXmlNode('PhoronixTestSuite/System/Identifier', $this->result_identifier);
     $this->xml_writer->addXmlNode('PhoronixTestSuite/System/Hardware', phodevi::system_hardware(true));
     $this->xml_writer->addXmlNode('PhoronixTestSuite/System/Software', phodevi::system_software(true));
     $this->xml_writer->addXmlNode('PhoronixTestSuite/System/User', pts_client::current_user());
     $this->xml_writer->addXmlNode('PhoronixTestSuite/System/TimeStamp', date('Y-m-d H:i:s'));
     $this->xml_writer->addXmlNode('PhoronixTestSuite/System/TestClientVersion', PTS_VERSION);
     //$this->xml_writer->addXmlNode('PhoronixTestSuite/System/Notes', pts_test_notes_manager::generate_test_notes($test_type));
 }
 public function pre_execution_process()
 {
     if ($this->do_save_results()) {
         if ($this->is_new_result_file || $this->result_already_contains_identifier() == false) {
             $this->result_file->set_title($this->file_name_title);
             $this->result_file->set_description($this->run_description);
             $this->result_file->set_notes($this->get_notes());
             $this->result_file->set_internal_tags($this->get_internal_tags());
             $this->result_file->set_reference_id($this->get_reference_id());
             $this->result_file->set_preset_environment_variables($this->get_preset_environment_variables());
             // TODO XXX JSON In null and notes
             $sys = new pts_result_file_system($this->results_identifier, phodevi::system_hardware(true), phodevi::system_software(true), $this->generate_json_system_attributes(), pts_client::current_user(), pts_test_notes_manager::generate_test_notes($this->tests_to_run), date('Y-m-d H:i:s'), PTS_VERSION);
             $this->result_file->add_system($sys);
         }
         pts_client::setup_test_result_directory($this->get_file_name());
     }
 }
 public function post_execution_process()
 {
     if ($this->do_save_results()) {
         if ($this->result_file->get_test_count() == 0 && $this->is_new_result_file) {
             pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name());
             return false;
         }
         pts_file_io::delete(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/test-logs/active/', null, true);
         if ($this->is_new_result_file || $this->result_already_contains_identifier() == false) {
             // TODO XXX JSON In null and notes
             $sys = new pts_result_file_system($this->results_identifier, phodevi::system_hardware(true), phodevi::system_software(true), $this->generate_json_system_attributes(), pts_client::current_user(), pts_test_notes_manager::generate_test_notes($this->tests_to_run), date('Y-m-d H:i:s'), PTS_VERSION);
             $this->result_file->add_system($sys);
         }
         echo PHP_EOL;
         pts_module_manager::module_process('__event_results_process', $this);
         pts_client::save_test_result($this->get_file_name() . '/composite.xml', $this->result_file->get_xml(), true, null, $this->results_identifier);
         pts_module_manager::module_process('__event_results_saved', $this);
         //echo PHP_EOL . 'Results Saved To: ; . PTS_SAVE_RESULTS_PATH . $this->get_file_name() . ;/composite.xml' . PHP_EOL;
         if (!$this->auto_mode) {
             if ($this->batch_mode) {
                 if ($this->batch_mode['OpenBrowser']) {
                     pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, true);
                 }
             } else {
                 pts_client::display_web_page(PTS_SAVE_RESULTS_PATH . $this->get_file_name() . '/index.html', null, true, false);
             }
         }
         if ($this->allow_sharing_of_results && pts_network::internet_support_available()) {
             if ($this->auto_upload_to_openbenchmarking || pts_openbenchmarking_client::auto_upload_results() || pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/AlwaysUploadResultsToOpenBenchmarking', 'FALSE')) {
                 $upload_results = true;
             } else {
                 if ($this->batch_mode) {
                     $upload_results = $this->batch_mode['UploadResults'];
                 } else {
                     if (!$this->auto_mode) {
                         $upload_results = pts_user_io::prompt_bool_input('Would you like to upload the results to OpenBenchmarking.org', true);
                     } else {
                         $upload_results = false;
                     }
                 }
             }
             if ($upload_results) {
                 $this->openbenchmarking_results_data = pts_openbenchmarking::upload_test_result($this, true);
                 if ($this->get_results_url()) {
                     if (!$this->auto_mode && !$this->batcj_mode && pts_openbenchmarking_client::auto_upload_results() == false) {
                         pts_client::display_web_page($this->get_results_url(), 'Do you want to launch OpenBenchmarking.org', true);
                     }
                 } else {
                     echo PHP_EOL . 'Results Failed To Upload.' . PHP_EOL;
                 }
             }
         }
     }
 }