本文整理汇总了PHP中mysql_get_client_info函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_get_client_info函数的具体用法?PHP mysql_get_client_info怎么用?PHP mysql_get_client_info使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_get_client_info函数的15个代码示例,这些例子默认根据受欢迎程度排序。您可以为喜欢或者感觉有用的代码点赞,您的评价将有助于系统推荐出更棒的PHP代码示例。
示例1: getAttribute
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;
}
}
示例2: getTxtLog
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;
}
示例3: get_mysql_version
/**
* @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;
}
}
示例4: modifpostAction
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'));
}
示例5: mysql_acceptable
/**
* @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;
}
}
示例6: bmDebug
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";
}
}
示例7: showSystemStatus
/**
*
* 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();
}
示例8: get_mysql_version
/**
* @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>";
}
}
}
示例9: main
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();
}
示例10: clientVers
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);
}
示例11: mysql
/**
* 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, '>=');
}
示例12: checkMysql
/**
* 检查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');
}
示例13: server_info
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());
}
示例14: main
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();
}
示例15: __construct
/**
* {@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));
}
}