-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathinstall
executable file
·45 lines (31 loc) · 890 Bytes
/
install
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
#!/usr/bin/php
<?php
echo "*** Installing Cowl.\n";
echo "** Moving app-directory\n";
# Move sample app directory
if ( ! is_dir('../app/') )
{
shell_exec("cp -R app-SAMPLE/ ../app/");
}
echo "** Moving .htaccess\n";
# Move .htaccess and index.php
if ( ! file_exists('../.htaccess') )
{
shell_exec("cp SAMPLE.htaccess ../.htaccess");
# Change RewriteBase / to the real base
echo "# Please enter the base web path of your app (almost always /): \n";
$BASE_PATH = trim(fgets(STDIN));
file_put_contents("../.htaccess", str_replace("RewriteBase /", "RewriteBase $BASE_PATH", file_get_contents("../.htaccess")));
}
echo "** Moving index.php\n";
if ( ! file_exists('../index.php') )
{
shell_exec("cp index.php-SAMPLE ../index.php");
}
# Make /cowl/cache writeable
if ( ! is_dir('cache/') )
{
shell_exec("mkdir cache");
}
shell_exec("chmod 0777 ./cache");
echo "*** Done.\n";