Skip to content

How to develop webino module

bacinsky edited this page Nov 24, 2014 · 7 revisions

HOME / How to develop / Webino module development

Prerequisites

It's required to have installed the Webino Development Kit, globally.
To install development toolkit, run:
sudo npm install webino-devkit -g --unsafe-perm
Read more on webino devkit installation
Read more on webino devkit usage

To understand the basic Webino concepts, you have to know something about its core modules.
Read more on webino core modules

Module setup

Setting up the development environment for a module.

Automatic

Useful when you want to develop your Webino modules instantly.

  1. Run webino mod:WebinoExample, replace "WebinoExample" with required module name.

Semi-automatic

Useful when you want to initialize cloned module repository.

  1. Run cd /var/www/public/webino/modules to go into modules directory
  • Clone required module repository and go to its directory
  • Run webino init

Building

Build of a module goes through all routine tasks needed before a release.

  1. Go to module directory
  • Run webino build to build the module

NOTE: Ideal for continuous integration.

Testing

Run following tasks as you wish to validate your module.

  1. Go to module directory
  • Run webino show to check module integration with the skeleton application
  • Run webino phpunit to run PHPUnit tests
  • Run webino test to run tests and analysis
  • Run webino selenium_test to run integration tests
    • OPTIONAL: To specify the testing URI set the uri option, e.g. grunt selenium_test -uri http://example.com/
    • NOTE: Selenium server will be started/stopped automatically, assuming /etc/init.d/selenium is available to run.

More informations

Requirements

Directory structure

Builded API documentation ------- ._api/
Build logs ---------------------- ._log/
Testing environment ------------- ._test/
Testing application --------------- ZendSkeletonApplication/
Module CLI tools ---------------- bin/
DI definition generator ----------- definition_generator.php
Module config ------------------- config/
                                    module.config.php
Module data assets -------------- data/
Generated DI definitions -------- di/
                                    definition.php
PHP files to include ------------ inc/
                                    functions.php
NetBeans IDE settings ----------- nbproject/
                                    project.properties
                                    project.xml
Module PHP source --------------- src/
                                    WebinoExample/
Module main class ------------------- Module.php
Module tests -------------------- tests/
Functional tests ------------------ functional/
                                      AppTest.php
Module tests resources ------------ resources/
Module test configs ----------------- config/
Testing app config -------------------- application.config.php
Module test config -------------------- module.config.php
                                      data/
Test resources DI definitions --------- di/
                                          definition.php
Test assets PHP source -------------- src/
                                        Application/
                                          Controller/
Testing app index controller--------------- IndexController.php
Module test view templates ---------- view/
                                        application/
                                          index/
                                            layout.html
Testing app autoloader -------------- init_autoloader.php
Acceptance tests ------------------ selenium/
                                      WebinoExample/
                                        HomeTest.php
                                      bootstrap.php
                                      phpunit.xml
Unit tests ------------------------ WebinoExample/
                                    bootstrap.php
                                    phpunit.xml
Third-party libraries ----------- vendor/
                                  .gitignore
Dependency manager config ------- composer.json
Automation tool file ------------ Gruntfile.js
                                  LICENSE
Standard module file ------------ Module.php
Automation tool config ---------- package.json
Documenter config --------------- phpdoc.xml
VCS pre-commit hook ------------- pre-commit
                                  README

NOTE: Replace "WebinoExample" with your namespace.
NOTE: Directory names starting with "._" are excluded from VCS.