定制 eriktrapman/webcommand-bundle 二次开发

按需修改功能、优化性能、对接业务系统,提供一站式技术支持

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

eriktrapman/webcommand-bundle

Composer 安装命令:

composer require eriktrapman/webcommand-bundle

包简介

Enables you to run a Command from a browser when there's no SSH-access

README 文档

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());
    }

统计信息

  • 总下载量: 34
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 0
  • 点击次数: 1
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 0
  • Watchers: 1
  • Forks: 0
  • 开发语言: PHP

其他信息

  • 授权协议: MIT
  • 更新时间: 2012-12-22