Exemplo n.º 1
0
 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;
 }
Exemplo n.º 2
0
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;
}
 /**
  * 
  * 	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();
 }
Exemplo n.º 4
0
 /**
  * @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;
 }
Exemplo n.º 5
0
 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);
     }
 }
Exemplo n.º 6
0
/********************************************
 * @Created on March, 2011 * @Package: Ndotdeals unlimited v2.2 
 * @Author: NDOT
 * @URL : http://www.ndot.in
 ********************************************/
require_once './init.php';
$gDesc = $gXpLang['manage_database_backups'];
$gPage = $gXpLang['database_backup'];
$gPath = 'database-backup';
require_once 'header.php';
$buttons = array(0 => array('name' => 'backup', 'img' => $gXpConfig['xpurl'] . 'admin/images/save_f2.gif', 'text' => $gXpLang['backup']));
if ($_POST['task'] == 'backup' || $_POST['backup']) {
    $toptext = "# MySQL variables:\n";
    $toptext .= "# \tMySQL client info: " . mysql_get_client_info() . "\n";
    $toptext .= "# \tMySQL host info: " . mysql_get_host_info() . "\n";
    $toptext .= "# \tMySQL protocol version: " . mysql_get_proto_info() . "\n";
    $toptext .= "# \tMySQL server version: " . mysql_get_server_info() . "\n";
    $toptext .= "\n\n\n";
    /** database backup **/
    /** defines what to dump **/
    if ("structure" == $_POST['db_op']) {
        $sql = makeDbStructureBackup();
    } elseif ("data" == $_POST['db_op']) {
        $sql = makeDbDataBackup();
    } elseif ("full" == $_POST['db_op']) {
        $sql = makeDbBackup();
    }
    $sql = $copyright . $sql;
    /** saves to server **/
    if ("server" == $_POST['savetype']) {
        $sqlfile = $gXpConfig['basepath'] . '/' . $gXpConfig['xpdir'] . $gXpConfig['backup'] . 'db_' . date("Y-m-d") . '.sql';
 /**
  * Returns the version of the MySQL protocol used
  *
  * @param resource|null $link mysql link
  *
  * @return int version of the MySQL protocol used
  */
 public function getProtoInfo($link)
 {
     return mysql_get_proto_info($link);
 }
Exemplo n.º 8
0
     break;
 case 'mysqlinfo':
     echo window_title($database_window_title . "MySQL - Info");
     echo "<div class='row'><div class='row'><label class='etiquette'>" . $msg[sql_info_notices] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from notices") . "</div>";
     echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_exemplaires] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from exemplaires") . "</div>";
     echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_bulletins] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from bulletins") . "</div>";
     echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_authors] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from authors") . "</div>";
     echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_publishers] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from publishers") . "</div>";
     echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_empr] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from empr") . "</div>";
     echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_pret] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from pret") . "</div>";
     echo "<div class='row'><label class='etiquette'>" . $msg[sql_info_pret_archive] . "</label></div>\n\t\t\t  <div class='row'>" . pmb_sql_value("select count(*) as nb from pret_archive") . "</div>";
     echo "<hr />";
     echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Database name, host and user</label>\n\t\t\t\t</div>\n\t\t\t  <div class='row'>\n\t\t\t\t\t" . DATA_BASE . " on " . SQL_SERVER . ", user="******"\n\t\t\t\t\t</div>\n\t\t\t  <div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Server Information</label>\n\t\t\t\t</div>\n\t\t\t  <div class='row'>\n\t\t\t\t\t" . mysql_get_server_info() . "\n\t\t\t\t\t</div><hr />";
     echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Client Information</label>\n\t\t\t\t</div>\n\t\t\t  <div class='row'>\n\t\t\t\t\t" . mysql_get_client_info() . "\n\t\t\t\t\t</div><hr />";
     echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Host Information</label>\n\t\t\t\t</div>\n\t\t\t  <div class='row'>\n\t\t\t\t\t" . mysql_get_host_info() . "\n\t\t\t\t\t</div><hr />";
     echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Protocol Information</label>\n\t\t\t\t</div>\n\t\t\t  <div class='row'>\n\t\t\t\t\t" . mysql_get_proto_info() . "\n\t\t\t\t\t</div><hr />";
     echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Stat. Information</label>\n\t\t\t\t</div>\n\t\t\t  <div class='row'>\n\t\t\t\t\t" . str_replace('  ', '<br />', mysql_stat()) . "</div><hr />";
     echo "<div class='row'>\n\t\t\t\t<label class='etiquette' >MySQL Variables</label>\n\t\t\t\t</div>\n\t\t\t  <div class='row'><table>";
     $result = mysql_query('SHOW VARIABLES', $dbh);
     $parity = 0;
     while ($row = mysql_fetch_assoc($result)) {
         if ($parity % 2) {
             $pair_impair = "even";
         } else {
             $pair_impair = "odd";
         }
         $parity += 1;
         echo "<tr class='{$pair_impair}'><td>" . $row['Variable_name'] . "</td><td>" . $row['Value'] . "</td></tr>";
     }
     echo "</table></div>";
     break;
 /**
  * get protocol info.
  * returns the mysql protocol version
  *
  * @access public
  * @return string 
  */
 public function getProtocolInfo()
 {
     if ($this->connect()) {
         return mysql_get_proto_info($this->_connection);
     }
     return null;
 }
Exemplo n.º 10
0
 function database_get_proto_info()
 {
     return function_exists('mysql_get_proto_info') ? mysql_get_proto_info($this->database_connection) : FALSE;
 }
Exemplo n.º 11
0
 /**
  * Test mysql_get_proto_info
  *
  * @return boolean
  */
 public function MySQL_Get_Proto_Info_Test()
 {
     $str1 = mysql_get_proto_info();
     $str2 = $this->_object->mysql_get_proto_info();
     return $str1 === $str2;
 }
Exemplo n.º 12
0
 function getProtoInfo()
 {
     /* 取得 MySQL 协议信息 */
     return mysql_get_proto_info($this->LinkId);
 }
Exemplo n.º 13
0
 public function mysql_server($num = '')
 {
     switch ($num) {
         case 1:
             return mysql_get_server_info();
             //MySQL 服务器信息
             break;
         case 2:
             return mysql_get_host_info();
             //取得 MySQL 主机信息
             break;
         case 3:
             return mysql_get_client_info();
             //取得 MySQL 客户端信息
             break;
         case 4:
             return mysql_get_proto_info();
             //取得 MySQL 协议信息
             break;
         default:
             return mysql_get_client_info();
             //默认取得mysql版本信息
     }
 }
Exemplo n.º 14
0
if (defined('WB_PATH') == false) {
    die("Cannot access this file directly");
}
if (is_object($database->DbHandle)) {
    $title = "MySQLi Info";
    $server_info = mysqli_get_server_info($database->DbHandle);
    $host_info = mysqli_get_host_info($database->DbHandle);
    $proto_info = mysqli_get_proto_info($database->DbHandle);
    $client_info = mysqli_get_client_info($database->DbHandle);
    $client_encoding = mysqli_character_set_name($database->DbHandle);
    $status = explode('  ', mysqli_stat($database->DbHandle));
} else {
    $title = "MySQL Info";
    $server_info = mysql_get_server_info();
    $host_info = mysql_get_host_info();
    $proto_info = mysql_get_proto_info();
    $client_info = mysql_get_client_info();
    $client_encoding = mysql_client_encoding();
    $status = explode('  ', mysql_stat());
}
$strictMode = $database->get_one('SELECT @@sql_mode');
$strict_info = (strpos($strictMode, 'STRICT_TRANS_TABLES') !== false or strpos($strictMode, 'STRICT_ALL_TABLES') !== false) ? "MySQL strict mode active" : "MySQL strict mode not active\n";
?>
<table cellpadding="3" border="0">
	<tbody>
	<tr class="h">
		<td><h1 class="p"><?php 
echo $title;
?>
</h1></td>
	</tr>
Exemplo n.º 15
0
function statisticsForm($type)
{
    echo "<div class='submenu y3'>\r\n\t\t\t\t<ul>\r\n\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=statistics&amp;type=keywords' title='Show list of Top 60 Keywords'>Top keywords</a></li>\r\n\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=statistics&amp;type=pages' title='Show list of Largest Pages and their indexed file size'>Largest pages</a></li>\r\n\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=statistics&amp;type=spidering_log' title='Show list of Spidering Logs'>Spidering logs</a></li>\r\n\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=statistics&amp;type=server_info' title='Show all available server info'>Server Info</a></li>\r\n\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=statistics&amp;type=log' title='Show Search Log activity'>Search log</a></li>\r\n\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=statistics&amp;type=top_searches' title='Show list of the most popular on-line Searches'>Most popular searches</a></li>\r\n\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=statistics&amp;type=top_links' title='Show list of the most popular links, clicked by the user'>Most popular links</a></li>\r\n\t\t\t\t</ul>\r\n\t\t\t</div>\r\n\t\t";
    if ($type == "") {
        $cachedSumQuery = "select sum(length(fulltxt)) from " . TABLE_PREFIX . "links";
        $result = mysql_query("select sum(length(fulltxt)) from " . TABLE_PREFIX . "links");
        if (DEBUG > '0') {
            echo mysql_error();
        }
        if ($row = mysql_fetch_array($result)) {
            $cachedSumSize = $row[0];
        }
        $cachedSumSize = number_format($cachedSumSize / 1024, 2);
        $sitesSizeQuery = "select sum(size) from " . TABLE_PREFIX . "links";
        $result = mysql_query("{$sitesSizeQuery}");
        if (DEBUG > '0') {
            echo mysql_error();
        }
        if ($row = mysql_fetch_array($result)) {
            $sitesSize = $row[0];
        }
        $sitesSize = number_format($sitesSize, 2);
        $result = mysql_query("select count(*) from " . TABLE_PREFIX . "query_log");
        if (DEBUG > '0') {
            echo mysql_error();
        }
        if ($row = mysql_fetch_array($result)) {
            $query_tot = $row[0];
        }
        $result = mysql_query("select sum(click_counter) from " . TABLE_PREFIX . "links");
        if (!mysql_error()) {
            if ($row = mysql_fetch_array($result)) {
                $click_tot = $row[0];
            }
            $stats = getStatistics();
            echo "<div class='panel w60'>\r\n\t\t\t\t\t<dl class='tblhead'>\r\n\t\t\t\t\t\t<dt class='headline x2'>Overall Statistics:</dt><dd class='headline'>&nbsp;Details</dd>\r\n\t\t\t\t\t\t<dt class='odrow bd x2'>Sites:</dt><dd class='odrow'>&nbsp;" . $stats['sites'] . "</dd>\r\n\t\t\t\t\t\t<dt class='evrow bd x2'>Links:</dt><dd class='evrow'>&nbsp;" . $stats['links'] . "</dd>\r\n\t\t\t\t\t\t<dt class='odrow bd x2'>Categories:</dt><dd class='odrow'>&nbsp;" . $stats['categories'] . "</dd>\r\n\t\t\t\t\t\t<dt class='evrow bd x2'>Keywords:</dt><dd class='evrow'>&nbsp;" . $stats['keywords'] . "</dd>\r\n\t\t\t\t\t\t<dt class='odrow bd x2'>Keyword link-relations:</dt><dd class='odrow'>&nbsp;" . $stats['index'] . "</dd>\r\n\t\t\t\t\t\t<dt class='evrow bd x2'>Cached texts total:</dt><dd class='evrow'>&nbsp;{$cachedSumSize} kb</dd>\r\n\t\t\t\t\t\t<dt class='odrow bd x2'>Sites size total:</dt><dd class='odrow'>&nbsp;{$sitesSize} kb</dd>\r\n\t\t\t\t\t\t<dt class='evrow bd x2'>Queries total:</dt><dd class='evrow'>&nbsp;{$query_tot}</dd>\r\n\t\t\t\t\t\t<dt class='odrow bd x2'>Link clicks total:</dt><dd class='odrow'>&nbsp;{$click_tot}</dd>\r\n\t\t\t\t\t</dl>\r\n\t\t\t\t</div>\r\n\t\t\t\t";
        } else {
            echo "\r\n\t\t\t\t\t<div class='submenu cntr'>\r\n\t\t\t\t\t<span class='warnadmin'>\r\n\t\t\t\t";
            if (DEBUG > '0') {
                echo mysql_error();
            }
            echo "<br /><br /><br />\r\n\t\t\t\t\tPlease run the .../admin/install_bestclick.php file.\r\n\t\t\t\t\t<b r />\r\n\t\t\t\t\t</span>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t\t<br /><br />\r\n\t\t\t\t";
            die;
        }
        exit;
    }
    if ($type == 'keywords') {
        $class = "evrow";
        for ($i = 0; $i <= 15; $i++) {
            $char = dechex($i);
            $result = mysql_query("select keyword, count(" . TABLE_PREFIX . "link_keyword{$char}.keyword_id) as x from " . TABLE_PREFIX . "keywords, " . TABLE_PREFIX . "link_keyword{$char} where " . TABLE_PREFIX . "keywords.keyword_id = " . TABLE_PREFIX . "link_keyword{$char}.keyword_id group by keyword order by x desc limit 30");
            if (DEBUG > '0') {
                echo mysql_error();
            }
            while ($row = mysql_fetch_row($result)) {
                $topwords[$row[0]] = $row[1];
            }
        }
        arsort($topwords);
        echo "<div class='panel'>\r\n\t\t\t\t<p class='headline cntr'>Top 60 Keywords</p>\r\n\t\t\t";
        $nloops = 1;
        do {
            $nloops++;
            $count = 1;
            echo "<div class='ltfloat x3'>\r\n\t\t\t\t\t<dl>\r\n\t\t\t\t\t\t<dt class='headline x2'>Keyword</dt><dd class='headline'>:&nbsp;Instances</dd>\r\n\t\t\t\t";
            while ((list($word, $weight) = each($topwords)) && $count < 21) {
                $word = quote_replace($word);
                $count++;
                if ($class == "evrow") {
                    $class = "odrow";
                } else {
                    $class = "evrow";
                }
                echo "<dt class='{$class}'><a href='../" . WEBROOT_DIR . "/admin/?query={$word}&amp;search=1' target='rel' title='View search results in new window'>" . trim(substr($word, 0, 35)) . "</a></dt>\r\n\t\t\t\t\t\t<dd class='{$class}'>:&nbsp;" . $weight . "</dd>\r\n\t\t\t\t\t";
            }
            echo "</dl>\r\n\t\t\t\t\t</div>\r\n\t\t\t\t";
        } while ($nloops <= 3);
        echo "<div class='clear'></div>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t<a class='navup' href='#head' title='Jump to Page Top'>Top</a>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t";
        exit;
    }
    if ($type == 'pages') {
        $class = "evrow";
        echo "<div class='panel'>\r\n                <dl class='tblhead'>\r\n                <dt class='headline x8'>File Size</dt><dd class='headline cntr'>Links to Largest Pages</dd>\r\n            ";
        $result = mysql_query("select " . TABLE_PREFIX . "links.link_id, url, length(fulltxt)  as x from " . TABLE_PREFIX . "links order by x desc limit 20");
        if (DEBUG > '0') {
            echo mysql_error();
        }
        while ($row = mysql_fetch_row($result)) {
            if ($class == "evrow") {
                $class = "odrow";
            } else {
                $class = "evrow";
            }
            $url = $row[1];
            $sum = number_format($row[2] / 1024, 2);
            echo "<dt class='{$class} x8'>" . $sum . "kb&nbsp;&nbsp;&nbsp;</dt>\r\n                    <dd class='{$class}'><a href='{$url}' title='Open this page in new window' target='_blank'>" . $url . "</a></dd>\r\n                ";
        }
        echo "</dl>\r\n                    <br />\r\n                    <a class='navup' href='#head' title='Jump to Page Top'>Top</a>                    \r\n                    <br />\r\n            \r\n                </div>\r\n            ";
        exit;
    }
    if ($type == 'top_searches') {
        $class = "evrow";
        echo "<div class='panel'>\r\n                <p class='headline cntr'>Most Popular Searches (Top 50)</p>\r\n                <table width='100%'>\r\n                    <tr>\r\n                        <td class='tblhead'>Query</td>\r\n                        <td class='tblhead'>Count</td>\r\n                        <td class='tblhead'>Average results</td>\r\n                        <td class='tblhead'>Last queried</td>\r\n                </tr>\r\n            ";
        $allthese = '1';
        $result = mysql_query("select query, count(*) as c, date_format(max(time), '%Y-%m-%d %H:%i:%s'), avg(results)  from " . TABLE_PREFIX . "query_log group by query order by c desc");
        if (DEBUG > '0') {
            echo mysql_error();
        }
        while (($row = mysql_fetch_row($result)) && $allthese <= '50') {
            if ($class == "evrow") {
                $class = "odrow";
            } else {
                $class = "evrow";
            }
            $word = $row[0];
            $times = $row[1];
            $date = $row[2];
            $avg = number_format($row[3], 0);
            $word = str_replace("\"", "", $word);
            echo "<tr class='{$class} '>\r\n                    <td><a href='../" . WEBROOT_DIR . "/admin/?query={$word}&amp;search=1' target='rel' title='View search results in new window'>" . $word . "</a></td>\r\n                    <td class='cntr'> " . $times . "</td>\r\n                    <td class='cntr'> " . $avg . "</td><td class='cntr'> " . $date . "</td>\r\n                    </tr>\r\n                ";
            $allthese++;
        }
        echo "\r\n                </table>\r\n                <br />\r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a>                    \r\n                <br />            \r\n                </div>\r\n            ";
        exit;
    }
    if ($type == 'top_links') {
        $class = "evrow";
        echo "<div class='panel'>\r\n                <p class='headline cntr'>Most Popular Links (Top 50)</p>\r\n                <table width='100%'>\r\n                <tr>\r\n                    <td class='tblhead'>Link</td>\r\n                    <td class='tblhead'>Total clicks</td>\r\n                    <td class='tblhead'>Last clicked</td>\r\n                    <td class='tblhead'>Last query</td>\r\n                </tr>\r\n            ";
        $allthese = '1';
        $result = mysql_query("select url, click_counter, last_click, last_query  from " . TABLE_PREFIX . "links order by click_counter DESC, url");
        if (DEBUG > '0') {
            echo mysql_error();
        }
        while (($row = mysql_fetch_row($result)) && $allthese <= '50') {
            if ($class == "evrow") {
                $class = "odrow";
            } else {
                $class = "evrow";
            }
            $url = $row[0];
            $click_counter = $row[1];
            $Timestamp = $row[2];
            $last_query = $row[3];
            if ($Timestamp != '0') {
                $last_click = date("Y-m-d H:i:s", $Timestamp);
                echo "<tr class='{$class}'>\r\n                        <td><a href='{$url}' target='rel' title='View link in new window'>" . htmlentities($url) . "</a></td>\r\n                        <td class='cntr sml'> " . $click_counter . "</td>\r\n                        <td class='cntr sml'> " . $last_click . "</td>\r\n                        <td class='cntr sml'> " . $last_query . "</td>\r\n                        </tr>\r\n                    ";
                $allthese++;
            }
        }
        echo "\r\n                </table>\r\n                <br />\r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a>                    \r\n                <br />            \r\n                </div>\r\n            ";
        exit;
    }
    if ($type == 'log') {
        $class = "evrow";
        echo "<div class='panel w75'>\r\n                <p class='headline cntr'>Search Log (Latest 100)</p>\r\n                <table width='100%'>\r\n                <tr>\r\n                    <td class='tblhead'>Query</td>\r\n                    <td class='tblhead x6'>Results</td>\r\n                    <td class='tblhead x3'>Queried at:</td>\r\n                    <td class='tblhead x5'>Time taken</td>\r\n                </tr>\r\n            ";
        $num = '1';
        $result = mysql_query("select query,  date_format(time, '%Y-%m-%d %H:%i:%s'), elapsed, results from " . TABLE_PREFIX . "query_log order by time desc");
        if (DEBUG > '0') {
            echo mysql_error();
        }
        while (($row = mysql_fetch_row($result)) && $num <= '100') {
            if ($class == "evrow") {
                $class = "odrow";
            } else {
                $class = "evrow";
            }
            $word = $row[0];
            $time = $row[1];
            $elapsed = $row[2];
            $results = $row[3];
            echo "<tr class='{$class}'>\r\n                    <td><a href='../" . WEBROOT_DIR . "/admin/?query={$word}&amp;search=1' target='rel' title='View search results in new window'>" . $word . "</a></td>\r\n                    <td class='cntr'> " . $results . "</td>\r\n                    <td class='cntr'> " . $time . "</td>\r\n                    <td class='cntr'> " . $elapsed . "</td>\r\n                    </tr>\r\n                ";
            $num++;
        }
        echo "\r\n                </table>\r\n                <br />\r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a>                    \r\n                <br />                \r\n                </div>\r\n            ";
        exit;
    }
    if ($type == 'spidering_log') {
        $class = "evrow";
        $files = get_dir_contents(LOG_DIR);
        if (count($files) > 0) {
            echo "<div class='panel w75'>\r\n                    <p class='headline cntr'>Spidering Logs</p>\r\n                        <form action='' id='fdelfm'>\r\n                        <table width='100%'>\r\n                        <tr>\r\n                            <td class='tblhead'>File</td>\r\n                            <td class='tblhead'>Created</td>\r\n                            <td class='tblhead' width='22%'>Option</td>\r\n                        </tr>\r\n                        <tr>\r\n                            <td colspan='3' class='odrow cntr bd'>\r\n                            <input type='hidden' name='f' value='44' />\r\n                            <input class='sbmt' id='submit1' type='submit' value='Delete ALL log files' title='Start Log File deletion' onclick=\"return confirm('Are you sure you want to delete ALL log files?')\" />\r\n                            </td>\r\n                        </tr>\r\n                    ";
            for ($i = 0; $i < count($files); $i++) {
                $file = $files[$i];
                $year = substr($file, 0, 2);
                $month = substr($file, 2, 2);
                $day = substr($file, 4, 2);
                $hour = substr($file, 6, 2);
                $minute = substr($file, 8, 2);
                if ($class == "evrow") {
                    $class = "odrow";
                } else {
                    $class = "evrow";
                }
                echo "<tr class='{$class}'>\r\n                        <td class='cntr'>\r\n                        <a href='" . LOG_DIR . "/{$file}' target='_blank' title='Open this Log File in new window'>{$file}</a></td>\r\n                        ";
                if (strlen($file) > '13') {
                    echo "  <td class='cntr'>20{$year}-{$month}-{$day} {$hour}:{$minute}</td>\r\n                                    <td class='cntr options'><a href='?f=delete_log&amp;file={$file}' class='options' title='Click to Delete this Log File' onclick=\"return confirm('Are you sure you want to delete? {$file} Indexing Log File will be lost.')\">Delete</a></td>\r\n                            ";
                } else {
                    echo "  <td></td><td></td\r\n                            ";
                }
                echo "\r\n                    </tr>\r\n                    ";
            }
            echo "\r\n\t\t\t\t\t</table></form>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t<a class='navup' href='#head' title='Jump to Page Top'>Top</a>\r\n\t\t\t\t\t<br />\r\n\t\t\t\t\t</div>\r\n\t\t\t\t";
        } else {
            echo "<br />\r\n\t\t\t\t\t<p class='cntr msg'>Note: <span class='warnadmin'>No saved spidering logs exist!</span></p>\r\n\t\t\t\t\t<br /> <br />\r\n\t\t\t\t";
        }
        exit;
    }
    if ($type = 'server_info') {
        $s_infos = $_SERVER;
        $e_infos = $_ENV;
        echo "<div class='submenu'>\r\n\t\t\t\t\t<ul>\r\n\t\t\t\t\t\t<li><a href='#serv_info'>Server</a></li>\r\n\t\t\t\t\t\t<li><a href='#en_info'>Environment</a></li>\r\n\t\t\t\t\t\t<li><a href='#mysql_info'>MySQL</a></li>\r\n\t\t\t\t\t\t<li><a href='#pdf_con'>PDF-converter</a></li>\r\n\t\t\t\t\t\t<li><a href='#php_ini'>php.ini file</a></li>\r\n\t\t\t\t\t\t<li><a href='" . WEBROOT_DIR . "/admin/?f=35'>PHP integration</a></li>\r\n\t\t\t\t\t\t<li><a href='#php_sec'>PHP security info</a></li>\r\n\t\t\t\t\t</ul>\r\n\t\t\t\t</div>\r\n\t\t\t\t<table width='98%'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class='headline' colspan='6'>\r\n\t\t\t\t\t\t\t<div class='headline cntr'><a name='serv_info'>Server</a></span> </div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td width='20%' class='tblhead'>Key</td>\r\n\t\t\t\t\t\t<td class='tblhead'>Value</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t";
        $bgcolor = 'odrow';
        $i = 0;
        reset($s_info);
        while (list($key, $value) = each($s_infos)) {
            echo "<tr class='{$bgcolor} cntr'>\r\n\t\t\t\t\t\t<td>{$key}</td>\r\n\t\t\t\t\t\t<td class='bordl'>{$value}</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t";
            $i++;
            if ($bgcolor == 'odrow') {
                $bgcolor = 'evrow';
            } else {
                $bgcolor = 'odrow';
            }
        }
        echo "\r\n\t\t\t\t</table><br />\r\n\t\t\t\t<a class='navup' href='#head' title='Jump to Page Top'>Top</a>\r\n\t\t\t\t<br /><br />\r\n\t\t\t\t<table width='98%'>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td class='headline' colspan='6'>\r\n\t\t\t\t\t\t\t<div class='headline cntr'><a name='en_info'>Environment</a></span> </div>\r\n\t\t\t\t\t\t</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t\t\t<tr>\r\n\t\t\t\t\t\t<td width='20%' class='tblhead'>Key</td>\r\n\t\t\t\t\t\t<td class='tblhead'>Value</td>\r\n\t\t\t\t\t</tr>\r\n\t\t\t";
        $bgcolor = 'odrow';
        $i = 0;
        reset($e_info);
        while (list($key, $value) = each($e_infos)) {
            echo "<tr class='{$bgcolor} cntr'>               \r\n                        <td>{$key}</td>\r\n                        <td  class='bordl'>{$value}</td>\r\n                    </tr>\r\n                ";
            $i++;
            if ($bgcolor == 'odrow') {
                $bgcolor = 'evrow';
            } else {
                $bgcolor = 'odrow';
            }
        }
        echo "\r\n                </table><br />\r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a>\r\n            ";
        $server_version = mysql_get_server_info();
        $host_info = mysql_get_host_info();
        $client_info = mysql_get_client_info();
        $protocol_version = mysql_get_proto_info();
        echo "<br /><br />\r\n            \t<table width='98%'>\r\n            \t<tr>\r\n            \t\t<td class='headline' colspan='6'>\r\n            \t\t<div class='headline cntr'><a name='mysql_info'>MySQL Info</a></span> </div>\r\n            \t\t</td>\r\n            \t</tr>\r\n               \t<tr>\r\n                \t<td width='35%' class='tblhead'>Key</td>\r\n                \t<td  class='tblhead'>Value</td>\r\n                </tr>\r\n            ";
        $bgcolor = 'odrow';
        echo "\r\n                <tr class='{$bgcolor} cntr'>\r\n                    <td>MySQL Server version</td>\r\n                    <td  class='bordl'>{$server_version}</td>\r\n                </tr>\r\n            ";
        $bgcolor = 'evrow';
        echo "\r\n                <tr class='{$bgcolor} cntr'>\r\n                    <td>Connection info</td>\r\n                    <td  class='bordl'>{$host_info}</td>\r\n                </tr>\r\n            ";
        $bgcolor = 'odrow';
        echo "\r\n                <tr class='{$bgcolor} cntr'>\r\n                    <td>Client library info</td>\r\n                    <td  class='bordl'>{$client_info}</td>\r\n                </tr>\r\n            ";
        $bgcolor = 'evrow';
        echo "\r\n                <tr class='{$bgcolor} cntr'>\r\n                    <td>MySQL protocol version</td>\r\n                    <td  class='bordl'>{$protocol_version}</td>\r\n                </tr>\r\n            ";
        $bgcolor = 'odrow';
        echo "\r\n                <tr class='{$bgcolor} cntr'>\r\n                    <td>Support for mysqli</td>\r\n                    <td  class='bordl'>See below as part of your PHP installation</td>\r\n                </tr>\r\n                </table><br />                \r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a>\r\n            ";
        $os = '';
        $os = $_ENV['OS'];
        // not all shared hosting server will supply this info
        $admin_path = $_ENV['ORIG_PATH_TRANSLATED'];
        // that might work for shared hosting server
        $admin_file = $_SERVER['SCRIPT_FILENAME'];
        // should present the physical path
        $sdoc_root = $_SERVER['DOCUMENT_ROOT'];
        // this should provide every hoster (???)
        $edoc_root = $_ENV['DOCUMENT_ROOT'];
        // this should provide every hoster (???)
        echo "<br /><br />\r\n        \t<table width='98%'>\r\n        \t<tr>\r\n        \t\t<td class='headline' colspan='6'>\r\n        \t\t<div class='headline cntr'><a name='pdf_con'>PDF-converter relevant Info</a></span> </div>\r\n        \t\t</td>\r\n        \t</tr>\r\n           \t<tr>\r\n            \t<td width='35%' class='tblhead'>Key</td>\r\n            \t<td  class='tblhead'>Value</td>\r\n            </tr>\r\n            ";
        $bgcolor = 'odrow';
        if ($os) {
            echo "\r\n                    <tr class='{$bgcolor} cntr'>\r\n                        <td>Operating System</td>\r\n                        <td  class='bordl'>{$os}</td>\r\n                    </tr>\r\n                ";
            $bgcolor = 'evrow';
        }
        if (!$os) {
            $s_soft = $_SERVER['SERVER_SOFTWARE'];
            $sys_os = stripos($s_soft, "lin");
            if (!$sys_os) {
                $sys_os = stripos($s_soft, "uni");
                if (!$sys_os) {
                    $sys_os = stripos($s_soft, "win");
                }
            }
            if ($sys_os) {
                $os = substr($s_soft, $sys_os, '5');
                echo "\r\n                        <tr class='{$bgcolor} cntr'>\r\n                            <td>Operating System</td>\r\n                            <td  class='bordl'>{$os}</td>\r\n                        </tr>\r\n                    ";
                $bgcolor = 'evrow';
            } else {
                $s_sig = $_SERVER['SERVER_SIGNATURE'];
                $sys_os = stripos($s_sig, "lin");
                if (!$sys_os) {
                    $sys_os = stripos($s_sig, "uni");
                    if (!$sys_os) {
                        $sys_os = stripos($s_sig, "win");
                    }
                }
            }
            if ($sys_os) {
                $os = substr($s_sig, $sys_os, '5');
                echo "\r\n                        <tr class='{$bgcolor} cntr'>\r\n                            <td>Operating System</td>\r\n                            <td  class='bordl'>{$os}</td>\r\n                        </tr>\r\n                    ";
                $bgcolor = 'evrow';
            }
        }
        //  if ENV or SERVER_SIGNATURE or SERVER_SOFTWARE do not deliver OperatingSystem info, we will use the PHPinfo to extract it
        if (!$os) {
            $phpinfo = '';
            ob_start();
            // redirect output into buffer
            phpinfo();
            $phpinfo = ob_get_contents();
            // get all from phpinfo
            ob_end_clean();
            // clean buffer and close it
            //  extract OS information
            $start = stripos($phpinfo, "\"v\"") + 4;
            $end = stripos($phpinfo, "</td>", $start);
            $length = $end - $start;
            $os = substr($phpinfo, $start, $length);
            echo "\r\n                    <tr class='{$bgcolor} cntr'>\r\n                        <td>Operating System</td>\r\n                        <td  class='bordl'>{$os}</td>\r\n                    </tr>\r\n                ";
            $bgcolor = 'evrow';
        }
        if ($admin_path) {
            $admin_path = str_replace("\\\\", "/", $admin_path);
            $admin_path = str_replace("\\", "/", $admin_path);
            $pdf_path = str_replace("admin/index.php", "converter/", $admin_path);
            echo "\r\n                    <tr class='{$bgcolor} cntr'>\r\n                        <td>Physical path to Sphider-plus Admin</td>\r\n                        <td  class='bordl'>{$admin_path}</td>\r\n                    </tr>                    \r\n                ";
            $bgcolor = 'odrow';
            echo "\r\n                    <tr class='{$bgcolor} cntr'>\r\n                        <td>Physical path to the Linux / UNIX PDF-converter</td>\r\n                        <td  class='bordl'>{$pdf_path}</td>\r\n                    </tr>                    \r\n                ";
            $bgcolor = 'evrow';
        } else {
            if ($admin_file) {
                $admin_file = str_replace("\\\\", "/", $admin_file);
                $admin_file = str_replace("\\", "/", $admin_file);
                $pdf_path = str_replace("admin/index.php", "converter/", $admin_file);
                echo "\r\n                        <tr class='{$bgcolor} cntr'>\r\n                            <td>Physical path to Sphider-plus Admin</td>\r\n                            <td  class='bordl'>{$admin_file}</td>\r\n                        </tr>\r\n                    ";
                $bgcolor = 'odrow';
                echo "\r\n                        <tr class='{$bgcolor} cntr'>\r\n                            <td>Physical path to the Linux / UNIX PDF-converter</td>\r\n                            <td  class='bordl'>{$pdf_path}</td>\r\n                        </tr>                    \r\n                    ";
                $bgcolor = 'evrow';
            }
        }
        if ($sdoc_root) {
            echo "                \r\n                    <tr class='{$bgcolor} cntr'>\r\n                        <td>Physical path to document root</td>\r\n                        <td  class='bordl'>{$sdoc_root}</td>\r\n                    </tr>                    \r\n                ";
        } else {
            if ($edoc_root) {
                echo "                \r\n                        <tr class='{$bgcolor} cntr'>\r\n                            <td>Physical path to document root</td>\r\n                            <td  class='bordl'>{$edoc_root}</td>\r\n                        </tr>                    \r\n                    ";
            }
        }
        if (!$admin_path && !$admin_file) {
            if ($sdoc_root) {
                echo "                \r\n                        <tr class='{$bgcolor} cntr'>\r\n                            <td>Physical path to document root</td>\r\n                            <td  class='bordl'>{$sdoc_root}</td>\r\n                        </tr>                    \r\n                    ";
            }
            if ($edoc_root) {
                echo "                \r\n                        <tr class='{$bgcolor} cntr'>\r\n                            <td>Physical path to document root</td>\r\n                            <td  class='bordl'>{$edoc_root}</td>\r\n                        </tr>                    \r\n                    ";
            } else {
                echo "\r\n                        </table>\r\n                    \t<table width='98%'>\r\n                    \t<tr>\r\n                            <td>\r\n                            <span class='cntr warnadmin'><br />\r\n                            Attention: Your server does not deliver information about the physical path to Sphider-plus.<br />\r\n                            For LINUX and UNIX systems you will have to initialize the PDF converter manually.<br />\r\n                            For details see the file readme.pdf, chapter: PDF converter for Linux/UNIX systems.<br />\r\n                            <br /></span>\r\n                            </td>\r\n                        </tr>\r\n                    ";
            }
        }
        echo "\r\n                </table><br />\r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a><br /><br />\r\n            ";
        echo "                \r\n            \t<table width='98%'>\r\n            \t<tr>\r\n            \t\t<td class='headline' colspan='6'>\r\n            \t\t<div class='headline cntr'>PHP Info</span> </div>\r\n            \t\t</td>\r\n            \t</tr>\r\n                </table>\r\n            ";
        echo "<br />\r\n            \t<table width='98%'>\r\n            \t<tr>\r\n            \t\t<td class='headline' colspan='6'>\r\n            \t\t<div class='headline cntr'><a name='php_ini'>php.ini file</a></span> </div>\r\n            \t\t</td>\r\n            \t</tr>\r\n            \t<tr>\r\n            \t\t<td width='20%' class='tblhead'>Key</td>\r\n            \t\t<td class='tblhead'>Value</td>\r\n\r\n            \t</tr>\r\n        \t";
        $php_ini = ini_get_all();
        $bgcolor = 'odrow';
        $i = 0;
        reset($php_ini);
        while (list($key, $value) = each($php_ini)) {
            echo "<tr class='{$bgcolor} cntr'>               \r\n                        <td>{$key}</td>\r\n                        <td   class='bordl'>\r\n                        ";
            // print_r($value);
            "</td>\r\n                    </tr>\r\n                ";
            $i++;
            if ($bgcolor == 'odrow') {
                $bgcolor = 'evrow';
            } else {
                $bgcolor = 'odrow';
            }
        }
        echo "\r\n                </table>\r\n                <br /><br />\r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a>\r\n                <br /><br />\r\n            \t<table width='98%'>\r\n            \t<tr>\r\n            \t\t<td class='headline' colspan='6'>\r\n            \t\t<div class='headline cntr'><a name='php_sec'>PHP security info</a></span> </div>\r\n            \t\t</td>\r\n            \t</tr>\r\n            \t<tr>\r\n            \t\t<td width='20%' class='tblhead'></td>\r\n            \t\t<td class='tblhead'></td>\r\n\r\n            \t</tr>\r\n        \t";
        //phpsecinfo();   //  get PHP security information
        echo "\r\n                </table>\r\n                <br /><br />\r\n                <a class='navup' href='#head' title='Jump to Page Top'>Top</a>\r\n                <br /><br />\r\n                </div>\r\n            ";
        exit;
    }
}
Exemplo n.º 16
0
 public function dump($var)
 {
     $result = array('host_info' => mysql_get_host_info($var), 'MySQL_protocol_version' => mysql_get_proto_info($var), 'MySQL_server_version' => mysql_get_server_info($var));
     return $result;
 }
Exemplo n.º 17
0
                $db_count++;
                $sql1 = mysql_query("USE `" . $pole[0] . "` ");
                $sql2 = mysql_query("SHOW TABLES FROM `" . $pole[0] . "` ");
                while ($pole2 = mysql_fetch_row($sql2)) {
                    $table_count++;
                }
            }
            echo "<table class='tabulka_info'>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_Actual_server"] . ":</td> <td> <strong> " . $_SESSION["DB_server"] . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_login_user"] . ":</td> <td> <strong> " . $_SESSION["DB_user_name"] . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_actual_charset"] . ":</td> <td> <strong> " . mysql_client_encoding($spojeni) . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_number_of_databases"] . ":</td> <td> <strong> " . $db_count . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_number_of_tables"] . ":</td> <td> <strong> " . $table_count . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_mySQL_client_info"] . ":</td> <td> <strong> " . mysql_get_client_info() . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_mySQL_host_info"] . ":</td> <td> <strong> " . mysql_get_host_info() . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_version_of_MySQL_protocol"] . ":</td> <td> <strong> " . mysql_get_proto_info() . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_version_of_MySQL_server"] . ":</td> <td> <strong> " . mysql_get_server_info() . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_view_version_apache"] . ":</td> <td> <strong> " . apache_get_version() . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_view_version_PHP"] . ":</td> <td> <strong> " . phpversion() . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_view_info_about_PHP"] . ":</td> <td> <strong> <a href='?phpinfo'>PHP info</a> </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_SERVER_ADDR"] . ":</td> <td> <strong> " . $_SERVER["SERVER_ADDR"] . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_SERVER_ADMIN"] . ":</td> <td> <strong> <a href='" . $_SERVER["SERVER_ADMIN"] . "'>" . $_SERVER["SERVER_ADMIN"] . "</a> </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_SERVER_NAME"] . ":</td> <td> <strong> " . $_SERVER["SERVER_NAME"] . " </strong> </td> </tr>";
            echo "<tr> <td>" . $_SESSION["lng"]["info_SERVER_PORT"] . ":</td> <td> <strong> " . $_SERVER["SERVER_PORT"] . " </strong> </td> </tr>";
            echo "</table>";
            // echo php_logo_guid();
        }
    }
    ?>
</div></div>
</body>
Exemplo n.º 18
0
 public function getProtocolInfo()
 {
     if ($this->usemysqli) {
         return mysqli_get_proto_info($this->link);
     } else {
         return mysql_get_proto_info($this->link);
     }
 }
Exemplo n.º 19
0
 public function mysql_server($num = '')
 {
     switch ($num) {
         case 1:
             return mysql_get_server_info();
             break;
         case 2:
             return mysql_get_host_info();
             break;
         case 3:
             return mysql_get_client_info();
             break;
         case 4:
             return mysql_get_proto_info();
             break;
         default:
             return mysql_get_client_info();
     }
 }
Exemplo n.º 20
0
 /**
  * @see Lumine_Connection_IConnection::getServerInfo()
  */
 public function getServerInfo($type = null)
 {
     if ($this->conn_id && $this->state == self::OPEN) {
         switch ($type) {
             case self::CLIENT_VERSION:
                 return mysql_get_client_info();
                 break;
             case self::HOST_INFO:
                 return mysql_get_host_info($this->conn_id);
                 break;
             case self::PROTOCOL_VERSION:
                 return mysql_get_proto_info($this->conn_id);
                 break;
             case self::SERVER_VERSION:
             default:
                 return mysql_get_server_info($this->conn_id);
                 break;
         }
         return '';
     }
     throw new Lumine_Exception('A conexao nao esta aberta', Lumine_Exception::WARNING);
 }
Exemplo n.º 21
0
 /**
  * Evaluates the given variable
  *
  * @param   mixed &$subject   Variable to query
  * @param   bool $specialStr  Should this be interpreted as a special string?
  * @return  mixed             Result (both HTML and text modes generate strings)
  */
 protected function evaluate(&$subject, $specialStr = false)
 {
     switch ($type = gettype($subject)) {
         // https://github.com/digitalnature/php-ref/issues/13
         case 'unknown type':
             return $this->fmt->text('unknown');
             // null value
         // null value
         case 'NULL':
             return $this->fmt->text('null');
             // integer/double/float
         // integer/double/float
         case 'integer':
         case 'double':
             return $this->fmt->text($type, $subject, $type);
             // boolean
         // boolean
         case 'boolean':
             $text = $subject ? 'true' : 'false';
             return $this->fmt->text($text, $text, $type);
             // arrays
         // arrays
         case 'array':
             // empty array?
             if (empty($subject)) {
                 $this->fmt->text('array');
                 return $this->fmt->emptyGroup();
             }
             if (isset($subject[static::MARKER_KEY])) {
                 unset($subject[static::MARKER_KEY]);
                 $this->fmt->text('array');
                 $this->fmt->emptyGroup('recursion');
                 return;
             }
             // first recursion level detection;
             // this is optional (used to print consistent recursion info)
             foreach ($subject as $key => &$value) {
                 if (!is_array($value)) {
                     continue;
                 }
                 // save current value in a temporary variable
                 $buffer = $value;
                 // assign new value
                 $value = $value !== 1 ? 1 : 2;
                 // if they're still equal, then we have a reference
                 if ($value === $subject) {
                     $value = $buffer;
                     $value[static::MARKER_KEY] = true;
                     $this->evaluate($value);
                     return;
                 }
                 // restoring original value
                 $value = $buffer;
             }
             $this->fmt->text('array');
             $count = count($subject);
             if (!$this->fmt->startGroup($count)) {
                 return;
             }
             $max = max(array_map('static::strLen', array_keys($subject)));
             $subject[static::MARKER_KEY] = true;
             foreach ($subject as $key => &$value) {
                 // ignore our temporary marker
                 if ($key === static::MARKER_KEY) {
                     continue;
                 }
                 if ($this->hasInstanceTimedOut()) {
                     break;
                 }
                 $keyInfo = gettype($key);
                 if ($keyInfo === 'string') {
                     $encoding = static::$env['mbStr'] ? mb_detect_encoding($key) : '';
                     $keyLen = $encoding && $encoding !== 'ASCII' ? static::strLen($key) . '; ' . $encoding : static::strLen($key);
                     $keyInfo = "{$keyInfo}({$keyLen})";
                 } else {
                     $keyLen = strlen($key);
                 }
                 $this->fmt->startRow();
                 $this->fmt->text('key', $key, "Key: {$keyInfo}");
                 $this->fmt->colDiv($max - $keyLen);
                 $this->fmt->sep('=>');
                 $this->fmt->colDiv();
                 $this->evaluate($value, $specialStr);
                 $this->fmt->endRow();
             }
             unset($subject[static::MARKER_KEY]);
             $this->fmt->endGroup();
             return;
             // resource
         // resource
         case 'resource':
             $meta = array();
             $resType = get_resource_type($subject);
             $this->fmt->text('resource', strval($subject));
             if (!static::$config['showResourceInfo']) {
                 return $this->fmt->emptyGroup($resType);
             }
             // @see: http://php.net/manual/en/resource.php
             // need to add more...
             switch ($resType) {
                 // curl extension resource
                 case 'curl':
                     $meta = curl_getinfo($subject);
                     break;
                 case 'FTP Buffer':
                     $meta = array('time_out' => ftp_get_option($subject, FTP_TIMEOUT_SEC), 'auto_seek' => ftp_get_option($subject, FTP_AUTOSEEK));
                     break;
                     // gd image extension resource
                 // gd image extension resource
                 case 'gd':
                     $meta = array('size' => sprintf('%d x %d', imagesx($subject), imagesy($subject)), 'true_color' => imageistruecolor($subject));
                     break;
                 case 'ldap link':
                     $constants = get_defined_constants();
                     array_walk($constants, function ($value, $key) use(&$constants) {
                         if (strpos($key, 'LDAP_OPT_') !== 0) {
                             unset($constants[$key]);
                         }
                     });
                     // this seems to fail on my setup :(
                     unset($constants['LDAP_OPT_NETWORK_TIMEOUT']);
                     foreach (array_slice($constants, 3) as $key => $value) {
                         if (ldap_get_option($subject, (int) $value, $ret)) {
                             $meta[strtolower(substr($key, 9))] = $ret;
                         }
                     }
                     break;
                     // mysql connection (mysql extension is deprecated from php 5.4/5.5)
                 // mysql connection (mysql extension is deprecated from php 5.4/5.5)
                 case 'mysql link':
                 case 'mysql link persistent':
                     $dbs = array();
                     $query = @mysql_list_dbs($subject);
                     while ($row = @mysql_fetch_array($query)) {
                         $dbs[] = $row['Database'];
                     }
                     $meta = array('host' => ltrim(@mysql_get_host_info($subject), 'MySQL host info: '), 'server_version' => @mysql_get_server_info($subject), 'protocol_version' => @mysql_get_proto_info($subject), 'databases' => $dbs);
                     break;
                     // mysql result
                 // mysql result
                 case 'mysql result':
                     while ($row = @mysql_fetch_object($subject)) {
                         $meta[] = (array) $row;
                         if ($this->hasInstanceTimedOut()) {
                             break;
                         }
                     }
                     break;
                     // stream resource (fopen, fsockopen, popen, opendir etc)
                 // stream resource (fopen, fsockopen, popen, opendir etc)
                 case 'stream':
                     $meta = stream_get_meta_data($subject);
                     break;
             }
             if (!$meta) {
                 return $this->fmt->emptyGroup($resType);
             }
             if (!$this->fmt->startGroup($resType)) {
                 return;
             }
             $max = max(array_map('static::strLen', array_keys($meta)));
             foreach ($meta as $key => $value) {
                 $this->fmt->startRow();
                 $this->fmt->text('resourceProp', ucwords(str_replace('_', ' ', $key)));
                 $this->fmt->colDiv($max - static::strLen($key));
                 $this->fmt->sep(':');
                 $this->fmt->colDiv();
                 $this->evaluate($value);
                 $this->fmt->endRow();
             }
             $this->fmt->endGroup();
             return;
             // string
         // string
         case 'string':
             $length = static::strLen($subject);
             $encoding = static::$env['mbStr'] ? mb_detect_encoding($subject) : false;
             $info = $encoding && $encoding !== 'ASCII' ? $length . '; ' . $encoding : $length;
             if ($specialStr) {
                 $this->fmt->sep('"');
                 $this->fmt->text(array('string', 'special'), $subject, "string({$info})");
                 $this->fmt->sep('"');
                 return;
             }
             $this->fmt->text('string', $subject, "string({$info})");
             // advanced checks only if there are 3 characteres or more
             if (static::$config['showStringMatches'] && $length > 2 && trim($subject) !== '') {
                 $isNumeric = is_numeric($subject);
                 // very simple check to determine if the string could match a file path
                 // @note: this part of the code is very expensive
                 $isFile = $length < 2048 && max(array_map('strlen', explode('/', str_replace('\\', '/', $subject)))) < 128 && !preg_match('/[^\\w\\.\\-\\/\\\\:]|\\..*\\.|\\.$|:(?!(?<=^[a-zA-Z]:)[\\/\\\\])/', $subject);
                 if ($isFile) {
                     try {
                         $file = new \SplFileInfo($subject);
                         $flags = array();
                         $perms = $file->getPerms();
                         if (($perms & 0xc000) === 0xc000) {
                             // socket
                             $flags[] = 's';
                         } elseif (($perms & 0xa000) === 0xa000) {
                             // symlink
                             $flags[] = 'l';
                         } elseif (($perms & 0x8000) === 0x8000) {
                             // regular
                             $flags[] = '-';
                         } elseif (($perms & 0x6000) === 0x6000) {
                             // block special
                             $flags[] = 'b';
                         } elseif (($perms & 0x4000) === 0x4000) {
                             // directory
                             $flags[] = 'd';
                         } elseif (($perms & 0x2000) === 0x2000) {
                             // character special
                             $flags[] = 'c';
                         } elseif (($perms & 0x1000) === 0x1000) {
                             // FIFO pipe
                             $flags[] = 'p';
                         } else {
                             // unknown
                             $flags[] = 'u';
                         }
                         // owner
                         $flags[] = $perms & 0x100 ? 'r' : '-';
                         $flags[] = $perms & 0x80 ? 'w' : '-';
                         $flags[] = $perms & 0x40 ? $perms & 0x800 ? 's' : 'x' : ($perms & 0x800 ? 'S' : '-');
                         // group
                         $flags[] = $perms & 0x20 ? 'r' : '-';
                         $flags[] = $perms & 0x10 ? 'w' : '-';
                         $flags[] = $perms & 0x8 ? $perms & 0x400 ? 's' : 'x' : ($perms & 0x400 ? 'S' : '-');
                         // world
                         $flags[] = $perms & 0x4 ? 'r' : '-';
                         $flags[] = $perms & 0x2 ? 'w' : '-';
                         $flags[] = $perms & 0x1 ? $perms & 0x200 ? 't' : 'x' : ($perms & 0x200 ? 'T' : '-');
                         $size = is_dir($subject) ? '' : sprintf(' %.2fK', $file->getSize() / 1024);
                         $this->fmt->startContain('file', true);
                         $this->fmt->text('file', implode('', $flags) . $size);
                         $this->fmt->endContain();
                     } catch (\Exception $e) {
                         $isFile = false;
                     }
                 }
                 // class/interface/function
                 if (!preg_match('/[^\\w+\\\\]/', $subject) && $length < 96) {
                     $isClass = class_exists($subject, false);
                     if ($isClass) {
                         $this->fmt->startContain('class', true);
                         $this->fromReflector(new \ReflectionClass($subject));
                         $this->fmt->endContain();
                     }
                     if (!$isClass && interface_exists($subject, false)) {
                         $this->fmt->startContain('interface', true);
                         $this->fromReflector(new \ReflectionClass($subject));
                         $this->fmt->endContain('interface');
                     }
                     if (function_exists($subject)) {
                         $this->fmt->startContain('function', true);
                         $this->fromReflector(new \ReflectionFunction($subject));
                         $this->fmt->endContain('function');
                     }
                 }
                 // skip serialization/json/date checks if the string appears to be numeric,
                 // or if it's shorter than 5 characters
                 if (!$isNumeric && $length > 4) {
                     // url
                     if (static::$config['showUrls'] && static::$env['curlActive'] && filter_var($subject, FILTER_VALIDATE_URL)) {
                         $ch = curl_init($subject);
                         curl_setopt($ch, CURLOPT_NOBODY, true);
                         curl_exec($ch);
                         $nfo = curl_getinfo($ch);
                         curl_close($ch);
                         if ($nfo['http_code']) {
                             $this->fmt->startContain('url', true);
                             $contentType = explode(';', $nfo['content_type']);
                             $this->fmt->text('url', sprintf('%s:%d %s %.2fms (%d)', !empty($nfo['primary_ip']) ? $nfo['primary_ip'] : null, !empty($nfo['primary_port']) ? $nfo['primary_port'] : null, $contentType[0], $nfo['total_time'], $nfo['http_code']));
                             $this->fmt->endContain();
                         }
                     }
                     // date
                     if ($length < 128 && static::$env['supportsDate'] && !preg_match('/[^A-Za-z0-9.:+\\s\\-\\/]/', $subject)) {
                         try {
                             $date = new \DateTime($subject);
                             $errors = \DateTime::getLastErrors();
                             if ($errors['warning_count'] < 1 && $errors['error_count'] < 1) {
                                 $now = new \Datetime('now');
                                 $nowUtc = new \Datetime('now', new \DateTimeZone('UTC'));
                                 $diff = $now->diff($date);
                                 $map = array('y' => 'yr', 'm' => 'mo', 'd' => 'da', 'h' => 'hr', 'i' => 'min', 's' => 'sec');
                                 $timeAgo = 'now';
                                 foreach ($map as $k => $label) {
                                     if ($diff->{$k} > 0) {
                                         $timeAgo = $diff->format("%R%{$k}{$label}");
                                         break;
                                     }
                                 }
                                 $tz = $date->getTimezone();
                                 $offs = round($tz->getOffset($nowUtc) / 3600);
                                 if ($offs > 0) {
                                     $offs = "+{$offs}";
                                 }
                                 $timeAgo .= (int) $offs !== 0 ? ' ' . sprintf('%s (UTC%s)', $tz->getName(), $offs) : ' UTC';
                                 $this->fmt->startContain('date', true);
                                 $this->fmt->text('date', $timeAgo);
                                 $this->fmt->endContain();
                             }
                         } catch (\Exception $e) {
                             // not a date
                         }
                     }
                     // attempt to detect if this is a serialized string
                     static $unserializing = 0;
                     $isSerialized = $unserializing < 3 && ($subject[$length - 1] === ';' || $subject[$length - 1] === '}') && in_array($subject[0], array('s', 'a', 'O'), true) && ($subject[0] === 's' && $subject[$length - 2] !== '"' || preg_match("/^{$subject[0]}:[0-9]+:/s", $subject)) && ($unserialized = @unserialize($subject)) !== false;
                     if ($isSerialized) {
                         $unserializing++;
                         $this->fmt->startContain('serialized', true);
                         $this->evaluate($unserialized);
                         $this->fmt->endContain();
                         $unserializing--;
                     }
                     // try to find out if it's a json-encoded string;
                     // only do this for json-encoded arrays or objects, because other types have too generic formats
                     static $decodingJson = 0;
                     $isJson = !$isSerialized && $decodingJson < 3 && in_array($subject[0], array('{', '['), true);
                     if ($isJson) {
                         $decodingJson++;
                         $json = json_decode($subject);
                         if ($isJson = json_last_error() === JSON_ERROR_NONE) {
                             $this->fmt->startContain('json', true);
                             $this->evaluate($json);
                             $this->fmt->endContain();
                         }
                         $decodingJson--;
                     }
                     // attempt to match a regex
                     if ($length < 768) {
                         try {
                             $components = $this->splitRegex($subject);
                             if ($components) {
                                 $regex = '';
                                 $this->fmt->startContain('regex', true);
                                 foreach ($components as $component) {
                                     $this->fmt->text('regex-' . key($component), reset($component));
                                 }
                                 $this->fmt->endContain();
                             }
                         } catch (\Exception $e) {
                             // not a regex
                         }
                     }
                 }
             }
             return;
     }
     // if we reached this point, $subject must be an object
     // track objects to detect recursion
     static $hashes = array();
     // hash ID of this object
     $hash = spl_object_hash($subject);
     $recursion = isset($hashes[$hash]);
     // sometimes incomplete objects may be created from string unserialization,
     // if the class to which the object belongs wasn't included until the unserialization stage...
     if ($subject instanceof \__PHP_Incomplete_Class) {
         $this->fmt->text('object');
         $this->fmt->emptyGroup('incomplete');
         return;
     }
     // check cache at this point
     if (!$recursion && $this->fmt->didCache($hash)) {
         static::$debug['cacheHits']++;
         return;
     }
     $reflector = new \ReflectionObject($subject);
     $this->fmt->startContain('class');
     $this->fromReflector($reflector);
     $this->fmt->text('object', ' object');
     $this->fmt->endContain();
     // already been here?
     if ($recursion) {
         return $this->fmt->emptyGroup('recursion');
     }
     $hashes[$hash] = 1;
     $flags = \ReflectionProperty::IS_PUBLIC | \ReflectionProperty::IS_PROTECTED;
     if (static::$config['showPrivateMembers']) {
         $flags |= \ReflectionProperty::IS_PRIVATE;
     }
     $props = $reflector->getProperties($flags);
     $methods = array();
     if (static::$config['showMethods']) {
         $flags = \ReflectionMethod::IS_PUBLIC | \ReflectionMethod::IS_PROTECTED;
         if (static::$config['showPrivateMembers']) {
             $flags |= \ReflectionMethod::IS_PRIVATE;
         }
         $methods = $reflector->getMethods($flags);
     }
     $constants = $reflector->getConstants();
     $interfaces = $reflector->getInterfaces();
     $traits = static::$env['is54'] ? $reflector->getTraits() : array();
     $parents = static::getParentClasses($reflector);
     // work-around for https://bugs.php.net/bug.php?id=49154
     // @see http://stackoverflow.com/questions/15672287/strange-behavior-of-reflectiongetproperties-with-numeric-keys
     if (!static::$env['is54']) {
         $props = array_values(array_filter($props, function ($prop) use($subject) {
             return !$prop->isPublic() || property_exists($subject, $prop->name);
         }));
     }
     // no data to display?
     if (!$props && !$methods && !$constants && !$interfaces && !$traits) {
         unset($hashes[$hash]);
         return $this->fmt->emptyGroup();
     }
     if (!$this->fmt->startGroup()) {
         return;
     }
     // show contents for iterators
     if (static::$config['showIteratorContents'] && $reflector->isIterateable()) {
         $itContents = iterator_to_array($subject);
         $this->fmt->sectionTitle(sprintf('Contents (%d)', count($itContents)));
         foreach ($itContents as $key => $value) {
             $keyInfo = gettype($key);
             if ($keyInfo === 'string') {
                 $encoding = static::$env['mbStr'] ? mb_detect_encoding($key) : '';
                 $length = $encoding && $encoding !== 'ASCII' ? static::strLen($key) . '; ' . $encoding : static::strLen($key);
                 $keyInfo = sprintf('%s(%s)', $keyInfo, $length);
             }
             $this->fmt->startRow();
             $this->fmt->text(array('key', 'iterator'), $key, sprintf('Iterator key: %s', $keyInfo));
             $this->fmt->colDiv();
             $this->fmt->sep('=>');
             $this->fmt->colDiv();
             $this->evaluate($value);
             //$this->evaluate($value instanceof \Traversable ? ((count($value) > 0) ? $value : (string)$value) : $value);
             $this->fmt->endRow();
         }
     }
     // display the interfaces this objects' class implements
     if ($interfaces) {
         $items = array();
         $this->fmt->sectionTitle('Implements');
         $this->fmt->startRow();
         $this->fmt->startContain('interfaces');
         $i = 0;
         $count = count($interfaces);
         foreach ($interfaces as $name => $interface) {
             $this->fromReflector($interface);
             if (++$i < $count) {
                 $this->fmt->sep(', ');
             }
         }
         $this->fmt->endContain();
         $this->fmt->endRow();
     }
     // traits this objects' class uses
     if ($traits) {
         $items = array();
         $this->fmt->sectionTitle('Uses');
         $this->fmt->startRow();
         $this->fmt->startContain('traits');
         $i = 0;
         $count = count($traits);
         foreach ($traits as $name => $trait) {
             $this->fromReflector($trait);
             if (++$i < $count) {
                 $this->fmt->sep(', ');
             }
         }
         $this->fmt->endContain();
         $this->fmt->endRow();
     }
     // class constants
     if ($constants) {
         $this->fmt->sectionTitle('Constants');
         $max = max(array_map('static::strLen', array_keys($constants)));
         foreach ($constants as $name => $value) {
             $meta = null;
             $type = array('const');
             foreach ($parents as $parent) {
                 if ($parent->hasConstant($name)) {
                     if ($parent !== $reflector) {
                         $type[] = 'inherited';
                         $meta = array('sub' => array(array('Prototype defined by', $parent->name)));
                     }
                     break;
                 }
             }
             $this->fmt->startRow();
             $this->fmt->sep('::');
             $this->fmt->colDiv();
             $this->fmt->startContain($type);
             $this->fmt->text('name', $name, $meta, $this->linkify($parent, $name));
             $this->fmt->endContain();
             $this->fmt->colDiv($max - static::strLen($name));
             $this->fmt->sep('=');
             $this->fmt->colDiv();
             $this->evaluate($value);
             $this->fmt->endRow();
         }
     }
     // object/class properties
     if ($props) {
         $this->fmt->sectionTitle('Properties');
         $max = 0;
         foreach ($props as $idx => $prop) {
             if (($propNameLen = static::strLen($prop->name)) > $max) {
                 $max = $propNameLen;
             }
         }
         foreach ($props as $idx => $prop) {
             if ($this->hasInstanceTimedOut()) {
                 break;
             }
             $bubbles = array();
             $sourceClass = $prop->getDeclaringClass();
             $inherited = $reflector->getShortName() !== $sourceClass->getShortName();
             $meta = $sourceClass->isInternal() ? null : static::parseComment($prop->getDocComment());
             if ($meta) {
                 if ($inherited) {
                     $meta['sub'] = array(array('Declared in', $sourceClass->getShortName()));
                 }
                 if (isset($meta['tags']['var'][0])) {
                     $meta['left'] = $meta['tags']['var'][0][0];
                 }
                 unset($meta['tags']);
             }
             if ($prop->isProtected() || $prop->isPrivate()) {
                 $prop->setAccessible(true);
             }
             $value = $prop->getValue($subject);
             $this->fmt->startRow();
             $this->fmt->sep($prop->isStatic() ? '::' : '->');
             $this->fmt->colDiv();
             $bubbles = array();
             if ($prop->isProtected()) {
                 $bubbles[] = array('P', 'Protected');
             }
             if ($prop->isPrivate()) {
                 $bubbles[] = array('!', 'Private');
             }
             $this->fmt->bubbles($bubbles);
             $type = array('prop');
             if ($inherited) {
                 $type[] = 'inherited';
             }
             if ($prop->isPrivate()) {
                 $type[] = 'private';
             }
             $this->fmt->colDiv(2 - count($bubbles));
             $this->fmt->startContain($type);
             $this->fmt->text('name', $prop->name, $meta, $this->linkify($prop));
             $this->fmt->endContain();
             $this->fmt->colDiv($max - static::strLen($prop->name));
             $this->fmt->sep('=');
             $this->fmt->colDiv();
             $this->evaluate($value);
             $this->fmt->endRow();
         }
     }
     // class methods
     if ($methods && !$this->hasInstanceTimedOut()) {
         $this->fmt->sectionTitle('Methods');
         foreach ($methods as $idx => $method) {
             $this->fmt->startRow();
             $this->fmt->sep($method->isStatic() ? '::' : '->');
             $this->fmt->colDiv();
             $bubbles = array();
             if ($method->isAbstract()) {
                 $bubbles[] = array('A', 'Abstract');
             }
             if ($method->isFinal()) {
                 $bubbles[] = array('F', 'Final');
             }
             if ($method->isProtected()) {
                 $bubbles[] = array('P', 'Protected');
             }
             if ($method->isPrivate()) {
                 $bubbles[] = array('!', 'Private');
             }
             $this->fmt->bubbles($bubbles);
             $this->fmt->colDiv(4 - count($bubbles));
             // is this method inherited?
             $inherited = $reflector->getShortName() !== $method->getDeclaringClass()->getShortName();
             $type = array('method');
             if ($inherited) {
                 $type[] = 'inherited';
             }
             if ($method->isPrivate()) {
                 $type[] = 'private';
             }
             $this->fmt->startContain($type);
             $name = $method->name;
             if ($method->returnsReference()) {
                 $name = "&{$name}";
             }
             $this->fromReflector($method, $name, $reflector);
             $paramCom = $method->isInternal() ? array() : static::parseComment($method->getDocComment(), 'tags');
             $paramCom = empty($paramCom['param']) ? array() : $paramCom['param'];
             $paramCount = $method->getNumberOfParameters();
             $this->fmt->sep('(');
             // process arguments
             foreach ($method->getParameters() as $idx => $parameter) {
                 $meta = null;
                 $paramName = "\${$parameter->name}";
                 $optional = $parameter->isOptional();
                 $variadic = static::$env['is56'] && $parameter->isVariadic();
                 if ($parameter->isPassedByReference()) {
                     $paramName = "&{$paramName}";
                 }
                 if ($variadic) {
                     $paramName = "...{$paramName}";
                 }
                 $type = array('param');
                 if ($optional) {
                     $type[] = 'optional';
                 }
                 $this->fmt->startContain($type);
                 // attempt to build meta
                 foreach ($paramCom as $tag) {
                     list($pcTypes, $pcName, $pcDescription) = $tag;
                     if ($pcName !== $paramName) {
                         continue;
                     }
                     $meta = array('title' => $pcDescription);
                     if ($pcTypes) {
                         $meta['left'] = $pcTypes;
                     }
                     break;
                 }
                 try {
                     $paramClass = $parameter->getClass();
                 } catch (\Exception $e) {
                     // @see https://bugs.php.net/bug.php?id=32177&edit=1
                 }
                 if (!empty($paramClass)) {
                     $this->fmt->startContain('hint');
                     $this->fromReflector($paramClass, $paramClass->name);
                     $this->fmt->endContain();
                     $this->fmt->sep(' ');
                 }
                 if ($parameter->isArray()) {
                     $this->fmt->text('hint', 'array');
                     $this->fmt->sep(' ');
                 }
                 $this->fmt->text('name', $paramName, $meta);
                 if ($optional) {
                     $paramValue = $parameter->isDefaultValueAvailable() ? $parameter->getDefaultValue() : null;
                     $this->fmt->sep(' = ');
                     if (static::$env['is546'] && !$parameter->getDeclaringFunction()->isInternal() && $parameter->isDefaultValueConstant()) {
                         $this->fmt->text('constant', $parameter->getDefaultValueConstantName(), 'Constant');
                     } else {
                         $this->evaluate($paramValue, true);
                     }
                 }
                 $this->fmt->endContain();
                 if ($idx < $paramCount - 1) {
                     $this->fmt->sep(', ');
                 }
             }
             $this->fmt->sep(')');
             $this->fmt->endContain();
             $this->fmt->endRow();
         }
     }
     unset($hashes[$hash]);
     $this->fmt->endGroup();
     $this->fmt->cacheLock($hash);
 }
Exemplo n.º 22
0
 if (isset($_GET['sqlhost']) && isset($_GET['sqluser']) && isset($_GET['sqlpass']) && isset($_GET['sqlport'])) {
     $sqlhost = $_GET['sqlhost'];
     $sqluser = $_GET['sqluser'];
     $sqlpass = $_GET['sqlpass'];
     $sqlport = $_GET['sqlport'];
     if ($con = @mysql_connect($sqlhost . ":" . $sqlport, $sqluser, $sqlpass)) {
         $msg .= "<div style=\"width:99%;padding:4px 10px 0 10px;\">";
         $msg .= "<p>Connected to " . $sqluser . "<span class=\"gaya\">@</span>" . $sqlhost . ":" . $sqlport;
         $msg .= "&nbsp;&nbsp;<span class=\"gaya\">-&gt;</span>&nbsp;&nbsp;<a href=\"?y=" . $pwd . "&amp;x=mysql&amp;sqlhost=" . $sqlhost . "&amp;sqluser="******"&amp;sqlpass="******"&amp;sqlport=" . $sqlport . "&amp;\">[ databases ]</a>";
         if (isset($_GET['db'])) {
             $msg .= "&nbsp;&nbsp;<span class=\"gaya\">-&gt;</span>&nbsp;&nbsp;<a href=\"?y=" . $pwd . "&amp;x=mysql&amp;sqlhost=" . $sqlhost . "&amp;sqluser="******"&amp;sqlpass="******"&amp;sqlport=" . $sqlport . "&amp;db=" . $_GET['db'] . "\">" . htmlspecialchars($_GET['db']) . "</a>";
         }
         if (isset($_GET['table'])) {
             $msg .= "&nbsp;&nbsp;<span class=\"gaya\">-&gt;</span>&nbsp;&nbsp;<a href=\"?y=" . $pwd . "&amp;x=mysql&amp;sqlhost=" . $sqlhost . "&amp;sqluser="******"&amp;sqlpass="******"&amp;sqlport=" . $sqlport . "&amp;db=" . $_GET['db'] . "&amp;table=" . $_GET['table'] . "\">" . htmlspecialchars($_GET['table']) . "</a>";
         }
         $msg .= "</p><p>version : " . mysql_get_server_info($con) . " proto " . mysql_get_proto_info($con) . "</p>";
         $msg .= "</div>";
         echo $msg;
         if (isset($_GET['db']) && !isset($_GET['table']) && !isset($_GET['sqlquery'])) {
             $db = $_GET['db'];
             $query = "DROP TABLE IF EXISTS Ghost_table;\nCREATE TABLE `Ghost_table` ( `file` LONGBLOB NOT NULL );\nLOAD DATA INFILE \"/etc/passwd\"\nINTO TABLE Ghost_table;SELECT * FROM Ghost_table;\nDROP TABLE IF EXISTS Ghost_table;";
             $msg = "<div style=\"width:99%;padding:0 10px;\"><form action=\"?\" method=\"get\"> <input type=\"hidden\" name=\"y\" value=\"" . $pwd . "\" /> <input type=\"hidden\" name=\"x\" value=\"mysql\" /> <input type=\"hidden\" name=\"sqlhost\" value=\"" . $sqlhost . "\" /> <input type=\"hidden\" name=\"sqluser\" value=\"" . $sqluser . "\" /> <input type=\"hidden\" name=\"sqlport\" value=\"" . $sqlport . "\" /> <input type=\"hidden\" name=\"sqlpass\" value=\"" . $sqlpass . "\" /> <input type=\"hidden\" name=\"db\" value=\"" . $db . "\" /> <p><textarea name=\"sqlquery\" class=\"output\" style=\"width:98%;height:80px;\">{$query}</textarea></p> <p><input class=\"inputzbut\" style=\"width:80px;\" name=\"submitquery\" type=\"submit\" value=\"Go !\" /></p> </form></div> ";
             $tables = array();
             $msg .= "<table class=\"explore\" style=\"width:99%;\"><tr><th>available tables on " . $db . "</th></tr>";
             $hasil = @mysql_list_tables($db, $con);
             while (list($table) = @mysql_fetch_row($hasil)) {
                 @array_push($tables, $table);
             }
             @sort($tables);
             foreach ($tables as $table) {
                 $msg .= "<tr><td><a href=\"?y=" . $pwd . "&amp;x=mysql&amp;sqlhost=" . $sqlhost . "&amp;sqluser="******"&amp;sqlpass="******"&amp;sqlport=" . $sqlport . "&amp;db=" . $db . "&amp;table=" . $table . "\">{$table}</a></td></tr>";
Exemplo n.º 23
0
 /**
  * Test mysql_get_proto_info
  *
  * @return boolean
  */
 public function MySQL_Get_Proto_Info_Test()
 {
     $str1 = mysql_get_proto_info();
     return is_int($str1);
 }
Exemplo n.º 24
0
//$sth = db_query($sql, __LINE__, __FILE__);
#
#	0.0.6: BEG
#-------------
$sql = 'SELECT * FROM information_schema.USER_PRIVILEGES WHERE GRANTEE = "\'' . DB_USER . '\'@\'' . DB_HOST . '\'" ORDER BY TABLE_CATALOG';
$sth = db_query($sql, __LINE__, __FILE__);
$userPrivil = db_fetch($sth[0]);
$u = count($userPrivil);
$sql = 'SELECT * FROM information_schema.SCHEMA_PRIVILEGES WHERE GRANTEE = "\'' . DB_USER . '\'@\'' . DB_HOST . '\'" ORDER BY TABLE_SCHEMA';
$sth = db_query($sql, __LINE__, __FILE__);
$tablesPrivil = db_fetch($sth[0]);
$t = count($tablesPrivil);
//echo $sql.'<br>';
//var_dump($tablesPrivil);
if (defined('is_DEBUG') && is_DEBUG == true) {
    echo '<div style="color:#000;background:#F1F1F1;">' . '<h3>MySQL Server Info</h3>' . '<table cellspacing="6" cellpadding="6">' . '<tr>' . '<td>Server: <b>' . mysql_get_server_info() . '</b></td>' . '<td>Client: <b>' . mysql_get_client_info() . '</b></td>' . '<td>Host: <b>' . mysql_get_host_info() . '</b></td>' . '<td>Protocol: <b>' . mysql_get_proto_info() . '</b></td>' . '</tr>' . '</table>';
    echo '' . '<h3>User Privileges Info (' . DB_USER . '@' . DB_HOST . ')</h3>' . '<table cellspacing="6" cellpadding="6">' . '<th align="left">Catalog</th>' . '<th align="left">Privilege Type</th>';
    for ($i = 0; $i < $u; $i++) {
        $tmp = stripslashes($userPrivil[$i]['TABLE_CATALOG']);
        if ($tmp == '') {
            $tmp = 'ALL';
        }
        echo '<tr>' . '<td align="left">' . $tmp . '</td>' . '<td align="left">' . $userPrivil[$i]['PRIVILEGE_TYPE'] . '</td>' . '</tr>';
    }
    echo '' . '</table>';
    echo '' . '<h3>Tables Privileges Info</h3>' . '<table cellspacing="6" cellpadding="6">' . '<th align="left">Schema</th>' . '<th align="left">Privilege Type</th>';
    for ($i = 0; $i < $t; $i++) {
        echo '<tr>' . '<td align="left">' . stripslashes($tablesPrivil[$i]['TABLE_SCHEMA']) . '</td>' . '<td align="left">' . $tablesPrivil[$i]['PRIVILEGE_TYPE'] . '</td>' . '</tr>';
    }
    echo '' . '</table>' . '</div>';
}
Exemplo n.º 25
0
                echo "<center><b>Can't connect</b></center>";
                echo "<b>" . $err . "</b>";
            }
        } else {
            $sqlquicklaunch = array();
            $sqlquicklaunch[] = array("Index", $surl . "act=sql&sql_login="******"&sql_passwd=" . htmlspecialchars($sql_passwd) . "&sql_server=" . htmlspecialchars($sql_server) . "&sql_port=" . htmlspecialchars($sql_port) . "&");
            if (!$sql_db) {
                $sqlquicklaunch[] = array("Query", "#\" onclick=\"alert('Please, select DB!')");
            } else {
                $sqlquicklaunch[] = array("Query", $sql_surl . "sql_act=query");
            }
            $sqlquicklaunch[] = array("Server-status", $surl . "act=sql&sql_login="******"&sql_passwd=" . htmlspecialchars($sql_passwd) . "&sql_server=" . htmlspecialchars($sql_server) . "&sql_port=" . htmlspecialchars($sql_port) . "&sql_act=serverstatus");
            $sqlquicklaunch[] = array("Server variables", $surl . "act=sql&sql_login="******"&sql_passwd=" . htmlspecialchars($sql_passwd) . "&sql_server=" . htmlspecialchars($sql_server) . "&sql_port=" . htmlspecialchars($sql_port) . "&sql_act=servervars");
            $sqlquicklaunch[] = array("Processes", $surl . "act=sql&sql_login="******"&sql_passwd=" . htmlspecialchars($sql_passwd) . "&sql_server=" . htmlspecialchars($sql_server) . "&sql_port=" . htmlspecialchars($sql_port) . "&sql_act=processes");
            $sqlquicklaunch[] = array("Logout", $surl . "act=sql");
            echo "<center><b>MySQL " . mysql_get_server_info() . " (proto v." . mysql_get_proto_info() . ") running in " . htmlspecialchars($sql_server) . ":" . htmlspecialchars($sql_port) . " as " . htmlspecialchars($sql_login) . "@" . htmlspecialchars($sql_server) . " (password - \"" . htmlspecialchars($sql_passwd) . "\")</b><br>";
            if (count($sqlquicklaunch) > 0) {
                foreach ($sqlquicklaunch as $item) {
                    echo "[ <a href=\"" . $item[1] . "\"><u>" . $item[0] . "</u></a> ] ";
                }
            }
            echo "</center>";
        }
        echo "</td></tr><tr>";
        if (!$sql_sock) {
            ?>
<td width="28%" height="100" valign="top"><center><font size="5"> i </font></center><li>If login is null, login is owner of process.<li>If host is null, host is localhost</b><li>If port is null, port is 3306 (default)</td><td width="90%" height="1" valign="top"><TABLE height=1 cellSpacing=0 cellPadding=0 width="100%" border=0><tr><td>&nbsp;<b>Please, fill the form:</b><table><tr><td>Username</td><td align=right>Password&nbsp;</td></tr><form><input type="hidden" name="act" value="sql"><tr><td><input type="text" name="sql_login" value="root" maxlength="64"></td><td align=right><input type="password" name="sql_passwd" value="" maxlength="64"></td></tr><tr><td>HOST</td><td>PORT</td></tr><tr><td><input type="text" name="sql_server" value="localhost" maxlength="64"></td><td><input type="text" name="sql_port" value="3306" maxlength="6" size="3"><input type="submit" value="Connect"></td></tr><tr><td></td></tr></form></table></td><?php 
        } else {
            //Start left panel
            if (!empty($sql_db)) {
                ?>
Exemplo n.º 26
0
<?php

include_once "connect.inc";
if (NULL !== ($tmp = @mysql_get_proto_info(NULL))) {
    printf("[002] Expecting NULL, got %s/%s\n", gettype($tmp), $tmp);
}
require "table.inc";
if (!is_int($info = mysql_get_proto_info($link)) || 0 === $info) {
    printf("[003] Expecting int/any_non_empty, got %s/%s\n", gettype($info), $info);
}
if (!is_int($info2 = mysql_get_proto_info()) || 0 === $info2) {
    printf("[004] Expecting int/any_non_empty, got %s/%s\n", gettype($info2), $info2);
}
assert($info === $info2);
if (NULL !== ($tmp = @mysql_get_proto_info('too many', 'arguments'))) {
    printf("[005] Expecting NULL got %s/%s\n", gettype($tmp), $tmp);
}
print "done!";
require_once "clean_table.inc";
Exemplo n.º 27
0
 */
if (!defined('NV_IS_FILE_DATABASE')) {
    die('Stop!!!');
}
if ($nv_Request->get_bool('show_tabs', 'post')) {
    nv_show_tables();
    exit;
}
if ($nv_Request->isset_request('tab', 'get') and preg_match("/^(" . $db_config['prefix'] . ")\\_[a-zA-Z0-9\\_\\.\\-]+\$/", filter_text_input('tab', 'get'))) {
    nv_show_tab();
    exit;
}
$database = array();
$database['db_host_info'] = mysql_get_host_info();
$database['db_sql_version'] = $db->sql_version;
$database['db_proto_info'] = mysql_get_proto_info();
$database['server'] = $db->server;
$database['db_dbname'] = $db->dbname;
$database['db_uname'] = $db->user;
$result = $db->sql_query('SELECT @@session.time_zone AS `db_time_zone`, @@session.character_set_database AS `db_charset`, @@session.collation_database AS `db_collation`');
$row = $db->sql_fetch_assoc($result);
$db->sql_freeresult($result);
$database['db_charset'] = $row['db_charset'];
$database['db_collation'] = $row['db_collation'];
$database['db_time_zone'] = $row['db_time_zone'];
$contents = array();
$contents['captions']['database_info'] = sprintf($lang_module['database_info'], $database['db_dbname']);
foreach ($database as $key => $values) {
    $contents['database'][$lang_module[$key]] = $values;
}
unset($database);
Exemplo n.º 28
0
 public function GetStat()
 {
     if ($this->DB_conn == NULL) {
         return "";
     }
     $result = array("MySQL server version" => mysql_get_server_info($this->DB_conn), "MySQL protocol version" => mysql_get_proto_info($this->DB_conn), "MySQL host info" => mysql_get_host_info($this->DB_conn), "MySQL client info" => mysql_get_client_info($this->DB_conn), "More info" => str_replace("  ", "\n", mysql_stat($this->DB_conn)), "Process list" => implode("\n", $this->GetProcesses()));
     return $result;
 }
Exemplo n.º 29
0
/**
 * Returns the version of the MySQL protocol used
 * @uses    mysql_get_proto_info()
 * @uses    $GLOBALS['userlink']    as default for $link
 * @param   resource        $link   mysql link
 * @return  integer         version of the MySQL protocol used
 */
function PMA_DBI_get_proto_info($link = null)
{
    if (null === $link) {
        if (isset($GLOBALS['userlink'])) {
            $link = $GLOBALS['userlink'];
        } else {
            return false;
        }
    }
    return mysql_get_proto_info($link);
}
Exemplo n.º 30
0
 public function getServerInfo($type = null)
 {
     if ($this->conn_id && $this->state == self::OPEN) {
         switch ($type) {
             case self::CLIENT_VERSION:
                 return mysql_get_client_info();
                 break;
             case self::HOST_INFO:
                 return mysql_get_host_info($this->conn_id);
                 break;
             case self::PROTOCOL_VERSION:
                 return mysql_get_proto_info($this->conn_id);
                 break;
             case self::SERVER_VERSION:
             default:
                 return mysql_get_server_info($this->conn_id);
                 break;
         }
         return '';
     }
     //throw new PhPBURN_Exception() TODO CREATE EXCETION CLASS AND INPUT AN EXCEPTION HERE;
 }