root/dev/install/install_step2.php @ 461

Revision 461, 4.6 KB (checked in by kovell, 11 years ago)

Fixes: eve-dev changed to eve-id, recursive clearup scripts recurse more than one level, defunct admin sync removed.

Line 
1<?php
2if(!$installrunning)
3{header('Location: index.php');die();}
4$stoppage = false;
5
6// graphics
7echo '<div class="block-header2">Graphics</div>';
8if (function_exists('imagecreatefromstring'))
9{
10        echo 'GD is available.<br/>';
11        if (!function_exists('imagecreatetruecolor'))
12        {
13                echo 'Your GD is outdated though and will cause problems, please contact your system administrator to upgrade to GD 2.0 or higher.<br/>';
14        }
15        echo 'Now let\'s see if you got the FreeType library needed for painting TrueType .ttf fonts onto images<br/>';
16        if (function_exists('imagettftext'))
17        {
18                echo 'I found FreeType support, this is needed by the signature mod. Good!<br/>';
19        }
20        else
21        {
22                echo 'Unfortunately I was unable to locate FreeType support so you cannot use all available signatures. :(<br/>';
23        }
24}
25else
26{
27        echo 'GD is NOT available.<br/>The Killboard will be unable to output character portraits or corporation logos, please speak with your system administrator to install GD 2.0 or higher.<br/>';
28        echo 'You can continue the installation but the Killboard might not run smoothly.<br/>';
29}
30
31// directorys
32echo '<br/><div class="block-header2">Directory structure</div>';
33function checkdir($dir)
34{
35        if (!file_exists($dir))
36        {
37                echo 'Creating '.$dir.' for you...<br/>';
38                mkdir($dir);
39                chmod($dir, 0777);
40        }
41        if (is_writeable($dir))
42        {
43                echo 'Directory '.$dir.' is there and writeable, excellent.<br/>';
44        }
45        else
46        {
47                echo 'I cannot write into '.$dir.', you need to fix that for me before you can continue.<br/>';
48                echo 'Please issue a "chmod 777 '.$dir.'" on the commandline inside of this directory<br/>';
49                global $stoppage;
50                $stoppage = true;
51        }
52}
53
54if (is_writeable('../cache'))
55{
56        echo 'Cache directory is writeable, testing for subdirs now:<br/>';
57        checkdir('../cache/cache');
58        checkdir('../cache/api');
59        checkdir('../cache/corps');
60        checkdir('../cache/data');
61        checkdir('../cache/map');
62        checkdir('../cache/mails');
63        checkdir('../cache/portraits');
64        checkdir('../cache/templates_c');
65}
66else
67{
68        $stoppage = true;
69        echo 'I cannot write into ../cache, you need to fix that for me before you can continue.<br/>';
70        echo 'Please issue a "chmod 777 ../cache" and "chmod 777 ../cache/*" on the commandline inside of this directory<br/>';
71}
72
73echo '<br/><div class="block-header2">Config</div>';
74if (!file_exists('../kbconfig.php'))
75{
76        $stoppage = true;
77        echo 'Please create the file \'kbconfig.php\' and make it writeable by the webserver.<br/>';
78}
79elseif (is_writeable('../kbconfig.php'))
80{
81        echo 'The config file \'../kbconfig.php\' is there and writeable, excellent!<br/>';
82}
83else
84{
85        $stoppage = true;
86        echo 'I cannot write into ../kbconfig.php, you need to fix that for me before you can continue.<br/>';
87        echo 'Please issue a "chmod 777 ../kbconfig" on the commandline inside of this directory<br/>';
88}
89
90echo '<br/><div class="block-header2">Connectivity</div>';
91// connectivity
92$url = 'http://www.eve-id.net/logo.png';
93if (ini_get('allow_url_fopen'))
94{
95        echo 'allow_url_fopen is on, I will try to fetch a testpage from "'.$url.'".<br/>';
96        if (count(file($url)))
97        {
98                echo 'Seems to be ok, I got the file.<br/>';
99        }
100        else
101        {
102                echo 'I could not get the file this might be a firewall related issue or the eve-dev server is not available.<br/>';
103        }
104}
105else
106{
107        include('../common/includes/class.http.php');
108        echo 'allow_url_fopen is disabled, nethertheless I will try a socket connect now.<br/>';
109
110        $http = new http_request($url);
111        if ($http->get_content())
112        {
113                echo 'Seems to be ok, I got the file.<br/>';
114        }
115        else
116        {
117                echo 'I could not get the file. This might be a firewall related issue or the eve-dev server is not available.<br/>';
118        }
119}
120
121if (file_exists('../kbconfig.php'))
122{
123        include('../kbconfig.php');
124        if(defined('KB_SITE') && defined('DB_HOST') && defined('DB_USER')
125                && defined('DB_NAME') && defined('DB_PASS'))
126        {
127                $conn = mysql_connect(DB_HOST.':'.DB_PORT, DB_USER, DB_PASS);
128                mysql_select_db(DB_NAME);
129                $res = mysql_query("SELECT * FROM kb3_config WHERE cfg_site = '".KB_SITE."'", $conn);
130                if($res && mysql_num_rows($res))
131                {
132                        echo '<br/><div class="block-header2">EVE Development Killboard Installed</div>';
133                        echo 'EVE Development Killboard is already installed. Proceeding with install may damage the existing installation.<br/>';
134                        echo 'If you do not wish to install then remove the /install directory from your EVE Development Killboard installation to ensure it is not run again.';
135                }
136        }
137}
138
139?>
140
141<?php if ($stoppage)
142{
143        return;
144}?>
145<p><a href="?step=<?php echo ($_SESSION['state']+1); ?>">Next Step</a></p>
Note: See TracBrowser for help on using the browser.