本文整理汇总了PHP中mysql_get_host_info函数的典型用法代码示例。如果您正苦于以下问题:PHP mysql_get_host_info函数的具体用法?PHP mysql_get_host_info怎么用?PHP mysql_get_host_info使用的例子?那么, 这里精选的函数代码示例或许可以为您提供帮助。
在下文中一共展示了mysql_get_host_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: castMysqlLink
public static function castMysqlLink($h, array $a, Stub $stub, $isNested)
{
$a['host'] = mysql_get_host_info($h);
$a['protocol'] = mysql_get_proto_info($h);
$a['server'] = mysql_get_server_info($h);
return $a;
}
示例3: EchoConnInfo
function EchoConnInfo($conn)
{
$str = GetBlock(mysql_get_host_info($conn));
$str .= GetBlock(mysql_get_proto_info($conn));
$str .= GetBlock(mysql_get_server_info($conn));
echo $str;
}
示例4: connectMySQL
function connectMySQL()
{
try {
$conexion = mysql_connect($this->host, $this->username, $this->password);
//Establece la conexión con el servidor
if ($conexion) {
echo 'Conexion exitosa.';
echo "<br>Info: ";
echo "<br>Host: ";
echo mysql_get_host_info();
echo "<br>Server: ";
echo mysql_get_server_info();
} else {
die('<br>Imposible conectar: ' . mysql_error());
}
$db = mysql_select_db($this->nameDB, $conexion);
//Establece la conexión con una base de datos del servidor
} catch (Exception $e) {
echo "Error, falló la conexión con la base de datos";
echo $e->getMessage();
//Devuelve el mensaje de la exception
echo $e->getCode();
//Devuelve el código de la Execption(Integer)
echo $e->getLine();
//Devuelve la línea donde se lanzó la execption
}
}
示例5: 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";
}
}
示例6: 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();
}
示例7: sql_connect
function sql_connect($server, $username, $password, $database)
{
global $dconf, $debug;
if (!strlen(trim($server))) {
print "<h4>MySQL server not specified</h4>\n";
return false;
}
if (!strlen(trim($username))) {
print "<h4>MySQL server username not specified</h4>\n";
return false;
}
if ($dconf[verbose]) {
print "<pre>Connecting to mysql://" . $username . "@" . $server . "/" . $database . "...</pre>\n";
}
if (!strlen(trim($password))) {
$myc = mysql_connect($server, $username);
} else {
$myc = mysql_connect($server, $username, $password);
}
if (!$myc) {
print "<h4>Unable to connect to " . $server . "</h4>\n";
return false;
}
if ($dconf[verbose]) {
print "Connected to MySQL server " . mysql_get_server_info() . " at " . mysql_get_host_info() . "\n";
}
if (!mysql_select_db($database)) {
print "<h4>Could not select database " . $database . "</h4>\n";
return false;
}
if ($dconf[verbose]) {
print "<pre>Database " . $database . " selected</pre>\n";
}
return $myc;
}
示例8: index
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');
}
示例9: get_details
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;
}
示例10: get
/**
* @inheritdoc
*/
public function get(VariableWrapper $data)
{
if (!$this->supports($data)) {
throw new \Ladybug\Exception\InvalidInspectorClassException();
}
/** @var $collection CollectionType */
$collection = $this->extendedTypeFactory->factory('collection', $this->level);
$var = $data->getData();
$collection->add($this->createTextType(mysql_get_host_info($var), 'Host info'));
$collection->add($this->createTextType(mysql_get_proto_info($var), 'Protocol version'));
$collection->add($this->createTextType(mysql_get_server_info($var), 'Server version'));
$collection->setTitle('MySQL connection');
$collection->setLevel($this->level);
return $collection;
}
示例11: connect
public function connect($dbIP, $dbUser, $dbPass, $dbName, $dbPort = null)
{
// check parameters
if ($dbIP == '') {
die('<b>ERROR:</b> no database host provided... <b>system/libs/phpDB.php, line 32</b>');
}
if ($dbName == '') {
die('<b>ERROR:</b> no database name provided... <b>system/libs/phpDB.php, line 33</b>');
}
if ($dbUser == '') {
die('<b>ERROR:</b> no database user provided... <b>system/libs/phpDB.php, line 34</b>');
}
//if ($dbPass == '') die('no database password provided');
// 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);
}
}
示例12: check_conn
function check_conn($action = '')
{
if (!($host = @mysql_get_host_info($this->conn))) {
switch ($action) {
case 'kill':
return $host;
break;
case 'check':
return $host;
break;
default:
case 'active':
if (!($this->conn = @mysql_connect($this->host, $this->user, $this->pass))) {
$this->verbose("CONNECTION TO {$this->host} FAILED");
return FALSE;
}
$this->verbose("CONNECTION TO {$this->host} ESTABLISHED");
$this->select_db();
return @mysql_get_host_info($this->conn);
break;
}
} else {
switch ($action) {
case 'kill':
@mysql_close($this->conn);
$this->conn = $this->db = null;
return true;
break;
case 'check':
return $host;
break;
default:
case 'active':
return $host;
break;
}
}
}
示例13: array
</div>
<div class="tab-page" id="sysinfoDesc">
<h2 class="tab"><?php
echo $_lang["click_to_view_details"];
?>
</h2>
<script type="text/javascript">tp.addTabPage( document.getElementById( "sysinfoDesc" ) );</script>
<div class="sectionHeader">サポートに必要な情報</div>
<div class="sectionBody" style="padding:10px 20px;">
<p>
<a href="http://forum.modx.jp/" target="_blank">公式フォーラム</a>でサポートを受けることができます。以下の情報を付記いただくと解決の助けとなります。<br />
<a href="index.php?a=114">イベントログ</a>に重要なヒントが記録されていることもあります。
</p>
<?php
$info = array('OS' => php_uname('s') . ' ' . php_uname('r') . ' ' . php_uname('v') . ' ' . php_uname('m'), 'PHPのバージョン' => PHP_VERSION, 'セーフモード' => ini_get('safe_mode') == 0 ? 'off' : 'on', 'php_sapi_name' => php_sapi_name(), 'MySQLのバージョン' => $modx->db->getVersion(), 'MySQLホスト情報' => mysql_get_host_info(), 'MODXのバージョン' => $modx_version, 'サイトのURL' => $modx->config['site_url'], 'ホスト名' => gethostbyaddr(getenv('SERVER_ADDR')), 'MODX_BASE_URL' => MODX_BASE_URL, 'upload_tmp_dir' => ini_get('upload_tmp_dir') . '(ファイルアップロード処理のために一時的なファイル保存領域として用いるテンポラリディレクトリ。この値が空になっている時は、OSが認識するテンポラリディレクトリが用いられます)', 'memory_limit' => ini_get('memory_limit') . '(スクリプトが確保できる最大メモリ。通常はpost_max_sizeよりも大きい値にしますが、memory_limit・post_max_size・upload_max_filesizeの3つの値を同一に揃えても支障ありません。)', 'post_max_size' => ini_get('post_max_size') . '(POSTデータに許可される最大サイズ。POSTには複数のデータが含まれるので、通常はupload_max_filesizeよりも大きい値にします)', 'upload_max_filesize' => ini_get('upload_max_filesize') . '(アップロードを受け付けるファイルの最大サイズ)', 'max_execution_time' => ini_get('max_execution_time') . '秒(PHP処理の制限時間。スクリプト暴走の継続を防止します)', 'max_input_time' => ini_get('max_input_time') . '秒(POST・GET・ファイルアップロードなどの入力を処理する制限時間。回線の太さの影響を受けることもあります)', 'session.save_path' => ini_get('session.save_path') . '(セッションデータを保存するディレクトリ。CGI版PHPの場合はユーザの違いが原因でここに書き込み権限がない場合があるため、注意が必要です)', 'magic_quotes_gpc' => get_magic_quotes_gpc() ? 'On' : 'Off' . '(クォート文字を自動的にエスケープします。トラブルの元になりやすいためOffを推奨します)');
echo '<p>' . getenv('SERVER_SOFTWARE') . '</p>' . "\n" . "\n";
echo '<table style="margin-bottom:20px;">';
foreach ($info as $key => $value) {
echo '<tr><td style="padding-right:30px;vertical-align:top;">' . $key . '</td><td>' . $value . '</td></tr>' . "\n";
}
echo '</table>' . "\n";
echo '<h4>mbstring</h4>' . "\n" . "\n";
echo '<table style="margin-bottom:20px;">';
$mbstring_array = array('mbstring.detect_order', 'mbstring.encoding_translation', 'mbstring.func_overload', 'mbstring.output_buffering', 'mbstring.http_input', 'mbstring.http_output', 'mbstring.internal_encoding', 'mbstring.language', 'mbstring.strict_detection', 'mbstring.substitute_character');
foreach ($mbstring_array as $v) {
$key = $v;
$value = ini_get($v) !== false ? ini_get($v) : 'no value';
echo '<tr><td style="padding-right:30px;">' . $key . '</td><td>' . $value . '</td></tr>' . "\n";
}
echo '</table>' . "\n";
示例14: MySQL_Get_Host_Info_Test
/**
* Test mysql_get_host_info
*
* @return boolean
*/
public function MySQL_Get_Host_Info_Test()
{
$str1 = mysql_get_host_info();
return stripos($str1, 'via');
}
示例15: getDbInfo
public function getDbInfo()
{
$charsets = $this->getCharsetInfo();
$charset_str = array();
foreach ($charsets as $name => $value) {
$charset_str[] = "{$name} = {$value}";
}
return array("MySQL Version" => @mysql_get_client_info(), "MySQL Host Info" => @mysql_get_host_info($this->database), "MySQL Server Info" => @mysql_get_server_info($this->database), "MySQL Client Encoding" => @mysql_client_encoding($this->database), "MySQL Character Set Settings" => join(", ", $charset_str));
}