Example #1
0
function showMessage($msg = 'OK', $color = 32)
{
    if (\CB\Util\getOS() == "LINUX") {
        echo "[" . $color . "m" . $msg . "" . PHP_EOL;
    } else {
        echo $msg . PHP_EOL;
    }
}
Example #2
0
    $cfg = array();
}
// we include config_platform that will load config.ini if exist and will define $cfg variable
// If config.ini doesnt exist it wil raise an exception: Can't load config file
try {
    require_once $cbHome . 'httpsdocs/config_platform.php';
} catch (\Exception $e) {
    //config.ini could not exist
    //we don't need to do anything here because this script will create confing.ini in result
    //we just use values form config.ini as defaults, if it exists
}
// detect working mode (interactive or not)
require_once \CB\LIB_DIR . 'install_functions.php';
$cfg = \CB\Install\cliLoadConfig(isset($options) ? $options : null);
\CB\Install\displaySystemNotices();
if (\CB\Util\getOS() != "WIN") {
    //ask for apache user and set ownership for some folders
    $cfg['apache_user'] = readParam('apache_user', $cfg['apache_user']);
    if (\CB\Cache::get('RUN_SETUP_INTERACTIVE_MODE')) {
        setOwnershipForApacheUser($cfg);
    }
}
//init prefix
$cfg['prefix'] = readParam('prefix', $cfg['prefix']);
//init db config
$tryInitDBConfig = 0;
do {
    initDBConfig($cfg);
    $tryInitDBConfig++;
    if ($tryInitDBConfig > 3) {
        trigger_error("ERROR: Cannot configure database connections !!!", E_USER_ERROR);