-
Notifications
You must be signed in to change notification settings - Fork 19
/
Copy pathcli_htdocs_install.php
65 lines (50 loc) · 2.99 KB
/
cli_htdocs_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
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
<?php
$in_install = true;
$config_file = __DIR__.'/commons/config.inc';
if(file_exists($config_file)) {
require_once(__DIR__.'/commons/config.inc');
$web_documentroot = $apache_documentroot;
} else {
if($argc < 2)
die("Usage: cli_htdocs_install.php <web_root>");
$web_documentroot = $argv[1];
}
system("mkdir -p $web_documentroot/ezadmin");
system("mkdir -p $web_documentroot/ezmanager");
system("mkdir -p $web_documentroot/ezplayer");
# places web files in the webspace
system("cp -rp ".__DIR__."/ezadmin/htdocs/* $web_documentroot/ezadmin");
system("cp -rp ".__DIR__."/ezmanager/htdocs/* $web_documentroot/ezmanager");
system("cp -rp ".__DIR__."/ezplayer/htdocs/* $web_documentroot/ezplayer");
system("mkdir -p $web_documentroot/ezadmin/commons && mkdir -p $web_documentroot/ezmanager/commons && mkdir -p $web_documentroot/ezplayer/commons ");
system("cp -rp ".__DIR__."/commons/htdocs/* $web_documentroot/ezadmin/commons");
system("cp -rp ".__DIR__."/commons/htdocs/* $web_documentroot/ezmanager/commons");
system("cp -rp ".__DIR__."/commons/htdocs/* $web_documentroot/ezplayer/commons");
$web_file = file_get_contents($web_documentroot . "/ezadmin/install.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezadmin/install.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezadmin/index.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezadmin/index.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezmanager/index.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezmanager/index.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezmanager/distribute.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezmanager/distribute.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezmanager/inscription.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezmanager/inscription.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezmanager/recorder/index.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezmanager/recorder/index.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezmanager/recorder/logs.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezmanager/recorder/logs.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezplayer/index.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezplayer/index.php", $web_file);
$web_file = file_get_contents($web_documentroot . "/ezplayer/infos.php");
$web_file = str_replace("!PATH", __DIR__, $web_file);
file_put_contents($web_documentroot . "/ezplayer/infos.php", $web_file);
echo "Copied htdocs files to $web_documentroot" . PHP_EOL;