PHP.GT

Latest releases

Config: FileWriter

Published on by Greg Bowler

Now the library reads in from .dev, .deploy and .prod ini files, it is possible to write to these files too, which is intended to enhance continuous deployment tasks.

Config: Feature release

Published on by Greg Bowler

  • Underscores used in environment variables to separate section and key
  • ConfigSection made immutable
  • Load default configuration from file(s)
  • Load override configuration from file(s)
  • Strengthen tests

Config:

Published on by Greg Bowler

  • Implement key prefixes
  • Configurable separator
  • Allow passing existing array of config
  • Load in variables from the environment
  • Load in variables from ini

DomTemplate: Improved data binding

Published on by Greg Bowler

  • Do not output -t prefix when XPath name used
  • Carry over classes from source elements when expanding components
  • Clone templates to avoid same templates being reused
  • Inject data into attribute values using braces

Database: Parameter enhancements

Published on by Greg Bowler

  • Multiple iterable objects can be passed into the query function as variable arguments, the key-value-pairs will be merged into one parameter binding.
  • Bound parameters are flattened more effectively.
  • SqlQuery/Query class refactoring.

Database: Enhanced migrations

Published on by Greg Bowler

This feature release contains enhanced migration functionality, along with some small refactorings.

  • More meaningful exceptions thrown when migrations are halted
  • Windows compatibility
  • Test edge cases of different migration file lists
  • Simplify migration order rules
  • Client class is more meaningfully renamed to Database

Session: Bug fixes

Published on by Greg Bowler

This pre-release fully tests the Session class itself while fixing any bugs or design changes that came up in the testing process.

Input: Improvements to two key functions

Published on by Greg Bowler

Test coverage has been improved, along with improvements to two key functions:

  • Instead of just has, the new hasValue function is introduced (issue #17)
  • The when function can be set to trigger on just a key’s presence, rather than a key’s value (issue #15)

DomTemplate: Fragments, templates and components improved

Published on by Greg Bowler

  • DocumentFragment::appendHTML allows HTML5 to be appended to the fragment directly
  • Fix recursive expandComponents when components are nested
  • Looser type checking where document fragments are allowed
  • Edge case tests
  • t- and c- class prefixes normalised

Dom: Bug fix and dependency bump

Published on by Greg Bowler

Thanks to @jaroslavtyc for catching a bug that affected getting ID by magic __get access. The PHP return type now allows the correct nullable type for when there is no element by the provided ID.

Dependencies have been bumped up with this minor release.

Session: I.E. / Edge

Published on by Greg Bowler

A bug has been resolved that prevented I.E. and Edge from storing the session cookie correctly. This was due to the “path” parameter of the Set-Cookie header to be incorrectly sharing the on-disk path of the session file. Other browsers seemed to allow this, but has been fixed now.

Dom: Bugfixes

Published on by Greg Bowler

  • innerText synonymous for textContent on Element
  • getAttribute compatibility with DOM Level 4
  • Retrieving an out-of-bounds NodeList element returns null
  • NodeList bug fixed where Countable affects Iterator key

DomTemplate: Components made more flexible

Published on by Greg Bowler

Components behave better when mixed with templates.

Notably, a component can be nested within a template element, and its value will be expanded as soon as the template is used, rather than when the template is rendered to the page. This allows the developer to manipulate the contents of the component on-the-fly.

Input: General API improvements

Published on by Greg Bowler

  • More meaningful exceptions thrown.
  • Tests’ data providers improved.
  • All parameters passed if there is no when in the trigger.
  • Different parameter types can be cast using getter functions on InputData.

Input: FileUpload support

Published on by Greg Bowler

The main changes in this release consist of the way the three array-like objects are handled internally; QueryStringInputData, BodyInputData and FileUploadInputData now all extend the same base class, InputData allowing a consistent API with extended functionality where necessary.

FileUploadInputData is a new array-like object used to access the user-uploaded files, introduced by this release. The object unwraps the $_FILES superglobal into a data structure that makes sense, finally representing the individual files as FileUpload objects.

Input: Improve API design while moving towards FileUpload support

Published on by Greg Bowler

Two issues have come together to drastically improve the library:

FileUpload support is required now that key-value-pairs work. An improvement to how callbacks are triggered required refactoring. This update includes a large refactor compromising mainly of the following:

Classes broken out into more granular parts. Namespaces bundle similar classes together. All user input types, including FileUpload, extend common base class AbstractInputData. All values of user input are handled as InputDatum instances.

Session: First handler implemented

Published on by Greg Bowler

This first release marks the first working version of a SessionHandler implementation: FileHandler.

There are currently 0 tests as this class was built as an explorative feasibility idea. Now we have a working session class, tests can be written and depending on the number of issues caught, we can drive towards a v1 release pretty quickly.

Curl: OOP improvements

Published on by Greg Bowler

  • Exceptions instead of returning errors.
  • Curl Multi Info extracted into its own interface.
  • No return types are ambiguous.

Cookie: CookieHandler complete

Published on by Greg Bowler

The CookieHandler class is what is used to interface with cookies, and behaves just like the $_COOKIE superglobal so it is easy to get used to.

  • ArrayAccess to get quick access to cookie values.
  • get, set, has, delete methods for OOP usage.

Cookie: Cookie object implemented

Published on by Greg Bowler

The Cookie object is a very simple object that acts as a representation of a key value pair, but with the immutable object pattern to avoid other classes editing their value on-the-fly.

“The practice by which changes result in a new instance is termed immutability, and is a feature designed to ensure the integrity of a given value”.

This is important with Cookies, because once they are set on the Request/Response, they object representation shouldn’t be changed without being set again.

ProtectedGlobal: Initial release

Published on by Greg Bowler

The initial functionality was scoped out, but when implementing with the real $GLOBALS array, a few changes were necessary.

This release marks the initial scope for the repository. Before v1 is near there needs to be tests for edge cases and more usage with the real $GLOBALS array throughout the WebEngine.

DomTemplate: Bindable class lists

Published on by Greg Bowler

The final planned feature for v1 is now implemented: bindable class lists.

Automatically toggle a class name of an element depending on a truthy value of the dataset.