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; }
public static function init() { set_time_limit(0); pts_define_directories(); // Define directories 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]); } }
return; } require 'phoromatic-export-viewer-config.php'; if (!is_file(PATH_TO_PHORONIX_TEST_SUITE . 'pts-core/pts-core.php')) { echo '<p>You must first set the <em>PATH_TO_PHORONIX_TEST_SUITE</em> define within the <em>phoromatic-export-viewer-config.php</em> file.</p>'; return; } if (!is_file(PATH_TO_EXPORTED_PHOROMATIC_DATA . 'export-index.json')) { echo '<p>You must first set the <em>PATH_TO_EXPORTED_PHOROMATIC_DATA</em> define within the <em>phoromatic-export-viewer-config.php</em> file. No <em>export-index.json</em> found.</p>'; return; } define('PHOROMATIC_EXPORT_VIEWER', true); define('PTS_MODE', 'LIB'); define('PTS_AUTO_LOAD_OBJECTS', true); require PATH_TO_PHORONIX_TEST_SUITE . 'pts-core/pts-core.php'; pts_define_directories(); set_time_limit(0); ini_set('memory_limit', '2048M'); error_reporting(E_ALL); $export_index_json = file_get_contents(PATH_TO_EXPORTED_PHOROMATIC_DATA . 'export-index.json'); $export_index_json = json_decode($export_index_json, true); if (!isset($export_index_json['phoromatic']) || empty($export_index_json['phoromatic'])) { echo '<p>Error decoding the Phoromatic export JSON file.</p>'; return; } if (strpos($_SERVER['REQUEST_URI'], '?') === false && isset($_SERVER['QUERY_STRING'])) { $_SERVER['REQUEST_URI'] .= '?' . $_SERVER['QUERY_STRING']; } $URI = substr($_SERVER['REQUEST_URI'], strpos($_SERVER['REQUEST_URI'], '?') + 1); $PATH = explode('/', $URI); $REQUESTED = str_replace('.', null, array_shift($PATH));