承接 foobar/foobar8 相关项目开发

从需求分析到上线部署,全程专人跟进,保证项目质量与交付效率

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

foobar/foobar8

最新稳定版本:1.0

Composer 安装命令:

composer require foobar/foobar8

包简介

foo bar for PHP 8* only

README 文档

README

Serves package testing purposes only... obviously.

💿 composer require foobar/foobar8

Usage

When migrating from a package to another, it may be useful to know that composer schema (i.e. composer.json) may contain replace property.

The schema of this package is (abridged):

{
  "name": "foobar/foobar8",
  "require": {
    "php": "^8"
  },
  "replace": {
    "foobar/foobar7": "*"
  }
}

Where replace indicates that foobar/foobar8 completely replaces foobar/foobar7, allowing Composer to consider foobar/foobar8 as a drop-in replacement for foobar/foobar7.

Prop replace creates an implicit conflict rule, and is also more useful than provide, which serves different purpose (to implement virtual interfaces).

Read the Composer schema docs here: Composer replace.

Migration

Prerequisites (or current state):

  • project running on PHP 7
  • foobar/foobar7 installed (i.e. required by the project)

Migration:

  1. switch to PHP 8
  2. composer require foobar/foobar8
  3. (optional) remove foobar/foobar7 requirement

This will satisfy all the other libraries that depend on foobar/foobar7, too, not just the project itself.

One should end up with something like this:

{
  "type": "project",
  "require": {
    "php": "^8",
    "foobar/foobar7": "^1",
    "foobar/foobar8": "^1"
  }
}

Useful when reimplementing older libraries or providing backport versions for older architectures.

It may be useful in other scenarios too, when reimplementing third party libraries.
An example would be a library that is slow to be maintained, but a serious flaw is found. One may source and distribute the patch himself and only replace a certain version. Once the third party package is updated, it will be used again, without need for changes to the consuming project.

Note that the replacing works not only across PHP versions. One may replace any package, or even selected versions of a package.

统计信息

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

GitHub 信息

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

其他信息

  • 授权协议: Unlicense
  • 更新时间: 2024-08-07

承接程序开发

PHP开发

VUE

Vue开发

前端开发

小程序开发

公众号开发

系统定制

数据库设计

云部署

网站建设

安全加固