Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

feat!: update minimum supported PHP version to 8.1 #109

Draft
wants to merge 10 commits into
base: main
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
1 change: 1 addition & 0 deletions .envrc
Original file line number Diff line number Diff line change
@@ -0,0 +1 @@
use flake
2 changes: 1 addition & 1 deletion .github/workflows/pullrequest.yml
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ jobs:
strategy:
matrix:
operating-system: [ubuntu-latest]
php-version: ['8.0', '8.1', '8.2']
php-version: ['8.1', '8.2', '8.3']

steps:
- uses: actions/checkout@v4
Expand Down
2 changes: 1 addition & 1 deletion .gitignore
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@

/features/*.feature

/.devenv*
/.direnv
4 changes: 2 additions & 2 deletions .tool-versions
Original file line number Diff line number Diff line change
@@ -1,3 +1,3 @@
php 8.2.12
php 8.3.0
# php 8.2.12
# php 8.1.11
# php 8.0.24
4 changes: 2 additions & 2 deletions CONTRIBUTING.md
Original file line number Diff line number Diff line change
Expand Up @@ -4,11 +4,11 @@

### System Requirements

PHP 8+ is required.
PHP 8.1+ is required.

### Compilation target(s)

We target compatibility with PHP versions 8.0, 8.1, and 8.2.
We target compatibility with supported versions of PHP. Currently, this includes PHP versions 8.1, 8.2, and 8.3.

### Installation and Dependencies

Expand Down
14 changes: 12 additions & 2 deletions README.md
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@
[![Specification](https://img.shields.io/static/v1?label=Specification&message=v0.5.1&color=yellow)](https://github.com/open-feature/spec/tree/v0.5.1)
[![Latest Stable Version](http://poser.pugx.org/open-feature/sdk/v)](https://packagist.org/packages/open-feature/sdk)
[![Total Downloads](http://poser.pugx.org/open-feature/sdk/downloads)](https://packagist.org/packages/open-feature/sdk)
![PHP 8.0+](https://img.shields.io/badge/php->=8.0-blue.svg)
![PHP 8.1+](https://img.shields.io/badge/php->=8.0-blue.svg)
[![License](http://poser.pugx.org/open-feature/sdk/license)](https://packagist.org/packages/open-feature/sdk)
[![OpenSSF Best Practices](https://bestpractices.coreinfrastructure.org/projects/6853/badge)](https://bestpractices.coreinfrastructure.org/projects/6853)

Expand Down Expand Up @@ -108,7 +108,17 @@ The OpenFeature project maintains the [open-feature/php-sdk-contrib](https://git

This library targets PHP version 8.0 and newer. As long as you have any compatible version of PHP on your system you should be able to utilize the OpenFeature SDK.

This package also has a `.tool-versions` file for use with PHP version managers like `asdf`.
#### asdf

This package has a `.tool-versions` file for use with PHP version managers like `asdf`.

#### Nix

This package includes a `flake.nix` file which defines reproducible development shells powered by [Nix](https://nixos.org/). You can manually drop into a shell with `nix develop`, or provide a specific PHP minor version target with `nix develop .#php82`.

#### direnv

This package includes a `.envrc` file which automatically infers the usage of the default shell for the project, which is set to the minimum supported version of PHP.

### Installation and Dependencies

Expand Down
6 changes: 3 additions & 3 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^8",
"php": "^8.1",
"myclabs/php-enum": "^1.8",
"psr/log": "^2.0 || ^3.0"
},
Expand Down Expand Up @@ -56,10 +56,10 @@
},
"config": {
"allow-plugins": {
"phpstan/extension-installer": true,
"captainhook/plugin-composer": true,
"dealerdirect/phpcodesniffer-composer-installer": true,
"ergebnis/composer-normalize": true,
"captainhook/plugin-composer": true,
"phpstan/extension-installer": true,
"ramsey/composer-repl": true
},
"sort-packages": true
Expand Down
26 changes: 26 additions & 0 deletions flake.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

94 changes: 94 additions & 0 deletions flake.nix
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
description = "OpenFeature PHP SDK Nix flake dev shells";

# Flake inputs
inputs.nixpkgs.url = "github:NixOS/nixpkgs";

# Flake outputs
outputs = { self, nixpkgs }:
let
# Systems supported
allSystems = [
"x86_64-linux" # 64-bit Intel/ARM Linux
"aarch64-linux" # 64-bit AMD Linux
"x86_64-darwin" # 64-bit Intel/ARM macOS
"aarch64-darwin" # 64-bit Apple Silicon
];

# Helper to provide system-specific attributes
nameValuePair = name: value: { inherit name value; };
genAttrs = names: f: builtins.listToAttrs (map (n: nameValuePair n (f n)) names);
forAllSystems = f: genAttrs allSystems (system: f {
pkgs = import nixpkgs {
inherit system;
};
});
in
{
# Development environment output
devShells = forAllSystems ({ pkgs }:
let
coreShellPackages = [
pkgs.zsh
];
coreDevPackages = [
pkgs.git
];
corePhpPackages = [
pkgs.libpng
];
php81Packages = [
pkgs.php81
pkgs.php81.packages.composer
];
php82Packages = [
pkgs.php82
pkgs.php82.packages.composer
];
php83Packages = [
pkgs.php83
pkgs.php83.packages.composer
];
emptyStr = "";
shellHookCommandFactory = { git ? true, php ? false, node ? false, yarn ? false, pnpm ? false, python ? false, bun ? false }: ''
echo $ Started devenv shell for OpenFeature PHP-SDK with $PHP_VERSION
echo
${if git then ''git --version'' else emptyStr}
${if php then ''php --version'' else emptyStr}
echo
'';
phpShellHookCommand = shellHookCommandFactory { php = true; };
in rec
{
php81 = pkgs.mkShell {
packages = coreShellPackages ++ coreDevPackages ++ corePhpPackages ++ php81Packages;

PHP_VERSION = "PHP81";

shellHook = phpShellHookCommand;
};

php82 = pkgs.mkShell {
packages = coreShellPackages ++ coreDevPackages ++ corePhpPackages ++ php82Packages;

PHP_VERSION = "PHP82";

shellHook = phpShellHookCommand;
};

php83 = pkgs.mkShell {
packages = coreShellPackages ++ coreDevPackages ++ corePhpPackages ++ php83Packages;

PHP_VERSION = "PHP83";

shellHook = phpShellHookCommand;
};

# Default aliases, uses minimum supported PHP version
php = php81;

default = php;
}
);
};
}
2 changes: 1 addition & 1 deletion integration/composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@
}
],
"require": {
"php": "^8",
"php": "^8.1",
"open-feature/sdk": "^2.0.0",
"open-feature/flagd-provider": "^0.7.0",
"guzzlehttp/guzzle": "^7.5",
Expand Down
Loading
Loading