-
Notifications
You must be signed in to change notification settings - Fork 0
/
install.php
45 lines (34 loc) · 1.2 KB
/
install.php
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
<?php
/**
* @author Kevin Newesil <[email protected]>
* @version 0.1-BETA
*
* @todo get icons for file extentions and show file extention as fileTypeIcon
*/
// Start session and enable error reporting to all for now as it's debugging version.
session_start();
error_reporting( -1 );
if( empty( $_POST ) ) {
die( file_get_contents( 'html/install/index.html' ) );
}
$vhost = $_POST['vhost'];
$phpinfo = $_POST['phpinfo'];
$timezone = $_POST['timezone'];
$project = $_POST['foldername'];
unset($_POST);
if( !is_dir( 'config' ) ) { if(!mkdir( 'config' )) { die('error creating config folder'); } }
$fh = fopen( 'config/config.php', 'w' );
$data = '<?php
return array(
/* Define base paths for the project to run in. */
\'base\' => $_SERVER[\'DOCUMENT_ROOT\'] . DIRECTORY_SEPARATOR,
\'project\' => \'' . $project . '\',
/* Set the default dates and timezone configuration correct. */
\'timezone\' => \'' . $timezone . '\',
\'phpinfo\' => ' . $phpinfo . ',
/* Location of vhost file to fetch server aliases instead of localhost links */
\'vhost\' => \'' . $vhost . '\',
);';
fwrite( $fh, $data );
fclose( $fh );
header( 'location:http://localhost' );