*** empty log message ***
[phpmyadmin/crack.git] / defines.inc.php3
blob99aea79875c3fb9f17db5ae19ccf07c373011f5a
1 <?php
2 /* $Id$ */
5 /**
6 * DEFINES VARIABLES & CONSTANTS
7 * Overview:
8 * PHPMYADMIN_VERSION (string) - phpMyAdmin version string
9 * PHP_INT_VERSION (int) - eg: 30017 instead of 3.0.17 or
10 * 40006 instead of 4.0.6RC3
11 * PMA_WINDOWS (bool) - mark if phpMyAdmin running on windows
12 * server
13 * MYSQL_INT_VERSION (int) - eg: 32339 instead of 3.23.39
15 // phpMyAdmin release
16 if (!defined('PHPMYADMIN_VERSION')) {
17 define('PHPMYADMIN_VERSION', '2.2.0');
20 // php version
21 if (!defined('PHP_INT_VERSION')) {
22 if (!ereg('([0-9]).([0-9]).([0-9])', phpversion(), $match)) {
23 $result = ereg('([0-9]).([0-9])', phpversion(), $match);
25 if (isset($match) && !empty($match[1])) {
26 if (!isset($match[2])) {
27 $match[2] = 0;
29 if (!isset($match[3])) {
30 $match[3] = 0;
32 define('PHP_INT_VERSION', (int)sprintf('%d%02d%02d', $match[1], $match[2], $match[3]));
33 unset($match);
34 } else {
35 define('PHP_INT_VERSION', FALSE);
39 // Whether the os php is running on is windows or not
40 if (!defined('PMA_WINDOWS')) {
41 if (defined('PHP_OS') && eregi('win', PHP_OS)) {
42 define('PMA_WINDOWS', TRUE);
43 } else {
44 define('PMA_WINDOWS', FALSE);
48 // MySQL Version
49 if (!defined('MYSQL_MAJOR_VERSION') && isset($link)) {
50 if (!empty($server)) {
51 $result = mysql_query('SELECT VERSION() AS version');
52 if ($result != FALSE && @mysql_num_rows($result) > 0) {
53 $row = mysql_fetch_array($result);
54 $match = explode('.', $row['version']);
55 } else {
56 $result = @mysql_query('SHOW VARIABLES LIKE \'version\'');
57 if ($result != FALSE && @mysql_num_rows($result) > 0){
58 $row = mysql_fetch_row($result);
59 $match = explode('.', $row[1]);
62 } // end server id is defined case
64 if (!isset($match) || !isset($match[0])) {
65 $match[0] = 3;
67 if (!isset($match[1])) {
68 $match[1] = 21;
70 if (!isset($match[2])) {
71 $match[2] = 0;
74 define('MYSQL_INT_VERSION', (int)sprintf('%d%02d%02d', $match[0], $match[1], intval($match[2])));
75 unset($match);