Skip to content

Releases: userfrosting/framework

5.1.3

30 Jun 14:45
9842ebb
Compare
Choose a tag to compare

What's changed

  • [Config] Fix issue with getBool, getString, getInt and getArray where a null value could be returned even if a default parameter was provided when the data did in fact return null, making the return value not type safe as it should be.

Full Changelog: 5.1.2...5.1.3

5.1.2

22 Jun 02:25
868aa5b
Compare
Choose a tag to compare

What's changed

Full Changelog: 5.1.1...5.1.2

5.1.1

17 May 23:53
fb9c2a3
Compare
Choose a tag to compare

What's changed

Full Changelog: 5.1.0...5.1.1

5.1.0

22 Mar 02:14
3deed7a
Compare
Choose a tag to compare

What's changed

  • Removed Assets
  • Drop PHP 8.1 support, add PHP 8.3 support
  • Update to Laravel 10
  • Update to PHPUnit 10
  • SprinkleManager is a bit more strict on argument types. Recipe classed must be a class-string. The actual instance of the class will now be rejected (it wasn't a documented feature anyway).

Fortress

Complete refactoring of Fortress. Mostly enforcing strict types, updating PHPDocs, simplifying code logic and making uses of new PHP features and method. Most classes have been deprecated and replaced by new classes with updated implementation. In general, instead of passing the schema in the constructor of Adapters, Transformers and Validators class, you pass it directly to theses class methods. This makes it easier to inject the classes as services and reuse the same instance with different schemas. Checkout the documentation for more information on new class usage.

  • UserFrosting\Fortress\RequestSchema constructor first argument now accept the schema data as an array, as well as a string representing a path to the schema json or yaml file. The argument can still be omitted to create an empty schema. This change makes UserFrosting\Fortress\RequestSchema\RequestSchemaRepository obsolete and and such been deprecated. For example:

    // Before
    $schemaFromFile = new \UserFrosting\Fortress\RequestSchema('path/to/schema.json');
    $schemaFromArray = new \UserFrosting\Fortress\RequestSchema\RequestSchemaRepository([
      // ...
    ]);
    
    // After
    $schemaFromFile = new \UserFrosting\Fortress\RequestSchema('path/to/schema.json');
    $schemaFromArray = new \UserFrosting\Fortress\RequestSchema([
      // ...
    ]);
  • UserFrosting\Fortress\RequestSchema\RequestSchemaInterface now extends \Illuminate\Contracts\Config\Repository. The interface itself is otherwise unchanged.

  • UserFrosting\Fortress\RequestDataTransformer is deprecated and replaced by \UserFrosting\Fortress\Transformer\RequestDataTransformer (notice the difference in the namespace!). \UserFrosting\Fortress\RequestDataTransformerInterface is also deprecated and replaced by \UserFrosting\Fortress\Transformer\RequestDataTransformerInterface. When using the new class, instead of passing the schema in the constructor, you pass it directly to transform() or transformField(). For example :

    // Before
    $transformer = new \UserFrosting\Fortress\RequestDataTransformer($schema);
    $result = $transformer->transform($data, 'skip');
    
    // After
    $transformer = new \UserFrosting\Fortress\Transformer\RequestDataTransformer();
    $result = $transformer->transform($schema, $data, 'skip');
  • \UserFrosting\Fortress\ServerSideValidator is deprecated and replaced by \UserFrosting\Fortress\Validator\ServerSideValidator (notice the difference in the namespace!). \UserFrosting\Fortress\ServerSideValidatorInterface is also deprecated and replaced by \UserFrosting\Fortress\Validator\ServerSideValidatorInterface. When using the new class, instead of passing the schema in the constructor, you pass it directly to validate(). For example :

    // Before
    $validator = new \UserFrosting\Fortress\ServerSideValidator($schema, $this->translator);
    $result = $validator->validate($data);
    
    // After
    $adapter = new \UserFrosting\Fortress\Validator\ServerSideValidator($this->translator);
    $result = $validator->validate($schema, $data);
  • UserFrosting\Fortress\Adapter\FormValidationAdapter is deprecated.
    Instead of defining the format in the rules method, you simply use of the appropriate class for the associated format.

    rules(...) Replacement class
    $format = json & $stringEncode = true UserFrosting\Fortress\Adapter\FormValidationJsonAdapter
    $format = json & $stringEncode = false UserFrosting\Fortress\Adapter\FormValidationArrayAdapter
    $format = html5 UserFrosting\Fortress\Adapter\FormValidationHtml5Adapter

    UserFrosting\Fortress\Adapter\JqueryValidationAdapter is deprecated.
    Instead of defining the format in the rules method, you simply use of the appropriate class for the associated format.

    rules(...) Replacement class
    $format = json & $stringEncode = true UserFrosting\Fortress\Adapter\JqueryValidationJsonAdapter
    $format = json & $stringEncode = false UserFrosting\Fortress\Adapter\JqueryValidationArrayAdapter

    All adapters above now implements UserFrosting\Fortress\Adapter\ValidationAdapterInterface for easier type-hinting.

    Finally, instead of passing the schema in the constructor, you now pass it directly to rules().

    For example :

    // Before
    $adapter = new FormValidationAdapter($schema, $this->translator);
    $result = $adapter->rules('json', false);
    
    // After
    $adapter = new FormValidationArrayAdapter($this->translator);
    $result = $adapter->rules($schema);
  • ClientSideValidationAdapter abstract class replaced with FromSchemaTrait trait + ValidationAdapterInterface interface.

  • FormValidationHtml5Adapter Will now throw an exception on missing field param, instead of returning null.

  • In FormValidationHtml5Adapter, when using identical rule, the validation used to be applied to the "confirmation" field. It will now be applied to the source field, making it consistent with array|json format. For example, if password requires to be identical to passwordc, the validation was added to the passwordc field. Now it's applied to password.

Config

  • Methods getBool, getString, getInt & getArray now return null if key doesn't exist, to make it on par with parent get method.

Alert

  • Messages are now translated at read time (#1156, #811). Messages will be translated when using messages and getAndClearMessages. addMessage now accept the optional placeholders, which will be stored with the alert message. addMessageTranslated is deprecated.
  • Translator is not optional anymore. setTranslator method has been removed.
  • addValidationErrors is deprecated (N.B.: It can't accept the new \UserFrosting\Fortress\Validator\ServerSideValidatorInterface)

UniformResourceLocator

  • Two locations cannot have the same name anymore. An InvalidArgumentException will be thrown otherwise. (Ref userfrosting/UserFrosting#1243).
  • [DEPRECATION] Location's getSlug is deprecated (redundant with the name and not really used).

Full Changelog: 5.0.0...5.1.0

5.0.0

25 Nov 00:35
da67b86
Compare
Choose a tag to compare

With version 5, this repo can be used as a bare bone Slim & Symfony Console application. It include the necessary routing class, PHP-DI as the Dependency Injection Container, a PSR EventDispatcher, etc. SprinkleManager has also been moved from Core/System Sprinkle and completely rewritten.

It's necessary for the SprinkleManager, Slim and Symfony (Bakery) to be outside of the Core Sprinkle so it can be properly managed. All extra feature (template, database, config, etc.) are left for the Core Sprinkle. The old sprinkle.json has been replace with SprinkleRecipe interface.

Version 5 also requires PHP 8.0 and up. With that in mind, most of the code has been updated to support PHP 8 and make use of it's new features. Code quality has also been stepped up, with PHPStan analysis added to the build process.

Global

Added

  • Moved Alert into Framework from Core Sprinkle
  • Added Bakery / Symfony Console app : UserFrosting\Bakery\Bakery
  • UserFrosting / Slim 4 Web app : UserFrosting\UserFrosting
  • Moved SprinkleManager from main repo.
  • Added custom Event Dispatcher and Listeners : UserFrosting\Event\EventDispatcher & UserFrosting\Event\SprinkleListenerProvider

Dependencies

  • Drop PHP 7.3 & 7.4 support
  • Updated twig/twig to ^3.3

Code Quality

  • Updated PHPStan config and added Github Action for automatic code analysis for UniformResourceLocator & Config (with no issues on max level)
  • Updated PHP-CS-Fixer & StyleCI config

Assets

Assets module is now deprecated and will be removed in UserFrosting 5.1 !

Removed

  • UserFrosting\Assets\ServeAsset\SlimServeAsset has been removed. Code has been moved into Core Sprinkle

Bakery

Added

  • UserFrosting\Bakery\WithSymfonyStyle moved to this repo from Core.

Testing

  • Added helper class to test Bakery command, Container, CustomAssertionsTrait, HttpTester, TestCase, etc.

Support

Removed

  • These HTTP exceptions have been removed and replace with new system in Core Sprinkle :
    • BadRequestException
    • ForbiddenException
    • HttpException
    • NotFoundException
  • UserFrosting\Support\Util\Util::normalizePath has been removed. Use UserFrosting\UniformResourceLocator\Normalizer::normalizePath instead.

UniformResourceLocator

Changes

  • Remove dependency on rockettheme/toolbox by integrating our own StreamWrapper\Stream and StreamBuilder
  • findResource and getResource now return null if a resource is not found instead of false

Added

  • Added readonly option for streams. Files accessed using a readonly scheme will be protected against destructive action at the streamwrapper level.

Deprecated

  • findResource is deprecated. Use getResource instead
  • findResources is deprecated. Use getResources instead
  • registerStream and registerSharedStream are deprecated. Use addStream instead
  • registerLocation is deprecated. Use addLocation instead

Removed

  • Scheme Prefix has been removed
  • Resource : setLocation, setPath, setLocatorBasePath and setStream methods have been removed
  • ResourceLocation : setName and setPath methods have been removed
  • ResourceStream : setScheme, setPath and setShared methods have been removed
  • Deprecated ResourceLocator::addPath method removed
  • ResourceLocator::setBasePath method removed

Fortress

Fix

Removed

  • Removed deprecated method getSchema in RequestSchema

Full Changelog: 4.6.1...5.0.0
Upgrade Guide: https://learn.userfrosting.com/upgrading/46-to-50

5.0.0-rc1

12 Nov 18:46
f4f79ab
Compare
Choose a tag to compare
5.0.0-rc1 Pre-release
Pre-release

Full Changelog: 5.0.0-beta5...5.0.0-rc1

5.0.0-beta5

25 Oct 02:37
b97e4a2
Compare
Choose a tag to compare
5.0.0-beta5 Pre-release
Pre-release

What's Changed

Full Changelog: 5.0.0-beta4...5.0.0-beta5

5.0.0-beta4

29 Sep 00:41
6078a01
Compare
Choose a tag to compare
5.0.0-beta4 Pre-release
Pre-release

5.0.0-beta3

27 Sep 01:51
22cc608
Compare
Choose a tag to compare
5.0.0-beta3 Pre-release
Pre-release

What's Changed

  • Properly update Cache creation tools

Full Changelog: 5.0.0-beta2...5.0.0-beta3

5.0.0-beta2

25 Sep 02:16
d7f1e41
Compare
Choose a tag to compare
5.0.0-beta2 Pre-release
Pre-release

What's Changed

  • Add UserFrosting\Cache\Cache alias for Illuminate\Cache\Repository, for easier dependency injection
  • Officially deprecate Assets framework

Full Changelog: 5.0.0-beta1...5.0.0-beta2