Fixed bug #12728: Upgrade ExtJS skin to match t3skin
[Packages/TYPO3.CMS.git] / misc / phpcheck / incfile.php
1 <?php
2 // This checks for my own IP at home. You can just remove the if-statement.
3 if (1==0 || ($_SERVER['REMOTE_ADDR']!='127.0.0.1')) {
4 die('In the source distribution of TYPO3, this script is disabled by a die() function call.<br/><b>Fix:</b> Open the file misc/phpcheck/incfile.php and remove/out-comment the line that outputs this message!');
5 }
6
7 include('../../t3lib/class.t3lib_div.php');
8
9 SetCookie('test_script_cookie', 'Cookie Value!', 0, t3lib_div::getIndpEnv('TYPO3_SITE_PATH'));
10
11 if (defined('E_DEPRECATED')) {
12 error_reporting(E_ALL ^ E_NOTICE ^ E_DEPRECATED);
13 } else {
14 error_reporting(E_ALL ^ E_NOTICE);
15 }
16
17 define("TYPO3_OS", stristr(PHP_OS,"win")&&!stristr(PHP_OS,"darwin")?"WIN":"");
18 /*
19 define("PATH_thisScript",
20 TYPO3_OS=="WIN" ?
21 str_replace('//','/',str_replace('\\','/', $HTTP_SERVER_VARS["PATH_TRANSLATED"]?$HTTP_SERVER_VARS["PATH_TRANSLATED"]:getenv("PATH_TRANSLATED"))) :
22 (PHP_SAPI=="cgi"?(getenv("PATH_TRANSLATED")?getenv("PATH_TRANSLATED"):getenv("SCRIPT_FILENAME")):$HTTP_SERVER_VARS["PATH_TRANSLATED"])
23 );
24 */
25
26 define("PATH_thisScript", str_replace('//','/', str_replace('\\','/', PHP_SAPI=="cgi"||PHP_SAPI=="isapi" ? $HTTP_SERVER_VARS["PATH_TRANSLATED"]:$HTTP_SERVER_VARS["SCRIPT_FILENAME"])));
27 define('PATH_site', dirname(PATH_thisScript).'/');
28
29
30
31 if (count($_GET) || $_SERVER["HTTP_REFERER"]) {
32 # KOMPENSATED:
33 echo "<H3>t3lib_div::getIndpEnv()</H3><p>These are 'system variables' returned from t3lib_div::getIndpEnv() and should be universal for any server configuration:</p>";
34 t3lib_div::debug(t3lib_div::getIndpEnv("_ARRAY"));
35
36 t3lib_div::debug(array(
37 "PHP_OS"=>PHP_OS,
38 "TYPO3_OS"=>TYPO3_OS,
39 "PATH_thisScript"=>PATH_thisScript,
40 "php_sapi_name()" => PHP_SAPI
41 ));
42
43
44
45
46 ##t3lib_div::debug(parse_url("http://admin:palindrom@192.168.1.4:8080/typo3/32/temp/phpcheck/index.php/arg1/arg2/arg3/index.php?arg1,arg2,arg3&p1=parameter1&p2[key]=value#link1"));
47
48
49 echo "<H3>Raw values</H3><p>These are the raw 'system variables' returned from getenv(), HTTP_SERVER_VARS, HTTP_ENV_VARS etc. These are displayed here so we can find the right values via this testscript to map to with t3lib_div::getIndpEnv()</p>";
50 $envTestVars = explode(",","REQUEST_URI,REMOTE_ADDR,REMOTE_HOST,PATH_INFO,SCRIPT_NAME,SCRIPT_FILENAME,HTTP_HOST,HTTP_USER_AGENT,HTTP_ACCEPT_ENCODING,HTTP_REFERER,QUERY_STRING");
51 $lines=array();
52 $lines[] = '<tr bgcolor="#eeeeee">
53 <td>Key</td>
54 <td nowrap>getenv()</td>
55 <td nowrap>HTTP_SERVER_VARS</td>
56 <td nowrap>_SERVER</td>
57 <td nowrap>HTTP_ENV_VARS</td>
58 <td nowrap>_ENV</td>
59 </tr>';
60 while(list(,$v)=each($envTestVars)) {
61 $lines[] = '<tr>
62 <td bgcolor="#eeeeee">'.htmlspecialchars($v).'</td>
63 <td nowrap>'.htmlspecialchars(getenv($v)).'&nbsp;</td>
64 <td nowrap>'.htmlspecialchars($GLOBALS["HTTP_SERVER_VARS"][$v]).'&nbsp;</td>
65 <td nowrap>'.htmlspecialchars($GLOBALS["_SERVER"][$v]).'&nbsp;</td>
66 <td nowrap>'.htmlspecialchars($GLOBALS["HTTP_ENV_VARS"][$v]).'&nbsp;</td>
67 <td nowrap>'.htmlspecialchars($GLOBALS["_ENV"][$v]).'&nbsp;</td>
68 </tr>';
69 }
70 echo '<table border=1 style="font-family:verdana; font-size:10px;">'.implode("",$lines).'</table>';
71
72 echo '<table border=1 style="font-family:verdana; font-size:10px;">
73 <tr><td>'.htmlspecialchars('$GLOBALS["HTTP_SERVER_VARS"]["DOCUMENT_ROOT"]').'</td><td>'.htmlspecialchars($GLOBALS["HTTP_SERVER_VARS"]["DOCUMENT_ROOT"]).'</td></tr>
74 <tr><td>'.htmlspecialchars('$HTTP_SERVER_VARS["PATH_TRANSLATED"]').'</td><td>'.htmlspecialchars($HTTP_SERVER_VARS["PATH_TRANSLATED"]).'</td></tr>
75 <tr><td>'.htmlspecialchars('$GLOBALS["HTTP_SERVER_VARS"]["REDIRECT_URL"]').'</td><td>'.htmlspecialchars($GLOBALS["HTTP_SERVER_VARS"]["REDIRECT_URL"]).'</td></tr>
76 <tr><td>'.htmlspecialchars('$GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]').'</td><td>'.htmlspecialchars($GLOBALS["HTTP_SERVER_VARS"]["REQUEST_URI"]).'</td></tr>
77 </table>';
78
79
80
81 echo "Cookie 'test_script_cookie': '<strong>".$HTTP_COOKIE_VARS["test_script_cookie"]."</strong>'<BR>";
82
83
84 echo '<HR><a name="link1"></a>';
85 echo '<div style="border: 1px solid black; padding: 10px 10px 10px 10px;"><h3>What to do now?</h3>
86 <p>1) Click this link above once more: <a href="index.php?arg1,arg2,arg3&p1=parameter1&p2[key]='.substr(md5(time()),0,4).'#link1">Go to this page again.</a><BR>
87 2) Then save this HTML-page and send it to kasperYYYY@typo3.com with information about 1) which webserver (Apache/ISS), 2) Unix/Windows, 3) CGI or module (ISAPI)<br>
88 2a) You might help us find any differences in your values to this <a href="reference.html" target="_blank">reference example</a> by comparing the values before you send the result (thanks).
89 <br>
90 3) If you are really advanced you try and click the link below here. With CGI-versions of servers it will most likely give an error page. If it does not, please send the output to me as well (save HTML-page and send to kasperYYYY@typo3.com). If you do this PATH_INFO test, please let me know.<br><br>
91
92 4) For the really, really advanced folks, it might be interesting to see the output if you could place this link in the root of a domain. That means the index.php script will be executed from eg. "http://www.blablabla.com/" and not "http://www.blablabla.com/kaspers_test/" - it can make a difference.<br>
93 <br>
94 <br>
95 I am operating with these categories of servers. <strong>Please identify your configuration and label your email with that "type":</strong><br><br>
96
97 <table border=1>
98 <tr bgcolor="#eeeeee">
99 <td><em>TYPE:</em></td>
100 <td><em>Description:</em></td>
101 </tr>
102 <tr>
103 <td>WA13CGI</td>
104 <td>Windows / Apache 1.3.x / CGI</td>
105 </tr>
106 <tr>
107 <td>WA2CGI</td>
108 <td>Windows / Apache 2.x / CGI</td>
109 </tr>
110 <tr>
111 <td>WA13ISAPI</td>
112 <td>Windows / Apache 1.3.x / ISAPI-module</td>
113 </tr>
114 <tr>
115 <td>WA2ISAPI</td>
116 <td>Windows / Apache 2.x / ISAPI-module</td>
117 </tr>
118 <tr>
119 <td>WISS_CGI</td>
120 <td>Windows / ISS / CGI</td>
121 </tr>
122 <tr>
123 <td>WISS_ISAPI</td>
124 <td>Windows / ISS / ISAPI-module</td>
125 </tr>
126 <tr>
127 <td>MA13MOD</td>
128 <td>Mac (Darwin) / Apache 1.3.x / Module</td>
129 </tr>
130 <tr>
131 <td>LA13CGI</td>
132 <td>Linux / Apache 1.3.x / CGI</td>
133 </tr>
134 <tr>
135 <td>LA2CGI</td>
136 <td>Linux / Apache 2.x / CGI</td>
137 </tr>
138 <tr>
139 <td>LA13MOD</td>
140 <td>Linux / Apache 1.3.x / Module</td>
141 </tr>
142 <tr>
143 <td>LA2MOD</td>
144 <td>Linux / Apache 2.x / Module</td>
145 </tr>
146 </table>
147
148
149 </p></div>';
150 echo '<a href="index.php/arg1/arg2/arg3/#link2" name="link2">Go to this page again (PATH_INFO).</a><BR>';
151
152 phpinfo();
153 } else {
154 echo '<a href="index.php?arg1,arg2,arg3&p1=parameter1&p2[key]=value#link1" name="link1">Click this link to start the test.</a><BR>';
155 }
156 ?>