install.php 16 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348
  1. <!DOCTYPE html>
  2. <html lang="en">
  3. <head>
  4. <meta charset="utf-8">
  5. <meta http-equiv="X-UA-Compatible" content="IE=edge">
  6. <meta name="viewport" content="width=device-width, initial-scale=1">
  7. <title>Koseven Installation</title>
  8. <meta name="title" content="Koseven Installation">
  9. <meta name="description" content="The following tests have been run to determine if Koseven will work in your environment.">
  10. <meta name="author" content="Koseven Team">
  11. <style>
  12. body {
  13. margin: 0;
  14. background-color: #efefef;
  15. font-family: 'Arial', sans-serif;
  16. }
  17. .container {
  18. max-width: 800px;
  19. margin: 10px auto;
  20. background: #fff;
  21. padding: 20px 15px;
  22. border-radius: 12px;
  23. }
  24. table {
  25. margin: 20px 0;
  26. }
  27. h1,
  28. th {
  29. margin: 5px 0;
  30. color: #2f2f2f;
  31. }
  32. p,
  33. td {
  34. margin: 10px 0;
  35. color: #383838;
  36. }
  37. a,
  38. a:visited {
  39. color: #3195f0;
  40. text-decoration: none;
  41. }
  42. th {
  43. text-align: left;
  44. width: 30%;
  45. }
  46. td,
  47. th {
  48. padding: 5px 0;
  49. }
  50. .logo {
  51. background-image: url(data:image/png;base64,iVBORw0KGgoAAAANSUhEUgAAAFAAAAAoCAMAAABevo0zAAABmFBMVEUAAADs7Ozt7e3s7Ozs7Ozs7Ozs7Ozs7Ozt7e3s7Ozs7Ozs7Ozs7Ozs7Ozs7Ozs7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Je9AlfmofYhzugyBlMW0mGirN5N1dPGJi63PQJL161/dSMRbZ9hXnLyRJl39bzM7HUZvoDWps9T11AvETC18Z5QLdykd+hlB4SGA0bl+6QMyv7iXBMMvpIIOz4OBDusTWpYuutzSpiNhgOULctRBcR3iU2LvYSCEwJABxN2tAIagqr1v8bUlyWlpD2PCEJUyjw7RPT7VrvA759WueNFhXHHwgIkH0CCX2Ft1DgCxDYIgAJLjIjB/4lkiuR0Mvh42XM4GOYaxsEYDucZHJ29yhH8OlDsLq5yog3KPAHnJL9QnCRu71+m4eAG2h9jBN2Id/VcZwLU1bgToFotid5sIDNTEoh4hEag9bgBkW+/B0U+BwEHiRCqMknJBqi/p6QztQpkV5SD3iKfOMwWjcT3z6oyQM8VbM1XAwhISsshvgKuybbh3zPQGArEZ4GwjKWcwaZ1WeXcBianI844LszCCt6lyAcA0J0nhwb4jDOYSg5y+o69vQvR2CbPnVWxIo8SZGzAVK/M35riuowSCdIFVDgC2ewViCDiBRMV/z3X+SH0Elif6RccE/y/FpeBIFHmBB2PEdFll3UkGt89BjcM0vOoO7QJ5hvB5yTL1zOXnfafPX5clUJWMAS9y3A2EozYRoIcapEH6Scp1wVsVVcFC6jwJ80V0FgUjC2wbhGWbkij9EIYj/mYvqI7+kyji0zV/P2+sRotUUuRjxjqhRdhtBZ/hUNelfsgas4U2EJblNbhIMD9iSXyhnAnHk/gesM9ttYJoBrSNjzAGybocVpvH7chLkqXDTpUdkYefhbWjUXpbH1B3U3rwEUyDlsa8yX9aNHtfauXu0okKFjjJeyMWcKZzup9UD8UYtHeLz+NszWLuc6PGDfHhVHvRvzbuEjcUAztmgX28Teppi9w/5kNGsGXrd88EeE+72waf0oHTm0f4/9pNia5i8QdvHxF5+c4F+bFmujAAAAAElFTkSuQmCC);
  52. width: 80px;
  53. height: 40px;
  54. float: right;
  55. }
  56. .pass {
  57. color: #155724;
  58. }
  59. .warning {
  60. color: #d2b362;
  61. }
  62. .fail {
  63. color: #721c24;
  64. }
  65. code {
  66. font-family: monospace;
  67. font-size: 15px;
  68. background: #f1f0f0;
  69. }
  70. .alert {
  71. padding: 20px;
  72. border-radius: 12px;
  73. border: 1px solid;
  74. margin-bottom: 20px;
  75. }
  76. .alert code {
  77. background: none;
  78. }
  79. .danger {
  80. color: #721c24;
  81. background-color: #f8d7da;
  82. border-color: #f5c6cb;
  83. }
  84. .success {
  85. color: #155724;
  86. background-color: #d4edda;
  87. border-color: #c3e6cb;
  88. }
  89. .icon {
  90. display: inline-block;
  91. width: 24px;
  92. height: 24px;
  93. margin-bottom: -6px;
  94. margin-right: 10px;
  95. }
  96. .icon-success {
  97. background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjMTU1NzI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPiAgICA8cGF0aCBkPSJNOSAxNi4yTDQuOCAxMmwtMS40IDEuNEw5IDE5IDIxIDdsLTEuNC0xLjRMOSAxNi4yeiIvPjwvc3ZnPg==);
  98. }
  99. .icon-danger {
  100. background-image: url(data:image/svg+xml;base64,PHN2ZyBmaWxsPSIjNzIxYzI0IiBoZWlnaHQ9IjI0IiB2aWV3Qm94PSIwIDAgMjQgMjQiIHdpZHRoPSIyNCIgeG1sbnM9Imh0dHA6Ly93d3cudzMub3JnLzIwMDAvc3ZnIj4gICAgPHBhdGggZD0iTTE5IDYuNDFMMTcuNTkgNSAxMiAxMC41OSA2LjQxIDUgNSA2LjQxIDEwLjU5IDEyIDUgMTcuNTkgNi40MSAxOSAxMiAxMy40MSAxNy41OSAxOSAxOSAxNy41OSAxMy40MSAxMnoiLz4gICAgPHBhdGggZD0iTTAgMGgyNHYyNEgweiIgZmlsbD0ibm9uZSIvPjwvc3ZnPg==);
  101. }
  102. </style>
  103. </head>
  104. <body>
  105. <div class="container">
  106. <div class="logo"></div>
  107. <h1>Environment Tests</h1>
  108. <p>
  109. The following tests have been run to determine if Koseven will work in your environment. If any of the tests have failed, consult the <a href="https://koseven.dev/guide/ko7/install" target="_blank">documentation</a> for more information on how to correct the problem.
  110. </p>
  111. <?php $failed = FALSE ?>
  112. <table>
  113. <tbody>
  114. <tr>
  115. <th>PHP Version</th>
  116. <?php if (version_compare(PHP_VERSION, '7', '>=')): ?>
  117. <td class="pass">
  118. <?php echo PHP_VERSION ?>
  119. </td>
  120. <?php else: $failed = TRUE ?>
  121. <td class="fail">Koseven requires PHP 7 or newer, this version is
  122. <?php echo PHP_VERSION ?>.</td>
  123. <?php endif ?>
  124. </tr>
  125. <tr>
  126. <th>System Directory</th>
  127. <?php if (is_dir(SYSPATH) AND is_file(SYSPATH.'classes/KO7'.EXT)): ?>
  128. <td class="pass">
  129. <?php echo SYSPATH ?>
  130. </td>
  131. <?php else: $failed = TRUE ?>
  132. <td class="fail">The configured <code>system</code> directory does not exist or does not contain required files.</td>
  133. <?php endif ?>
  134. </tr>
  135. <tr>
  136. <th>Application Directory</th>
  137. <?php if (is_dir(APPPATH) AND is_file(APPPATH.'bootstrap'.EXT)): ?>
  138. <td class="pass">
  139. <?php echo APPPATH ?>
  140. </td>
  141. <?php else: $failed = TRUE ?>
  142. <td class="fail">The configured <code>application</code> directory does not exist or does not contain required files.</td>
  143. <?php endif ?>
  144. </tr>
  145. <tr>
  146. <th>Cache Directory</th>
  147. <?php if (is_dir(APPPATH) AND is_dir(APPPATH.'cache') AND is_writable(APPPATH.'cache')): ?>
  148. <td class="pass">
  149. <?php echo APPPATH.'cache/' ?>
  150. </td>
  151. <?php else: $failed = TRUE ?>
  152. <td class="fail">The <code><?php echo APPPATH.'cache/' ?></code> directory is not writable.</td>
  153. <?php endif ?>
  154. </tr>
  155. <tr>
  156. <th>Logs Directory</th>
  157. <?php if (is_dir(APPPATH) AND is_dir(APPPATH.'logs') AND is_writable(APPPATH.'logs')): ?>
  158. <td class="pass">
  159. <?php echo APPPATH.'logs/' ?>
  160. </td>
  161. <?php else: $failed = TRUE ?>
  162. <td class="fail">The <code><?php echo APPPATH.'logs/' ?></code> directory is not writable.</td>
  163. <?php endif ?>
  164. </tr>
  165. <tr>
  166. <th>PCRE UTF-8</th>
  167. <?php if ( ! @preg_match('/^.$/u', 'ñ')): $failed = TRUE ?>
  168. <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not been compiled with UTF-8 support.</td>
  169. <?php elseif ( ! @preg_match('/^\pL$/u', 'ñ')): $failed = TRUE ?>
  170. <td class="fail"><a href="http://php.net/pcre">PCRE</a> has not been compiled with Unicode property support.</td>
  171. <?php else: ?>
  172. <td class="pass">Pass</td>
  173. <?php endif ?>
  174. </tr>
  175. <tr>
  176. <th>SPL Enabled</th>
  177. <?php if (function_exists('spl_autoload_register')): ?>
  178. <td class="pass">Pass</td>
  179. <?php else: $failed = TRUE ?>
  180. <td class="fail">PHP <a href="http://www.php.net/spl">SPL</a> is either not loaded or not compiled in.</td>
  181. <?php endif ?>
  182. </tr>
  183. <tr>
  184. <th>Reflection Enabled</th>
  185. <?php if (class_exists('ReflectionClass')): ?>
  186. <td class="pass">Pass</td>
  187. <?php else: $failed = TRUE ?>
  188. <td class="fail">PHP <a href="http://www.php.net/reflection">reflection</a> is either not loaded or not compiled in.</td>
  189. <?php endif ?>
  190. </tr>
  191. <tr>
  192. <th>Filters Enabled</th>
  193. <?php if (function_exists('filter_list')): ?>
  194. <td class="pass">Pass</td>
  195. <?php else: $failed = TRUE ?>
  196. <td class="fail">The <a href="http://www.php.net/filter">filter</a> extension is either not loaded or not compiled in.</td>
  197. <?php endif ?>
  198. </tr>
  199. <tr>
  200. <th>Iconv Extension Loaded</th>
  201. <?php if (extension_loaded('iconv')): ?>
  202. <td class="pass">Pass</td>
  203. <?php else: $failed = TRUE ?>
  204. <td class="fail">The <a href="http://php.net/iconv">iconv</a> extension is not loaded.</td>
  205. <?php endif ?>
  206. </tr>
  207. <?php if (extension_loaded('mbstring')): ?>
  208. <tr>
  209. <th>Mbstring Not Overloaded</th>
  210. <?php if (ini_get('mbstring.func_overload') & MB_OVERLOAD_STRING): $failed = TRUE ?>
  211. <td class="fail">The <a href="http://php.net/mbstring">mbstring</a> extension is overloading PHP's native string functions.</td>
  212. <?php else: ?>
  213. <td class="pass">Pass</td>
  214. <?php endif ?>
  215. </tr>
  216. <?php endif ?>
  217. <tr>
  218. <th>Character Type (CTYPE) Extension</th>
  219. <?php if ( ! function_exists('ctype_digit')): $failed = TRUE ?>
  220. <td class="fail">The <a href="http://php.net/ctype">ctype</a> extension is not enabled.</td>
  221. <?php else: ?>
  222. <td class="pass">Pass</td>
  223. <?php endif ?>
  224. </tr>
  225. <tr>
  226. <th>URI Determination</th>
  227. <?php if (isset($_SERVER['REQUEST_URI']) OR isset($_SERVER['PHP_SELF']) OR isset($_SERVER['PATH_INFO'])): ?>
  228. <td class="pass">Pass</td>
  229. <?php else: $failed = TRUE ?>
  230. <td class="fail">Neither <code>$_SERVER['REQUEST_URI']</code>, <code>$_SERVER['PHP_SELF']</code>, or <code>$_SERVER['PATH_INFO']</code> is available.</td>
  231. <?php endif ?>
  232. </tr>
  233. </tbody>
  234. </table>
  235. <?php if ($failed === TRUE): ?>
  236. <div id="results" class="alert danger">
  237. <span class="icon icon-danger"></span> Koseven may not work correctly with your environment.
  238. </div>
  239. <?php else: ?>
  240. <div id="results" class="alert success">
  241. <span class="icon icon-success"></span> Your environment passed all requirements. Remove or rename the <code>install<?php echo EXT ?></code> file now.
  242. </div>
  243. <?php endif ?>
  244. <h1>Optional Tests</h1>
  245. <p>
  246. The following extensions are not required to run the Koseven core, but if enabled can provide access to additional classes.
  247. </p>
  248. <table>
  249. <tbody>
  250. <tr>
  251. <th>PECL HTTP Enabled</th>
  252. <?php if (extension_loaded('http')): ?>
  253. <td class="pass">Pass</td>
  254. <?php else: ?>
  255. <td class="fail">Koseven can use the <a href="http://php.net/http">http</a> extension for external requests.</td>
  256. <?php endif ?>
  257. </tr>
  258. <tr>
  259. <th>cURL Enabled</th>
  260. <?php if (extension_loaded('curl')): ?>
  261. <td class="pass">Pass</td>
  262. <?php else: ?>
  263. <td class="fail">Koseven can use the <a href="http://php.net/curl">cURL</a> extension for external requests.</td>
  264. <?php endif ?>
  265. </tr>
  266. <tr>
  267. <th>GD Enabled</th>
  268. <?php
  269. if (extension_loaded('gd') && version_compare(GD_VERSION, '2.0', '>=')):
  270. if (gd_info()['WebP Support'] && gd_info()['BMP Support']):
  271. ?>
  272. <td class="pass">Pass</td>
  273. <?php else: ?>
  274. <td class="warning">For full support we recommend installing GD with 'webp' and 'bmp' support.</td>
  275. <?php endif; ?>
  276. <?php else: ?>
  277. <td class="fail">Koseven can use <a href="http://php.net/gd">GD</a> >= v2 for Image manipulation</td>
  278. <?php endif ?>
  279. </tr>
  280. <tr>
  281. <th>Imagick Enabled</th>
  282. <?php
  283. if (
  284. extension_loaded('imagick') &&
  285. preg_match('/ImageMagick ([0-9]+\.[0-9]+\.[0-9]+)/', Imagick::getVersion()['versionString'], $api_version) === 1 &&
  286. version_compare($api_version[1], '6.9', '>=')
  287. ):
  288. if (Imagick::queryFormats('WEBP') && Imagick::queryFormats('BMP')):
  289. ?>
  290. <td class="pass">Pass</td>
  291. <?php else: ?>
  292. <td class="warning">For full support we recommend installing imagick with 'webp' and 'bmp' support.</td>
  293. <?php endif; ?>
  294. <?php else: ?>
  295. <td class="fail">Koseven can use <a href="http://php.net/imagick">Imagick</a> >= v6.9 for Image manipulation.</td>
  296. <?php endif ?>
  297. </tr>
  298. <tr>
  299. <th>MySQLi Enabled</th>
  300. <?php if (function_exists('mysqli_connect')): ?>
  301. <td class="pass">Pass</td>
  302. <?php else: ?>
  303. <td class="fail">Koseven can use the <a href="http://php.net/mysqli">MySQLi</a> extension to support MySQL databases.</td>
  304. <?php endif ?>
  305. </tr>
  306. <tr>
  307. <th>PDO Enabled</th>
  308. <?php if (class_exists('PDO')): ?>
  309. <td class="pass">Pass</td>
  310. <?php else: ?>
  311. <td class="fail">Koseven can use <a href="http://php.net/pdo">PDO</a> to support additional databases.</td>
  312. <?php endif ?>
  313. </tr>
  314. </tbody>
  315. </table>
  316. </div>
  317. </body>
  318. </html>