PHP.GT

Latest releases

Dom: Facade release candidate 2

Published on by Greg Bowler

This second release candidate is made ready for full release within the month. Included within this RC are minor tweaks, including typehint improvements and the implementation of RadioNodeList. Any future functionality will be made as subsequent v3 releases, the only updates this month will be minor tweaks or bugfixes.

ServiceContainer: Initial release

Published on by Greg Bowler

Now this repository has been used within a few PHP.Gt repositories, and an edge case for handling non-objects has been added, a stable release is being made.

This library is intentionally simple, striving to only have functionality required to be compatible with PSR-11 .

Have fun!

Http: Global state factory

Published on by Greg Bowler

Ready for the v4 release of WebEngine, there needed to be a way to produce a PSR-7 ServerRequest from the global state rather than by supplying a pre-populated RequestInterface. This release contains this the new functionality, along with many minor improvements.

Routing: File Matching & Assembly components

Published on by Greg Bowler

Included in this pre-release are the following features:

  • Path and Assembly components are introduced.
  • Better type safety throughout.
  • HTTP Content-type negotiation.
  • Stream wrapper ensures files have a namespace.
  • FileMatcher: PathMatcher for expanding a directory of matching files.
  • FileMatcher: BasicFileMatch.
  • FileMatcher: MagicFileMatch

Logger: Initial feature pre-release

Published on by Greg Bowler

Bundled with this pre-release is the functionality to log to any file or stream. There isn’t much more planned than this, but as with all PHP.Gt repositories, a major release cannot be made until it has been used in a few real-world projects.

Have fun!

Routing: Fully implemented routing

Published on by Greg Bowler

This release marks the completion of the first main feature, and this repository’s namesake: routing.

A PSR-7 request can be provided to the router, along with an object with method attributes, and the request will be matched against the available attributes in order to execute the correct method.

Next up is providing a dynamic path extractor and providing a mechanism for building the correct Assembly objects.

DomValidation: May 2021 update

Published on by Greg Bowler

In this release, we introduce/test the following validation features:

  • The pattern attribute, and how it displays the title attribute on error.
  • Minimum length and maximum length.
  • Adding a hint to the validation message from within the HTML.
  • PHP 8 compatibility.

Promise: Deferred processes & chaining nested promises

Published on by Greg Bowler

This release comes with some real-world tests, added to mimic the functionality of real-world usage of this library.

In the unit tests you’ll see some lazy-searching over data structures that involve multiple nested promises. There are no backwards breaking changes in this release, but to achieve this functionality, the Deferred class can now be assigned processes to execute as part of its task.

As always, have fun and stay productive!

ServiceContainer: Initial pre-release

Published on by Greg Bowler

This repository’s functionality is intentionally simple, so even though this is the first minor release, the planned functionality is already fully tested after just a few commits.

Right now you can create a new Container, add services to the container and invoke objects with automatically wired-up typed parameters.

A major release will be made once this repository has been integrated within the various parts of PHP.Gt and used in a real world project or two.

Dom: Facade release candidate

Published on by Greg Bowler

In this release we take advantage of the facade design pattern to provide a set of classes that iron out any creases with the W3C DOM Specification. In previous versions, we were using libxml-provided classess (DOMDocument, DOMNode, etc.) and extending with our own functionality, but this meant that it was impossible to deviate from the inheritance model supplied by libxml.

The footprint of this version should be identical, but with added classes to represent the different types of Node extension.

Creating objects within the DOM is typically done through Factory classes, as most constructors are private to allow for more controlled/abstracted object creation.

Please test this release candidate and submit feedback through the issues list.

Have fun!

Database: Default characterset: utf8mb4_general_ci

Published on by Greg Bowler

Across the whole database, unless otherwise stated within the settings, all tables will now use utf8mb4_general_ci as the default characterset.

This removes any issues when dealing with multibyte characters such as emoji, and simplifies the use of string functions using user-supplied variables within queries and stored procedures.

Alongside these changes are dependency upgrades and the switch to native Github Dependabot, for keeping dependencies up to date.

SqlBuilder: New features ready for v1

Published on by Greg Bowler

This release is intended to be feature complete, ready for v1, but as it hasn’t been actively used in any real-world project, the v1 release is going to wait.

New features:

  • Indexed & named parameter helpers - if you are referencing a field that has the same name as an injected parameter, or the injected parameter is done by index, you can use the :fieldName and ?fieldName helper syntax to remove duplication.
  • OOP improved greatly, abstract classes are more meaningful for example, delete from tablename - a delete query can’t not have a from table, so now neither can the abstract delete class.
  • insert...select and replace...select queries are now fully implemented.

Curl: CI and type safety improvements

Published on by Greg Bowler

We’re one step closer to a CI environment fully hosted within Github Actions now, with PHPUnit and PHPStan tests being run within Actions. Codesniffer is planned soon too.

PHP 8 compatibility is made possible thanks to an updated dependency tree.

PropFunc: Internal __prop data structure

Published on by Greg Bowler

Sometimes it becomes useful to store the value of a class’s magic properties internally, so this minor patch release introduced the __prop internal property, which can be access by any class using the MagicProp trait.

PropFunc: v1 release

Published on by Greg Bowler

PropFunc is heavily used in php.gt/dom due to the reliance on a the W3C specification. There have been minor improvements made since it was integrated within Dom, so now v1 is being released to allow Dom to get ready for its next stable release.

Have fun!

PropFunc: Refactored to drop inner key-value array

Published on by Greg Bowler

This release finalises the way private/protected values should be accessed via the magic methods. Now if a class needs one of its public properties changing to read-only, it can do by making the property private/protected and implementing the magic getter.

Json: v1 release

Published on by Greg Bowler

Following on from the v1 release of PHP.Gt/DataObject earlier today, PHP.Gt/Json is now able to have its first stable release made.

No new functionality has been introduced since the last pre-release, only the upgraded dependency.

Have fun and stay productive!

DataObject: v1 release

Published on by Greg Bowler

The first public stable release of the most boring PHP library has just landed! DataObject adds such simple functionality to projects, but it is an important staple to how repositories within PHP.Gt and beyond will interoperate.

Have fun and stay productive!

WebEngine: Upgraded webpack default compilation

Published on by Greg Bowler

This minor patch release updates the way Webpack compilation is performed for ES6 scripts, so that it defaults to a more sensible production mode and specifies the entry script to script/main.es6.

PropFunc: Tested

Published on by Greg Bowler

The simple functionality of the repository is now tested. The main plans are for using with PHP.Gt/Dom, so before v1 is released it will be battle-tested in a few real world applications.

DomTemplate: Github Actions

Published on by Greg Bowler

This patch release includes two improvements:

  1. CI is handled by Github Actions now - you can check out the build history at https://github.com/PhpGt/Cli/actions

  2. PHPStan level 6 has been applied to the code, meaning certain type hints have been improved for greater readability and future maintainability.

WebEngine: Modularise components

Published on by Greg Bowler

This major release has modularised the components that make up WebEngine. All components are hosted within their own separate PHP.Gt repositories and included using Composer.

This is the first major change to architecture, making the transition to a dependency injected WebEngine in V4 much easier.

Sync: PHP.Gt/Cli compatibility (second change)

Published on by Greg Bowler

For backwards compatibility, this patch release was split into two. Now, exceptions are caught when trying to get an argument value from a parameter that has not been set.

This does not change the functionality of the repository, just the way the integration happens between Sync and Cli.

Sync: PHP.Gt/Cli compatibility

Published on by Greg Bowler

This patch release makes the repository compatible with an upcoming change to PHP.Gt/Cli, which uses PHP’s native type checking instead of a null-checked parameter. Without this fix in place, PHP would throw an exception if the second parameter of ArgumentValueList::get() was passed a null value.