Best Phoronix-test-suite code snippet using system_info
SystemSettings.php
Source:SystemSettings.php
...9 }10 function check_connection(){11 return($this->conn);12 }13 function load_system_info(){14 if(!isset($_SESSION['system_info'])){15 $sql = "SELECT * FROM system_info";16 $qry = $this->conn->query($sql);17 while($row = $qry->fetch_assoc()){18 $_SESSION['system_info'][$row['meta_field']] = $row['meta_value'];19 }20 }21 }22 function update_system_info(){23 $sql = "SELECT * FROM system_info";24 $qry = $this->conn->query($sql);25 while($row = $qry->fetch_assoc()){26 if(isset($_SESSION['system_info'][$row['meta_field']]))unset($_SESSION['system_info'][$row['meta_field']]);27 $_SESSION['system_info'][$row['meta_field']] = $row['meta_value'];28 }29 return true;30 }31 function update_settings_info(){32 $data = "";33 foreach ($_POST as $key => $value) {34 if(isset($_SESSION['system_info'][$key])){35 $value = str_replace("'", "'", $value);36 $qry = $this->conn->query("UPDATE system_info set meta_value = '{$value}' where meta_field = '{$key}' ");37 }else{38 $qry = $this->conn->query("INSERT into system_info set meta_value = '{$value}', meta_field = '{$key}' ");39 }40 }41 if(isset($_FILES['img']) && $_FILES['img']['tmp_name'] != ''){42 $fname = 'uploads/'.strtotime(date('y-m-d H:i')).'_'.$_FILES['img']['name'];43 $move = move_uploaded_file($_FILES['img']['tmp_name'],'../'. $fname);44 if(isset($_SESSION['system_info']['logo'])){45 $qry = $this->conn->query("UPDATE system_info set meta_value = '{$fname}' where meta_field = 'logo' ");46 if(is_file('../'.$_SESSION['system_info']['logo'])) unlink('../'.$_SESSION['system_info']['logo']);47 }else{48 $qry = $this->conn->query("INSERT into system_info set meta_value = '{$fname}',meta_field = 'logo' ");49 }50 }51 if(isset($_FILES['bot_avatar']) && $_FILES['bot_avatar']['tmp_name'] != ''){52 $ext = pathinfo($_FILES['bot_avatar']['name'], PATHINFO_EXTENSION);53 $fname = 'uploads/bot_avatar.'.$ext;54 $move = move_uploaded_file($_FILES['bot_avatar']['tmp_name'],'../'. $fname);55 if(isset($_SESSION['system_info']['bot_avatar'])){56 $qry = $this->conn->query("UPDATE system_info set meta_value = '{$fname}' where meta_field = 'bot_avatar' ");57 if(is_file('../'.$_SESSION['system_info']['bot_avatar'])) unlink('../'.$_SESSION['system_info']['bot_avatar']);58 }else{59 $qry = $this->conn->query("INSERT into system_info set meta_value = '{$fname}',meta_field = 'bot_avatar' ");60 }61 }62 if(isset($_FILES['user_avatar']) && $_FILES['user_avatar']['tmp_name'] != ''){63 $ext = pathinfo($_FILES['user_avatar']['name'], PATHINFO_EXTENSION);64 $fname = 'uploads/user_avatar.'.$ext;65 $move = move_uploaded_file($_FILES['user_avatar']['tmp_name'],'../'. $fname);66 if(isset($_SESSION['system_info']['user_avatar'])){67 $qry = $this->conn->query("UPDATE system_info set meta_value = '{$fname}' where meta_field = 'user_avatar' ");68 if(is_file('../'.$_SESSION['system_info']['user_avatar'])) unlink('../'.$_SESSION['system_info']['user_avatar']);69 }else{70 $qry = $this->conn->query("INSERT into system_info set meta_value = '{$fname}',meta_field = 'user_avatar' ");71 }72 }73 $update = $this->update_system_info();74 $flash = $this->set_flashdata('success','System Info Successfully Updated.');75 if($update && $flash){76 // var_dump($_SESSION);77 return true;78 }79 }80 function set_userdata($field='',$value=''){81 if(!empty($field) && !empty($value)){82 $_SESSION['userdata'][$field]= $value;83 }84 }85 function userdata($field = ''){86 if(!empty($field)){87 if(isset($_SESSION['userdata'][$field]))88 return $_SESSION['userdata'][$field];89 else90 return null;91 }else{92 return false;93 }94 }95 function set_flashdata($flash='',$value=''){96 if(!empty($flash) && !empty($value)){97 $_SESSION['flashdata'][$flash]= $value;98 return true;99 }100 }101 function chk_flashdata($flash = ''){102 if(isset($_SESSION['flashdata'][$flash])){103 return true;104 }else{105 return false;106 }107 }108 function flashdata($flash = ''){109 if(!empty($flash)){110 $_tmp = $_SESSION['flashdata'][$flash];111 unset($_SESSION['flashdata']);112 return $_tmp;113 }else{114 return false;115 }116 }117 function sess_des(){118 if(isset($_SESSION['userdata'])){119 unset($_SESSION['userdata']);120 return true;121 }122 return true;123 }124 function info($field=''){125 if(!empty($field)){126 if(isset($_SESSION['system_info'][$field]))127 return $_SESSION['system_info'][$field];128 else129 return false;130 }else{131 return false;132 }133 }134 function set_info($field='',$value=''){135 if(!empty($field) && !empty($value)){136 $_SESSION['system_info'][$field] = $value;137 }138 }139}140$_settings = new SystemSettings();141$_settings->load_system_info();142$action = !isset($_GET['f']) ? 'none' : strtolower($_GET['f']);143$sysset = new SystemSettings();144switch ($action) {145 case 'update_settings':146 echo $sysset->update_settings_info();147 break;148 default:149 // echo $sysset->index();150 break;151}
...
about.php
Source:about.php
...7 echo xlt('ACL Administration Not Authorized');8 exit;9}10require_once("gacl_admin.inc.php");11function get_system_info() {12 global $gacl_api;13 //Grab system info14 $system_info = 'PHP Version: '.phpversion()."\n";15 $system_info .= 'Zend Version: '.zend_version()."\n";16 $system_info .= 'Web Server: '.$_SERVER['SERVER_SOFTWARE']."\n\n";17 $system_info .= 'phpGACL Settings: '."\n";18 $system_info .= ' phpGACL Version: '.$gacl_api->get_version()."\n";19 $system_info .= ' phpGACL Schema Version: '.$gacl_api->get_schema_version()."\n";20 if($gacl_api->_caching == TRUE) {21 $caching = 'True';22 } else {23 $caching = 'False';24 }25 $system_info .= ' Caching Enabled: '. $caching ."\n";26 if($gacl_api->_force_cache_expire == TRUE) {27 $force_cache_expire = 'True';28 } else {29 $force_cache_expire = 'False';30 }31 $system_info .= ' Force Cache Expire: '.$force_cache_expire."\n";32 $system_info .= ' Database Prefix: \''.$gacl_api->_db_table_prefix."'\n";33 $system_info .= ' Database Type: '.$gacl_api->_db_type."\n";34 $database_server_info = $gacl_api->db->ServerInfo();35 $system_info .= ' Database Version: '.$database_server_info['version']."\n";36 $system_info .= ' Database Description: '.$database_server_info['description']."\n\n";37 $system_info .= 'Server Name: '. $_SERVER["SERVER_NAME"] ."\n";38 $system_info .= ' OS: '. PHP_OS ."\n";39 $system_info .= ' IP Address: '. $_SERVER["REMOTE_ADDR"] ."\n";40 $system_info .= ' Browser: '. $_SERVER["HTTP_USER_AGENT"] ."\n\n";41 $system_info .= 'System Information: '. php_uname() ."\n";42 return trim($system_info);43}44$system_info = get_system_info();45//Read credits.46$smarty->assign("credits", implode('',file('../CREDITS')) );47$smarty->assign("system_info", $system_info);48$smarty->assign("system_info_md5", md5($system_info) );49$smarty->assign("return_page", $_SERVER['PHP_SELF'] );50$smarty->assign('current','about');51$smarty->assign('page_title', 'About phpGACL');52$smarty->assign("phpgacl_version", $gacl_api->get_version() );53$smarty->assign("phpgacl_schema_version", $gacl_api->get_schema_version() );54$smarty->display('phpgacl/about.tpl');55?>...
system_info
Using AI Code Generation
1require_once 'system_info.php';2$system = new system_info();3$system->get_system_info();4$system->get_cpu_info();5$system->get_gpu_info();6$system->get_memory_info();7$system->get_disk_info();8$system->get_network_info();9$system->get_os_info();10$system->get_php_info();11$system->get_webserver_info();12$system->get_mysql_info();13$system->get_php_modules();14";15";16";17";18";19";20";21";22";23";24";25";26";27";28";29";30";31";32CPU: Intel(R) Core(TM)2 Quad CPU Q6600 @ 2.40GHz
system_info
Using AI Code Generation
1require_once('phoromatic/core.php');2require_once('phoromatic/system.php');3require_once('phoromatic/pts-core.php');4require_once('phoromatic/pts-core/objects/pts_test_profile.php');5require_once('phoromatic/pts-core/objects/pts_test_result.php');6require_once('phoromatic/pts-core/objects/pts_result_file_analyzer.php');7require_once('phoromatic/pts-core/objects/pts_test_r
system_info
Using AI Code Generation
1include 'system_info.php';2$obj = new system_info();3$info = $obj->get_system_info();4print_r($info);5include 'system_info.php';6$obj = new system_info();7$info = $obj->get_system_info();8$json = json_encode($info);9print_r($json);10include 'system_info.php';11$obj = new system_info();12$info = $obj->get_system_info();13$json = json_encode($info);14echo $json;15include 'system_info.php';16$obj = new system_info();17$info = $obj->get_system_info();18$json = json_encode($info);19echo $json;20include 'system_info.php';21$obj = new system_info();22$info = $obj->get_system_info();23$json = json_encode($info);24echo $json;25include 'system_info.php';26$obj = new system_info();
system_info
Using AI Code Generation
1require_once('system_info.php');2$system_info = new system_info();3$system_info->get_system_info();4{5 public function get_system_info()6 {7 $os = $this->get_os();8 $processor = $this->get_processor();9 $memory = $this->get_memory();10 $graphics = $this->get_graphics();11 $disk = $this->get_disk();12 $network = $this->get_network();13 $display = $this->get_display();14 $audio = $this->get_audio();15 $input = $this->get_input();16 $printer = $this->get_printer();17 $scanner = $this->get_scanner();18 $camera = $this->get_camera();19 $phone = $this->get_phone();20 $modem = $this->get_modem();21 $isdn = $this->get_isdn();22 $tv = $this->get_tv();23 $firewire = $this->get_firewire();24 $usb = $this->get_usb();25 $bluetooth = $this->get_bluetooth();26 $infrared = $this->get_infrared();27 $wifi = $this->get_wifi();28 $wwan = $this->get_wwan();29 $wimax = $this->get_wimax();30 $cellular = $this->get_cellular();31 $gps = $this->get_gps();32 $dvd = $this->get_dvd();33 $cd = $this->get_cd();34 $floppy = $this->get_floppy();35 $tape = $this->get_tape();36 $partition = $this->get_partition();37 $filesystem = $this->get_filesystem();38 $battery = $this->get_battery();39 $ups = $this->get_ups();40 $monitor = $this->get_monitor();41 $mouse = $this->get_mouse();42 $keyboard = $this->get_keyboard();43 $pen = $this->get_pen();44 $lightpen = $this->get_lightpen();45 $touchscreen = $this->get_touchscreen();46 $remote = $this->get_remote();
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.
You could also refer to video tutorials over LambdaTest YouTube channel to get step by step demonstration from industry experts.
Trigger Selenium automation tests on a cloud-based Grid of 3000+ real browsers and operating systems.
Test now for FreeGet 100 minutes of automation test minutes FREE!!