public function getAttribute($attribute, &$source = null, $func = 'PDO::getAttribute', &$last_error = null) { if ($source == null) { $source =& $this->driver_options; } switch ($attribute) { case EhrlichAndreas_Pdo_Abstract::ATTR_AUTOCOMMIT: $result = mysql_unbuffered_query('SELECT @@AUTOCOMMIT', $this->link); if (!$result) { $this->set_driver_error(null, EhrlichAndreas_Pdo_Abstract::ERRMODE_EXCEPTION, $func); } $row = mysql_fetch_row($result); mysql_free_result($result); return intval($row[0]); break; case EhrlichAndreas_Pdo_Abstract::ATTR_TIMEOUT: return intval(ini_get('mysql.connect_timeout')); break; case EhrlichAndreas_Pdo_Abstract::ATTR_CLIENT_VERSION: return mysql_get_client_info(); break; case EhrlichAndreas_Pdo_Abstract::ATTR_CONNECTION_STATUS: return mysql_get_host_info($this->link); break; case EhrlichAndreas_Pdo_Abstract::ATTR_SERVER_INFO: return mysql_stat($this->link); break; case EhrlichAndreas_Pdo_Abstract::ATTR_SERVER_VERSION: return mysql_get_server_info($this->link); break; default: return parent::getAttribute($attribute, $source, $func, $last_error); break; } }
public static function getTxtLog($rows = null) { global $wpdb; $log = array(); $info = 'HOST: ' . $_SERVER['HTTP_HOST'] . "\r\n"; $info .= 'PHP: ' . phpversion() . "\r\n"; $info .= 'MySQL: ' . mysql_get_client_info(); $log[] = $info; if ($rows === null) { $sql = 'SELECT * FROM `' . $wpdb->prefix . 'wpgrabber_errors` ORDER BY date_add'; $rows = $wpdb->get_results($sql, ARRAY_A); if ($wpdb->last_error != '') { self::add($wpdb->last_error, __FILE__, __LINE__); } } if (!empty($rows)) { foreach ($rows as $r) { $l = date('d.m.Y H:i', $r['date_add']) . "\r\n"; $l .= $r['message'] . "\r\n"; $l .= $r['file']; if ($r['date_send']) { $l .= "\r\n" . 'SEND:' . date('d.m.Y H:i', $r['date_send']); } $log[] = $l; } } $log = implode("\r\n" . str_repeat('-', 20) . "\r\n", $log); return $log; }
/** * @param string $type The MySQL type, client or server * @return string The MySQL version of either the server or the client * * Function to retrieve the MySQL version (client/server) */ function get_mysql_version($type = 'server') { // What do we want to return, the client or the server ? if ($type == 'server') { // Retrieve the database settings from the session $server = $this->ci->session->userdata('hostname') . ':' . $this->ci->session->userdata('port'); $username = $this->ci->session->userdata('username'); $password = $this->ci->session->userdata('password'); // Connect to MySQL if ($db = @mysql_connect($server, $username, $password)) { $mysql = @mysql_get_server_info($db); // Close the connection @mysql_close($db); return $mysql; } else { @mysql_close($db); return FALSE; } } else { // Get the version $mysql = preg_replace('/[^0-9\\.]/', '', mysql_get_client_info()); // Compare it return $mysql ? preg_replace('/[^0-9\\.]/', '', $mysql) : FALSE; } }
public function modifpostAction($idVersion) { // echo "<script>alert('rentre dans la fonction');</script>"; $var[0] = apache_get_version(); $var[1] = implode(explode('-', mysql_get_client_info(), -1)); $var[2] = \Symfony\Component\HttpKernel\Kernel::VERSION . " " . $this->container->getParameter('kernel.environment'); $em = $this->getDoctrine()->getEntityManager(); $laVersion = new \Developpement\CartopliBundle\Entity\Installation(); $laVersion = $em->getRepository('DeveloppementCartopliBundle:Installation')->findOneByNum($idVersion); // On crée le FormBuilder grâce à la méthode du contrôleur $formBuilder = $this->createFormBuilder($laVersion); $versionCarto = $em->getRepository('DeveloppementCartopliBundle:Installation')->getVersionCarto(); $formBuilder->add('description', 'textarea', array('data' => $laVersion->getDescription()), array('attr' => array('class' => 'readonlylogin', 'id' => 'readme')))->add('remerciement', 'textarea', array('data' => $laVersion->getRemerciement()), array('attr' => array('class' => 'readonlylogin', 'id' => 'readme'))); $request = $this->getRequest(); if ($request->isMethod('POST')) { $formMod = $formBuilder->getForm(); // echo "<script>alert('post fait');</script>"; $formMod->bind($request); // var_dump($formMod); $em->persist($laVersion); $em->flush(); } $laVersion = $em->getRepository('DeveloppementCartopliBundle:Installation')->findOneByNum($idVersion); // return $this->render('DeveloppementCartopliBundle:Default:apropos.html.twig', array('versionCarto' => $versionCarto, 'var' => $var, 'idVersion' => $numero, 'description' => $texteTest, 'remerciement'=>$laVersion->getRemerciement(),'form' => $formMod->createView())); // On redirige vers la route d'origine afin de palier aux problemes de css return $this->redirect($this->generateUrl('developpement_cartopli_apropos')); }
/** * @param string $type The MySQL type, client or server * @return string The MySQL version of either the server or the client * * Function to retrieve the MySQL version (client/server) */ public function mysql_acceptable($type = 'server') { // Server version if ($type == 'server') { // Retrieve the database settings from the session $server = $this->ci->session->userdata('hostname') . ':' . $this->ci->session->userdata('port'); $username = $this->ci->session->userdata('username'); $password = $this->ci->session->userdata('password'); // Connect to MySQL if ($db = @mysql_connect($server, $username, $password)) { $this->mysql_server_version = @mysql_get_server_info($db); // Close the connection @mysql_close($db); // If the MySQL server version is at least version 5 return TRUE, else FALSE return $this->mysql_server_version >= 5 ? TRUE : FALSE; } else { @mysql_close($db); return FALSE; } } else { // Get the version $this->mysql_client_version = preg_replace('/[^0-9\\.]/', '', mysql_get_client_info()); // If the MySQL client version is at least version 5 return TRUE, else FALSE return $this->mysql_client_version >= 5 ? TRUE : FALSE; } }
function bmDebug() { global $pommo; echo "\n\n<br><br><b>BASIC DEBUG</b><hr><br>\n\n"; echo "\n\nPHP: " . phpversion() . "<br><br>\n\n"; echo "\n\nMYSQL CLIENT: " . mysql_get_client_info() . "<br><br>\n\n"; echo "\n\nMYSQL HOST: " . mysql_get_host_info() . "<br><br>\n\n"; echo "\n\nMYSQL SERVER: " . mysql_get_server_info() . "<br><br>\n\n"; echo "\n\nBACKTRACE: " . $this->bmBacktrace() . "<br><br>\n\n"; echo "\nBaseURL:" . Pommo::$_baseUrl . "<br>\n"; echo "\n HTTP:" . Pommo::$_http . "<br>\n"; echo "\nBaseDir: " . Pommo::$_baseDir . "<br>\n"; echo "\nWorkDir:" . Pommo::$_workDir . "<br>\n"; echo "\nLang:" . Pommo::$_lang . "<br>\n"; echo "\nVerbosity:" . Pommo::$_verbosity . "<br>\n"; echo "\nRevision: " . Pommo::$_revision . "<br>\n"; echo "\nSection: " . Pommo::$_section . "<br>\n"; echo "\n\n<br><br><b>CONFIG DEBUG</b><hr><br>\n\n"; $config = Pommo_Api::configGet('all'); if (!empty($config)) { echo "\n\n<br>CONFIG:<br>\n\n"; foreach ($config as $name => $value) { if ($name == 'admin_username' || $name == 'admin_password') { $value = '**CENSOR** - ' . strlen($value); } elseif ($name == 'messages') { continue; } echo "\n{$name}: {$value} <br>\n"; } } else { echo "\n\n<br>CONFIG: could not load\n\n"; } }
/** * * Systemstatus anzeigen * */ public function showSystemStatus($ErrorString = "", $StatusString = "") { //if(!Controler_Main::getInstance()->isUserLoggedIn())//if( $this->User->getUserLevel() < BACKEND_USERLEVEL ) if (Controler_Main::getInstance()->getUserLevel() < BACKEND_USERLEVEL) { $ControlerStart = new Controler_Start(); $ControlerStart->start(); return false; } $Request = new Request(); /* $SystemInformationFinder= new SystemInformationFinder(); $MySql = $SystemInformationFinder->mysqlVersion(); $MySqlVersion = $MySql[0]['s_MySqlVersion']; */ $PHPVersion = phpversion(); $WebserverVersion = $_SERVER['SERVER_SOFTWARE']; $WebserverVersion = "<div class='befehlskontainer' >" . str_replace(" ", "</div><div class='befehlskontainer' >", $WebserverVersion) . "</div>"; $WebserverConfig = "<div class='befehlskontainer' >:T_SERVER_NAME:: " . $_SERVER['SERVER_NAME'] . "</div><div class='befehlskontainer' >"; $WebserverConfig .= ":T_SERVER_ADDR:: " . $_SERVER['SERVER_ADDR'] . "</div><div class='befehlskontainer' >"; $WebserverConfig .= ":T_SERVER_PORT:: " . $_SERVER['SERVER_PORT'] . "</div><div class='befehlskontainer' >"; $WebserverConfig .= ":T_REMOTE_ADDR:: " . $_SERVER['REMOTE_ADDR'] . "</div><div class='befehlskontainer' >"; $WebserverConfig .= ":T_DOCUMENT_ROOT:: " . $_SERVER['DOCUMENT_ROOT'] . "</div><div class='befehlskontainer' >"; $WebserverConfig .= ":T_SERVER_ADMIN:: " . $_SERVER['SERVER_ADMIN'] . "</div>"; $Template = Template::getInstance("tpl_BE_SystemStatus.php"); $Template->assign("UserId", Controler_Main::getInstance()->getUser()->getId()); $Template->assign("WebserverConfig", $WebserverConfig); $Template->assign("WebserverVersion", $WebserverVersion); $Template->assign("PHPVersion", $PHPVersion); $Template->assign("MySqlVersion", mysql_get_server_info()); $Template->assign("MySqlClientInfo", mysql_get_client_info()); $Template->assign("MySqlProtInfo", mysql_get_proto_info()); $Template->assign("MySqlHostInfo", mysql_get_host_info()); $Template->render(); }
/** * @param string $type The MySQL type, client or server * @return string The MySQL version of either the server or the client * * Function to retrieve the MySQL version (client/server) */ function get_mysql_version($type = 'server') { // What do we want to return, the client or the server ? if ($type == 'server') { // Retrieve the database settings from the session $server = $this->ci->session->userdata('server'); $username = $this->ci->session->userdata('username'); $password = $this->ci->session->userdata('password'); // Connect to MySQL $db = @mysql_connect($server, $username, $password); // Compare it if (is_resource($db)) { $mysql = @mysql_get_server_info($db); // Close the connection @mysql_close($db); return $mysql; } else { @mysql_close($db); return "<span class='red'>a version which could not be retrieved</span>"; } } else { // Get the version $mysql = mysql_get_client_info(); // Compare it if ($mysql != FALSE) { return $mysql; } else { return "<span class='red'>a version which could not be retrieved</span>"; } } }
public function main() { $server_info = array('运行环境' => PHP_OS . ' ' . $_SERVER["SERVER_SOFTWARE"], 'PHP运行方式' => php_sapi_name(), 'MYSQL版本' => mysql_get_client_info(), '上传附件限制' => ini_get('upload_max_filesize'), '执行时间限制' => ini_get('max_execution_time') . '秒', '磁盘剩余空间 ' => round(@disk_free_space(".") / (1024 * 1024), 2) . 'M'); $this->assign('server_info', $server_info); //用户总数 $user = M('User'); $website_user_count = $user->count('uid'); //商户总数 $website_merchant_count = $user->where(array('is_seller' => 1))->count('uid'); //店铺总数 $store = M('Store'); $website_merchant_store_count = $store->count('store_id'); //订单总数 $order = M('Order'); $website_merchant_order_count = $order->count('order_id'); //商品数 $product = M('Product'); $website_merchant_goods_count = $product->count('product_id'); //昨日新增用户 $where = array(); $date = date('Y-m-d', strtotime('-1 day')); $start_time = $date . ' 00:00:00'; $end_time = $date . ' 23:59:59'; $where['_string'] = "reg_time >= '" . strtotime($start_time) . "' AND reg_time <= '" . strtotime($end_time) . "'"; $yesterday_add_user_count = $user->where($where)->count('uid'); //昨日新增店铺 $where = array(); $where['_string'] = "date_added >= '" . strtotime($start_time) . "' AND date_added <= '" . strtotime($end_time) . "'"; $yesterday_add_store_count = $user->where($where)->count('uid'); //未付款订单 $not_paid_order_count = $order->where(array('status' => 1))->count('order_id'); //未发货订单 $not_send_order_count = $order->where(array('status' => 2))->count('order_id'); //已发货订单 $send_order_count = $order->where(array('status' => 3))->count('order_id'); //昨日新增订单 $where = array(); $where['_string'] = "add_time >= '" . strtotime($start_time) . "' AND add_time <= '" . strtotime($end_time) . "'"; $yesterday_ordered_count = $order->where($where)->count('order_id'); //上架商品 $selling_product_count = $product->where(array('status' => 1))->count('product_id'); //昨日新增商品 $where = array(); $where['_string'] = "date_added >= '" . strtotime($start_time) . "' AND date_added <= '" . strtotime($end_time) . "'"; $yesterday_add_product_count = $product->where($where)->count('product_id'); $this->assign('website_user_count', $website_user_count); $this->assign('website_merchant_count', $website_merchant_count); $this->assign('website_merchant_store_count', $website_merchant_store_count); $this->assign('website_merchant_order_count', $website_merchant_order_count); $this->assign('website_merchant_goods_count', $website_merchant_goods_count); $this->assign('yesterday_add_user_count', $yesterday_add_user_count); $this->assign('yesterday_add_store_count', $yesterday_add_store_count); $this->assign('not_paid_order_count', $not_paid_order_count); $this->assign('not_send_order_count', $not_send_order_count); $this->assign('send_order_count', $send_order_count); $this->assign('yesterday_ordered_count', $yesterday_ordered_count); $this->assign('selling_product_count', $selling_product_count); $this->assign('yesterday_add_product_count', $yesterday_add_product_count); $this->display(); }
function clientVers() { $orig = @mysql_get_client_info(); $vstr = $this->_findVers($orig); $tmp = explode('.', $vstr, 3); $vint = (int) @$tmp[0] * 10000 + (int) @$tmp[1] * 100 + (int) @$tmp[2]; return array('orig' => $orig, 'vstr' => $vstr, 'vint' => $vint); }
/** * Checks if mysql installed with the minimum required version * * @param mixed $min * @return boolean */ public static function mysql($min = '5') { $extensions = get_loaded_extensions(); if (!in_array('mysql', $extensions)) { return false; } $version = preg_replace('#(^\\D*)([0-9.]+).*$#', '\\2', mysql_get_client_info()); return version_compare($version, $min, '>='); }
/** * 检查MySQL数据库版本 * * @return boolean $result 检查结果 */ function checkMysql() { if (function_exists("mysql_get_client_info")) { $versionInfo = mysql_get_client_info(); preg_match('/[^\\d]*([\\d\\.]+)[^\\d]*/', $versionInfo, $version); $version = isset($version[1]) ? $version[1] : $versionInfo; return version_compare($version, '5.0', '>='); } return t('bugfree', 'Not Install'); }
function server_info($arg) { $sitePass = $arg; global $CONF_SitePassword; global $CONF_version, $CONF_releaseDate, $opMode, $CONF_isMasterServer, $CONF_admin_email; if (!securityCheck($sitePass)) { return new IXR_Error(4000, 'Access Denied'); } return array($CONF_version, $CONF_releaseDate, $opMode, $CONF_isMasterServer, $CONF_admin_email, PHP_VERSION, mysql_get_server_info(), mysql_get_client_info()); }
public function main() { if ($this->system_session['area_id']) { $this->redirect(U('Index/profile')); } $server_info = array('运行环境' => PHP_OS . ' ' . $_SERVER["SERVER_SOFTWARE"], 'PHP运行方式' => php_sapi_name(), 'MYSQL版本' => mysql_get_client_info(), '上传附件限制' => ini_get('upload_max_filesize'), '执行时间限制' => ini_get('max_execution_time') . '秒', '磁盘剩余空间 ' => round(@disk_free_space(".") / (1024 * 1024), 2) . 'M'); $this->assign('server_info', $server_info); //网站统计 $pigcms_assign['website_user_count'] = M('User')->count(); $pigcms_assign['website_merchant_count'] = M('Merchant')->count(); $pigcms_assign['website_merchant_store_count'] = M('Merchant_store')->count(); //团购统计 $pigcms_assign['group_group_count'] = M('Group')->count(); $pigcms_assign['group_today_order_count'] = D('Group_order')->get_all_oreder_count('day'); $pigcms_assign['group_week_order_count'] = D('Group_order')->get_all_oreder_count('week'); $pigcms_assign['group_month_order_count'] = D('Group_order')->get_all_oreder_count('month'); $pigcms_assign['group_year_order_count'] = D('Group_order')->get_all_oreder_count('year'); //订餐统计 $pigcms_assign['meal_store_count'] = M('Merchant_store_meal')->count(); $pigcms_assign['meal_today_order_count'] = D('Meal_order')->get_all_oreder_count('day'); $pigcms_assign['meal_week_order_count'] = D('Meal_order')->get_all_oreder_count('week'); $pigcms_assign['meal_month_order_count'] = D('Meal_order')->get_all_oreder_count('month'); $pigcms_assign['meal_year_order_count'] = D('Meal_order')->get_all_oreder_count('year'); //商家待审核 // $pigcms_assign['merchant_verify_list'] = D('Merchant')->where(array('status'=>'2','reg_time'=>array('gt',$this->system_session['last_time'])))->select(); if ($this->system_session['area_id']) { $pigcms_assign['merchant_verify_count'] = D('Merchant')->where(array('status' => '2', 'area_id' => $this->system_session['area_id']))->count(); //店铺待审核 // $pigcms_assign['merchant_verify_store_list'] = D('Merchant_store')->where(array('status'=>'2','last_time'=>array('gt',$this->system_session['last_time'])))->select(); $pigcms_assign['merchant_verify_store_count'] = D('Merchant_store')->where(array('status' => 0, 'area_id' => $this->system_session['area_id']))->count(); //团购待审核 // $pigcms_assign['group_verify_list'] = D('Group')->where(array('status'=>'2','last_time'=>array('gt',$this->system_session['last_time'])))->select(); $merchants = D('Merchant')->field('mer_id')->where(array('status' => '1', 'area_id' => $this->system_session['area_id']))->select(); $mer_ids = array(); foreach ($merchants as $m) { if (!in_array($m['mer_id'], $mer_ids)) { $mer_ids[] = $m['mer_id']; } } $pigcms_assign['group_verify_count'] = 0; if ($mer_ids) { $pigcms_assign['group_verify_count'] = D('Group')->where(array('status' => '2', 'mer_id' => array('in', $mer_ids)))->count(); } } else { $pigcms_assign['merchant_verify_count'] = D('Merchant')->where(array('status' => '2'))->count(); //店铺待审核 // $pigcms_assign['merchant_verify_store_list'] = D('Merchant_store')->where(array('status'=>'2','last_time'=>array('gt',$this->system_session['last_time'])))->select(); $pigcms_assign['merchant_verify_store_count'] = D('Merchant_store')->where(array('status' => 0))->count(); //团购待审核 // $pigcms_assign['group_verify_list'] = D('Group')->where(array('status'=>'2','last_time'=>array('gt',$this->system_session['last_time'])))->select(); $pigcms_assign['group_verify_count'] = D('Group')->where(array('status' => '2'))->count(); } $this->assign($pigcms_assign); $this->display(); }
/** * {@inheritdoc} */ public function __construct(array $directoriesToCheck = array()) { parent::__construct(); $this->addPimRequirement(!extension_loaded('php5-mysql'), 'Extension php5-mysql should be installed', 'Install and enable <strong>php5-mysql</strong>'); if (extension_loaded('php5-mysql')) { $this->addPimRequirement(version_compare(mysql_get_client_info(), self::REQUIRED_MYSQL_VERSION, '>='), sprintf('MySQL version must be at least %s', self::REQUIRED_MYSQL_VERSION), sprintf('Install MySQL %s or newer (installed version is %s)', self::REQUIRED_MYSQL_VERSION, mysql_get_client_info())); } // Check directories foreach ($directoriesToCheck as $directoryToCheck) { $this->addPimRequirement(is_writable($directoryToCheck), sprintf('%s directory must be writable', $directoryToCheck), sprintf('Change the permissions of the "<strong>%s</strong>" directory', $directoryToCheck)); } }
public function check() { $data = array(); $status = 1; //输出基本配置信息 $data['env']['操作系统'] = array('need' => '不限制', 'best' => '类Unix', 'current' => PHP_OS); $data['env']['PHP'] = array('need' => '5.2', 'best' => '5.4 or new', 'current' => PHP_VERSION); if (function_exists('mysqli_get_client_version')) { $current = 'mysqli:' . mysqli_get_client_version(); } elseif (function_exists('mysql_get_client_info')) { $current = 'mysql:' . mysql_get_client_info(); } else { $current = '未安装'; $status = 0; } $data['env']['数据库'] = array('need' => '与php版本对应', 'best' => '与php版本对应', 'current' => $current); $gd_info = array(); if (function_exists('gd_info')) { $gd_info = gd_info(); } else { $status = 0; } $data['env']['GD库'] = array('need' => '1.0', 'best' => '2.0', 'current' => isset($gd_info['GD Version']) ? $gd_info['GD Version'] : '未安装'); $curl_version = array(); if (function_exists('curl_version')) { $curl_version = curl_version(); } else { $status = 0; } $data['env']['CURL扩展'] = array('need' => '与php版本对应', 'best' => '与php版本对应', 'current' => isset($curl_version['version']) ? $curl_version['version'] : '未安装'); if (class_exists('ZipArchive')) { $current = '已安装'; } else { $current = '未安装'; $status = 0; } $data['env']['ZIP扩展'] = array('need' => '与php版本对应', 'best' => '与php版本对应', 'current' => $current); //检查文件是否可写 $check_write_file = array(); $check_write_file = array('api/application/config/database.php' => APPPATH . 'config/database.php', 'api/application/cache' => APPPATH . 'cache', 'api/application/logs' => APPPATH . 'logs', 'api/resources' => dirname(APPPATH) . '/resources'); foreach ($check_write_file as $item => $file) { if (is_writable($file)) { $is_writable = 1; } else { $is_writable = 0; $status = 0; } $data['writeable'][$item] = $is_writable; } $data['allow_next'] = $status; echo $this->to_api_message(1, 'check_env', $data); }
/** * Index Function Server information * @author linxinliang<*****@*****.**> */ public function index() { if (function_exists('gd_info')) { $gd = gd_info(); $gd = $gd['GD Version']; } else { $gd = "不支持"; } $info = array('操作系统' => PHP_OS, '主机名IP端口' => $_SERVER['SERVER_NAME'] . ' (' . $_SERVER['SERVER_ADDR'] . ':' . $_SERVER['SERVER_PORT'] . ')', '运行环境' => $_SERVER["SERVER_SOFTWARE"], 'PHP运行方式' => php_sapi_name(), '程序目录' => WEB_ROOT, 'MYSQL版本' => function_exists("mysql_close") ? mysql_get_client_info() : '不支持', 'GD库版本' => $gd, '上传附件限制' => ini_get('upload_max_filesize'), '执行时间限制' => ini_get('max_execution_time') . "秒", '剩余空间' => round(@disk_free_space(".") / (1024 * 1024), 2) . 'M', '服务器时间' => date("Y年n月j日 H:i:s"), '北京时间' => gmdate("Y年n月j日 H:i:s", time() + 8 * 3600), '采集函数检测' => ini_get('allow_url_fopen') ? '支持' : '不支持', 'register_globals' => get_cfg_var("register_globals") == "1" ? "ON" : "OFF", '字符串处理' => 1 === get_magic_quotes_gpc() ? 'magic_quotes_gpc=yes' : 'magic_quotes_gpc=on', 'magic_quotes_runtime' => 1 === get_magic_quotes_runtime() ? 'YES' : 'NO'); $this->assign('data', M('admin')->where('id=' . $_SESSION['my_info']['id'])->find()); $this->assign('server_info', $info); $this->display(); }
/** * 网站,服务器基本信息 * @return */ public function index() { $gd = '不支持'; if (function_exists('gd_info')) { $gd = gd_info(); $gd = $gd['GD Version']; } $hostport = $_SERVER['SERVER_NAME'] . "({$_SERVER['SERVER_ADDR']}:{$_SERVER['SERVER_PORT']})"; $mysql = function_exists('mysql_close') ? mysql_get_client_info() : '不支持'; $info = array('system' => get_system(), 'hostport' => $hostport, 'server' => $_SERVER['SERVER_SOFTWARE'], 'php_env' => php_sapi_name(), 'app_dir' => WEB_ROOT, 'mysql' => $mysql, 'gd' => $gd, 'upload_size' => ini_get('upload_max_filesize'), 'exec_time' => ini_get('max_execution_time') . '秒', 'disk_free' => round(@disk_free_space(".") / (1024 * 1024), 2) . 'M', 'server_time' => date("Y-n-j H:i:s"), 'beijing_time' => gmdate("Y-n-j H:i:s", time() + 8 * 3600), 'reg_gbl' => get_cfg_var("register_globals") == '1' ? 'ON' : 'OFF', 'quotes_gpc' => 1 === get_magic_quotes_gpc() ? 'YES' : 'NO', 'quotes_runtime' => 1 === get_magic_quotes_runtime() ? 'YES' : 'NO', 'fopen' => ini_get('allow_url_fopen') ? '支持' : '不支持'); $this->assign('info', $info); $this->display(); }
public function index() { $this->assign('extensions', get_loaded_extensions()); $this->assign('pagetitle', '首页--ThinkPHP助手'); $this->assign('php_version', PHP_VERSION); if (strcmp(PHP_VERSION, "5.4.0") < 0) { $this->assign('mysql_client', mysql_get_client_info()); $this->assign('mysql_host', mysql_get_host_info()); $this->assign('mysql_server', mysql_get_server_info()); } cookie('version', THINK_VERSION); $this->display('index'); }
public function main() { if (function_exists('gd_info')) { $gd = gd_info(); $gd = $gd['GD Version']; } else { $gd = "不支持"; } $system_info = array('0' => PHP_OS, '1' => php_sapi_name(), '2' => function_exists("mysql_close") ? mysql_get_client_info() : '不支持', '3' => PHP_VERSION, '4' => ini_get('upload_max_filesize'), '5' => $gd); $this->assign('system_info', $system_info); $this->assign('area', get_location($_SESSION['user_info']['last_login_ip'])); $this->assign('user_info', $_SESSION['user_info']); $this->display('Admin:main'); }
function get_details() { $result = $this->_owner->query('SHOW VARIABLES', false, true); while ($row = mysql_fetch_row($result)) { $details[$row[0]] = $row[1]; } mysql_free_result($result); $details['engine'] = 'MySQL'; $details['client'] = mysql_get_client_info(); $details['server'] = mysql_get_server_info($this->_owner->connect_id); $details['unicode'] = version_compare($details['server'], '4.1') >= 0; $details['host'] = mysql_get_host_info($this->_owner->connect_id); return $details; }
function dbcheck_mysql() { global $language, $lang_update_php; if (!isset($language)) { $language = $lang_update_php; } if (!function_exists('mysql_connect')) { return $language['not_available']; } $vers = mysql_get_client_info(); if ($vers[0] < 4) { return $language['version_too_old']; } return true; }
/** * index * * @return void */ function index() { $this->set('title_for_layout', __('Installation: Welcome', true)); // core setup $setup = array(array('label' => __('PHP version', true) . ' >= ' . $this->phpVersion . '.x', 'value' => phpversion() >= $this->phpVersion ? 'Yes' : 'No', 'desc' => 'Php ' . $this->phpVersion . '.x is recomended, although php 4.x may run Infinitas fine.'), array('label' => __('zlib compression support', true), 'value' => extension_loaded('zlib') ? 'Yes' : 'No', 'desc' => 'zlib is required for some of the functionality in Infinitas'), array('label' => __('MySQL support', true), 'value' => function_exists('mysql_connect') ? 'Yes' : 'No', 'desc' => 'Infinitas uses mysql for generating dynamic content. Other databases will follow soon.'), array('label' => __('MySQL Version', true) . ' >= ' . $this->sqlVersion . '.x', 'value' => substr(mysql_get_client_info(), 0, 1) >= 4 ? 'Yes' : 'No', 'desc' => 'Infinitas requires Mysql version >= ' . $this->sqlVersion)); // path status $paths = array(array('path' => APP . 'config', 'writeable' => is_writable(APP . 'config') ? 'Yes' : 'No', 'desc' => 'This path needs to be writeable for Infinitas to complete the installation.'), array('path' => APP . 'tmp', 'writeable' => is_writable(APP . 'tmp') ? 'Yes' : 'No', 'desc' => 'The tmp dir needs to be writable for caching to work in Infinitas.'), array('path' => APP . 'webroot', 'writeable' => is_writable(APP . 'webroot') ? 'Yes' : 'No', 'desc' => 'This needs to be web accesible or your images and css will not be found.')); // recomendations $recomendations = array(array('setting' => 'safe_mode', 'recomendation' => 'Off', 'desc' => 'This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0'), array('setting' => 'display_errors', 'recomendation' => 'On', 'desc' => 'Infinitas will handle errors througout the app'), array('setting' => 'file_uploads', 'recomendation' => 'On', 'desc' => 'File uploads are needed for the wysiwyg editors and system installers'), array('setting' => 'magic_quotes_runtime', 'recomendation' => 'Off', 'desc' => 'This function has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.'), array('setting' => 'register_globals', 'recomendation' => 'Off', 'desc' => 'This feature has been DEPRECATED as of PHP 5.3.0 and REMOVED as of PHP 6.0.0. Relying on this feature is highly discouraged.'), array('setting' => 'output_buffering', 'recomendation' => 'Off', 'desc' => 'Infinitas will handle output_buffering for you throughout the app'), array('setting' => 'session.auto_start', 'recomendation' => 'Off', 'desc' => 'Sessions are completly hanled by Infinitas')); foreach ($recomendations as $k => $setting) { $recomendations[$k]['actual'] = (int) ini_get($setting['setting']) ? 'On' : 'Off'; $recomendations[$k]['state'] = $recomendations[$k]['actual'] == $setting['setting'] ? 'No' : 'Yes'; } $this->set(compact('setup', 'paths', 'recomendations')); }
/** * Checks if server is ready to work with smt2 by comparing the server's $type version. * At least are required both PHP 5 and MySQL 5. * @param string $type "php" or "mysql", by now * @param string $minReqVer minimun system version (default: 5.0.0) * @return boolean TRUE on sucess, or FALSE on failure */ function check_systemversion($type, $minReqVer = "5.0.0") { switch (strtolower($type)) { case 'mysql': // mysqli_get_client_info() doesn't require connection $ver = mysql_get_client_info(); break; case 'php': $ver = phpversion(); break; default: break; } // $ver must be >= $minReqVer $status = version_compare($ver, $minReqVer, ">="); return $status; }
function check_mysql_version($list, $show_name) { $name = $list['name']; $value = $list['value']; $sign = $list['sign']; $result = 'true'; if ($sign == ">=") { $s = "大于"; } else { $s = "小于"; } $mysql_now_vers = mysql_get_client_info(); if (function_exists('mysql_connect') && function_exists('mysql_get_server_info')) { $result = 'true'; } return array('value' => sprintf('%s' . ($result ? "函数库可用" : "函数库不可用") . ',要求%s为%s,' . ($result ? "现为%s" : ""), $name, $show_name, $value, $mysql_now_vers), 'result' => $result); }
public function index() { #var_dump($_SESSION[C('USER_AUTH_KEY')]);exit; parent::_initalize(); $systemConfig = $this->systemConfig; $this->assign("systemConfig", $systemConfig); #var_dump($systemConfig); //服务器信息 if (function_exists('gd_info')) { $gd = gd_info(); $gd = $gd['GD Version']; } else { $gd = "不支持"; } $info = array('操作系统' => PHP_OS, '主机名IP端口' => $_SERVER['SERVER_NAME'] . ' (' . $_SERVER['SERVER_ADDR'] . ':' . $_SERVER['SERVER_PORT'] . ')', '运行环境' => $_SERVER["SERVER_SOFTWARE"], 'PHP运行方式' => php_sapi_name(), '程序目录' => WEB_ROOT, 'MYSQL版本' => function_exists("mysql_close") ? mysql_get_client_info() : '不支持', 'GD库版本' => $gd, '上传附件限制' => ini_get('upload_max_filesize'), '执行时间限制' => ini_get('max_execution_time') . "秒", '剩余空间' => round(@disk_free_space(".") / (1024 * 1024), 2) . 'M', '服务器时间' => date("Y年n月j日 H:i:s"), '北京时间' => gmdate("Y年n月j日 H:i:s", time() + 8 * 3600), '采集函数检测' => ini_get('allow_url_fopen') ? '支持' : '不支持', 'register_globals' => get_cfg_var("register_globals") == "1" ? "ON" : "OFF", 'magic_quotes_gpc' => 1 === get_magic_quotes_gpc() ? 'YES' : 'NO', 'magic_quotes_runtime' => 1 === get_magic_quotes_runtime() ? 'YES' : 'NO'); $this->assign('server_info', $info); $this->display(); }
/** * Sends anonymous stastics back to cibonfire.com. These are only used * for seeing environments we should be targeting for development. * * @return [type] [description] */ public function statistics() { $this->load->library('installer_lib'); $db = $this->load->database('default', true); $data = array('bonfire_version' => BONFIRE_VERSION, 'php_version' => phpversion(), 'server' => $this->input->server('SERVER_SOFTWARE'), 'dbdriver' => $db->dbdriver, 'dbserver' => @mysql_get_server_info($db->conn_id), 'dbclient' => preg_replace('/[^0-9\\.]/', '', mysql_get_client_info()), 'curl' => $this->installer_lib->cURL_enabled(), 'server_hash' => md5($this->input->server('SERVER_NAME') . $this->input->server('SERVER_ADDR') . $this->input->server('SERVER_SIGNATURE'))); $data_string = ''; foreach ($data as $key => $value) { $data_string .= $key . '=' . $value . '&'; } rtrim($data_string, '&'); $url = 'http://cibonfire.com/stats/collect'; $ch = curl_init(); curl_setopt($ch, CURLOPT_URL, $url); curl_setopt($ch, CURLOPT_POST, count($data)); curl_setopt($ch, CURLOPT_POSTFIELDS, $data_string); curl_setopt($ch, CURLOPT_FOLLOWLOCATION, true); $result = curl_exec($ch); curl_close($ch); //die(var_dump($result)); }
function remote_version_check($VAR) { global $C_auth; if (!$C_auth->auth_method_by_name("module", "upgrade")) { return false; } if (is_file(PATH_AGILE . 'Version.txt')) { $f['version'] = trim(file_get_contents(PATH_AGILE . 'Version.txt')); } else { $f['version'] = 'SVN'; } $f['license'] = LICENSE_KEY; $f['php'] = phpversion(); $f['mysql'] = mysql_get_client_info(); $f['os'] = $_ENV['OS']; $f['proc'] = $_ENV['PROCESSOR_ARCHITECTURE']; $f['arch'] = $_ENV['PROCESSOR_ARCHITEW6432']; $f['server'] = $_SERVER["SERVER_SOFTWARE"]; global $smarty; $smarty->assign('send', $f); }
public function connect($dbIP, $dbUser, $dbPass, $dbName, $dbPort = null) { // check parameters if ($dbIP == '') { die('<b>ERROR:</b> no database host provided... <b>w2db.php, line ' . __LINE__ . '</b>'); } if ($dbName == '') { die('<b>ERROR:</b> no database name provided... <b>w2db.php, line ' . __LINE__ . '</b>'); } if ($dbUser == '') { die('<b>ERROR:</b> no database user provided... <b>w2db.php, line ' . __LINE__ . '</b>'); } //if ($dbPass == '') die('no database password provided'); $this->dbName = $dbName; // connect if ($this->dbType == 'postgres') { $this->dbConn = pg_connect("host={$dbIP} " . ($dbPort != null ? "port={$dbPort} " : "") . "dbname={$dbName} user={$dbUser} password={$dbPass}"); if (!$this->dbConn) { $this->dbConn = null; print "<b>ERROR:</b> Cannot connect to postgres.<br>"; return false; } $this->dbVersion = pg_version($this->dbConn); $this->dbVersion['host'] = pg_host($this->dbConn); } if ($this->dbType == 'mysql') { $this->dbConn = mysql_connect($dbIP . ($dbPort != null ? ":" . $dbPort : ""), $dbUser, $dbPass); if (!$this->dbConn) { $this->dbConn = null; print "<b>ERROR:</b> Cannot connect to mysql.<br>"; return false; } mysql_select_db($dbName); $this->dbVersion = array(); $this->dbVersion['client'] = mysql_get_client_info(); $this->dbVersion['protocol'] = mysql_get_proto_info($this->dbConn); $this->dbVersion['server'] = mysql_get_server_info($this->dbConn); $this->dbVersion['host'] = mysql_get_host_info($this->dbConn); } }
public static function systemInfo() { if (function_exists('gd_info')) { $gd = gd_info(); $gd = $gd['GD Version']; } else { $gd = "不支持"; } ?> <div class="list"> <h1><b>系统信息</b></h1> <ul> <li><span>操作系统:</span><?php echo PHP_OS; ?> </li> <li><span>运行方式:</span><?php echo php_sapi_name(); ?> </li> <li><span>PHP版本:</span><?php echo PHP_VERSION; ?> </li> <li><span>MYSQL版本:</span><?php echo function_exists("mysql_close") ? mysql_get_client_info() : '不支持'; ?> </li> <li><span>上传限制:</span><?php echo ini_get('upload_max_filesize'); ?> </li> <li><span>GD库版本:</span><?php echo $gd; ?> </li> </ul> </div> <?php }