-
-
Notifications
You must be signed in to change notification settings - Fork 3
/
Copy pathwp-install.php
44 lines (38 loc) · 1.58 KB
/
wp-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
<?php
require __DIR__ . '/config.php';
#var_dump( $_POST );
if ( isset( $_POST['gonow'] ) ) {
if ( isset( $_POST['vhosts'] ) ) {
$vhosts_create = new \VSP\Laragon\Modules\VHosts\Create();
$vhosts_create->create_new( $_POST['vhosts'] );
$vhost_db = new \VSP\Laragon\Modules\VHosts\Read_DB( host_db_file( $vhosts_create->host_id() ) );
if ( $vhost_db->is_readable() ) {
$wp_config = $_POST['wp_config'];
$wp_config['domains_list'] = $vhost_db->domains_list( false );
$wp_config['apache_host'] = $vhost_db->host_config( 'apache', 'live' );
$wp_config['nginx_host'] = $vhost_db->host_config( 'nginx', 'live' );
$main_config = $_POST['wpinstall'];
$main_config['document_root'] = $vhost_db->document_root();
$main_config['host_id'] = $vhosts_create->host_id();
$clone = ( isset( $_POST['wp_clone'] ) ) ? $_POST['wp_clone'] : false;
$wp_install = new \VSP\Laragon\Modules\WP_Install\Install( $wp_config, $main_config, $clone );
echo $vhosts_create->alerts();
echo $wp_install->alerts();
}
}
}
require ABSPATH . '/parts/wp-install/list.php';
?>
<form method="post" style="display: none;">
<?php
include ABSPATH . '/parts/wp-install/vhost.php';
include ABSPATH . '/parts/wp-install/wp.php';
include ABSPATH . '/parts/wp-install/mysql-form.php';
include ABSPATH . '/parts/vhosts/apache.php';
include ABSPATH . '/parts/vhosts/nginx.php';
?>
<button type="submit" class="btn-success btn mt-3" name="gonow">Clone / Install</button>
</form>
<?php
template( 'footer' );
?>