Giter Club home page Giter Club logo

opencart-distributor's Introduction

Module distributor for Opencart

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!

Requirements

  • Zip (sudo apt install zip)
  • PHP >= v7.0

Demo

$ cd proj_dir
$ oc-distribute

Install

$ 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

Settings

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:

Define all files of module

First rules what should edit its d_rules/files_to_distribute.php
Need to set all relative files pathes of module

Set rules of copying files

Configure rule d_rules/copy.php.

Base integration

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:

Replace format

'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'
        ],
    ...
]

You need to install.xml file in your 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

You need to install.php or install.sql file in your module?

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.

Archivator

Configure d_rules/archivator.php to final collector your module

Obfuscate some files(for safe licence)[optional]

Configure d_rules/obfuscator.php

Build

$ cd proj_dir //Without version, just in root
$ oc-distribute

Lifecycle

  1. Module files copy from base version to another versions.
    First handler is Distributor class, which copy files with replace content by rules.
    Second handler is AdditionalFiles class, which copy additional files with replace content by files_to_distribute[additional_files] rules.
    Second handler is InstallXML class, which create install.xml file by install_xml rules and automatically apply modifications.
  2. Module collected to dir specify in distributor_config[collection_folder] config, by default to dist
  3. Module's files obfuscated by obfuscator rules. (Optional)
  4. Create zip archive by archivator rules.

License

The MIT License (MIT)

opencart-distributor's People

Contributors

denis-kisel avatar

Watchers

 avatar  avatar

Forkers

ip-cam

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    ๐Ÿ–– Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. ๐Ÿ“Š๐Ÿ“ˆ๐ŸŽ‰

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google โค๏ธ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.