Pular para o conteúdo principal

Changelog - Version 7.0

Status: in development. This document tracks changes landing on the 7.0 branch. Nothing here is released yet, and the contents may still change.

Breaking Changes​

Enum cases renamed to PascalCase​

Enum cases follow the ByJG standard and are written in PascalCase. The backed values did not change, so ->value, from(), tryFrom() and stored data are not affected; only code that names a case (or reads ->name) has to be updated.

The Relation enum from byjg/anydataset 7.0 was renamed the same way (Relation::EQUAL is now Relation::Equal, etc.); update the filters you pass to MongoDbDriver.

EnumBefore (6.x)After (7.0)
DynamoDbAttributeTypeNUMBER, STRING, BINARY, BOOLEAN, NULL, MAP, LIST, STRING_SET, NUMBER_SET, BINARY_SETNumber, String, Binary, Boolean, Null, Map, List, StringSet, NumberSet, BinarySet

KeyValueCacheEngine removed​

ByJG\AnyDataset\NoSql\Cache\KeyValueCacheEngine (the PSR-16 cache on top of a Key/Value store) was removed, together with its documentation page (cache.md). It only worked with the S3 driver: Cloudflare KV does not implement has(), and DynamoDB needs key options the cache never passed. It was also the only reason this package required byjg/cache-engine, which is no longer a dependency.

Use a cache from byjg/cache-engine instead (Redis, Memcached, FileSystem, ...). The Key/Value drivers (S3, DynamoDB, Cloudflare KV) are unchanged.

AWS drivers: no credentials in the URI means the SDK default provider chain​

AwsS3Driver and AwsDynamoDbDriver without a user in the URI (s3://us-east-1/bucket, dynamodb://us-east-1/table) now leave the credentials to the AWS SDK default provider chain: environment variables (AWS_ACCESS_KEY_ID/AWS_SECRET_ACCESS_KEY), the ~/.aws files, then the ECS/EC2 instance role. Before, they passed an empty static key and secret, so every request was signed with empty credentials and an IAM role was never used. With byjg/uri 7.0 (absent parts are null) the old code threw InvalidArgumentException: Credentials must be ... in the constructor.

key@region (a key without a secret) still uses the static key with an empty secret. key:secret@region is unchanged.

Bug Fixes​

  • MongoDbDriver: the uri. and driver. connection string options now reach the MongoDB Manager. Before, every option was rejected with "Invalid option" (parse_str() turns the . into _); and even past that, uri. options were dropped and driver. options were passed with the prefix still on the key. uri. options are now added to the MongoDB connection string (so typed values such as uri.wtimeoutMS=500 work), and driver. options are passed as driver options without the prefix.
  • MongoDbDriver: a connection string with a host list (mongodb://server1,server2/db) now throws an InvalidArgumentException. Before, only the first host was used and the database name was wrong (,server2/db). Use a single seed host with uri.replicaSet=<name> instead.
  • MongoDbDriver: the username and password are now percent-encoded in the MongoDB connection string. Before, they were passed decoded, so a credential with @, :, /, %, ? or # broke the connection string or authenticated with the wrong credentials. Pass them percent-encoded in the URI (e.g. p%40ss for p@ss). Requires byjg/uri 7.0, which returns the username decoded like the password.
  • MongoDbDriver: a username or password of "0" was treated as missing (!empty()), so the connection was opened without credentials. Both are now used; authentication is only skipped when the username or the password is absent or empty.

Requirements​

  • PHP 8.3, 8.4, 8.5 and 8.6 are now supported: "php": ">=8.3 <8.7". The previous <8.6 upper bound excluded PHP 8.6, since <8.6 is exclusive.

ByJG dependencies​

  • byjg/anydataset is now ^7.0.
  • byjg/cache-engine is no longer required (see KeyValueCacheEngine removed above).
  • byjg/serializer is now ^7.0.
  • byjg/webrequest is now ^7.0.

While 7.0 is unreleased these resolve to 7.0.x-dev from each component's 7.0 branch, via minimum-stability: dev with prefer-stable: true.

Toolchain​

  • PHPUnit updated to ^12.5.

  • Psalm is installed as psalm/phar instead of vimeo/psalm.

    vimeo/psalm lists the PHP versions it supports and no published release includes 8.6, so as a dev dependency it made composer install fail on the 8.6 build job before any test ran. psalm/phar requires only php ^8.2 and bundles its own dependencies, so it installs on every PHP version in the matrix and cannot conflict with the project's. Psalm itself still refuses to run on 8.6, which is why the Psalm job uses 8.5. composer psalm runs it.

  • PHPUnit 13 is deliberately not used. It requires PHP >=8.4.1, breaking the 8.3 floor.

Continuous Integration​

  • The build matrix now includes PHP 8.6.
  • The Psalm job runs on PHP 8.5.

Housekeeping​

  • phpunit.xml.dist renamed to phpunit.xml.
  • The documentation pages were renamed to kebab-case (aws-dynamodb-key-value.md, aws-s3-key-value.md, cloudflare-kv.md, mongodb.md), so their addresses on the documentation site change as well.
  • phpunit.xml sets ignoreIndirectDeprecations="true". PHP 8.6 deprecates is as a class name, and guzzlehttp/promises (required by the AWS SDK) has a class called Is. Deprecations raised inside this package's own src/ still fail the suite.