public function do_actions() { #/* # * Fetch the data on the admin users. # */ #$user_entries = Admin_UsersHelper::get_all_user_entries(); # #/* # * Preprocess the user data. # */ #$preprocessed_users = array(); # #foreach ($user_entries as $user_entry) { # $preprocessed_users[] # = array( # 'name' => $user_entry->get_name(), # 'email' => $user_entry->get_email(), # 'real_name' => $user_entry->get_real_name(), # 'type' => $user_entry->get_type() # ); #} # #/* # * Print of the data. # */ #CLIScripts_DataRenderingHelper # ::render_array_of_assocs_in_table( # $preprocessed_users # ); $user_assocs = array(); foreach (Admin_UsersHelper::get_all_user_entries() as $user_entry) { $user_assocs[] = $user_entry->get_assoc(); } CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($user_assocs, array('id' => 'ID')); }
public function do_actions() { $user_assocs = array(); foreach (Admin_UsersHelper::get_all_user_entries() as $user_entry) { $user_assocs[] = $user_entry->get_assoc(); } CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($user_assocs, array('id' => 'ID')); }
public function do_actions() { #$project_directory # = HaddockProjectOrganisation_ProjectDirectoryHelper # ::get_project_directory(); $module_names_aoa = array(); foreach (HaddockProjectOrganisation_ModuleDirectoriesHelper::get_all_module_directories_sorted_by_identifying_name() as $module_directory) { $module_names_aoa[] = array('identifying_name' => $module_directory->get_identifying_name(), 'camel_case_root' => $module_directory->get_camel_case_root(), 'title' => $module_directory->get_title()); } CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($module_names_aoa); }
public static function show_user_data_on_cli(Admin_UserEntry $user_entry) { /* * Preprocess the data into an assoc. */ $user_assoc = $user_entry->get_assoc(); #print_r($user_assoc); /* * Render the data. */ CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table(array($user_assoc), array('id' => 'ID')); }
public function do_actions() { $test_results_set = UnitTests_TestsHelper::run_all_tests(); #print_r($test_results_set); exit; #$test_results_summary # = $test_results_set->get_summary(); # ##print_r($test_results_summary); # #echo 'Test Results Summary' . PHP_EOL; #echo PHP_EOL; # #$padding_chars = -25; #printf( # '%' . $padding_chars . 's: %d' . PHP_EOL, # 'Total passed test', # $test_results_summary['total_passed_tests'] #); #printf( # '%' . $padding_chars . 's: %d' . PHP_EOL, # 'Total test functions', # $test_results_summary['total_test_functions'] #); #printf( # '%' . $padding_chars . 's: %s' . PHP_EOL, # 'All tests passed', # $test_results_summary['all_tests_passed'] ? 'Yes' : 'No' #); #printf( # '%' . $padding_chars . 's: %.3f s' . PHP_EOL, # 'Total test time', # $test_results_summary['total_test_time'] #); #echo PHP_EOL; /* * Print off the test results. */ $test_results = $test_results_set->get_test_results(); #print_r($test_results); #echo 'Test Results' . PHP_EOL; #echo PHP_EOL; # #/* # * Preformat some of the columns data. # */ #for ( # $i = 0; # $i < count($test_results); # $i++ #) { # $test_results[$i]['passes_all_tests'] # = $test_results[$i]['passes_all_tests'] ? 'Yes' : 'No'; # # $test_results[$i]['total_test_time'] # = sprintf( # '%.3f', # $test_results[$i]['total_test_time'] # ); #} # #CLIScripts_DataRenderingHelper # ::render_array_of_assocs_in_table( # $test_results, # array( # 'total_test_time' => 'Total Test Time (s)' # ) # ); #$titles = array( # 'test_name' => 'Test Name', # 'passed_tests_count' => 'Passed Tests Count', # 'test_functions_count' => 'Test Functions Count', # 'passes_all_tests' => 'Passes All Tests', # 'total_test_time' => 'Total Test Time (s)' #); # #$title_str = sprintf( # '%-40s | %5s | %5s | %5s | %3s', # 'Test Name', # 'Passed Tests Count', # 'Test Functions Count', # 'Passes All Tests', # 'Total Test Time (s)' #); # #$hr = str_repeat( # '-', # strlen($title_str) # ); # #$title_str = "|$title_str|" . PHP_EOL; # #$hr = "|$hr|" . PHP_EOL; # #echo $hr; # #echo $title_str; # #echo $hr; # #foreach ( # $test_results # as # $test_result #) { # printf( # '|%-40s%5d%5d%5s %.3f|', # $test_result['test_name'], # $test_result['passed_tests_count'], # $test_result['test_functions_count'], # $test_result['passes_all_tests'] ? 'Yes' : 'No', # $test_result['total_test_time'] # ); # echo PHP_EOL; #} # #echo $hr; #echo 'Test Results' . PHP_EOL; #echo PHP_EOL; /* * Make the test results into an array of assocs * and reformat the data. */ $test_results_aoa = array(); foreach ($test_results as $test_result) { $test_results_aoa[] = array('class_name' => $test_result->get_class_name(), 'function_name' => $test_result->get_function_name(), 'passes' => $test_result->get_passes() ? 'Yes' : 'No', 'time' => sprintf('%.3f', $test_result->get_time())); } CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($test_results_aoa, array('time' => 'Time (s)')); }
public static function list_delta_file_applications() { $formatted_data = array(); foreach (self::get_delta_file_applications() as $delta_file_application) { $formatted_data[] = array('name' => $delta_file_application['name'], 'md5' => $delta_file_application['md5'], 'applied' => date('c', $delta_file_application['applied'])); } CLIScripts_DataRenderingHelper::render_array_of_assocs_in_table($formatted_data, array('md5' => 'MD5')); }