从 2.x 升级到 3.x

composer require cakephp/authentication:^3.0 -W

或手动调整您的 composer.json 文件并执行 composer update -W

重大变化

  • 在所有函数参数和返回值中添加了类型声明(如果可能)。这些类型声明旨在与文档注释相匹配,但包含对错误注释的修复。

  • 在所有类属性中添加了类型声明(如果可能)。这些声明也包含对错误注释的一些修复。

  • \Authentication\Identifier\IdentifierInterface::CREDENTIAL_USERNAME 已移至 \Authentication\Identifier\AbstractIdentifier::CREDENTIAL_USERNAME

  • \Authentication\Identifier\IdentifierInterface::CREDENTIAL_PASSWORD 已移至 \Authentication\Identifier\AbstractIdentifier::CREDENTIAL_PASSWORD

  • \Authentication\Identifier\IdentifierInterface::CREDENTIAL_TOKEN 已移至 \Authentication\Identifier\TokenIdentifier::CREDENTIAL_TOKEN

  • \Authentication\Identifier\IdentifierInterface::CREDENTIAL_JWT_SUBJECT 已移至 \Authentication\Identifier\JwtSubjectIdentifier::CREDENTIAL_JWT_SUBJECT

  • AuthenticationMiddleware 无法再配置。配置需要在 AuthenticationService 对象上进行。