eriktrapman / webcommand-bundle
Enables you to run a Command from a browser when there's no SSH-access
Installs: 33
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:symfony-bundle
Requires
- php: >=5.3.0
- symfony/console: >=2.1.0
- symfony/event-dispatcher: >=2.1.0
- symfony/form: >=2.1.0
- symfony/http-foundation: >=2.1.0
- symfony/http-kernel: >=2.1.0
Requires (Dev)
- symfony/symfony: >=2.1.0
This package is auto-updated.
Last update: 2023-03-01 00:08:29 UTC
README
The aim of this bundle is to ease managing a Symfony-application on a shared-hosting environment. In a shared-hosting environment there's not always the possibility to execute console-commands. This bundle allows to execute a console-command from a Controller and gives feedback in a flahs-message.
The bundle is not intended to make you run long cron-tasks from the Controller but to provide tools to update your database-schema, or install assets.
Example:
/** * @Route("/", name="admin_index") * @Template("") */ public function indexAction(\Symfony\Component\HttpFoundation\Request $request) { $form = $this->createForm('eriktrapman_commandselectortype'); if ($request->getMethod() == 'POST') { $form->bind($request); if ($form->isValid()) { $event = new \ErikTrapman\Bundle\WebCommandBundle\Event\CommandRunEvent( $form->get('command')->getData(), $form->get('options')->getData()); $this->get('event_dispatcher')->dispatch('eriktrapman.command.run', $event); return $this->redirect($this->generateUrl('admin_index')); } } return array('form' => $form->createView()); }