PHP.GT

Latest releases

Server: Logging improvements

Published on by Greg Bowler

In this release, errors are now output to STDERR by default, and it’s possible to configure whether to log static requests and send 404 errors to the error log.

What’s Changed

Full Changelog: https://github.com/phpgt/Server/compare/v1.1.5...v1.1.6

Logger: STDOUT/STDERR level configuration

Published on by Greg Bowler

In this minor release, it’s now possible to specify different streams to use for normal logs versus error logs. This allows your applications to configure what error log level to redirect to STDERR - useful for error logging tools like Glitchtip!

What’s Changed

Full Changelog: https://github.com/phpgt/Logger/compare/v1.0.1...v1.1.0

ServiceContainer: Case insensitive class names

Published on by Greg Bowler

The reason for this release is to allow the service container to work case-insensitively. This is released as a minor release rather than a patch release as it does affect backwards compatibility, but only in a more open way.

What’s Changed

Full Changelog: https://github.com/phpgt/ServiceContainer/compare/v1.3.4...v1.4.0

Routing: Non-compound classes in wrapped code

Published on by Greg Bowler

This release fixed issue #85, allowing non-compound classes such as DateTime to be referenced in wrapped code, without the need for fully qualifying them, or introducing unnecessary imports.

This release also marks the first PHPGT repository to move to the uppercase “GT” namespace prefix, full backwards compatibility.

What’s Changed

Full Changelog: https://github.com/phpgt/Routing/compare/v1.1.5...v1.1.6

Curl: December 2025 release

Published on by Greg Bowler

This pull request updates the CI/CD workflows and dependencies of the project to align with newer PHP versions and improve compatibility. Minor improvements and method signature changes are also made in the source code to reflect best practices.

What’s Changed

Full Changelog: https://github.com/phpgt/Curl/compare/v3.1.1...v3.2.0

Database: PHP object method queries

Published on by Greg Bowler

New Features:

  • Added PhpQuery and PhpQueryClassNotFoundException: Supports PHP-based query definitions.
  • Added setAppNamespace in multiple files: Enables custom namespace handling for queries.
  • Extended the Query abstract class with binding-related methods.

Refactoring and Enhancements:

  • Modified QueryCollection to handle both directory and class-based query containers.
  • Simplified logic in QueryFactory to include PHP-based query handling.
  • Adjusted SqlQuery and QueryCollection implementations for better compatibility.

Testing Enhancements:

  • Added tests to validate the new features in Database, including QueryCollectionClass and the handling of PHP queries/classes in QueryFactory.

Dependency Updates (composer.lock):

  • Updated multiple dependencies, including myclabs/deep-copy, phpstan/phpstan, phpunit/phpunit, squizlabs/php_codesniffer, and Symfony components.

CI Workflow (ci.yml):

  • Added support for pull_request triggers and updated permissions for better security.
  • Excluded .git directory from the build archive.
  • Updated the PHP Mess Detector to version v2.

Json: Schema Object & JsonDocumentBuilder

Published on by Greg Bowler

This release mainly focuses on improving type safety, handling complex JSON structures, and extending the functionality of JsonDocument and related classes.

Full Changelog: https://github.com/phpgt/Json/compare/v2.1.0...v2.2.0

In JsonKvpObject.php:

  • Adjusted validation logic to add support for potential null key in valid() method.

In JsonObjectBuilder.php:

  • Enhanced JSON structure validation during decoding.
  • Improved handling of complex JSON structures, including proper treatment of scalar values, associative arrays, and indexed arrays.
  • Streamlined code by replacing verbose conditional branches with modern match() syntax.
  • Introduced helper methods to process arrays and nested elements cleanly.

New File:

  • Added JsonTypeException.php to provide specific exception handling for JSON type-related errors.

In JsonDocument.php:

  • Added set() and get() methods to support dot notation for accessing and modifying nested keys.
  • Refactored code to ensure support for JsonKvpObject transformations while handling nested objects effectively.
  • Ensured proper type handling and safe traversal for nested structures with utility methods.

In JsonDocumentTest.php:

  • Refactored existing tests and added new tests to validate setObject, set() functionality (including nested keys), and construction of JSON objects from associations.

These improvements aim to make the library more robust, reduce vulnerabilities with incorrect type handling, and improve test coverage for better reliability.

Logger: October 2025 release

Published on by Greg Bowler

What’s Changed

New Contributors

Full Changelog: https://github.com/phpgt/Logger/compare/v1.0.0...v1.0.1

ServiceContainer: GT transition

Published on by Greg Bowler

This minor patch release introduces an automatic class alias check for classes within the Gt* namespace prefix, automatically fixing the case to GT*, in preparation of the transition to all repos having the GT namespace prefix.

Full Changelog: https://github.com/phpgt/ServiceContainer/compare/v1.3.2...v1.3.4

ProtectedGlobal: October 2025 release

Published on by Greg Bowler

This is a new major version release because of the backwards breaking changes introduced. Even though the changes are simple, they will break existing projects - the main protect and override functions have had their static keyword removed. This change was to increase testability of consuming applications, notably WebEngine.

Full Changelog: https://github.com/phpgt/ProtectedGlobal/compare/v1.1.2...v2.0.0

Config: PHP 8.4 compatibility and better type-safety

Published on by Greg Bowler

What’s Changed

New Contributors

Full Changelog: https://github.com/phpgt/Config/compare/v1.1.0...v1.1.1

Session: September 2025 release

Published on by Greg Bowler

This release addresses a change in how sessions are constructed (more specifically, how unserialize handles errors).

Upgrading to the previous release v1.2.3 could have caused an issue where the contents of the session data was not unserializable, and caused a fatal error to be thrown. If this happens in this release, the session is destroyed and created again on the next request.

What’s Changed

Full Changelog: https://github.com/phpgt/Session/compare/v1.2.3...v1.2.4