Skip to content

Commit 3443931

Browse files
committed
- reorganized the installer - part 1
1 parent 6444a95 commit 3443931

File tree

4 files changed

+19
-10
lines changed

4 files changed

+19
-10
lines changed
Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@
2828
EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
2929
*/
3030

31-
class installer extends installer_base {
31+
class installer_dist extends installer_base {
3232

3333
function configure_postfix($options = '')
3434
{

install/install.php

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -57,13 +57,14 @@
5757
require_once('lib/installer_base.lib.php');
5858

5959
//** Get distribution identifier
60-
$distname = get_distname();
60+
$dist = get_distname();
6161

62-
if($distname == '') die('Linux Dustribution or Version not recognized.');
62+
if($dist['id'] == '') die('Linux Dustribution or Version not recognized.');
6363

6464
//** Include the distribution specific installer class library and configuration
65-
include_once('dist/lib/'.$distname.'.lib.php');
66-
include_once('dist/conf/'.$distname.'.conf.php');
65+
if(is_file('dist/lib/'.strtolower($dist['name']).'.lib.php')) include_once('dist/lib/'.strtolower($dist['name']).'.lib.php');
66+
include_once('dist/lib/'.$dist['id'].'.lib.php');
67+
include_once('dist/conf/'.$dist['id'].'.conf.php');
6768

6869
//** Install logfile
6970
define('ISPC_LOG_FILE', '/var/log/ispconfig_install.log');

install/lib/install.lib.php

Lines changed: 13 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -65,19 +65,25 @@ function get_distname() {
6565
if(file_exists('/etc/debian_version')) {
6666

6767
if(trim(file_get_contents('/etc/debian_version')) == '4.0') {
68-
$distname = 'debian40';
68+
$distname = 'Debian';
69+
$distver = '4.0';
70+
$distid = 'debian40';
6971
swriteln("Operating System: Debian 4.0 or compatible\n");
7072
}
7173
if(trim(file_get_contents('/etc/debian_version')) == 'lenny/sid') {
72-
$distname = 'debian40';
74+
$distname = 'Debian';
75+
$distver = 'Lenny/Sid';
76+
$distid = 'debian40';
7377
swriteln("Operating System: Debian Lenny/Sid or compatible\n");
7478
}
7579
}
7680

7781
//** OpenSuSE
7882
elseif(file_exists("/etc/SuSE-release")) {
7983
if(stristr(file_get_contents('/etc/SuSE-release'),'11.0')) {
80-
$distname = 'opensuse110';
84+
$distname = 'openSUSE';
85+
$distver = '11.0';
86+
$distid = 'opensuse110';
8187
swriteln("Operating System: openSUSE 11.0 or compatible\n");
8288
}
8389
}
@@ -89,7 +95,9 @@ function get_distname() {
8995
$content = file_get_contents('/etc/redhat-release');
9096

9197
if(stristr($content,'Fedora release 9 (Sulphur)')) {
92-
$distname = 'fedora9';
98+
$distname = 'Fedora';
99+
$distver = '9';
100+
$distid = 'fedora9';
93101
swriteln("Operating System: Fedora 9 or compatible\n");
94102
}
95103

@@ -98,7 +106,7 @@ function get_distname() {
98106
die('unrecognized linux distribution');
99107
}
100108

101-
return $distname;
109+
return array('name' => $distname, 'version' => $distver, 'id' => $distid);
102110
}
103111

104112
function sread() {

0 commit comments

Comments
 (0)