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