File Structure

modules:
.   'Vendor_Module':
.   .   version: '1.0.0'
.   .   description: 'Module Short Description'
.   .   categories: [ 'Catalog', 'Shipping' ]
.   .   require:
.   .   .   module:
.   .   .   .   'Req_Module': '1.0.0'
.   .   .   phpext: [ 'xmlrpc', 'soap' ]
.   .   .   class: [ 'PHPUnit' ]
.   .   before_bootstrap: 'Callback::method'
.   .   auto_use: [ all, bootstrap, layout, views ]
.   .   autoload: 'lib'
.   .   default_config:
.   .   .   'config_tree'
.   .   observe:
.   .   .   - [ 'Event::name', 'Callback::method' ]
.   .   crontab:
.   .   .   - [ '* * * * *', 'Callback::method' ]
.   .   provides:
.   .   .   themes:
.   .   .   .   'Theme_Name':
.   .   .   .   .   area: 'FCom_Frontend'
.   .   .   .   .   layout: 'layout.yml'      .   .   .   .   [1] Layout file
.   .   override:
.   .   .   class:
.   .   .   .   'Original_Class_Name': 'New_Class_Name'

.   .   areas:
.   .   .   'FCom_(Admin|Frontend|ApiServer|Cron|Test)':
.   .   .   .   'Area specific options'
.   .   .   .   routing:
.   .   .   .   .   - [ '(get|post|any)', '/route/path', 'Controller.action' ]
.   .   .   .   observe:
.   .   .   .   .   - [ 'Event::name', 'Callback::method' ]
  1. Layout File

Areas

Collecting

// scan in 'modules' subfolder modules in structure of Vendor/Module
BModuleRegistry::i()->scan(__DIR__.'/modules/*/*');

// manually declare a module
BModuleRegistry::i()->addModule('My_Module', $manifestDataArray);

Bootstrapping modules

// Run bootstrap for the modules (including auto manifest processes and bootstrap methods)
BModuleRegistry::i()->bootstrap();
// run module migration scripts
BMigrate::i()->migrateModules();
            
<?php

class My_Module_Migrate extends BClass
{
    public function install__0_1_0()
    {
        //... DDL statements for installation
    }

    public function upgrade__0_1_0__0_1_1()
    {
        //... DDL statements for upgrade
    }
}
comments powered by Disqus