Skip to content

introducing survos/command-bundle, a web interface for console commands #55

@tacman

Description

@tacman

This is more a discussion than an issue, but discussions aren't enabled for this repo.

I've been working on a way to run commands from a web interface, mostly to take advantage of the debug toolbar, but also because sometimes I want access to a command without logging into the server. It uses console-extra's runCommand() method.

For example, in the Symfony demo application, there's a --send-to option, but it's hard to debug from the command line. Calling it from the browser shows the emails sent in the debug toolbar. Also, sometimes I want to add and list users from the website without writing custom controllers.

Here's a quick example exposing the app commands in the Symfony Demo

symfony new --demo command-demo && cd command-demo
# bump to the latest version of Symfony 6.3, use whatever version of you have installed
sed -i 's/"php": "8.1.0"//' composer.json 
sed -i 's/"require": "6.3"/"require": "^6.3"/' composer.json
composer config extra.symfony.allow-contrib true
composer update 
# allow recipes, waiting for PR approval
export SYMFONY_ENDPOINT=https://raw.githubusercontent.com/symfony/recipes-contrib/flex/pull-1548/index.json

composer req survos/command-bundle
yarn install && yarn dev
symfony server:start -d
symfony open:local  --path admin/commands

I also have a make:invokable-command that of course works hand-in-hand with this.

I wanted to first thank you for releasing console-extra and ask your feedback on my bundle. I don't yet have arrays working from the web interface.

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions

      pFad - Phonifier reborn

      Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

      Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


      Alternative Proxies:

      Alternative Proxy

      pFad Proxy

      pFad v3 Proxy

      pFad v4 Proxy