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_ID is only available in PHP 5.2.6 and later $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; }