-
Notifications
You must be signed in to change notification settings - Fork 0
Update to v6.5.0
Ensure you have complete backups of your current scripts and database before proceeding.
Download and install the latest version of the client application.
- Docker Setup: If using a Docker container, pull the latest image and restart the container.
-
Manual Setup: Download the updated scripts and overwrite the
corefolder on your server.
-
Migrate base constants from the
config.phpscript to theconfig.jsonfile. -
CRITICAL: Do not forget to restrict access to
config.jsonin your.htaccessfile. -
Update constant names to use the new
MELBIS_prefix. -
Remove constants:
MELBIS_VERSION_CACHEandMELBIS_OBFUSCATE_URL. -
Rename constant:
SHOP_CHARSETtoMELBIS_CHARSET. -
Add new constants:
-
MELBIS_ROOT(/) -
MELBIS_CACHE(True) -
MELBIS_BUILD(1) -
MELBIS_ENGINE(MyISAM) -
MELBIS_ENGINE_TEMP(Memory)
Connect to your database and run the following SQL commands:
ALTER TABLE {DBNICK}_store_comment_block ADD COLUMN from_ip6 CHAR(45) DEFAULT NULL AFTER from_ip, ADD COLUMN to_ip6 CHAR(45) DEFAULT NULL AFTER to_ip;
UPDATE {DBNICK}_store_comment_block SET from_ip6 = INET_NTOA(from_ip), to_ip6 = INET_NTOA(to_ip);
ALTER TABLE {DBNICK}_store_comment_block DROP COLUMN from_ip, DROP COLUMN to_ip, CHANGE COLUMN from_ip6 from_ip CHAR(45) NOT NULL DEFAULT '', CHANGE COLUMN to_ip6 to_ip CHAR(45) NOT NULL DEFAULT '';
ALTER TABLE {DBNICK}_user_log ADD COLUMN user_ip6 CHAR(45) DEFAULT NULL AFTER user_ip;
UPDATE {DBNICK}_user_log SET user_ip6 = INET_NTOA(user_ip);
ALTER TABLE {DBNICK}_user_log DROP COLUMN user_ip, CHANGE COLUMN user_ip6 user_ip CHAR(45) NOT NULL DEFAULT '';
ALTER TABLE {DBNICK}_store_comment ADD COLUMN user_ip6 CHAR(45) DEFAULT NULL AFTER user_ip;
UPDATE {DBNICK}_store_comment SET user_ip6 = INET_NTOA(user_ip);
ALTER TABLE {DBNICK}_store_comment DROP COLUMN user_ip, CHANGE COLUMN user_ip6 user_ip CHAR(45) NOT NULL DEFAULT '';
ALTER TABLE {DBNICK}_store_comment_vote ADD COLUMN user_ip6 CHAR(45) DEFAULT NULL AFTER user_ip;
UPDATE {DBNICK}_store_comment_vote SET user_ip6 = INET_NTOA(user_ip);
ALTER TABLE {DBNICK}_store_comment_vote DROP COLUMN user_ip, CHANGE COLUMN user_ip6 user_ip CHAR(45) NOT NULL DEFAULT '';
ALTER TABLE {DBNICK}_trans_origin ADD is_update TINYINT UNSIGNED DEFAULT '0' NOT NULL AFTER is_active;
CREATE TABLE {DBNICK}_tmp_trans_origin (
id INT UNSIGNED DEFAULT '0' NOT NULL,
user_id INT UNSIGNED DEFAULT NULL,
UNIQUE (user_id, id)
) ENGINE = {ENGINE} DEFAULT CHARSET={CHARSET};
ALTER TABLE {DBNICK}_oper ADD load_max_1 DECIMAL(10,2) DEFAULT '0' NOT NULL AFTER allow_to;
ALTER TABLE {DBNICK}_oper ADD load_max_5 DECIMAL(10,2) DEFAULT '0' NOT NULL AFTER load_max_1;
ALTER TABLE {DBNICK}_oper ADD load_max_15 DECIMAL(10,2) DEFAULT '0' NOT NULL AFTER load_max_5;
ALTER TABLE {DBNICK}_self_key_value ADD prefix CHAR(100) DEFAULT '' NOT NULL AFTER code;Launch the client application and update the following permissions under System/Users -> Operations and Permissions (Система/Пользователи -> Операции и права доступа):
-
EDIT: Load list (
SCRIPTS_TREE_LOAD). -
ADD: Update structural data (
SCRIPTS_STRUCTURE_REFRESH).
-
ADD: Setup settings language (
SERVER_SET_LANG).
Navigate to the Development Environment and apply the following changes to your scripts:
-
Update standard modules: Ensure
melbis.php,melbis_inc_logic.php, and other demonstration scripts are refreshed. -
Error Logging: Place an empty
error.savefile in the site root to track errors (logs will be written to_error_back.logand_error_front.log). CRITICAL: Deny web access to these log files in.htaccess. -
Entry Point: Delete
lazy.php. You can now useindex.phpas a single entry point.
-
Superglobals: Replace legacy globals (
$gGet,$gPost,$gFiles,$gServer) with native PHP superglobals ($_GET,$_POST,$_FILES,$_SERVER). -
Includes: Replace
MELBIS_INCwithrequire_once. -
Global Variables: Remove old globals and replace them with the new configuration constants:
-
$gSitePath→MELBIS_PATH -
$gUseCache→MELBIS_CACHE -
$gTemplate→MELBIS_TEMPLATE -
$gBuild→MELBIS_BUILD -
IP Handling: IPv6 addresses are now stored in a text field. Review your custom code and remove conversions like
INET_NTOA,INET_ATON,ip2long, andlong2ipwhere necessary. -
XML Module: The parameter order has changed:
Xml($mFile, $mShopCharset = MELBIS_CHARSET, $mXMLCharset = 'UTF-8', $mPutTitle = true, $mStandAlone = false).
- Remove
require_once('config.php');. - Remove the legacy method
MELBIS()->ParseLazy(). - Remove
$gSession. Session variable access is now handled via the Parser. RetainMELBIS()->DefineSession('MELBIS_SHOP');and refactor dependent scripts accordingly. - Update parser variable order to the new syntax:
MELBIS()->Run($entry_point, $entry_param);.
-
The parser is now executed via
MELBIS()->(defined inmelbis.php). You may still use the global$gParserif you define it manually in your scripts. -
Namespaces: Note the new namespaced class instantiations:
-
$gDb = new \Melbis\MelbisShop\MySql('MELBIS_halt'); -
$gParser = new \Melbis\MelbisShop\Parser('MELBIS_halt', $gDb); -
New Methods: Utilize
MELBIS()->LanguageSet()andMELBIS()->TemplateSet()for setting the language and template groups. -
New Methods: Convenient configuration of cron tasks directly in the development environment:
MELBIS()->CronAdd()andMELBIS()->CronRun(). -
Update Method:
MELBIS()->DefineSelfVars(Prefix)- now you can set a prefix for a custom constant loaded into the globalMELBIS()->gVarsarray. -
Order Modules: Calculation and order creation modules (e.g.,
MELBIS_INC_LOGIC_order_calc,MELBIS_INC_LOGIC_order_edit) now require theUserIDto be passed as a separate variable (e.g.,...($mUserId, $mVersion)). Previously, this was passed inside$mVersion['user_id']. -
Order Modules: Added/changed call parameters for
MELBIS_INC_LOGIC_order_calc,MELBIS_INC_LOGIC_order_edit, instead of sub-array '_', they are in the first-level array:parameters,parent_version_id,order_id,order_version_id,order_code,order_date_time -
Template Keys: Update system keys in your templates:
-
{PHPSESSID}→{PHP_SESS_ID} -
{LASTMODIFY}→{LAST_MODIFY} -
(Also verify:
{LANG},{ROOT},{BUILD},{TEMPLATE},{TIME_ZONE})
-
Table Locking: Method parameters have changed. For
MELBIS()->SqlTableUnlock($mLine, $mTables)andMELBIS()->SqlTableLock($mLine, $mTables), you must now pass the call line and table names including the{DBNICK}prefix. - APCu Requirement: Table modification timestamps are now cached in APCu memory. Ensure the PHP APCu extension is installed and that PHP is running as an Apache module or FPM to avoid data loss. (You can use the official [apc.php script](https://github.com/krakjoe/apcu/blob/master/apc.php) for monitoring).
-
Modification Tracking: Standard methods (
SqlUpdate,SqlInsert,SqlDelete) track changes automatically. If altering data via customMELBIS()->SqlQuery()calls, you must manually log the changes usingMELBIS()->SqlTableChange($mLine, $mTables, $mCheckAffect = false). - Configure any necessary parameters for the Trick and Smart caching modules.
- Rename module cache reset procedures:
MELBIS()->ResetModuleCache()→MELBIS()->UnitCacheReset(). -
Automated Maintenance: Enable automatic cache clearing with
MELBIS()->CacheClearAuto(), or (highly recommended) set up a cron job using: MELBIS()->CacheSmartReset()MELBIS()->CacheBaseClear()MELBIS()->CacheTrickClear()MELBIS()->CacheStaticClear()
If you wish to migrate your tables to the InnoDB format (which unlocks transaction methods like SqlBegin, SqlCommit, SqlRollback, and SqlTransactionActive), you can run the following automated script:
// Require main logic unit
require_once('units/melbis.php');
$command = "SHOW TABLE STATUS";
$store = MELBIS()->SqlSelect(__LINE__, $command);
foreach ($store as $row) {
// Skip non-MyISAM tables
if ($row['Engine'] != 'MyISAM') {
continue;
}
$table = $row['Name'];
// Check if the table matches the database prefix
if (strpos($table, MELBIS_DB_NICK) === 0) {
$table = substr($table, strlen(MELBIS_DB_NICK));
$command = "ALTER TABLE {DBNICK}$table ENGINE = InnoDB";
MELBIS()->SqlQuery(__LINE__, $command);
}
}- 🌍 Official Website: melbis.com
- 💰 Prices & Licenses: melbis.com/price
- 📀 Installation Packages: melbis.com/download
- 💻 GitHub Releases: melbis/melbis-shop/releases
- 🐳 Docker Hub: melbis/melbis-shop
- 📦 Packagist (Composer): melbis/melbis-shop
- 📢 Telegram News: @melbis_shop
- 📺 YouTube Tutorials: Melbis-Shop Channel
- 🖼️ Screenshots: View gallery
- 📖 Documentation: Installation & Setup
- 🏆 Flagship Example Store: Astroscope.com.ua (A live example of a high-load store powered by Melbis Shop)
Built for speed, scaled for business.