Tracking submodules
[kohana.git] / install.php
blobcbb0a4c55f23c5978bf21462e27c9d289652fa50
1 <?php defined('SYSPATH') or exit('Install tests must be loaded from within index.php!'); ?>
2 <!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Strict//EN"
3 "http://www.w3.org/TR/xhtml1/DTD/xhtml1-strict.dtd">
5 <html xmlns="http://www.w3.org/1999/xhtml" xml:lang="en" lang="en">
6 <head>
8 <meta http-equiv="Content-Type" content="text/html; charset=utf-8" />
9 <title>Kohana Installation</title>
11 <style type="text/css">
12 body { width: 42em; margin: 0 auto; font-family: sans-serif; background: #fff; font-size: 1em; }
13 h1 { letter-spacing: -0.04em; }
14 h1 + p { margin: 0 0 2em; color: #333; font-size: 90%; font-style: italic; }
15 code { font-family: monaco, monospace; }
16 table { border-collapse: collapse; width: 100%; }
17 table th,
18 table td { padding: 0.4em; text-align: left; vertical-align: top; }
19 table th { width: 12em; font-weight: normal; }
20 table tr:nth-child(odd) { background: #eee; }
21 table td.pass { color: #191; }
22 table td.fail { color: #911; }
23 #results { padding: 0.8em; color: #fff; font-size: 1.5em; }
24 #results.pass { background: #191; }
25 #results.fail { background: #911; }
26 </style>
28 </head>
29 <body>
31 <h1>Environment Tests</h1>
33 <p>
34 The following tests have been run to determine if <a href="http://kohanaframework.org/">Kohana</a> will work in your environment.
35 If any of the tests have failed, consult the <a href="http://kohanaframework.org/guide/about.install">documentation</a>
36 for more information on how to correct the problem.
37 </p>
39 <?php $failed = FALSE ?>
41 <table cellspacing="0">
42 <tr>
43 <th>PHP Version</th>
44 <?php if (version_compare(PHP_VERSION, '5.2.3', '>=')): ?>
45 <td class="pass"><?php echo PHP_VERSION ?></td>
46 <?php else: $failed = TRUE ?>
47 <td class="fail">Kohana requires PHP 5.2.3 or newer, this version is <?php echo PHP_VERSION ?>.</td>
48 <?php endif ?>
49 </tr>
50 <tr>
51 <th>System Directory</th>
52 <?php if (is_dir(SYSPATH) AND is_file(SYSPATH.'classes/kohana'.EXT)): ?>
53 <td class="pass"><?php echo SYSPATH ?></td>
54 <?php else: $failed = TRUE ?>
55 <td class="fail">The configured <code>system</code> directory does not exist or does not contain required files.</td>
56 <?php endif ?>
57 </tr>
58 <tr>
59 <th>Application Directory</th>
60 <?php if (is_dir(APPPATH) AND is_file(APPPATH.'bootstrap'.EXT)): ?>
61 <td class="pass"><?php echo APPPATH ?></td>
62 <?php else: $failed = TRUE ?>
63 <td class="fail">The configured <code>application</code> directory does not exist or does not contain required files.</td>
64 <?php endif ?>
65 </tr>
66 <tr>
67 <th>Cache Directory</th>
68 <?php if (is_dir(APPPATH) AND is_dir(APPPATH.'cache') AND is_writable(APPPATH.'cache')): ?>
69 <td class="pass"><?php echo APPPATH.'cache/' ?></td>
70 <?php else: $failed = TRUE ?>
71 <td class="fail">The <code><?php echo APPPATH.'cache/' ?></code> directory is not writable.</td>
72 <?php endif ?>
73 </tr>
74 <tr>
75 <th>Logs Directory</th>
76 <?php if (is_dir(APPPATH) AND is_dir(APPPATH.'logs') AND is_writable(APPPATH.'logs')): ?>
77 <td class="pass"><?php echo APPPATH.'logs/' ?></td>
78 <?php else: $failed = TRUE ?>
79 <td class="fail">The <code><?php echo APPPATH.'logs/' ?></code> directory is not writable.</td>
80 <?php endif ?>
81 </tr>
82 <tr>
83 <th>PCRE UTF-8</th>
84 <?php if ( ! @preg_match('/^.$/u', 'ñ')): $failed = TRUE ?>
85 <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not been compiled with UTF-8 support.</td>
86 <?php elseif ( ! @preg_match('/^\pL$/u', 'ñ')): $failed = TRUE ?>
87 <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not been compiled with Unicode property support.</td>
88 <?php else: ?>
89 <td class="pass">Pass</td>
90 <?php endif ?>
91 </tr>
92 <tr>
93 <th>SPL Enabled</th>
94 <?php if (function_exists('spl_autoload_register')): ?>
95 <td class="pass">Pass</td>
96 <?php else: $failed = TRUE ?>
97 <td class="fail">PHP <a href="http://www.php.net/spl">SPL</a> is either not loaded or not compiled in.</td>
98 <?php endif ?>
99 </tr>
100 <tr>
101 <th>Reflection Enabled</th>
102 <?php if (class_exists('ReflectionClass')): ?>
103 <td class="pass">Pass</td>
104 <?php else: $failed = TRUE ?>
105 <td class="fail">PHP <a href="http://www.php.net/reflection">reflection</a> is either not loaded or not compiled in.</td>
106 <?php endif ?>
107 </tr>
108 <tr>
109 <th>Filters Enabled</th>
110 <?php if (function_exists('filter_list')): ?>
111 <td class="pass">Pass</td>
112 <?php else: $failed = TRUE ?>
113 <td class="fail">The <a href="http://www.php.net/filter">filter</a> extension is either not loaded or not compiled in.</td>
114 <?php endif ?>
115 </tr>
116 <tr>
117 <th>Iconv Extension Loaded</th>
118 <?php if (extension_loaded('iconv')): ?>
119 <td class="pass">Pass</td>
120 <?php else: $failed = TRUE ?>
121 <td class="fail">The <a href="http://php.net/iconv">iconv</a> extension is not loaded.</td>
122 <?php endif ?>
123 </tr>
124 <?php if (extension_loaded('mbstring')): ?>
125 <tr>
126 <th>Mbstring Not Overloaded</th>
127 <?php if (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING): $failed = TRUE ?>
128 <td class="fail">The <a href="http://php.net/mbstring">mbstring</a> extension is overloading PHP's native string functions.</td>
129 <?php else: ?>
130 <td class="pass">Pass</td>
131 <?php endif ?>
132 </tr>
133 <?php endif ?>
134 <tr>
135 <th>Character Type (CTYPE) Extension</th>
136 <?php if ( ! function_exists('ctype_digit')): $failed = TRUE ?>
137 <td class="fail">The <a href="http://php.net/ctype">ctype</a> extension is not enabled.</td>
138 <?php else: ?>
139 <td class="pass">Pass</td>
140 <?php endif ?>
141 </tr>
142 <tr>
143 <th>URI Determination</th>
144 <?php if (isset($_SERVER['REQUEST_URI']) OR isset($_SERVER['PHP_SELF']) OR isset($_SERVER['PATH_INFO'])): ?>
145 <td class="pass">Pass</td>
146 <?php else: $failed = TRUE ?>
147 <td class="fail">Neither <code>$_SERVER['REQUEST_URI']</code>, <code>$_SERVER['PHP_SELF']</code>, or <code>$_SERVER['PATH_INFO']</code> is available.</td>
148 <?php endif ?>
149 </tr>
150 </table>
152 <?php if ($failed === TRUE): ?>
153 <p id="results" class="fail">✘ Kohana may not work correctly with your environment.</p>
154 <?php else: ?>
155 <p id="results" class="pass">✔ Your environment passed all requirements.<br />
156 Remove or rename the <code>install<?php echo EXT ?></code> file now.</p>
157 <?php endif ?>
159 <h1>Optional Tests</h1>
162 The following extensions are not required to run the Kohana core, but if enabled can provide access to additional classes.
163 </p>
165 <table cellspacing="0">
166 <tr>
167 <th>PECL HTTP Enabled</th>
168 <?php if (extension_loaded('http')): ?>
169 <td class="pass">Pass</td>
170 <?php else: ?>
171 <td class="fail">Kohana can use the <a href="http://php.net/http">http</a> extension for the Request_Client_External class.</td>
172 <?php endif ?>
173 </tr>
174 <tr>
175 <th>cURL Enabled</th>
176 <?php if (extension_loaded('curl')): ?>
177 <td class="pass">Pass</td>
178 <?php else: ?>
179 <td class="fail">Kohana can use the <a href="http://php.net/curl">cURL</a> extension for the Request_Client_External class.</td>
180 <?php endif ?>
181 </tr>
182 <tr>
183 <th>mcrypt Enabled</th>
184 <?php if (extension_loaded('mcrypt')): ?>
185 <td class="pass">Pass</td>
186 <?php else: ?>
187 <td class="fail">Kohana requires <a href="http://php.net/mcrypt">mcrypt</a> for the Encrypt class.</td>
188 <?php endif ?>
189 </tr>
190 <tr>
191 <th>GD Enabled</th>
192 <?php if (function_exists('gd_info')): ?>
193 <td class="pass">Pass</td>
194 <?php else: ?>
195 <td class="fail">Kohana requires <a href="http://php.net/gd">GD</a> v2 for the Image class.</td>
196 <?php endif ?>
197 </tr>
198 <tr>
199 <th>MySQL Enabled</th>
200 <?php if (function_exists('mysql_connect')): ?>
201 <td class="pass">Pass</td>
202 <?php else: ?>
203 <td class="fail">Kohana can use the <a href="http://php.net/mysql">MySQL</a> extension to support MySQL databases.</td>
204 <?php endif ?>
205 </tr>
206 <tr>
207 <th>PDO Enabled</th>
208 <?php if (class_exists('PDO')): ?>
209 <td class="pass">Pass</td>
210 <?php else: ?>
211 <td class="fail">Kohana can use <a href="http://php.net/pdo">PDO</a> to support additional databases.</td>
212 <?php endif ?>
213 </tr>
214 </table>
216 </body>
217 </html>