定制 carlosv2/mink-legacy-driver 二次开发

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

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

carlosv2/mink-legacy-driver

Composer 安装命令:

composer require --dev carlosv2/mink-legacy-driver

包简介

Driver for Mink/Behat providing a bridge for legacy applications

README 文档

README

This project aims to provide a bridge between Mink and legacy apps. In general terms, legacy apps are not written with the best practices in mind or they are too old to support them.

License Build Status SensioLabsInsight

Why?

Legacy apps are hard to maintain mainly because of the lack of tests or because of very slow and painful tests. This situation produces fear to change as the side effects are unknown. In addition to this, legacy apps use to suffer from the following situations:

  • No usage of composer autoload.
  • Rely on PHP superglobals (like $_GET, $_POST, $_SERVER, etc).
  • Having many frontend controllers.
  • Usage of exit/die to abruptly finish the request.

Installation

Install with:

$ composer require --dev carlosv2/mink-legacy-driver

Usage

Set up your behat.yml file as follows:

default:
  extensions:
    carlosV2\LegacyDriver\Extension: ~
    Behat\MinkExtension:
      sessions:
        default:
          legacy:
            environment: <array>
            controller: <string|array>
            document_root: <string>
            bootstrap: <string|array>

Where:

  • environment: Key/value array containing the environment variables. For example:

    environment:
      variable: value
      env: prod
  • controller: Location of the frontend controller. For example:

    controller: path/to/the/controller.php

    Alternatively you can supply an array of frontend controllers. For example:

    controller:
      - path: /uri/to/match
        file: path/to/the/uri/to/match.php
      - path: /uri/to/another
        file: another/path/to/match.php    

    The controllers key configures the symfony/routing component underneath. As a result, you can also add the methods and requirements keys. For example:

    controller:
      - path: /item/{id}
        file: process_item.php
        methods: ["GET", "PUT"]
        requirements:
          id: \d+
  • document_root: Location of the document root. For example:

    document_root: path/to/the/document/root/
  • bootstrap: Location of the bootstrap file to execute before every request. For example:

    bootstrap: path/to/the/bootstrap/file.php

    Alternatively you can supply multiple files to be executed before every request. For example:

    bootstrap:
      - path/to/the/bootstrap/file.php
      - another/path/to/bootstrap.php

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: MIT
  • 更新时间: 2017-02-26

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固