Skip to content
This repository has been archived by the owner on Dec 13, 2022. It is now read-only.

Commit

Permalink
Cp7 m24 migrate the installer and update (#6281)
Browse files Browse the repository at this point in the history
* refactor(install): fix upgrade process

change MySQL library of php requirements and add a check for release notes file

Resolves CP7M-24

* refactor(install): add missing folder and cfg mock

add missing folder `www/install/tmp` and add mock of `www/install/install.conf.php`

Resolves CP7M-24

* refactor(install): Fix smarty and smarty-plugins loading

Resolves problem for unknown smarty plugin. Loads composer-managed smarty.
  • Loading branch information
victorvassilev authored May 15, 2018
1 parent e6139eb commit bb6f78c
Show file tree
Hide file tree
Showing 6 changed files with 42 additions and 3 deletions.
3 changes: 3 additions & 0 deletions .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -4,3 +4,6 @@ nbproject/
/vendor/
composer.lock
GPL_LIB/SmartyCache/*
www/install/tmp/*
!www/install/tmp/.gitkeep
www/install/install.conf.php
29 changes: 29 additions & 0 deletions www/install/install.conf.dist.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,29 @@
<?php
$conf_centreon['centreon_dir'] = "/usr/share/centreon/";
$conf_centreon['centreon_etc'] = "/etc/centreon/";
$conf_centreon['centreon_dir_www'] = "/usr/share/centreon/www/";
$conf_centreon['centreon_dir_rrd'] = "/var/lib/centreon";
$conf_centreon['centreon_log'] = "/var/log/centreon";
$conf_centreon['centreon_varlib'] = "/var/lib/centreon";
$conf_centreon['centreon_group'] = "centreon";
$conf_centreon['centreon_user'] = "centreon";
$conf_centreon['rrdtool_dir'] = "/usr/bin/rrdtool";
$conf_centreon['apache_user'] = "apache";
$conf_centreon['apache_group'] = "apache";
$conf_centreon['mail'] = "/bin/mail";
$conf_centreon['broker_user'] = "centreon-broker";
$conf_centreon['broker_group'] = "centreon-broker";
$conf_centreon['broker_etc'] = "/etc/centreon-broker";
$conf_centreon['broker_init_script'] = "cbd";
$conf_centreon['monitoring_user'] = "centreon-engine";
$conf_centreon['monitoring_group'] = "centreon-engine";
$conf_centreon['monitoring_etc'] = "/etc/centreon-engine";
$conf_centreon['monitoring_init_script'] = "centengine";
$conf_centreon['monitoring_binary'] = "/usr/sbin/centengine";
$conf_centreon['monitoring_varlog'] = "/var/log/centreon-engine";
$conf_centreon['plugin_dir'] = "/usr/lib/nagios/plugins";
$conf_centreon['centreon_engine_connectors'] = "/usr/lib64/centreon-connector";
$conf_centreon['centreon_engine_lib'] = "/usr/lib64/centreon-engine";
$conf_centreon['centreonbroker_cbmod'] = "/usr/lib64/nagios/cbmod.so";
$conf_centreon['centreon_plugins'] = "/usr/lib/centreon/plugins";
?>
6 changes: 5 additions & 1 deletion www/install/step_upgrade/step3.php
Original file line number Diff line number Diff line change
Expand Up @@ -48,7 +48,11 @@
if (is_file('../RELEASENOTES.html')) {
$contents = "<div id='releasenotes'></div>";
} else {
$contents = "<textarea cols='100' rows='30' readonly>".file_get_contents('../RELEASENOTES')."</textarea>";
$releasenotesContent = '';
if (file_exists('../RELEASENOTES')) {
$releasenotesContent = file_get_contents('../RELEASENOTES');
}
$contents = "<textarea cols='100' rows='30' readonly>".$releasenotesContent."</textarea>";
}

$template->assign('step', STEP_NUMBER);
Expand Down
4 changes: 3 additions & 1 deletion www/install/steps/functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -22,11 +22,13 @@ function isSqlComment($str)
function getTemplate($dir)
{
$libDir = __DIR__ . '/../../../GPL_LIB';
require_once $libDir . '/Smarty/libs/Smarty.class.php';
$smartyDir = __DIR__ . '/../../../vendor/smarty/smarty/';
require_once $smartyDir . 'libs/Smarty.class.php';
$template = new \Smarty();
$template->compile_dir = $libDir . '/SmartyCache/compile';
$template->config_dir = $libDir . '/SmartyCache/config';
$template->cache_dir = $libDir . '/SmartyCache/cache';
$template->plugins_dir[] = $libDir . "/smarty-plugins";
$template->template_dir = $dir;
$template->caching = 0;
$template->compile_check = true;
Expand Down
1 change: 1 addition & 0 deletions www/install/tmp/.gitkeep
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@

2 changes: 1 addition & 1 deletion www/install/var/phplib
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
MySQL:mysql
MySQL:pdo_mysql
GD:gd
LDAP:ldap
XML Writer:xmlwriter
Expand Down

0 comments on commit bb6f78c

Please sign in to comment.