Skip to content

Commit

Permalink
Updated Mailbeez Installer to 4.6
Browse files Browse the repository at this point in the history
  • Loading branch information
webchills committed Dec 4, 2022
1 parent 8b4b122 commit 2ae2946
Show file tree
Hide file tree
Showing 13 changed files with 291 additions and 243 deletions.
2 changes: 1 addition & 1 deletion UPLOAD/mailhive/cloudbeez/cloudloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ class mailbeez_installer_dummy
{
function __construct()
{
$this->version = 4.21; // float value
$this->version = 4.6; // float value

}
}
Expand Down
6 changes: 3 additions & 3 deletions UPLOAD/mailhive/cloudbeez/cloudloader/languages/english.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
define('MAILBEEZ_INSTALL_SYSTEM_CONFIRM', 'Agree & Continue');
define('MAILBEEZ_INSTALL_CANCEL', 'Cancel');

define('MAILBEEZ_INSTALL_SYSTEM_CHECK_PHP', 'PHP version 5.6 or newer required');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_PHP', 'PHP version 5.6 .. 8.1 supported');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_SAFEMODE', 'Safe mode PHP setting is not enabled');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_CURL', 'cURL PHP Extension is required');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_TEST_CONNECTION', 'Test connection to CloudBeez server');
Expand All @@ -30,8 +30,8 @@
define('MAILBEEZ_INSTALL_INSTALL', 'Installation progress...');
define('MAILBEEZ_INSTALL_INSTALL_STEP1', 'Requesting package information...');
define('MAILBEEZ_INSTALL_INSTALL_STEP2', 'Downloading application files...');
define('MAILBEEZ_INSTALL_INSTALL_STEP3', 'Backing up...');
define('MAILBEEZ_INSTALL_INSTALL_STEP4', 'Checking Permissions...');
define('MAILBEEZ_INSTALL_INSTALL_STEP3', 'Creating backup...');
define('MAILBEEZ_INSTALL_INSTALL_STEP4', 'Checking permissions...');
define('MAILBEEZ_INSTALL_INSTALL_STEP5', 'Unpacking application files...');
define('MAILBEEZ_INSTALL_INSTALL_STEP6', 'Finishing installation...');

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3><i class="fa fa-info-circle" style="opacity: 0.75"></i> Information</h3>
</p>

<p>
The installer/updater creates a backup of <code><?php echo MH_ROOT_PATH; ?></code> and stores it as zip-archive into
The updater creates a backup of <code><?php echo MH_ROOT_PATH; ?></code> and stores it as zip-archive into
<code>/<?php echo MH_ROOT_PATH; ?>cloudbeez/backup</code>.
</p>

Expand Down
4 changes: 2 additions & 2 deletions UPLOAD/mailhive/cloudbeez/cloudloader/languages/german.php
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@
define('MAILBEEZ_INSTALL_SYSTEM_CONFIRM', 'Einverstanden & Weiter');
define('MAILBEEZ_INSTALL_CANCEL', 'Abbrechen');

define('MAILBEEZ_INSTALL_SYSTEM_CHECK_PHP', 'PHP Version 5.6 oder h&ouml;her erforderlich');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_PHP', 'PHP Version 5.6 .. 8.1 wird unterstützt');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_SAFEMODE', 'Safe mode PHP Setting muss deaktiviert sein');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_CURL', 'cURL PHP Extension ist erforderlich');
define('MAILBEEZ_INSTALL_SYSTEM_CHECK_TEST_CONNECTION', 'Test Verbindung zum CloudBeez-Server aufbauen');
Expand All @@ -30,7 +30,7 @@
define('MAILBEEZ_INSTALL_INSTALL', 'Grund-Installation in Arbeit...');
define('MAILBEEZ_INSTALL_INSTALL_STEP1', 'Fordere Paket Informationen an...');
define('MAILBEEZ_INSTALL_INSTALL_STEP2', 'Lade Anwendungs-Dateien...');
define('MAILBEEZ_INSTALL_INSTALL_STEP3', 'Backup...');
define('MAILBEEZ_INSTALL_INSTALL_STEP3', 'Erstelle Backup...');
define('MAILBEEZ_INSTALL_INSTALL_STEP4', 'Untersuche Dateirechte...');
define('MAILBEEZ_INSTALL_INSTALL_STEP5', 'Entpacke Anwendungs-Dateien...');
define('MAILBEEZ_INSTALL_INSTALL_STEP6', 'Abschluss der Grund-Installation...');
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -28,7 +28,7 @@ <h3><i class="fa fa-info-circle" style="opacity: 0.75"></i> Information</h3>
</p>

<p>
Es wird ein Sicherheitskopie des <code><?php echo MH_ROOT_PATH; ?></code> Verzeichnisses erstellt und unterhalb
Bei Updates wird eine Sicherheitskopie des <code><?php echo MH_ROOT_PATH; ?></code> Verzeichnisses erstellt und unterhalb
<code>/<?php echo MH_ROOT_PATH; ?>cloudbeez/backup</code> als Zip-Archive abgelegt.
</p>

Expand Down
15 changes: 11 additions & 4 deletions UPLOAD/mailhive/cloudbeez/cloudloader/php/Cloudloader.php
Original file line number Diff line number Diff line change
Expand Up @@ -68,8 +68,8 @@ public function __construct()
$this->unzipDirectory = PATH_INSTALL . '/cloudloader/work';
$this->backupDirectory = PATH_INSTALL . '/backup';
$this->glob_pattern = '*/catalog/mailhive';
$this->exclude_overwrite = array('');
$this->exclude_overwrite_package = array('');
$this->exclude_overwrite = array();
$this->exclude_overwrite_package = array();


$this->logFile = PATH_INSTALL . '/cloudloader/install.log';
Expand Down Expand Up @@ -433,7 +433,7 @@ protected function onInstallStep()
$this->debug_output("ERROR package hash file not found\n");
}


$this->deleteSessionVar('mailbeez_package_installer_workpath');
$this->deleteSessionVar('mailbeez_installer_workpath');
$this->deleteSessionVar('mailbeez_installer_backup_location');
$this->deleteSessionVar('mailbeez_installer_backup_location_dir');
Expand Down Expand Up @@ -545,8 +545,15 @@ public function log()
$args = func_get_args();
$message = array_shift($args);

if (is_array($message))

if (is_array($message)) {
unset($message['changelog']);
$message = implode(PHP_EOL, $message);
}

if (count($args) === 0) {
$message = str_replace('%', '%%', $message);
}

$filename = $this->logFile;
$stream = fopen($filename, 'a');
Expand Down
19 changes: 12 additions & 7 deletions UPLOAD/mailhive/cloudbeez/cloudloader/php/CloudloaderBase.php
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,7 @@ function smartCopy($source, $dest, $options = array('folderPermission' => 0766,
} else {
$result = copy($source, $__dest);
//chmod($__dest, $options['filePermission']);
@chmod($__dest, fileperms($source));
chmod($__dest, fileperms($source));
}
} else {
$result = true;
Expand Down Expand Up @@ -207,8 +207,10 @@ function smartCopy($source, $dest, $options = array('folderPermission' => 0766,
function check_in_array($input, $check_array)
{
foreach ($check_array as $check_element) {
if (stripos($input, $check_element) !== false) {
return true;
if ($check_element != '') {
if (stripos($input, $check_element) !== false) {
return true;
}
}
}
return false;
Expand Down Expand Up @@ -328,6 +330,7 @@ function deploy_files($workpath, $target_dir, $exclude_overwrite, $glob_path = '
continue;
}
$source_path = $source_directory . '/' . $filename;
$source_path = str_replace('//', '/', $source_path);

$this->debug_output("trying to copy $source_path -> $target_path$filename\n");

Expand Down Expand Up @@ -361,7 +364,7 @@ function deploy_files($workpath, $target_dir, $exclude_overwrite, $glob_path = '
}


if (sizeof($this->write_test_failed_file) > 0) {
if (is_array($this->write_test_failed_file) && sizeof($this->write_test_failed_file) > 0) {
throw new Exception(sprintf(MAILBEEZ_INSTALL_ERROR_FILE_NOT_WRITEABLE, sizeof($this->write_test_failed_file), implode('<li>', array_slice($this->write_test_failed_file, 0, 10))));
return false;
}
Expand Down Expand Up @@ -410,7 +413,7 @@ function backup($backup_source_folder, $backup_directory, $backup_file, $exclude

function Zip($source, $destination, $exclude_files_array = array(), $exclude_dir_array = array())
{
global $GLOBALS;
// global $GLOBALS;
// $this->debug_output( "$source, $destination";
$GLOBALS['exclude_files_array'] = $exclude_files_array;
$GLOBALS['exclude_dir_array'] = $exclude_dir_array;
Expand Down Expand Up @@ -472,7 +475,9 @@ function cleanLegacyImageCache($cache_dir)
$dir = opendir($cache_dir);

if (!$dir) {
closedir($dir);
if (!is_bool($dir)) {
closedir($dir);
}
return false;
}

Expand Down Expand Up @@ -518,7 +523,7 @@ public function drop($file)

function ZipPreAddCallBack($p_event, &$p_header)
{
global $GLOBALS;
// global $GLOBALS;

// print_r($p_header);
// print_r($GLOBALS['exclude_dir_array'] );
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@
// updating
$cloudloader->exclude_overwrite = array('catalog/mailhive/common/images/default_emailheader.gif');
}
$cloudloader->exclude_overwrite_package = array('');
$cloudloader->exclude_overwrite_package = array(); // PHP8.1 - if array('') all files are excluded? see \CloudloaderBase::check_in_array

$cloudloader->run();

Expand Down
42 changes: 21 additions & 21 deletions UPLOAD/mailhive/cloudbeez/cloudloader/php/PlatformObserver.php
Original file line number Diff line number Diff line change
Expand Up @@ -26,14 +26,14 @@ function mh_define($const, $value)
mh_define('MH_ROOT_PATH', 'mailhive/');

if (function_exists('zen_redirect')) {
define('MH_PLATFORM', 'zencart');
mh_define('MH_PLATFORM', 'zencart');
// sorry zencart - didn't had the time to migrate everything to your DB-Class (might come later - its cool)
// http://www.zen-cart.com/wiki/index.php/Developers_-_Porting_modules_from_osC
require_once(MH_DIR_FS_CATALOG . MH_ROOT_PATH . 'cloudbeez/cloudloader/php/osc_database.php');


} elseif (function_exists('gm_get_conf')) {
define('MH_PLATFORM', 'gambio');
mh_define('MH_PLATFORM', 'gambio');
if (!function_exists('xtc_date_short')) {
require_once(DIR_FS_INC . 'xtc_date_short.inc.php');
}
Expand All @@ -42,12 +42,12 @@ function mh_define($const, $value)
}
include_once(MH_DIR_FS_CATALOG . 'release_info.php');
//echo $gx_version;
define('MH_PLATFORM_GAMBIO', substr($gx_version, 1, 1));
mh_define('MH_PLATFORM_GAMBIO', substr($gx_version, 1, 1));

} elseif (defined('PROJECT_VERSION_PLAIN')) {
// mercari no longer supported
/*
define('MH_PLATFORM', 'mercari');
mh_define('MH_PLATFORM', 'mercari');
if (!function_exists('date_short')) {
require_once(DIR_FS_INC . 'inc.date_short.php');
}
Expand All @@ -58,15 +58,15 @@ function mh_define($const, $value)
require_once(MH_DIR_FS_CATALOG . 'mailhive/cloudbeez/cloudloader/php/osc_database.php');
$db_link = tep_db_connect();
// require_once(MH_DIR_FS_CATALOG . 'mailhive/common/classes/oscommerce/split_page_results.php');
define('MH_PLATFORM_MERCARI', PROJECT_VERSION_TYPE . ' ' . PROJECT_VERSION_PLAIN);
mh_define('MH_PLATFORM_MERCARI', PROJECT_VERSION_TYPE . ' ' . PROJECT_VERSION_PLAIN);
if (is_object($message_stack)) {
$messageStack = $message_stack;
}
*/
} elseif (function_exists('xtc_redirect')) {
define('MH_PLATFORM', 'xtc');
mh_define('MH_PLATFORM', 'xtc');
if (!function_exists('xtc_date_short')) {
require_once(DIR_FS_INC . 'xtc_date_short.inc.php');
}
Expand All @@ -83,43 +83,43 @@ function xtc_parse_input_field_data($data, $parse)
}

// matches xtcModfied and modified
define('MH_PLATFORM_XTCM', preg_match('/odified/', PROJECT_VERSION));
define('MH_PLATFORM_XTC_SEO', preg_match('/commerce:SEO/', PROJECT_VERSION));
define('MH_PLATFORM_XTC_ECB', preg_match('/eComBASE/', PROJECT_VERSION));
mh_define('MH_PLATFORM_XTCM', preg_match('/odified/', PROJECT_VERSION));
mh_define('MH_PLATFORM_XTC_SEO', preg_match('/commerce:SEO/', PROJECT_VERSION));
mh_define('MH_PLATFORM_XTC_ECB', preg_match('/eComBASE/', PROJECT_VERSION));
} elseif (defined('FILENAME_ADVANCED_MENU')) {
define('MH_PLATFORM', 'digistore');
mh_define('MH_PLATFORM', 'digistore');
} elseif (preg_match('/CRE Loaded/', PROJECT_VERSION) || preg_match('/Loaded/', PROJECT_VERSION)) {
// CRE Loaded PCI B2B
define('MH_PLATFORM', 'creloaded');
mh_define('MH_PLATFORM', 'creloaded');

if (preg_match('/CRE Loaded PCI B2B/', PROJECT_VERSION) || preg_match('/Loaded Commerce B2B/', PROJECT_VERSION)) {
define('MH_PLATFORM_CRE', 'B2B');
mh_define('MH_PLATFORM_CRE', 'B2B');
} else {
define('MH_PLATFORM_CRE', '');
mh_define('MH_PLATFORM_CRE', '');
}

} else {
define('MH_PLATFORM', 'oscommerce');
mh_define('MH_PLATFORM', 'oscommerce');

if (function_exists('tep_get_version')) {
define('MH_PLATFORM_OSC', (float)tep_get_version());
mh_define('MH_PLATFORM_OSC', (float)tep_get_version());
} else {
define('MH_PLATFORM_OSC', '2.2');
mh_define('MH_PLATFORM_OSC', '2.2');
}

if (MH_PLATFORM_OSC > 2.2) {
mh_define('MH_PLATFORM_OSC_23', true);
}
define('MH_PLATFORM_OSCMAX_25', preg_match('/osCmax v2.5/', PROJECT_VERSION));
mh_define('MH_PLATFORM_OSCMAX_25', preg_match('/osCmax v2.5/', PROJECT_VERSION));

define('MH_PLATFORM_TRUELOADED', preg_match('/Trueloaded/', PROJECT_VERSION));
mh_define('MH_PLATFORM_TRUELOADED', preg_match('/Trueloaded/', PROJECT_VERSION));

/*
// WP Online Store
if (defined('WPOLS_PLUGINS_DIR')) {
define('MH_PLATFORM_OSC_WPOS', PROJECT_VERSION);
define('MH_FORM_METHOD', 'post');
define('MH_PAGE_NAME', 'pages');
mh_define('MH_PLATFORM_OSC_WPOS', PROJECT_VERSION);
mh_define('MH_FORM_METHOD', 'post');
mh_define('MH_PAGE_NAME', 'pages');
$post = mh_cfg('MAILBEEZ_MAILHIVE_WPOLS_PAGE_ID');
if (mh_cfg('MH_CONTEXT') == 'STORE') {
Expand Down
Loading

0 comments on commit 2ae2946

Please sign in to comment.