public static function init() { pts_core::init(); if (defined('QUICK_START') && QUICK_START) { return true; } if (function_exists('cli_set_process_title') && PHP_OS == 'Linux') { cli_set_process_title('Phoronix Test Suite'); } pts_define('PHP_BIN', pts_client::read_env('PHP_BIN')); $dir_init = array(PTS_USER_PATH); foreach ($dir_init as $dir) { pts_file_io::mkdir($dir); } if (PTS_IS_CLIENT) { pts_network::client_startup(); } self::core_storage_init_process(); if (!is_file(PTS_TEMP_STORAGE)) { self::build_temp_cache(); } 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/'))); 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/'))); self::extended_init_process(); $openbenchmarking = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking'); $openbenchmarking_account_settings = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking_account_settings'); if ($openbenchmarking != null) { // OpenBenchmarking.org Account pts_openbenchmarking_client::init_account($openbenchmarking, $openbenchmarking_account_settings); } return true; }
public static function init() { set_time_limit(0); pts_define_directories(); // Define directories if (function_exists('cli_set_process_title') && !phodevi::is_macosx()) { cli_set_process_title('Phoronix Test Suite'); } if (defined('QUICK_START') && QUICK_START) { return true; } pts_define('PHP_BIN', pts_client::read_env('PHP_BIN')); pts_define('PTS_INIT_TIME', time()); if (!defined('PHP_VERSION_ID')) { $php_version = explode('.', PHP_VERSION); pts_define('PHP_VERSION_ID', $php_version[0] * 10000 + $php_version[1] * 100 + $php_version[2]); } $dir_init = array(PTS_USER_PATH); foreach ($dir_init as $dir) { pts_file_io::mkdir($dir); } if (PTS_IS_CLIENT) { pts_network::client_startup(); } self::core_storage_init_process(); if (!is_file(PTS_TEMP_STORAGE)) { self::build_temp_cache(); } //XXX pts_define('PTS_ETC_PATH', is_dir('/etc') ? '/etc/phoronix-test-suite/' : false); if (is_dir('/usr/local/share/phoronix-test-suite/')) { pts_define('PTS_SHARE_PATH', '/usr/local/share/phoronix-test-suite/'); } else { if (is_dir('/usr/share/')) { pts_define('PTS_SHARE_PATH', '/usr/share/phoronix-test-suite/'); if (is_writable('/usr/share') && !is_dir(PTS_SHARE_PATH)) { mkdir(PTS_SHARE_PATH); } } else { pts_define('PTS_SHARE_PATH', false); } } // XXX: technically the config init_files line shouldn't be needed since it should be dynamically called // pts_config::init_files(); pts_define('PTS_TEST_INSTALL_DEFAULT_PATH', pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Installation/EnvironmentDirectory', '~/.phoronix-test-suite/installed-tests/'))); pts_define('PTS_SAVE_RESULTS_PATH', pts_client::parse_home_directory(pts_config::read_user_config('PhoronixTestSuite/Options/Testing/ResultsDirectory', '~/.phoronix-test-suite/test-results/'))); self::extended_init_process(); $openbenchmarking = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking'); $openbenchmarking_account_settings = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'openbenchmarking_account_settings'); if ($openbenchmarking != null) { // OpenBenchmarking.org Account pts_openbenchmarking_client::init_account($openbenchmarking, $openbenchmarking_account_settings); } return true; }
public static function read_setting($setting) { return pts_storage_object::read_from_file(self::$json_storage, $setting); }
} pts_client::init(); // Initalize the Phoronix Test Suite (pts-core) client $pass_args = array(); if (is_file(PTS_PATH . 'pts-core/commands/' . $sent_command . '.php') == false) { $replaced = false; if (pts_module::valid_run_command($sent_command)) { $replaced = true; } else { if (isset($argv[1]) && strpos($argv[1], '.openbenchmarking') !== false && is_readable($argv[1])) { $sent_command = 'openbenchmarking_launcher'; $argv[2] = $argv[1]; $argc = 3; $replaced = true; } else { $aliases = pts_storage_object::read_from_file(PTS_TEMP_STORAGE, 'command_alias_list'); if ($aliases == null) { $aliases = pts_documentation::client_commands_aliases(); } if (isset($aliases[$sent_command])) { $sent_command = $aliases[$sent_command]; $replaced = true; } } } if ($replaced == false) { // Show help command, since there are no valid commands $sent_command = 'help'; } } pts_define('PTS_USER_LOCK', function_exists('posix_getpid') ? PTS_USER_PATH . 'run-lock-' . posix_getpid() : tempnam(PTS_USER_PATH, 'run-lock-'));
public static function detect_modules_to_load() { // Auto detect modules to load $env_vars = pts_storage_object::read_from_file(PTS_TEMP_STORAGE, 'environmental_variables_for_modules'); if ($env_vars == false) { $env_vars = pts_module_manager::modules_environmental_variables(); } foreach ($env_vars as $env_var => $modules) { if (($e = pts_client::read_env($env_var)) != false && !empty($e)) { foreach ($modules as $module) { if (!pts_module_manager::is_module_attached($module)) { pts_module_manager::attach_module($module); } } } } }
private static function load_download_speed_averages() { self::$average_count = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'download_average_count'); self::$average_speed = pts_storage_object::read_from_file(PTS_CORE_STORAGE, 'download_average_speed'); }