public static function test_profile_permitted_files() { $allowed_files = array('downloads.xml', 'test-definition.xml', 'results-definition.xml', 'install.sh', 'support-check.sh', 'pre.sh', 'post.sh', 'interim.sh', 'post-cache-share.sh'); foreach (pts_types::operating_systems() as $os) { $os = strtolower($os[0]); array_push($allowed_files, 'support-check_' . $os . '.sh'); array_push($allowed_files, 'install_' . $os . '.sh'); array_push($allowed_files, 'pre_' . $os . '.sh'); array_push($allowed_files, 'post_' . $os . '.sh'); array_push($allowed_files, 'interim_' . $os . '.sh'); } return $allowed_files; }
public static function initial_setup() { // Operating System Detection $supported_operating_systems = pts_types::operating_systems(); $uname_s = strtolower(php_uname('s')); foreach ($supported_operating_systems as $os_check) { for ($i = 0; $i < count($os_check); $i++) { if (strpos($uname_s, strtolower($os_check[$i])) !== false) { self::$operating_system = $os_check[0]; self::$operating_systems[strtolower($os_check[0])] = true; break; } } if (self::$operating_system != null) { break; } } if (self::operating_system() == false) { self::$operating_system = 'Unknown'; } self::load_sensors(); }
private static function available_operating_systems() { $os = array(); foreach (pts_types::operating_systems() as $os_r) { $os[$os_r[0]] = strtolower($os_r[0]); } return $os; }
public static function initial_setup() { // Operating System Detection $supported_operating_systems = pts_types::operating_systems(); $uname_s = strtolower(php_uname('s')); foreach ($supported_operating_systems as $os_check) { for ($i = 0; $i < count($os_check); $i++) { if (strpos($uname_s, strtolower($os_check[$i])) !== false) { self::$operating_system = $os_check[0]; self::$operating_systems[strtolower($os_check[0])] = true; break; } } if (self::$operating_system != null) { break; } } if (self::operating_system() == false) { self::$operating_system = 'Unknown'; } // OpenGL / graphics detection $graphics_detection = array('NVIDIA', array('ATI', 'AMD', 'fglrx'), array('Mesa', 'SGI')); $opengl_driver = phodevi::read_property('system', 'opengl-vendor') . ' ' . phodevi::read_property('system', 'opengl-driver') . ' ' . phodevi::read_property('system', 'dri-display-driver'); $opengl_driver = trim(str_replace('Corporation', null, $opengl_driver)); // Prevents a possible false positive for ATI being in CorporATIon foreach ($graphics_detection as $gpu_check) { if (!is_array($gpu_check)) { $gpu_check = array($gpu_check); } for ($i = 0; $i < count($gpu_check); $i++) { if (stripos($opengl_driver, $gpu_check[$i]) !== false) { self::$graphics[strtolower($gpu_check[0])] = true; break; } } } self::load_sensors(); }