Its framework for resolve task: Develops a module on one version and integrates to another versions automatic! This framework is extension for Opencart Quick Deploy framework.
Only for linux systems!
- Zip (
sudo apt install zip
) - PHP >= v7.0
$ cd proj_dir
$ oc-distribute
$ mkdir -p ~/Download/opencart-distributor && git clone https://github.com/denis-kisel/opencart-distributor ~/Download/opencart-distributor
$ cd ~/Download/opencart-distributor && sudo bash install.sh
# Init configs
$ cd proj_dir
$ oc-dist-init
First of all you need to deploy some versions of OC by Opencart Quick Deploy framework and configure distributor_config.php
.
Then you need to edit some rules for specific your module:
First rules what should edit its d_rules/files_to_distribute.php
Need to set all relative files pathes of module
Configure rule d_rules/copy.php
.
Edit rules:
d_rules/controller.php
d_rules/view.php
d_rules/model.php
For example: you need to integrate base code of controller file from 2000 version to 3000 version. You can replace some code in d_rules/controller.php
file:
'range_versions' => [
'admin' => [
['search', 'replace'],
...
],
'catalog' => [
['search', 'replace'],
...
]
]
#Example
'3000:3020' => [
...
'catalog' => [
[
'ControllerModule{class_name}',
'ControllerExtensionModule{class_name}'
],
...
]
#Also available serach by regex
#just start search with "[regex]"
#Setted modifies: sU
'3000:3020' => [
...
'catalog' => [
[
'[regex]Contrller(.*)Module',
'Controller${1}Module'
],
...
]
This file will automatic generated!
First of all you need to set config modification_code
in distributor_config.php
Then you can set modifications in d_rules/install_xml.php
file
Just put install.php
to root of developing site. For example: you have versions: 2000, 2200, 2300. Your developing version is 2000. Its meat what your file will be by path your_site/2000/install.php
Then you can config distribute file in d_rules/install_php.php
.
Config install.sql
by analogy.
Configure d_rules/archivator.php
to final collector your module
Configure d_rules/obfuscator.php
$ cd proj_dir //Without version, just in root
$ oc-distribute
- Module files copy from base version to another versions.
First handler isDistributor
class, which copy files with replace content by rules.
Second handler isAdditionalFiles
class, which copy additional files with replace content byfiles_to_distribute[additional_files]
rules.
Second handler isInstallXML
class, which create install.xml file byinstall_xml
rules and automatically apply modifications. - Module collected to dir specify in
distributor_config[collection_folder]
config, by default todist
- Module's files obfuscated by
obfuscator
rules. (Optional) - Create
zip
archive byarchivator
rules.
The MIT License (MIT)