- Add
->ago()
and->future()
helper methods to RealtimeClock
- Support specifying unescaped-slashes in
JSON::encode()
- Don't escape
/
in JSON-encoded log payloads from StackdriverApplicationLogger - Ensure StackdriverApplicationLogger can always log even with invalid UTF8 characters anywhere in payload
- Fix session & logging bugs when incoming user-agent contains invalid UTF8 or escape characters
- Support PHP 8.3
- Upgrade tests to support PHPUnit 11
- Drop support for PHP 8.1
- Support psr/log ^1.1 || ^2.0 || ^3.0
- Add DateIntervalUtils to stringify a DateInterval, and DateIntervalFactory for shorthand creation
- Add DateTimeImmutableFactory::zeroMicros() to create / modify a DT with microseconds truncated to zero
- Add DateTimeImmutableFactory::fromIso() to strictly parse ISO 8601 / RFC 3339 date-time strings
- Fix bug where devices with long user agents generated a database exception when attempting to create a session.
- Add assertCapturedOneExactTimer helper. Allowing you to simultaneously assert only one timer was recorded and the timer duration in a single method.
-
Fix a bug in UniqueMap where it throws on attempt to access an offset with a null value
-
Fix the docblock typehint for InitialisableSingletonTrait so that ::instance() to @return static
-
Add very light wrapper around the native sodium_crypto_box_seal... functions for anonymous public-key encryption. See the CryptoBox... classes. Provides strict typing, some automatic handling of secret memory (e.g. calling memzero on sensitive variables after use), a simple implementation of converting keys & ciphertexts to / from url-safe base64, and a basic mechanism to support key rotation with a fixed list of active keypairs.
-
Add a UniqueMap data structure class, for a strict associative array that throws on attempt to overwrite a key.
-
Drop support for PHP 8.0
-
Fix - the /tests directory was badly configured in the gitattributes and not actually excluded from the package.
-
Add a ConsistentStringScrambler - Consistently "randomise" the words in a string to be the same for the same random seed value using a Seeded Fisher-Yates shuffle
-
Add classes to simplify the creation and parsing of XML sitemaps
-
Add method to factory a DateTimeImmutable from a strict format and throw if it doesn't comply
-
Add TemporaryDirectoryManager to simplify the creation and destruction of temporary directories
-
Update
JSON::decode
to throw an explicit exception on NULL input This has always actually thrown an InvalidJSONException, but it used to be indistinguishable from theSyntax error
produced by empty/invalid JSON strings. -
Revert change in v1.16.0 that caught all
ErrorException
inJSON::decode
- these will now bubble as previously. -
Fix tests for StrictDate::date_after
-
Deprecate all StrictDate:: validation methods related to the deprecated
InvalidUserDateTime
object - validate date inputs either as strings or as (valid) date objects, not both.
-
Fix deprecation warning when passing NULL to date validator by casting to empty string to maintain current behaviour.
-
Make DbBackedMutexWrapper locking type-safe across PHP versions
- Support PHP 8.2
- Support PHP 8.1
- Drop support for PHP 7.4
- Optionally report the count of log entries to a MetricsAgent- see
StackdriverApplicationLogger::withMetrics()
- [BUG] Request memory usage logs introduced in 1.14 should have been reporting the "real" memory usage
e.g.
memory_get_peak_usage(TRUE)
rather than the less reliable emalloc based allocations php returns by default.
- StackdriverApplicationLogger: limit length of user-agent string in request logs to a maximum of 500 bytes.
- Now requires the
mbstring
PHP extension to be present. - StackdriverApplicationLogger: add the peak memory usage to the context info of the request logger (context.mem_mb).
- Add support to DateTimeImmutableFactory for creation from common 'Y-m-d H:i:s' format
- Deprecate old DateTimeImmutableFactory methods for creating DateTime objects from invalid user formats
- Extend MetricsAgent to handle additional metric types
- Add StatsiteAgent capable of formatting and sending UDP messages to statsite
- Add DateTimeDiff::microsBetween() to calculate the exact number of microseconds between two DateTimeImmutable values without any risk of floating point precision errors
- Support PHP8
- Thin interface for running a block of code inside an explicit database transaction Provides a null implementation for use in testing, and a Doctrine2 implementation that can be used if you're using Doctrine2 in your project. Alternatively you can implement your own wrapper as required.
- Barebones metrics interface which will be fleshed out in a further release
- OperationTimer for capturing timer metrics
- Correct @license tags
- [CAUTION] StoppedMockClock now stores / returns fractional seconds for consistency with real DateTimeImmutable PHP DateTime objects now always carry microseconds - the StoppedMockClock should therefore always include them in the times it accepts and returns. There is a possibility this will cause some strict equality checks in unit tests to fail. Not treated as a package breaking release as it only affects testcase code.
- Add ObjectPropertyRipper::ripAll to grab all variables (from simple objects with no private props in parent classes).
- Add DateTimeImmutableFactory and DateString methods for dealing with microsecond-precision date/time values
- Improve test assertion API on the MockMutexWrapper
- Support php^7.4
- Use new setcookie() signature
- Stable release of beta3 (no changes)
- Init the DeviceIdentifier to a fixed value in the CLI environment without setting any cookies, to prevent errors if the process has already sent output.
- Add MutexWrapper with Mock and Db (mysql) backed implementations for preventing concurrent executions of code.
- [BREAKING] Removed the $session_id parameter from
DefaultLogMetadata::requestTrace
- use the newDefaultLogMetadata::deviceIdentityLazy
method instead to capture the device ID into the logs. The session ID was removed because reading from $_COOKIE does not provide a value on the user's first request, and other methods (e.g. session_id()) may not give an accurate value if the session cookie name is customised but the session has not been started at the time of logging. - Add class to assign users a device ID cookie and provide the value for logging
- Add class to wrap accessing / setting / deleting cookies for injectability and testability
- Add helper method to get a DateTimeImmutable from a unix timestamp, in current timezone
- Add AssociativeArrayUtils for common operations on associative arrays
- Add InitialisableSingleonTrait for objects that need to be initialised as singletons
- Add StackdriverApplicationLogger framework and supporting classes
- Fix fatal error on updateSessionTimestamp due to incorrect variable naming. Made all vars consistent as $session_id to avoid recurrence.
- Fix missing return type from releaseLock when no lock is held
- Update MysqlSession to use strict sessions, SessionIdInterface and SessionUpdateTimestampHandlerInterface The updated hander solves a couple of edge cases where the session data could be written but not read if using the wrong hash. This would for example occur if an attacker attempted to overwrite and existing session, or if the hash salt changed during a user's session. The new handler uses strict session mode and custom handler logic to validate the session ID, including checking the hash, and issues a new session ID if it is invalid. The updated logic is also more performant at the database as sessions are only INSERTed on creation and subsequently UPDATEd, rather than the previous INSERT...ON DUPLICATE KEY UPDATE. **Note that ->initialise() now sets the session.use_strict_mode ini value as it is required for proper operation. This should be set anyway, and is only relevant to the handler (of which there can be only one) so this is not considered to be true global state or a breaking change.
- Add StaticAssetUrlProvider to provide simple cache-busted local URLs for CSS etc in local dev or remote (e.g. cloud storage / s3) urls in production.
- Allow DeploymentConfig->map() to return values in standalone environment
This brings the
standalone
closer to the behaviour of other environments, except that it will continue to return null if there is nothing mapped (where other environments will throw).->read
continues to return null in standalone in every case. Note that standalone will now return a value if there's one mapped forany
(*
) - which is a minor breaking change to the behaviour of the standalone environment.
- Add Base64Url StringEncoding helper class - like base64, but with entirely websafe characters for URLs etc
- Add JSON StringEncoding helper class - safe json parsing, encoding and prettifying with sane defaults
- Add DeploymentConfig sub-package for loading (and, optionally, decrypting) runtime environment configuration
- Allow asserting that the StoppedMockClock never slept
- First major release from 0.2.0
- Drop support for php < 7.2
- Run test suite against php 7.2
- Update StoppedMockClock to support newer phpunit (use namespaced assert class) and add unit tests.
- Add AbstractArrayRepository
- Add MysqlSession session handler
- Add StrictDate::on_or_after for validating date >= date ignoring any time component
- Extract the basic ValidNumber class for validating minimum
- Fix signature of InvalidUserDateTime::createFromMutable for PHP >= 5.6 compatibility
- Add RealtimeClock and StoppedMockClock testing wrapper
- First version