How to use init method of pts_client class

Best Phoronix-test-suite code snippet using pts_client.init

pts_client.php

Source:pts_client.php Github

copy

Full Screen

...56 }57 pts_file_io::unlink($lock_file);58 unset(self::$lock_pointers[$lock_file]);59 }60 public static function init()61 {62 pts_core::init();63 if(defined('QUICK_START') && QUICK_START)64 {65 return true;66 }67 if(function_exists('cli_set_process_title') && PHP_OS == 'Linux')68 {69 cli_set_process_title('Phoronix Test Suite');70 }71 pts_define('PHP_BIN', pts_client::read_env('PHP_BIN'));72 $dir_init = array(PTS_USER_PATH);73 foreach($dir_init as $dir)74 {75 pts_file_io::mkdir($dir);76 }77 if(PTS_IS_CLIENT)78 {79 pts_network::client_startup();80 }81 self::core_storage_init_process();82 if(!is_file(PTS_TEMP_STORAGE))83 {84 self::build_temp_cache();85 }86 pts_define('PTS_TEST_INSTALL_DEFAULT_PATH', pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/EnvironmentDirectory', '~/.phoronix-test-suite/installed-tests/')));87 pts_define('PTS_SAVE_RESULTS_PATH', pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Testing/ResultsDirectory', '~/.phoronix-test-suite/test-results/')));88 self::extended_init_process();89 $openbenchmarking = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking');90 $openbenchmarking_account_settings = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking_account_settings');91 if($openbenchmarking != null)92 {93 // OpenBenchmarking.org Account94 pts_openbenchmarking_client::init_account($openbenchmarking, $openbenchmarking_account_settings);95 }96 return true;97 }98 private static function extended_init_process()99 {100 // Extended Initalization Process101 $directory_check = array(102 PTS_TEST_INSTALL_DEFAULT_PATH,103 PTS_SAVE_RESULTS_PATH,104 PTS_MODULE_LOCAL_PATH,105 PTS_MODULE_DATA_PATH,106 PTS_DOWNLOAD_CACHE_PATH,107 PTS_OPENBENCHMARKING_SCRATCH_PATH,108 PTS_TEST_PROFILE_PATH,109 PTS_TEST_SUITE_PATH,110 PTS_TEST_PROFILE_PATH . 'local/',111 PTS_TEST_SUITE_PATH . 'local/'112 );113 foreach($directory_check as $dir)114 {115 pts_file_io::mkdir($dir);116 }117 // Setup ~/.phoronix-test-suite/xsl/118 pts_file_io::mkdir(PTS_USER_PATH . 'xsl/');119 copy(PTS_CORE_STATIC_PATH . 'xsl/pts-test-installation-viewer.xsl', PTS_USER_PATH . 'xsl/' . 'pts-test-installation-viewer.xsl');120 copy(PTS_CORE_STATIC_PATH . 'xsl/pts-user-config-viewer.xsl', PTS_USER_PATH . 'xsl/' . 'pts-user-config-viewer.xsl');121 copy(PTS_CORE_STATIC_PATH . 'images/pts-308x160.png', PTS_USER_PATH . 'xsl/' . 'pts-logo.png');122 // pts_compatibility ops here123 pts_client::init_display_mode();124 }125 public static function module_framework_init()126 {127 // Process initially called when PTS starts up128 // Check for modules to auto-load from the configuration file129 $load_modules = pts_config::read_user_config('PhoronixTestSuite/Options/Modules/LoadModules', null);130 if(!empty($load_modules))131 {132 foreach(pts_strings::comma_explode($load_modules) as $module)133 {134 $module_r = pts_strings::trim_explode('=', $module);135 if(count($module_r) == 2)136 {137 // TODO: end up hooking this into pts_module::read_variable() rather than using the real env138 pts_client::set_environment_variable($module_r[0], $module_r[1]);139 }140 else141 {142 pts_module_manager::attach_module($module);143 }144 }145 }146 // Check for modules to load manually in PTS_MODULES147 if(($load_modules = pts_client::read_env('PTS_MODULES')) !== false)148 {149 foreach(pts_strings::comma_explode($load_modules) as $module)150 {151 if(!pts_module_manager::is_module_attached($module))152 {153 pts_module_manager::attach_module($module);154 }155 }156 }157 // Detect modules to load automatically158 pts_module_manager::detect_modules_to_load();159 // Clean-up modules list160 pts_module_manager::clean_module_list();161 // Reset counter162 pts_module_manager::set_current_module(null);163 // Load the modules164 $module_store_list = array();165 foreach(pts_module_manager::attached_modules() as $module)166 {167 $class_vars = get_class_vars($module);168 $module_store_vars = isset($class_vars['module_store_vars']) ? $class_vars['module_store_vars'] : null;169 if(is_array($module_store_vars))170 {171 foreach($module_store_vars as $store_var)172 {173 if(!in_array($store_var, $module_store_list))174 {175 $module_store_list[] = $store_var;176 }177 }178 }179 }180 // Should any of the module options be saved to the results?181 foreach($module_store_list as $var)182 {183 $var_value = pts_client::read_env($var);184 if(!empty($var_value))185 {186 pts_module_manager::var_store_add($var, $var_value);187 }188 }189 pts_module_manager::module_process('__startup');190 pts_define('PTS_STARTUP_TASK_PERFORMED', true);191 register_shutdown_function(array('pts_module_manager', 'module_process'), '__shutdown');192 }193 public static function environmental_variables()194 {195 // The PTS environmental variables passed during the testing process, etc196 static $env_variables = null;197 if($env_variables == null)198 {199 $env_variables = array(200 'PTS_VERSION' => PTS_VERSION,201 'PTS_CODENAME' => PTS_CODENAME,202 'PTS_DIR' => PTS_PATH,203 'PHP_BIN' => PHP_BIN,204 'NUM_CPU_CORES' => phodevi::read_property('cpu', 'core-count'),205 'NUM_CPU_NODES' => phodevi::read_property('cpu', 'node-count'),206 'NUM_CPU_JOBS' => (phodevi::read_property('cpu', 'core-count') * 2),207 'SYS_MEMORY' => phodevi::read_property('memory', 'capacity'),208 'VIDEO_MEMORY' => phodevi::read_property('gpu', 'memory-capacity'),209 'VIDEO_WIDTH' => pts_arrays::first_element(phodevi::read_property('gpu', 'screen-resolution')),210 'VIDEO_HEIGHT' => pts_arrays::last_element(phodevi::read_property('gpu', 'screen-resolution')),211 'VIDEO_MONITOR_COUNT' => phodevi::read_property('monitor', 'count'),212 'VIDEO_MONITOR_LAYOUT' => phodevi::read_property('monitor', 'layout'),213 'VIDEO_MONITOR_SIZES' => phodevi::read_property('monitor', 'modes'),214 'OPERATING_SYSTEM' => phodevi::read_property('system', 'vendor-identifier'),215 'OS_VERSION' => phodevi::read_property('system', 'os-version'),216 'OS_ARCH' => phodevi::read_property('system', 'kernel-architecture'),217 'OS_TYPE' => phodevi::operating_system(),218 'THIS_RUN_TIME' => PTS_INIT_TIME,219 'DEBUG_REAL_HOME' => pts_core::user_home_directory()220 );221 if(!pts_client::executable_in_path('cc') && pts_client::executable_in_path('gcc') && getenv('CC') == false)222 {223 // This helps some test profiles build correctly if they don't do a cc check internally224 $env_variables['CC'] = 'gcc';225 }226 }227 return $env_variables;228 }229 public static function test_install_root_path()230 {231 if(getenv('PTS_TEST_INSTALL_ROOT_PATH') != false && is_dir(getenv('PTS_TEST_INSTALL_ROOT_PATH')) && is_writable(getenv('PTS_TEST_INSTALL_ROOT_PATH')))232 {233 return getenv('PTS_TEST_INSTALL_ROOT_PATH');234 }235 else236 {237 if(!defined('PTS_TEST_INSTALL_DEFAULT_PATH'))238 pts_define('PTS_TEST_INSTALL_DEFAULT_PATH', pts_strings::parse_for_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/EnvironmentDirectory', '~/.phoronix-test-suite/installed-tests/')));239 return PTS_TEST_INSTALL_DEFAULT_PATH;240 }241 }242 public static function user_run_save_variables()243 {244 static $runtime_variables = null;245 if($runtime_variables == null)246 {247 $runtime_variables = array(248 'VIDEO_RESOLUTION' => phodevi::read_property('gpu', 'screen-resolution-string'),249 'VIDEO_CARD' => phodevi::read_name('gpu'),250 'VIDEO_DRIVER' => phodevi::read_property('system', 'display-driver-string'),251 'OPENGL_DRIVER' => str_replace('(', '', phodevi::read_property('system', 'opengl-driver')),252 'OPERATING_SYSTEM' => phodevi::read_property('system', 'operating-system'),253 'PROCESSOR' => phodevi::read_name('cpu'),254 'MOTHERBOARD' => phodevi::read_name('motherboard'),255 'CHIPSET' => phodevi::read_name('chipset'),256 'KERNEL_VERSION' => phodevi::read_property('system', 'kernel'),257 'COMPILER' => phodevi::read_property('system', 'compiler'),258 'HOSTNAME' => phodevi::read_property('system', 'hostname')259 );260 }261 return $runtime_variables;262 }263 public static function supports_colored_text_output()264 {265 return (function_exists('posix_isatty') && posix_isatty(STDOUT)) || (PTS_IS_CLIENT && getenv('LS_COLORS'));266 }267 public static function cli_colored_text($str, $color, $bold = false)268 {269 if(!self::supports_colored_text_output() || empty($color))270 {271 return $str;272 }273 $attribute = ($bold ? '1' : '0');274 $colors = array(275 'black' => $attribute . ';30',276 'gray' => '1;30', // gray not bold doesn't look good in all consoles277 'blue' => $attribute . ';34',278 'green' => $attribute . ';32',279 'red' => $attribute . ';31',280 'cyan' => $attribute . ';36',281 );282 if(!isset($colors[$color]))283 {284 return $str;285 }286 return "\033[" . $colors[$color] . 'm' . $str . "\033[0m";287 }288 public static function cli_just_bold($str)289 {290 if(!self::supports_colored_text_output())291 {292 return $str;293 }294 return "\033[1m$str\033[0m";295 }296 public static function save_test_result($save_to = null, $save_results = null, $render_graphs = true, $result_identifier = null)297 {298 // Saves PTS result file299 if(substr($save_to, -4) != '.xml')300 {301 $save_to .= '.xml';302 }303 $save_to = str_replace(PTS_SAVE_RESULTS_PATH, null, $save_to);304 $save_to_dir = pts_client::setup_test_result_directory($save_to);305 if($save_to == null || $save_results == null)306 {307 $bool = false;308 }309 else310 {311 $save_name = basename($save_to, '.xml');312 if($save_name == 'composite' && $render_graphs)313 {314 pts_client::generate_result_file_graphs($save_results, $save_to_dir);315 }316 $bool = file_put_contents(PTS_SAVE_RESULTS_PATH . $save_to, $save_results);317 if($result_identifier != null && pts_config::read_bool_config('PhoronixTestSuite/Options/Testing/SaveSystemLogs', 'TRUE'))318 {319 // Save verbose system information here320 $system_log_dir = $save_to_dir . '/system-logs/' . $result_identifier . '/';321 pts_file_io::mkdir($system_log_dir, 0777, true);322 // Backup system files323 // TODO: move out these files/commands to log out to respective Phodevi components so only what's relevant will be logged324 $system_log_files = array(325 '/var/log/Xorg.0.log',326 '/proc/cpuinfo',327 '/proc/meminfo',328 '/proc/modules',329 '/proc/mounts',330 '/proc/cmdline',331 '/proc/version',332 '/proc/mdstat',333 '/etc/X11/xorg.conf',334 '/sys/kernel/debug/dri/0/radeon_pm_info',335 '/sys/kernel/debug/dri/0/i915_capabilities',336 '/sys/kernel/debug/dri/0/i915_cur_delayinfo',337 '/sys/kernel/debug/dri/0/i915_drpc_info',338 '/sys/devices/system/cpu/cpu0/cpufreq/scaling_available_frequencies',339 );340 /*341 if(phodevi::is_linux())342 {343 // the kernel config file might just be too large to upload for now344 $system_log_files[] = '/boot/config-' . php_uname('r');345 }346 */347 foreach($system_log_files as $file)348 {349 if(is_file($file) && is_readable($file) && filesize($file) < 1000000)350 {351 // copy() can't be used in this case since it will result in a blank file for /proc/ file-system352 $file_contents = file_get_contents($file);353 $file_contents = pts_strings::remove_line_timestamps($file_contents);354 file_put_contents($system_log_dir . basename($file), $file_contents);355 }356 }357 // Generate logs from system commands to backup358 $system_log_commands = array(359 'lspci -mmkvvvnn',360 'lscpu',361 'cc -v',362 // 'lsusb',363 'lsmod',364 'sensors',365 'dmesg',366 'vdpauinfo',367 'cpufreq-info',368 'glxinfo',369 'clinfo',370 'vulkaninfo',371 'uname -a',372 // 'udisks --dump',373 'upower --dump',374 );375 if(phodevi::is_bsd())376 {377 $system_log_commands[] = 'sysctl -a';378 $system_log_commands[] = 'kenv';379 }380 if(is_readable('/dev/mem'))381 {382 $system_log_commands[] = 'dmidecode';383 }384 foreach($system_log_commands as $command_string)385 {386 $command = explode(' ', $command_string);387 if(($command_bin = pts_client::executable_in_path($command[0])))388 {389 $cmd_output = shell_exec('cd ' . dirname($command_bin) . ' && ./' . $command_string . ' 2>&1');390 if(strlen($cmd_output) > 900000)391 {392 // Don't preserve really large logs, likely filled with lots of junk393 $cmd_output = null;394 continue;395 }396 // Try to filter out any serial numbers, etc.397 phodevi_vfs::cleanse_file($cmd_output, $command[0]);398 $cmd_output = pts_strings::remove_line_timestamps($cmd_output);399 file_put_contents($system_log_dir . $command[0], $cmd_output);400 }401 }402 // Dump some common / important environmental variables403 $environment_variables = array(404 'PATH' => null,405 'CFLAGS' => null,406 'CXXFLAGS' => null,407 'LD_LIBRARY_PATH' => null,408 'CC' => null,409 'CXX' => null,410 'LIBGL_DRIVERS_PATH' => null411 );412 foreach($environment_variables as $variable => &$value)413 {414 $v = getenv($variable);415 if($v != null)416 {417 $value = $v;418 }419 else420 {421 unset($environment_variables[$variable]);422 }423 }424 if(!empty($environment_variables))425 {426 $variable_dump = null;427 foreach($environment_variables as $variable => $value)428 {429 $variable_dump .= $variable . '=' . $value . PHP_EOL;430 }431 file_put_contents($system_log_dir . 'environment-variables', $variable_dump);432 }433 pts_module_manager::module_process('__post_test_run_system_logs', $system_log_dir);434 }435 }436 return $bool;437 }438 public static function init_display_mode($override_display_mode = false)439 {440 if(PTS_IS_WEB_CLIENT && !defined('PHOROMATIC_SERVER'))441 {442 self::$display = new pts_web_display_mode();443 return;444 }445 $env_mode = pts_client::is_debug_mode() ? 'BASIC' : $override_display_mode;446 switch(($env_mode != false || ($env_mode = pts_client::read_env('PTS_DISPLAY_MODE')) != false ? $env_mode : pts_config::read_user_config('PhoronixTestSuite/Options/General/DefaultDisplayMode', 'DEFAULT')))447 {448 case 'BASIC':449 self::$display = new pts_basic_display_mode();450 break;451 case 'BATCH':452 case 'CONCISE':453 self::$display = new pts_concise_display_mode();454 break;455 case 'SHORT':456 self::$display = new pts_short_display_mode();457 break;458 case 'DEFAULT':459 default:460 self::$display = new pts_concise_display_mode();461 break;462 }463 }464 public static function program_requirement_checks($only_show_required = false, $always_report = false)465 {466 $extension_checks = pts_needed_extensions();467 $printed_required_header = false;468 $printed_optional_header = false;469 foreach($extension_checks as $extension)470 {471 if($extension[1] == false || $always_report)472 {473 if($always_report)474 {475 $printed_required_header = true;476 $printed_optional_header = true;477 echo ($extension[1] == false ? 'MISSING' : 'PRESENT') . ' - ';478 }479 if($extension[0] == 1)480 {481 // Oops, this extension is required482 if($printed_required_header == false)483 {484 echo PHP_EOL . 'The following PHP extensions are REQUIRED:' . PHP_EOL . PHP_EOL;485 $printed_required_header = true;486 }487 }488 else489 {490 if(($only_show_required || PTS_IS_DAEMONIZED_SERVER_PROCESS) && $printed_required_header == false)491 {492 continue;493 }494 // This extension is missing but optional495 if($printed_optional_header == false)496 {497 echo PHP_EOL . ($printed_required_header ? null : 'NOTICE: ') . 'The following PHP extensions are OPTIONAL but recommended:' . PHP_EOL . PHP_EOL;498 $printed_optional_header = true;499 }500 }501 echo sprintf('%-9ls %-30ls' . PHP_EOL, $extension[2], $extension[3]);502 }503 }504 if($printed_required_header || $printed_optional_header)505 {506 echo PHP_EOL;507 if($printed_required_header && !$always_report)508 {509 exit;510 }511 }512 }513 private static function build_temp_cache()514 {515 $pso = pts_storage_object::recover_from_file(PTS_TEMP_STORAGE);516 if($pso == false)517 {518 $pso = new pts_storage_object();519 }520 $pso->add_object('environmental_variables_for_modules', pts_module_manager::modules_environmental_variables());521 $pso->add_object('command_alias_list', pts_documentation::client_commands_aliases());522 $pso->save_to_file(PTS_TEMP_STORAGE);523 }524 private static function core_storage_init_process()525 {526 $pso = pts_storage_object::recover_from_file(PTS_CORE_STORAGE);527 if($pso == false)528 {529 $pso = new pts_storage_object(true, true);530 }531 // OpenBenchmarking.org - GSID532 $global_gsid = $pso->read_object('global_system_id');533 $global_gsid_e = $pso->read_object('global_system_id_e');534 $global_gsid_p = $pso->read_object('global_system_id_p');535 if(empty($global_gsid) || pts_openbenchmarking::is_valid_gsid_format($global_gsid) == false)536 {537 // Global System ID for anonymous uploads, etc538 $requested_gsid = true;...

Full Screen

Full Screen

pts_network.php

Source:pts_network.php Github

copy

Full Screen

...93 {94 // On some platforms like DragonFly 4.2 ran into problem of all HTTPS downloads failing95 $download = str_replace('https://', 'http://', $download);96 }97 if(PTS_IS_CLIENT && strpos(phodevi::read_property('system', 'operating-system'), ' 7') === false && function_exists('curl_init') && stripos(PTS_PHP_VERSION, 'hiphop') === false)98 {99 // XXX: RHEL/EL 7.6 PHP packages introduced a segv when using CURL... Until that's resolved, just blacklist " 7"100 // as unknown when it will be fixed, but at least there is non-CURL codepath supported fine101 // " 7" is a bit liberal but also hard due to various EL7 downstreams102 // XXX: Facebook HipHop HHVM currently seems to have problems with PHP CURL103 $return_state = pts_network::curl_download($download, $to);104 }105 else106 {107 $return_state = pts_network::stream_download($download, $to);108 }109 //echo '\nPHP CURL must either be installed or you must adjust your PHP settings file to support opening FTP/HTTP streams.\n';110 //return false;111 if($return_state == true)112 {113 pts_client::$display->test_install_progress_completed();114 }115 }116 public static function curl_download($download, $download_to, $download_port_number = false)117 {118 if(!function_exists('curl_init'))119 {120 return false;121 }122 // XXX: with curl_multi_init we could do multiple downloads at once...123 $cr = curl_init();124 $fh = fopen($download_to, 'w');125 curl_setopt($cr, CURLOPT_FILE, $fh);126 curl_setopt($cr, CURLOPT_URL, $download);127 curl_setopt($cr, CURLOPT_HEADER, false);128 curl_setopt($cr, CURLOPT_FOLLOWLOCATION, true);129 curl_setopt($cr, CURLOPT_CONNECTTIMEOUT, self::$network_timeout);130 curl_setopt($cr, CURLOPT_BUFFERSIZE, 64000);131 curl_setopt($cr, CURLOPT_USERAGENT, pts_core::codename(true));132 curl_setopt($cr, CURLOPT_CAPATH, PTS_CORE_STATIC_PATH . 'certificates/');133 curl_setopt($cr, CURLOPT_SSL_VERIFYPEER, false);134 if($download_port_number)135 {136 curl_setopt($cr, CURLOPT_PORT, $port);137 }...

Full Screen

Full Screen

phoronix-test-suite.php

Source:phoronix-test-suite.php Github

copy

Full Screen

...3 Phoronix Test Suite4 URLs: http://www.phoronix.com, http://www.phoronix-test-suite.com/5 Copyright (C) 2008 - 2017, Phoronix Media6 Copyright (C) 2008 - 2017, Michael Larabel7 phoronix-test-suite.php: The main code for initalizing the Phoronix Test Suite8 This program is free software; you can redistribute it and/or modify9 it under the terms of the GNU General Public License as published by10 the Free Software Foundation; either version 3 of the License, or11 (at your option) any later version.12 This program is distributed in the hope that it will be useful,13 but WITHOUT ANY WARRANTY; without even the implied warranty of14 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the15 GNU General Public License for more details.16 You should have received a copy of the GNU General Public License17 along with this program. If not, see <http://www.gnu.org/licenses/>.18*/19setlocale(LC_NUMERIC, 'C');20define('PTS_PATH', dirname(dirname(__FILE__)) . '/');21// PTS_MODE types22// CLIENT = Standard Phoronix Test Suite Client23// LIB = Only load select PTS files24// SILENT = Load all normal pts-core files, but don't run client code25if(!defined('PTS_MODE'))26{27 define('PTS_MODE', in_array(($m = getenv('PTS_MODE')), array('CLIENT', 'LIB', 'WEB_CLIENT', 'SILENT')) ? $m : 'CLIENT');28}29// Any PHP default memory limit should be fine for PTS, until you run image quality comparison tests that begins to consume memory30if(stripos(phpversion(), 'hhvm') === false)31{32 ini_set('memory_limit', '256M');33}34if(getenv('PTS_MODE') == 'CLIENT' && ini_get('open_basedir') != false)35{36 $passes = true;37 $open_basedir = ini_get('open_basedir');38 if($open_basedir != false)39 {40 $is_in_allowed_dir = false;41 foreach(explode(':', $open_basedir) as $allowed_dir)42 {43 if(strpos(PTS_PATH, $allowed_dir) === 0)44 {45 $is_in_allowed_dir = true;46 break;47 }48 }49 if($is_in_allowed_dir == false)50 {51 $passes = false;52 }53 }54 if($passes == false)55 {56 echo PHP_EOL . 'ERROR: The php.ini configuration open_basedir directive is preventing ' . PTS_PATH . ' from loading.' . PHP_EOL;57 return false;58 }59 else60 {61 echo PHP_EOL . 'NOTICE: The php.ini configuration is using the "open_basedir" directive, which may prevent some parts of the Phoronix Test Suite from working. See the Phoronix Test Suite documentation for more details and to disable this setting.' . PHP_EOL;62 sleep(1);63 }64}65require(PTS_PATH . 'pts-core/pts-core.php');66if(!PTS_IS_CLIENT)67{68 // pts-core is acting as a library, return now since no need to run client code69 return;70}71// Default to C locale72setlocale(LC_ALL, 'C');73// Needed for shutdown functions74// declare(ticks = 1);75$sent_command = strtolower(str_replace('-', '_', (isset($argv[1]) ? $argv[1] : null)));76$quick_start_options = array('dump_possible_options');77pts_define('QUICK_START', in_array($sent_command, $quick_start_options));78if(QUICK_START == false)79{80 pts_client::program_requirement_checks(true);81}82pts_client::init(); // Initalize the Phoronix Test Suite (pts-core) client83$pass_args = array();84if(is_file(PTS_PATH . 'pts-core/commands/' . $sent_command . '.php') == false)85{86 $replaced = false;87 if(pts_module::valid_run_command($sent_command))88 {89 $replaced = true;90 }91 else if(isset($argv[1]) && strpos($argv[1], '.openbenchmarking') !== false && is_readable($argv[1]))92 {93 $sent_command = 'openbenchmarking_launcher';94 $argv[2] = $argv[1];95 $argc = 3;96 $replaced = true;97 }98 else99 {100 $aliases = pts_storage_object::read_from_file(PTS_TEMP_STORAGE, 'command_alias_list');101 if($aliases == null)102 {103 $aliases = pts_documentation::client_commands_aliases();104 }105 if(isset($aliases[$sent_command]))106 {107 $sent_command = $aliases[$sent_command];108 $replaced = true;109 }110 }111 if($replaced == false)112 {113 // Show help command, since there are no valid commands114 $sent_command = 'help';115 }116}117pts_define('PTS_USER_LOCK', function_exists('posix_getpid') ? PTS_USER_PATH . 'run-lock-' . posix_getpid() : tempnam(PTS_USER_PATH, 'run-lock-'));118if(QUICK_START == false)119{120 // Cleanup old / expired runlocks XXX expire if this can eventually be removed121 foreach(pts_file_io::glob(PTS_USER_PATH . 'run-lock-*') as $possible_run_lock)122 {123 if(!pts_client::is_locked($possible_run_lock))124 {125 pts_file_io::unlink($possible_run_lock);126 }127 }128 if(pts_client::create_lock(PTS_USER_LOCK) == false)129 {130 //trigger_error('It appears that the Phoronix Test Suite is already running.' . PHP_EOL . 'For proper results, only run one instance at a time.', E_USER_WARNING);131 }132 register_shutdown_function(array('pts_client', 'process_shutdown_tasks'));133 //pcntl_signal(SIGTERM, array('pts_client', 'exit_client'));134 if(pts_client::read_env('PTS_IGNORE_MODULES') == false)135 {136 pts_client::module_framework_init(); // Initialize the PTS module system137 }138}139// Read passed arguments140for($i = 2; $i < $argc && isset($argv[$i]); $i++)141{142 $pass_args[] = $argv[$i];143}144if(QUICK_START == false)145{146 pts_client::user_agreement_check($sent_command);147 // OpenBenchmarking.org148 pts_openbenchmarking::refresh_repository_lists();149}150pts_client::execute_command($sent_command, $pass_args); // Run command...

Full Screen

Full Screen

init

Using AI Code Generation

copy

Full Screen

1require_once 'pts_client.php';2$pts = new pts_client();3$pts->init();4require_once 'pts_client.php';5$pts = new pts_client();6$pts->init();7require_once 'pts_client.php';8$pts = new pts_client();9$pts->init();10require_once 'pts_client.php';11$pts = new pts_client();12$pts->init();13require_once 'pts_client.php';14$pts = new pts_client();15$pts->init();16require_once 'pts_client.php';17$pts = new pts_client();18$pts->init();19require_once 'pts_client.php';20$pts = new pts_client();21$pts->init();22require_once 'pts_client.php';23$pts = new pts_client();24$pts->init();25require_once 'pts_client.php';26$pts = new pts_client();27$pts->init();28require_once 'pts_client.php';29$pts = new pts_client();30$pts->init();31require_once 'pts_client.php';32$pts = new pts_client();33$pts->init();34require_once 'pts_client.php';35$pts = new pts_client();36$pts->init();37require_once 'pts_client.php';38$pts = new pts_client();39$pts->init();40require_once 'pts_client.php';41$pts = new pts_client();

Full Screen

Full Screen

init

Using AI Code Generation

copy

Full Screen

1include_once('pts_client.class.php');2$obj = new pts_client();3$obj->init();4$user = $obj->get_user();5$pass = $obj->get_pass();6$db = $obj->get_db();7$host = $obj->get_host();8$port = $obj->get_port();9$socket = $obj->get_socket();10$conn = $obj->get_conn();11$query = $obj->get_query();12$result = $obj->get_result();13$assoc = $obj->get_assoc();14$num_rows = $obj->get_num_rows();15$field_count = $obj->get_field_count();16$field = $obj->get_field();17$field_name = $obj->get_field_name();18$field_type = $obj->get_field_type();19$field_len = $obj->get_field_len();20$field_flags = $obj->get_field_flags();21$field_table = $obj->get_field_table();22$field_def = $obj->get_field_def();23$field_maxlen = $obj->get_field_maxlen();24$fetch_field = $obj->get_fetch_field();25$fetch_fields = $obj->get_fetch_fields();26$fetch_field_direct = $obj->get_fetch_field_direct();27$fetch_lengths = $obj->get_fetch_lengths();28$fetch_object = $obj->get_fetch_object();29$fetch_row = $obj->get_fetch_row();

Full Screen

Full Screen

Automation Testing Tutorials

Learn to execute automation testing from scratch with LambdaTest Learning Hub. Right from setting up the prerequisites to run your first automation test, to following best practices and diving deeper into advanced test scenarios. LambdaTest Learning Hubs compile a list of step-by-step guides to help you be proficient with different test automation frameworks i.e. Selenium, Cypress, TestNG etc.

LambdaTest Learning Hubs:

YouTube

You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.

Run Phoronix-test-suite automation tests on LambdaTest cloud grid

Perform automation testing on 3000+ real desktop and mobile devices online.

Trigger init code on LambdaTest Cloud Grid

Execute automation tests with init on a cloud-based Grid of 3000+ real browsers and operating systems for both web and mobile applications.

Test now for Free

Try LambdaTest Now !!

Get 100 minutes of automation test minutes FREE!!

Next-Gen App & Browser Testing Cloud

Was this article helpful?

Helpful

NotHelpful