PageRenderTime 128ms CodeModel.GetById 109ms app.highlight 5ms RepoModel.GetById 1ms app.codeStats 1ms

/tools/compatibility.php

https://bitbucket.org/hanigamal/my-wave-framework
PHP | 442 lines | 286 code | 58 blank | 98 comment | 94 complexity | 7710a8001dd2fb53fabf7375efca1f6f MD5 | raw file
  1<?php
  2
  3/**
  4 * Wave Framework <http://www.waveframework.com>
  5 * System Compatibility Script
  6 *
  7 * This script checks if installation is ready for Wave Framework. It checks for PHP version, whether 
  8 * Apache mod_rewrite RewriteEngine or Nginx URL rewriting is turned on and whether filesystem can be 
  9 * written to.
 10 *
 11 * @package    Tools
 12 * @author     Kristo Vaher <kristo@waher.net>
 13 * @copyright  Copyright (c) 2012, Kristo Vaher
 14 * @license    GNU Lesser General Public License Version 3
 15 * @tutorial   /doc/pages/guide_tools.htm
 16 * @since      1.5.1
 17 * @version    3.2.0
 18 */
 19
 20// This initializes tools and authentication
 21require('.'.DIRECTORY_SEPARATOR.'tools_autoload.php');
 22
 23// Log is printed out in plain text format
 24header('Content-Type: text/html;charset=utf-8');
 25
 26?>
 27<!DOCTYPE html>
 28<html lang="en">
 29	<head>
 30		<title>Compatibility</title>
 31		<meta charset="utf-8">
 32		<meta name="viewport" content="width=device-width"/> 
 33		<link type="text/css" href="style.css" rel="stylesheet" media="all"/>
 34		<link rel="icon" href="../favicon.ico" type="image/x-icon"/>
 35		<link rel="icon" href="../favicon.ico" type="image/vnd.microsoft.icon"/>
 36		<meta content="noindex,nocache,nofollow,noarchive,noimageindex,nosnippet" name="robots"/>
 37		<meta http-equiv="cache-control" content="no-cache"/>
 38		<meta http-equiv="pragma" content="no-cache"/>
 39		<meta http-equiv="expires" content="0"/>
 40	</head>
 41	<body>
 42		<?php
 43		
 44		// Header
 45		echo '<h1>System compatibility</h1>';
 46		echo '<h4 class="highlight">';
 47		foreach($softwareVersions as $software=>$version){
 48			// Adding version numbers
 49			echo '<b>'.$software.'</b> ('.$version.') ';
 50		}
 51		echo '</h4>';
 52		
 53		echo '<h2>Reference</h2>';
 54		echo '<div class="border box">';
 55			echo '<span class="bold">SUCCESS</span> Everything is OK<br/>';
 56			echo '<span class="bold orange">WARNING</span> Some functionality might not work or is unavailable<br/>';
 57			echo '<span class="bold red">FAILURE</span> Wave Framework is not meant to work on this system';
 58		echo '</div>';
 59		
 60		echo '<h2>Details</h2>';
 61
 62		// Messages are stored in this array
 63		$log=array();
 64
 65		// PHP VERSION
 66			$phpVersion=phpversion();
 67			if($phpVersion){
 68				if(version_compare($phpVersion,'5.3.0')>=0){
 69					$log[]='<span class="bold">SUCCESS</span>: PHP is running version 5.3 or newer';
 70				} else {
 71					$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: PHP is running older version than 5.3, Wave Framework has not been tested on older versions of PHP';
 72				}
 73			} else {
 74				$log[]='<span class="bold orange">WARNING</span>: Unable to detect PHP version number, Wave Framework requires PHP version 5.3 or above';
 75			}
 76			
 77		// SHORT OPEN TAG
 78			if(function_exists('ini_get') && ini_get('short_open_tag')==1){
 79				$log[]='<span class="bold">SUCCESS</span>: PHP setting short_open_tag is enabled';
 80			} else {
 81				$log[]='<span class="bold orange">WARNING</span>: PHP setting short_open_tag is turned off, default View controller requires this to work properly, if this is not possible then edit /controllers/controller.view.php';
 82			}
 83
 84		// PDO
 85
 86			// PDO
 87			if(extension_loaded('PDO')){
 88				$log[]='<span class="bold">SUCCESS</span>: PDO is supported';
 89			} else {
 90				$log[]='<span class="bold orange">WARNING</span>: PDO PHP extension is not supported, this extension is used by default database class, if database connections are not used then this warning can be ignored';
 91			}
 92			
 93			// PDO MYSQL
 94			if(extension_loaded('pdo_mysql')){
 95				$log[]='<span class="bold">SUCCESS</span>: PDO MySQL is supported';
 96			} else {
 97				$log[]='<span class="bold orange">WARNING</span>: PDO MySQL PHP extension is not supported, MySQL connections could not be used, if MySQL is not used then this warning can be ignored';
 98			}
 99			
100			// PDO SQLITE
101			if(extension_loaded('pdo_sqlite')){
102				$log[]='<span class="bold">SUCCESS</span>: PDO SQLite is supported';
103			} else {
104				$log[]='<span class="bold orange">WARNING</span>: PDO SQLite PHP extension is not supported, SQLite connections could not be used, if SQLite is not used then this warning can be ignored';
105			}
106			
107			//PDO POSTGRESQL
108			if(extension_loaded('pdo_pgsql')){
109				$log[]='<span class="bold">SUCCESS</span>: PDO PostgreSQL is supported';
110			} else {
111				$log[]='<span class="bold orange">WARNING</span>: PDO PostgreSQL PHP extension is not supported, PostgreSQL connections could not be used, if PostgreSQL is not used then this warning can be ignored';
112			}
113			
114			//PDO ORACLE
115			if(extension_loaded('pdo_oci')){
116				$log[]='<span class="bold">SUCCESS</span>: PDO Oracle is supported';
117			} else {
118				$log[]='<span class="bold orange">WARNING</span>: PDO Oracle PHP extension is not supported, Oracle connections could not be used, if Oracle is not used then this warning can be ignored';
119			}
120			
121			//PDO MSSQL
122			if(extension_loaded('pdo_mssql')){
123				$log[]='<span class="bold">SUCCESS</span>: PDO MSSQL is supported';
124			} else {
125				$log[]='<span class="bold orange">WARNING</span>: PDO MSSQL PHP extension is not supported, MSSQL connections could not be used, if MSSQL is not used then this warning can be ignored';
126			}
127			
128		// ZLIB
129			if(extension_loaded('Zlib')){
130				$log[]='<span class="bold">SUCCESS</span>: Zlib is supported';
131			} else {
132				$log[]='<span class="bold orange">WARNING</span>: Zlib PHP extension is not supported, this is needed if output compression is used, but system turns it off automatically if extension is not present';
133			}
134			
135		// APC
136			if(extension_loaded('apc')){
137				$log[]='<span class="bold">SUCCESS</span>: APC is supported';
138			} else {
139				$log[]='<span class="bold orange">WARNING</span>: APC PHP extension is not supported, this is not required by Wave Framework, but can improve performance, if supported';
140			}
141			
142		// XML
143			if(extension_loaded('SimpleXML')){
144				$log[]='<span class="bold">SUCCESS</span>: SimpleXML is supported';
145			} else {
146				$log[]='<span class="bold orange">WARNING</span>: SimpleXML PHP extension is not supported, this is not required by Wave Framework, but it is needed if you wish to send direct XML procedure to API';
147			}
148			
149		// CURL AND URL OPEN
150			if(extension_loaded('curl')){
151				$log[]='<span class="bold">SUCCESS</span>: cURL is supported';
152			} else {
153				if(function_exists('ini_get') && ini_get('allow_url_fopen')==1){
154					$log[]='<span class="bold orange">WARNING</span>: cURL PHP extension is not supported, this is not required by Wave Framework, but is useful when making API requests to other systems that include POST data';
155				} else {
156					$log[]='<span class="bold orange">WARNING</span>: cURL PHP extension is not supported and allow_url_fopen setting is also off, these are not required by Wave Framework, but without them you cannot make API requests to other networks';
157				}
158			}
159			
160		// FILEINFO
161			if(extension_loaded('fileinfo')){
162				$log[]='<span class="bold">SUCCESS</span>: Fileinfo is supported';
163			} else {
164				$log[]='<span class="bold orange">WARNING</span>: Fileinfo PHP extension is not supported, this is used by File Handler, if this is not available then system detects all downloadable files as application/octet-stream';
165			}
166			
167		// MCRYPT
168			if(extension_loaded('mcrypt')){
169				$log[]='<span class="bold">SUCCESS</span>: Mcrypt is supported';
170			} else {
171				$log[]='<span class="bold orange">WARNING</span>: Mcrypt PHP extension is not supported, this is optional and used only when API requests are made with www-crypt-input and www-crypt-output requests';
172			}
173			
174		// ZIP
175			if(extension_loaded('Zip')){
176				$log[]='<span class="bold">SUCCESS</span>: Zip is supported';
177			} else {
178				$log[]='<span class="bold orange">WARNING</span>: Zip PHP extension is not supported, this is required by automatic update script, this warning can be ignored if update script is not used';
179			}
180			
181		// FTP
182			if(extension_loaded('ftp')){
183				$log[]='<span class="bold">SUCCESS</span>: FTP is supported';
184			} else {
185				$log[]='<span class="bold orange">WARNING</span>: FTP PHP extension is not supported, this is required by automatic update script, this warning can be ignored if update script is not used';
186			}
187			
188		// FTP
189			if(extension_loaded('memcache')){
190				$log[]='<span class="bold">SUCCESS</span>: Memcache is supported';
191			} else {
192				$log[]='<span class="bold orange">WARNING</span>: Memcache is not supported, this can be ignored if you do not intend to support memcache as a caching layer';
193			}
194			
195		// GD LIBRARY
196			if(extension_loaded('gd')){
197				$log[]='<span class="bold">SUCCESS</span>: GD Graphics Library is supported';
198			} else {
199				$log[]='<span class="bold orange">WARNING</span>: GD Graphics Library extension is not supported, this is required for dynamically loaded images, this warning can be ignored if dynamic loading is not used';
200			}
201			
202		// APACHE AND NGINX
203			if(strpos($_SERVER['SERVER_SOFTWARE'],'Apache')!==false){
204				$log[]='<span class="bold">SUCCESS</span>: Apache server is used';
205				
206				// APACHE URL REWRITES
207					if(file_exists('.htaccess')){
208						// .htaccess in this directory attempts to rewrite compatibility.php into compatibility.php?mod_rewrite_enabled and if this is <span class="bold">SUCCESS</span>ful then mod_rewrite must work
209						if(isset($_GET['rewrite_enabled'])){
210							$log[]='<span class="bold">SUCCESS</span>: Apache mod_rewrite extension is supported';
211						} else {
212							$log[]='<span class="bold orange">WARNING</span>: Apache mod_rewrite extension is not supported, Index Gateway and mod_rewrite functionality will not work, this warning can be ignored if Index Gateway is not used';
213						}
214					} else {
215						$log[]='<span class="bold orange">WARNING</span>: Cannot test if mod_rewrite and RewriteEngine are enabled, .htaccess file is missing from /tools/ folder, this warning can be ignored if Index Gateway is not used';
216					}
217					
218				// HTACCESS
219					if(file_exists('..'.DIRECTORY_SEPARATOR.'.htaccess')){
220						$log[]='<span class="bold">SUCCESS</span>: .htaccess file is present';
221					} else {
222						$log[]='<span class="bold orange">WARNING</span>: .htaccess file is missing from root folder, Index Gateway and rewrite functionality will not work, this warning can be ignored if Index Gateway is not used';
223					}
224					
225			} else if(strpos($_SERVER['SERVER_SOFTWARE'],'nginx')!==false){
226				$log[]='<span class="bold">SUCCESS</span>: Nginx server is used';
227
228				// NGINX URL REWRITES
229				// This only works if the /nginx.conf location setting for compatibility script is used in Nginx server configuration
230				if(isset($_GET['rewrite_enabled'])){
231					$log[]='<span class="bold">SUCCESS</span>: Nginx HttpRewriteModule is supported';
232				} else {
233					$log[]='<span class="bold orange">WARNING</span>: Nginx HttpRewriteModule is not supported, Index Gateway and rewrite functionality will not work, this warning can be ignored if Index Gateway is not used';
234				}
235				
236			} else {
237				$log[]='<span class="bold orange">WARNING</span>: Your server is not Apache or Nginx, Index Gateway will not work, this warning can be ignored if Index Gateway is not used';
238			}
239			
240			
241		// FILESYSTEM
242
243			// FILESYSTEM ROOT
244			// No files should really be saved in this folder, but it might be necessary
245			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'test.tmp','1')){
246				$log[]='<span class="bold">SUCCESS</span>: /filesystem/ is writable';
247				unlink('../filesystem/test.tmp');
248			} else {
249				$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: /filesystem/ is not writable';
250			}
251			
252			// FILESYSTEM CACHE ROOT
253			// No files should really be saved in this folder, but it might be necessary
254			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'test.tmp','1')){
255				$log[]='<span class="bold">SUCCESS</span>: /filesystem/cache/ is writable';
256				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'test.tmp');
257			} else {
258				$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: /filesystem/cache/ is not writable';
259			}
260			
261			// FILESYSTEM IMAGE CACHE
262			// All dynamically loaded image cache is stored here
263			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'test.tmp','1')){
264				$log[]='<span class="bold">SUCCESS</span>: /filesystem/cache/images/ is writable';
265				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'images'.DIRECTORY_SEPARATOR.'test.tmp');
266			} else {
267				$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: /filesystem/cache/images/ is not writable';
268			}
269			
270			// FILESYSTEM OUTPUT CACHE
271			// All API response cache is stored here
272			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'output'.DIRECTORY_SEPARATOR.'test.tmp','1')){
273				$log[]='<span class="bold">SUCCESS</span>: /filesystem/cache/output/ is writable';
274				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'output'.DIRECTORY_SEPARATOR.'test.tmp');
275			} else {
276				$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: /filesystem/cache/output/ is not writable';
277			}
278			
279			// FILESYSTEM RESOURCE CACHE
280			// All loaded resources (JavaScript, CSS and so on) in their compressed and/or minified format are cached here
281			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'test.tmp','1')){
282				$log[]='<span class="bold">SUCCESS</span>: /filesystem/cache/resources/ is writable';
283				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'resources'.DIRECTORY_SEPARATOR.'test.tmp');
284			} else {
285				$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: /filesystem/cache/resources/ is not writable';
286			}
287			
288			// FILESYSTEM CUSTOM CACHE
289			// Cache created through Factory cache methods
290			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'custom'.DIRECTORY_SEPARATOR.'test.tmp','1')){
291				$log[]='<span class="bold">SUCCESS</span>: /filesystem/cache/custom/ is writable';
292				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'custom'.DIRECTORY_SEPARATOR.'test.tmp');
293			} else {
294				$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: /filesystem/cache/custom/ is not writable';
295			}
296			
297			// FILESYSTEM CACHE TAGS
298			// Cache created through Factory cache methods
299			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'tags'.DIRECTORY_SEPARATOR.'test.tmp','1')){
300				$log[]='<span class="bold">SUCCESS</span>: /filesystem/cache/tags/ is writable';
301				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'cache'.DIRECTORY_SEPARATOR.'tags'.DIRECTORY_SEPARATOR.'test.tmp');
302			} else {
303				$log[]='<span class="bold red"><span class="bold red">FAILURE</span></span>: /filesystem/cache/tags/ is not writable';
304			}
305			
306			// FILESYSTEM MESSENGER
307			// All the certificates and encryption keys should be stored here
308			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
309			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'messenger'.DIRECTORY_SEPARATOR.'test.tmp','1')){
310				$log[]='<span class="bold">SUCCESS</span>: /filesystem/messenger/ is writable';
311				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'messenger'.DIRECTORY_SEPARATOR.'test.tmp');
312			} else {
313				$log[]='<span class="bold orange">WARNING</span>: /filesystem/messenger/ is not writable, this warning can be ignored if state messenger is not used';
314			}
315			
316			// FILESYSTEM SESSIONS
317			// User session cookies
318			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'sessions'.DIRECTORY_SEPARATOR.'test.tmp','1')){
319				$log[]='<span class="bold">SUCCESS</span>: /filesystem/sessions/ is writable';
320				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'sessions'.DIRECTORY_SEPARATOR.'test.tmp');
321			} else {
322				$log[]='<span class="bold orange">WARNING</span>: /filesystem/sessions/ is not writable, user session storage is unavailable and session storage will not work, if used';
323			}
324			
325			// FILESYSTEM KEYS
326			// All the certificates and encryption keys should be stored here
327			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
328			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'keys'.DIRECTORY_SEPARATOR.'test.tmp','1')){
329				$log[]='<span class="bold">SUCCESS</span>: /filesystem/keys/ is writable';
330				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'keys'.DIRECTORY_SEPARATOR.'test.tmp');
331			} else {
332				$log[]='<span class="bold orange">WARNING</span>: /filesystem/keys/ is not writable, this warning can be ignored if API keys and security features are not used';
333			}
334			
335			// FILESYSTEM LIMITER
336			// All the limiter data (requests per IP and so on) is stored here and is used by Limiter to check for possible denial of service attacks from IP's
337			// Automatically blocked IP's are also stored here
338			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'limiter'.DIRECTORY_SEPARATOR.'test.tmp','1')){
339				$log[]='<span class="bold">SUCCESS</span>: /filesystem/limiter/ is writable';
340				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'limiter'.DIRECTORY_SEPARATOR.'test.tmp');
341			} else {
342				$log[]='<span class="bold orange">WARNING</span>: /filesystem/limiter/ is not writable, this warning can be ignored if Limiter is not used by Index Gateway';
343			}
344			
345			// FILESYSTEM LOG
346			// This stores all Logger generated log files
347			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR.'test.tmp','1')){
348				$log[]='<span class="bold">SUCCESS</span>: /filesystem/logs/ is writable';
349				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'logs'.DIRECTORY_SEPARATOR.'test.tmp');
350			} else {
351				$log[]='<span class="bold orange">WARNING</span>: /filesystem/logs/ is not writable, this warning can be ignored if performance logging is not used by Index Gateway';
352			}
353			
354			// FILESYSTEM ERRORS
355			// This stores all Logger generated log files
356			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'errors'.DIRECTORY_SEPARATOR.'test.tmp','1')){
357				$log[]='<span class="bold">SUCCESS</span>: /filesystem/errors/ is writable';
358				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'errors'.DIRECTORY_SEPARATOR.'test.tmp');
359			} else {
360				$log[]='<span class="bold orange">WARNING</span>: /filesystem/errors/ is not writable, it is recommended to keep this folder writable, since it is useful for debugging purposes';
361			}
362			
363			// FILESYSTEM SESSION TOKENS
364			// This stores all API sessions and tokens per API profile
365			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'tokens'.DIRECTORY_SEPARATOR.'test.tmp','1')){
366				$log[]='<span class="bold">SUCCESS</span>: /filesystem/tokens/ is writable';
367				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'tokens'.DIRECTORY_SEPARATOR.'test.tmp');
368			} else {
369				$log[]='<span class="bold orange">WARNING</span>: /filesystem/tokens/ is not writable, this warning can be ignored if API keys and security features are not used';
370			}
371			
372			// FILESYSTEM TEMPORARY FILES
373			// Various temporary files should be stored here
374			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
375			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'test.tmp','1')){
376				$log[]='<span class="bold">SUCCESS</span>: /filesystem/tmp/ is writable';
377				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'tmp'.DIRECTORY_SEPARATOR.'test.tmp');
378			} else {
379				$log[]='<span class="bold orange">WARNING</span>: /filesystem/tmp/ is not writable, this warning can be ignored if your system does not write anything to that folder';
380			}
381			
382			// FILESYSTEM USERDATA
383			// Various user uploaded files should be stored here
384			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
385			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'userdata'.DIRECTORY_SEPARATOR.'test.tmp','1')){
386				$log[]='<span class="bold">SUCCESS</span>: /filesystem/userdata/ is writable';
387				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'userdata'.DIRECTORY_SEPARATOR.'test.tmp');
388			} else {
389				$log[]='<span class="bold orange">WARNING</span>: /filesystem/userdata/ is not writable, this warning can be ignored if your system does not write anything to that folder';
390			}
391			
392			// BACKUPS
393			// System backups are stored here
394			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
395			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'backups'.DIRECTORY_SEPARATOR.'test.tmp','1')){
396				$log[]='<span class="bold">SUCCESS</span>: /filesystem/backups/ is writable';
397				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'backups'.DIRECTORY_SEPARATOR.'test.tmp');
398			} else {
399				$log[]='<span class="bold orange">WARNING</span>: /filesystem/backups/ is not writable, this means that default update script cannot store backup archives when used';
400			}
401			
402			// STATIC
403			// Static uploads are stored here
404			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
405			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'static'.DIRECTORY_SEPARATOR.'test.tmp','1')){
406				$log[]='<span class="bold">SUCCESS</span>: /filesystem/static/ is writable';
407				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'static'.DIRECTORY_SEPARATOR.'test.tmp');
408			} else {
409				$log[]='<span class="bold orange">WARNING</span>: /filesystem/static/ is not writable, this warning can be ignored if you do not intend to write anything in static folder';
410			}
411			
412			// UPDATES
413			// Update archives are stored here
414			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
415			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'updates'.DIRECTORY_SEPARATOR.'test.tmp','1')){
416				$log[]='<span class="bold">SUCCESS</span>: /filesystem/updates/ is writable';
417				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'updates'.DIRECTORY_SEPARATOR.'test.tmp');
418			} else {
419				$log[]='<span class="bold orange">WARNING</span>: /filesystem/updates/ is not writable, this means that default update script cannot store update archives when used';
420			}
421			
422			// FILESYSTEM DATA
423			// Various databases (like SQLite) should be stored here
424			// Wave Framework itself does not use this folder and this should be used by developer, if necessary
425			if(file_put_contents('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'test.tmp','1')){
426				$log[]='<span class="bold">SUCCESS</span>: /filesystem/data/ is writable';
427				unlink('..'.DIRECTORY_SEPARATOR.'filesystem'.DIRECTORY_SEPARATOR.'data'.DIRECTORY_SEPARATOR.'test.tmp');
428			} else {
429				$log[]='<span class="bold orange">WARNING</span>: /filesystem/data/ is not writable, this warning can be ignored if your system does not write anything to that folder';
430			}
431
432		// Printing out the log
433		echo '<p>';
434		echo implode('</p><p>',$log);
435		echo '</p>';
436
437		// Footer
438		echo '<p class="footer small bold">Generated at '.date('d.m.Y h:i').' GMT '.date('P').' for '.$_SERVER['HTTP_HOST'].'</p>';
439	
440		?>
441	</body>
442</html>