Console tools

Contents...

Webasyst framework allows executing several service commands by means of command line interface (CLI). Such service commands are useful for developers of custom products: apps and plugins.

To execute CLI commands, you must have appropriate access level to your web server with installed Webasyst framework; e.g., console (terminal) or SSH. For executing a service command, PHP interpreter must be called with file name wa.php specified, which is located in framework's root directory.

php wa.php createApp app_id parameters

Creates a basic set of directories and files required for the development of a new app inside wa-apps/[app_id]/ directory.

Parameters

Example

php wa.php createApp myapp -name 'My app' -version 1.0.0 -vendor 123456 -frontend -themes -plugins -cli -api

php wa.php createPlugin app_id plugin_id parameters

>Creates a basic set of directories and files required for the development of a new plugin for an existing app, inside directory wa-apps/[app_id]/plugins/[plugin_id].

Parameters

Example

php wa.php createPlugin someapp myplugin -name 'My plugin' -version 1.0.0 -vendor 123456 -frontend -settings

php wa.php createSystemplugin type plugin_id parameters

Creates a basic set of directories and files required for the development of a new payment, shipping, or SMS system plugin inside directory wa-plugins/[type]/[plugin_id].

Parameters

Example

php wa.php createSystemplugin shipping myplugin -name 'My shipping' -version 1.0.0 -vendor 123456 -prototype courier

php wa.php createWidget app_id widget_id parameters

Creates a basic set of directories and files required for the development of a new widget.

Parameters

Example

php wa.php createWidget shop mywidget -name 'My widget' -version 1.0.0 -vendor 123456 -settings

php wa.php generateDb app_id/plugin_id tables -update

Generates or updates database description file of an app or a plugin at lib/config/db.php.

Parameters

Examples for an app

#create file db.php
php wa.php generateDb myapp myapp_items myapp_types

#update file db.php
php wa.php generateDb myapp myapp_items myapp_types -update

Examples for a plugin

#create file db.php
php wa.php generateDb someapp/myplugin myplugin_items myplugin_types

#update file db.php
php wa.php generateDb someapp/myplugin myplugin_items myplugin_types -update

php wa.php compress slug params

Check source code style and formatting and compress source files to an archive for publication in Webasyst Store.

Parameters

Examples

# check source code except for third-party components and compress files to archive
php wa.php compress someapp/plugins/myplugin

# check all source code including that of third parties and compress files to archive
php wa.php compress someapp/plugins/myplugin -style true

# check source code except for third-party components without compressing files to archive
php wa.php compress someapp/plugins/myplugin -skip compress

# compress files to archive without any checks
php wa.php compress someapp/plugins/myplugin -skip test