Download the PHP package danilovl/web-command-bundle without Composer

On this page you can find all versions of the php package danilovl/web-command-bundle. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package web-command-bundle

phpunit downloads latest Stable Version license

WebCommandBundle

A Symfony bundle for running console commands via web interface (REST API). Supports both synchronous and asynchronous (via Messenger) execution.

Features

Available dashboard

Installation

  1. Install the bundle via composer:

  2. Add the bundle to config/bundles.php:

  3. Import routes in config/routing.yaml (routing is not automatic):

  4. Doctrine entity mapping

Add entity mapping to doctrine.yaml in packages folder.

  1. Update your database schema:

Configuration

Create config/packages/web_command.yaml:

Note:

Messenger Configuration

To enable asynchronous execution, configure Symfony Messenger:

Usage

REST API

The bundle provides a REST API to interact with commands. By default, the API is available under the /danilovl/web-command/api prefix.

Admin Interface

The bundle includes a built-in EasyAdmin dashboard for managing commands and viewing execution history. To use it, ensure you have EasyAdminBundle installed and configured, and enable it in the configuration:

The dashboard is available at /admin/danilovl/web-command.

The admin interface allows you to:

Web Dashboard

The bundle also provides a standalone web dashboard to run commands and view their history.

The dashboard is available at /danilovl/web-command/dashboard. Route Name: danilovl_web_command_dashboard_index

Features:

To use the web dashboard, you need to install assets:

Managing Commands

Each command is represented as an entity with several configuration options:

When adding a command, specify its name and optional default parameters. The Parameters field must be a JSON array of strings. These are arguments and options passed to the command.

Example for app:example --fix:

Example for app:example arg1 --option=value:

1. List Commands

Retrieve a list of all active commands that can be executed via the web interface.

Endpoint: GET /danilovl/web-command/api/commands/
Route Name: danilovl_web_commands

Response (200 OK):

2. Run Command

Execute a command.

Endpoint: POST /danilovl/web-command/api/commands/{id}/run
Route Name: danilovl_web_command_run

Request Body:

Response (200 OK - Synchronous execution):

Response (202 Accepted - Asynchronous execution): Returned when the command has async: true and asynchronous execution is enabled.

Response (404 Not Found):

3. List Histories

Retrieve a paginated list of histories for a specific command.

Endpoint: GET /danilovl/web-command/api/commands/{command}/histories
Route Name: danilovl_web_command_histories

Path Parameters:

Query Parameters:

Response (200 OK):

4. Get History Details

Retrieve details and output of a specific history record.

Endpoint: GET /danilovl/web-command/api/commands/histories/{id}
Route Name: danilovl_web_command_history_detail

Response (200 OK):

Response (404 Not Found):

5. Get Job Status

Retrieve the status of a specific job.

Endpoint: GET /danilovl/web-command/api/jobs/{id}/status
Route Name: danilovl_web_command_job_status

Response (200 OK):

Security

Voter

Each command can be protected by a Symfony Voter. Specify a Voter Class (or a role like ROLE_ADMIN) in the command configuration. The bundle will check permissions using AuthorizationCheckerInterface::isGranted().

URL Security

To restrict access to the dashboards and API to specific roles, configure Symfony's access_control in config/packages/security.yaml:

Events

The bundle dispatches events during the command execution lifecycle, allowing you to intercept and modify the process.

CommandStartEvent

Dispatched before a command is executed.

Usage:

CommandEndEvent

Dispatched after a command has finished execution (successfully or with an error).

Meta Information

The History entity includes a metaInfo field (JSON). By default, if the Symfony Security component is available, it automatically stores:

You can customize this data via CommandStartEvent::setMetaInfo(). If you set it to null, no meta information will be saved.

Database Schema Example

License

The WebCommandBundle is open-sourced software licensed under the MIT license.


All versions of web-command-bundle with dependencies

PHP Build Version
Package Version
Requires php Version ^8.5
doctrine/doctrine-bundle Version ^3.2.2
doctrine/orm Version ^3.6.2
easycorp/easyadmin-bundle Version ^4.27.6
symfony/asset Version ^8.0
symfony/console Version ^8.0
symfony/event-dispatcher Version ^8.0
symfony/framework-bundle Version ^8.0
symfony/messenger Version ^8.0
symfony/process Version ^8.0
symfony/twig-bundle Version ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package danilovl/web-command-bundle contains the following files

Loading the files please wait ...