symfony-bundle webcommand-bundle
Enables you to run a Command from a browser when there's no SSH-access
eriktrapman/webcommand-bundle
Enables you to run a Command from a browser when there's no SSH-access
- Saturday, March 23, 2013
- by ErikTrapman
- Repository
- 1 Watchers
- 0 Stars
- 26 Installations
- PHP
- 0 Dependents
- 0 Suggesters
- 0 Forks
- 0 Open issues
- 1 Versions
- 4 % Grown
WebCommandBundle
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., (*1)
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., (*2)
Example:, (*3)
/**
* @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());
}