Skip to content

Releases: oladesoftware/httpcrafter

RouterFacade

02 Jul 11:38
1b43844

Choose a tag to compare

What's new

  • RouterFacade class

Introduced a new RouterFacade class to provide a simplified interface for route registration, pattern mapping and route path generation.

Bug fixes

  • Pattern mapping fix

Full Changelog: v0.3.0...v0.4.0

[Router:generatePath] Generate path with dynamic value

01 Jul 17:07
1a42fc6

Choose a tag to compare

Update existing generatePath() method in the Router class to generate paths with dynamic values. This should allow developers to create URLs with parameters or dynamic segments without manually concatenating strings.

Example:

Assuming dynamic segment userID
$router->generatePath('profile', [ 'userID' => 123 ]);
Output: '/account/profile/123'

Full chancelog

set '?' to allow nullable for name parameter for Router addRoute function

14 Jan 13:33

Choose a tag to compare

  • Set ? to allow nullable for name parameter for Router->addRoute()

Full chancelogs

Set PHP minimum requirement

02 Jan 17:53
84be51a

Choose a tag to compare

Require PHP 8.2 and greater

Full chancelogs

Add redirection method to Response class

09 Dec 21:03

Choose a tag to compare

What's new?

  • Add redirection method to Response class

Usage:

// Redirect to the specified URL with a 301 Moved Permanently status code
$response->redirect('https://www.example.com', 301);
// Redirect to the specified URL with a 302 Moved Temporary status code
$response->redirect('/new-page', 302);

Full chancelogs

[release v0.1.3] Refactor Response and add interfaces for Authenticator and Authorization

10 Oct 17:40

Choose a tag to compare

Refactor Response Content-Length handling and add interfaces for Authenticator and Authorization

  • Moved Content-Length calculation logic to a private updateContentLength() method to improve encapsulation and reusability.
  • Updated send() method to call the updateContentLength() method before sending the headers.
  • Introduced interfaces for Authenticator and Authorization to standardize authentication and authorization mechanisms.

Full chancelogs

**Hotfix:** Fixed the calculation of the Content-Length header in the Response class

08 Oct 20:22

Choose a tag to compare

Release Notes for v0.1.2

  • Hotfix: Fixed the calculation of the Content-Length header in the Response class to ensure accurate length is set based on the body content.
  • Issue Addressed: Previous implementation incorrectly calculated the Content-Length using strlen() on the length itself instead of the actual content length.

release v0.1.1

07 Oct 22:38

Choose a tag to compare

hotfixes: Content-Length calculation based on type

Fullchancelogs

release v0.1.0

07 Oct 20:36

Choose a tag to compare

Enhancements to Httpcrafter

This release brings a significant restructuring of core components within the HTTP toolbox, along with the addition of a flexible routing solution. These updates enhance modularity and ease of use for developers looking to integrate individual tools.

Key Changes:

  • Refactor of Request and Response Classes

    • The Request.php and Response.php files have been reorganized into the src/Http/ directory, improving file structure and accessibility.
    • New interfaces—RequestInterface.php and ResponseInterface.php—have been introduced, providing more flexibility for developers to implement custom request and response handling.
  • Introduction of Router Class

    • We've added the Router class from the archived oladesoftware/router repository, which now serves as a foundational routing component within the HTTP toolbox.
    • The new Router class is available at src/Router/Router.php, with corresponding tests in tests/Router/RouterTest.php.
  • Updated Test Suite

    • The directory structure for test files has been updated to align with the new organization:
      • tests/RequestTest.phptests/Http/RequestTest.php
      • tests/ResponseTest.phptests/Http/ResponseTest.php

These updates further strengthen the modularity of the Httpcrafter, ensuring that each class can be used independently for a variety of use cases, while maintaining a clean and organized architecture.

Full Changelog

release v0.0.3

20 Jun 07:31

Choose a tag to compare

bug fix in response class:

  • set content-type

set requirement for php version

Full chancelogs