PHP.GT

Latest releases

Dom: Form feature tests

Published on by Greg Bowler

Thanks to @ognjen-petrovic we now have a FormTest class specifically for testing form-related functionality.

Implemented in this release is the checked attribute on Form elements, along with the following small changes:

  • Symfony’s CSS selector has been fixed at version 3.2.14 as it will be replaced entirely by github.com/PhpGt/CssXPath in the next major release.
  • Code sniffer has fixes some issues.

CssXPath: Test, test, test

Published on by Greg Bowler

Because of the reliance on Symfony’s CSS selector package, it’s very important to test real-world use cases of CSS selectors.

It is not greatly important to get to full CSS-spec for v1 release, because there are so many complex selectors that just shouldn’t be performed on the server, but getting 100% test coverage is a must.

Currently at 68%!

Dom: Element dataset functionality

Published on by Greg Bowler

The dataset property on the HTMLElement interface provides read/write access to all the custom data attributes (data-*) set on the element. This access is available both in HTML and within the DOM. It is a StringMap, one entry for each custom data attribute. Note that the dataset property itself can be read, but not directly written. Instead, all writes must be to the individual properties within the dataset, which in turn represent the data attributes. Note also that an HTML data-attribute and its corresponding DOM dataset.property do not share the same name, but they are always similar.

Read more here: https://developer.mozilla.org/en-US/docs/Web/API/HTMLElement/dataset

Dom: Improvements to core

Published on by Greg Bowler

The following two improvements have been made to better reflect the standard DOM behaviour:

  • innerHTML - a fragment must be used to set the innerHTML of an element, but fragments do not allow non-XML content to be appended! A temporary document is created to overcome this flaw in libxml.
  • NodeList Iterator - it is possible for an item in the iterator to be set to null (https://dom.spec.whatwg.org/#interface-nodelist)

Fetch: Bring up to date

Published on by Greg Bowler

Since initial development on this library started, PHPUnit and the PHP-HTTP organisation have refactored a lot of their code structure. This release brings everything up to date, fixes the basic tests that are currently available in the project.

Cli: Initial tests written

Published on by Greg Bowler

Adding the initial tests is being marked as a release because it acts as a commitment to the layout of new namespaces since the import of PHP.Gt/Installer code.

Cli: Imported from PhpGt/Installer

Published on by Greg Bowler

The functionality for the CLI interaction was originally coded into the PHP.Gt/Installer repository and has now been extracted into a reusable component.

This is the original basic code as it is extracted.

Csrf: Works well with WebEngine

Published on by Greg Bowler

This release mainly contains compatibility enhancements with WebEngine.

The functionality is kept the same, but all post data must be passed into the processAndVerify function, rather than relying on superglobals.

Database:

Published on by Greg Bowler

  • WebEngine specific handling of array-like objects (3dfb6a4c0ae9410e79fe465c35f43fa104ea3b5d).
  • toArray implemented on ResultSet and Rows.
  • Configuration is done through PHP.Gt/Config now.
  • Migrations are enhanced - zero configuration does not error.
  • Internal terminology change: “DSN” now referred to as “Driver”.

Curl: Buffered output

Published on by Greg Bowler

This release has a backwards-incompatible change of buffering the output when CURLOPT_RETURNTRANSFER is not set.

All curl output is buffered, rather than echoed to STDOUT. The buffer can be read using either the output or outputJson functions, allowing for much easier JSON webservice consumption.

CssXPath: Basic working functionality

Published on by Greg Bowler

This first pre-release has achieved the initial goal of passing the original tests for semi-complex CSS selector translation.

There are some edge cases to work through and when more complex tests are written we will surely find some room for improvement, but for now this is 233 lines of minimal code to do the same thing as the massive dependency WebEngine currently has.

We will soon be refactoring the Translator into its own classes of functionality, which will aim the project towards a stable release.

DomTemplate: Bugfixes and improvements

Published on by Greg Bowler

  • Bindable attributes removed more efficiently
  • :empty selector fixed when empty dataset is bound
  • Multiple braced parameters per attribute
  • Always cast bound data to objects (accepting assoc. arrays)
  • Types loosened to allow more compatibility with DOMDocument
  • Existing classes are persisted from custom components