Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
43 commits
Select commit Hold shift + click to select a range
3d1100c
Upgrade to php 8.4
Sep 8, 2025
bbaae01
Upgrade phpdi
Sep 8, 2025
338629f
Upgrade container interface methods
Sep 8, 2025
55e922c
Replace `\Zend\Diactoros` imports with `\Laminas\Diactoros`
Sep 8, 2025
c7790dc
Replace Blast Facades with own implementation
Sep 8, 2025
c3d8ceb
Fix facade tests
Sep 8, 2025
98b9d28
Replace `Logger::[level]` calls with `Level::[level]`
Oct 1, 2025
4d43027
Update mindplay/middleman ->dispatch to ->handle
Oct 1, 2025
106232f
Remove support for callable route destinations (removed in Rareloop r…
Oct 1, 2025
37224e1
Resolve `trigger_error` deprecations
Oct 1, 2025
dbc3874
Bump mmeyer2k/dcrypt
Oct 1, 2025
cc2aa78
Bump bugfix release of mikey179/vfsstream - fixes test failure
Oct 1, 2025
5f0c4c6
Rework encryption
Oct 1, 2025
9f30468
Re-support php >= 8.1
Oct 6, 2025
300e934
Refactor Facade -> AbstractFacade
Oct 6, 2025
ea77350
Switch to Spatie/ignition
Oct 6, 2025
9cf7e13
Upgrade phpunit config
Oct 6, 2025
7bbeb1b
Remove php84 syntax from Application
Oct 7, 2025
27a4e6d
Implement SAPIEmitter and resolve old symfony error usage
Oct 7, 2025
e0d6f55
Roll collections version back to 10 to support PHP 8.1
adamtomat Oct 8, 2025
9fabb30
Ensure illuminate/encryption is also on v10
adamtomat Oct 8, 2025
9181ded
Revert Rector changes
adamtomat Oct 9, 2025
492a904
Formatting tweaks
adamtomat Oct 9, 2025
4222a32
Update EncryptionServiceProvider
adamtomat Oct 9, 2025
d69d636
Fix bug
adamtomat Oct 9, 2025
366d39f
Fix PHP errors
adamtomat Oct 9, 2025
2af859c
Fix namespaces
adamtomat Oct 9, 2025
0b1e036
WIP refactor encrypter and tests
adamtomat Oct 9, 2025
42a3199
Fix encryption and session storage
adamtomat Oct 13, 2025
c4fb85b
Revert encryption changes
adamtomat Oct 13, 2025
bba9526
Remove unused exceptions
adamtomat Oct 13, 2025
b8b2311
Revert encryption-key change
adamtomat Oct 13, 2025
b043f1f
Update composer file to use pinned versions
adamtomat Oct 13, 2025
521bf22
Tweak CI file
adamtomat Oct 13, 2025
7863e62
Use php-actions/composer@v6
adamtomat Oct 13, 2025
efbb11f
Test removing repositories
adamtomat Oct 13, 2025
3614c0e
Test
adamtomat Oct 13, 2025
96088c8
Test
adamtomat Oct 13, 2025
1058e8c
Add repository back in
adamtomat Oct 14, 2025
0b6e032
Bring forked dcrypt library into core
adamtomat Oct 14, 2025
fd519af
Update dependencies
adamtomat Oct 14, 2025
11e6cc7
Fix PHPCS issue
adamtomat Oct 14, 2025
f961127
Make session storage a bit more resilliant
adamtomat Oct 15, 2025
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
5 changes: 2 additions & 3 deletions .github/workflows/ci.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,7 @@ jobs:
runs-on: ubuntu-latest
strategy:
matrix:
php_version: [8.1, 8.2, 8.3]
php_version: [8.1, 8.2, 8.3, 8.4]
composer_flags: ['', '--prefer-lowest']

steps:
Expand All @@ -20,7 +20,7 @@ jobs:
extensions: xdebug

- name: Install dependencies
uses: php-actions/composer@v5
uses: php-actions/composer@v6
with:
php_version: ${{ matrix.php_version }}
args: ${{ matrix.composer_flags }}
Expand All @@ -44,4 +44,3 @@ jobs:
# run: |
# composer global require php-coveralls/php-coveralls
# ~/.composer/vendor/bin/php-coveralls -v

1 change: 1 addition & 0 deletions .gitignore
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@
vendor
composer.lock
/tests/Unit/logs
.phpunit.result.cache
58 changes: 32 additions & 26 deletions composer.json
Original file line number Diff line number Diff line change
Expand Up @@ -4,36 +4,41 @@
"license": "MIT",
"require": {
"php": ">=8.1",
"php-di/php-di": "^6.4.0",
"rareloop/router": "^6.0.2",
"psr/container": "^1.1.2",
"psr/http-message": "^1.1",
"php-di/php-di": "^7.1.1",
"rareloop/router": "^6.0.3",
"psr/container": "^2.0.2",
"psr/http-message": "^2",
"psr/http-server-middleware": "^1.0.2",
"blast/facades": "^1.0",
"timber/timber": "^2.3.0",
"monolog/monolog": "^2.9.1",
"http-interop/response-sender": "^1.0",
"symfony/debug": "^4.4.44",
"illuminate/collections": "^8.53.1||^9.52.16",
"timber/timber": "^2.3.3",
"monolog/monolog": "^3.9",
"illuminate/collections": "^10.49",
"statamic/stringy": "^3.1.3",
"laminas/laminas-diactoros": "^2.25.2",
"rareloop/psr7-server-request-extension": "^2.1.0",
"mmeyer2k/dcrypt": "^8.3.1",
"laminas/laminas-diactoros": "^3.6.0",
"rareloop/psr7-server-request-extension": "^2.2.0",
"spatie/macroable": "^1.0.1",
"mindplay/middleman": "^3.1.0",
"psr/log": "^1.1.4",
"laminas/laminas-zendframework-bridge": "^1.7",
"symfony/var-dumper": "^5.0||^6.3.6"
"mindplay/middleman": "^4.0.4",
"psr/log": "^2.0.0",
"symfony/var-dumper": "^6.4.26",
"spatie/ignition": "^1.15.1",
"laminas/laminas-httphandlerrunner": "^2.13",
"symfony/error-handler": "^6.4.26",
"illuminate/support": "^10.49",
"illuminate/pipeline": "^10.49",
"spatie/backtrace": "^1.8.1",
"illuminate/conditionable": "^10.49",
"guzzlehttp/guzzle": "^7.10",
"spatie/flare-client-php": "^1.10.1"
},
"require-dev": {
"phpunit/phpunit": "^9.6.13",
"php-coveralls/php-coveralls": "^2.6",
"mockery/mockery": "^1.6.6",
"brain/monkey": "^2.6.1",
"squizlabs/php_codesniffer": "^3.7.2",
"php-mock/php-mock": "^2.4.1",
"mikey179/vfsstream": "1.6.11",
"dms/phpunit-arraysubset-asserts": "^0.3.1"
"phpunit/phpunit": "^9.6.29",
"php-coveralls/php-coveralls": "^2.8",
"mockery/mockery": "^1.6.12",
"brain/monkey": "^2.6.2",
"squizlabs/php_codesniffer": "^3.13.4",
"php-mock/php-mock": "^2.6.2",
"mikey179/vfsstream": "^1.6.12",
"dms/phpunit-arraysubset-asserts": "^0.5.0",
"antecedent/patchwork": "^2.2.3"
},
"autoload": {
"psr-4": {
Expand All @@ -46,8 +51,9 @@
}
},
"config": {
"preferred-install": "dist",
"allow-plugins": {
"composer/installers": true
}
}
}
}
28 changes: 13 additions & 15 deletions src/Application.php
Original file line number Diff line number Diff line change
Expand Up @@ -3,15 +3,13 @@
namespace Rareloop\Lumberjack;

use Closure;
use DI\ContainerBuilder;
use DI\Container;
use Illuminate\Support\Collection;
use Interop\Container\ContainerInterface as InteropContainerInterface;
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
use Psr\Container\ContainerInterface;
use Psr\Http\Message\ResponseInterface;
use Rareloop\Router\Invoker;
use function Http\Response\send;

class Application implements ContainerInterface, InteropContainerInterface
class Application implements ContainerInterface
{
private $container;
private $loadedProviders = [];
Expand All @@ -24,7 +22,7 @@ class Application implements ContainerInterface, InteropContainerInterface

public function __construct($basePath = false)
{
$this->container = ContainerBuilder::buildDevContainer();
$this->container = new Container();

$this->bind(Application::class, $this);

Expand Down Expand Up @@ -152,7 +150,7 @@ private function isSingletonClassBind($id)
*
* @return bool
*/
public function has($id)
public function has($id): bool
{
return $this->container->has($id);
}
Expand Down Expand Up @@ -234,7 +232,7 @@ public function bootstrapWith(array $bootstrappers)
*
* @return boolean
*/
public function hasRequestBeenHandled() : bool
public function hasRequestBeenHandled(): bool
{
return $this->requestHandled;
}
Expand Down Expand Up @@ -265,17 +263,17 @@ public function detectWhenRequestHasNotBeenHandled()
if ($this->has('__wp-controller-miss-template') && $this->has('__wp-controller-miss-controller')) {
wp_die(
'Loaded template <code>' .
$this->get('__wp-controller-miss-template') .
'</code> but couldn\'t find class <code>' .
$this->get('__wp-controller-miss-controller') .
'</code>'
$this->get('__wp-controller-miss-template') .
'</code> but couldn\'t find class <code>' .
$this->get('__wp-controller-miss-controller') .
'</code>'
);
}
}
});
}

public function shutdown(ResponseInterface $response = null)
public function shutdown(?ResponseInterface $response = null)
{
if ($response) {
global $wp;
Expand All @@ -284,13 +282,13 @@ public function shutdown(ResponseInterface $response = null)
// If we're handling a WordPressController response at this point then WordPress will already have
// sent headers as it happens earlier in the lifecycle. For this scenario we need to do a bit more
// work to make sure that duplicate headers are not sent back.
send($this->removeSentHeadersAndMoveIntoResponse($response));
(new SapiEmitter())->emit($this->removeSentHeadersAndMoveIntoResponse($response));
}

die();
}

protected function removeSentHeadersAndMoveIntoResponse(ResponseInterface $response) : ResponseInterface
protected function removeSentHeadersAndMoveIntoResponse(ResponseInterface $response): ResponseInterface
{
// 1. Format the previously sent headers into an array of [key, value]
// 2. Remove all headers from the output that we find
Expand Down
22 changes: 11 additions & 11 deletions src/Bootstrappers/RegisterExceptionHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,18 @@

namespace Rareloop\Lumberjack\Bootstrappers;

use DI\NotFoundException;
use Error;
use ErrorException;
use Psr\Http\Message\ResponseInterface;
use DI\NotFoundException;
use function Http\Response\send;
use Rareloop\Router\Responsable;
use Rareloop\Lumberjack\Application;
use Psr\Http\Message\ResponseInterface;
use Laminas\Diactoros\ServerRequestFactory;
use Laminas\HttpHandlerRunner\Emitter\SapiEmitter;
use Rareloop\Lumberjack\Exceptions\HandlerInterface;
use Rareloop\Router\Responsable;
use Symfony\Component\Debug\Exception\FatalErrorException;
use Zend\Diactoros\ServerRequestFactory;
use function Http\Response\send;
use Symfony\Component\ErrorHandler\Error\FatalError;

/**
* Determine whether or not we should be in debug mode or not
Expand Down Expand Up @@ -70,7 +72,7 @@ public function handleException($e)

public function send(ResponseInterface $response)
{
@send($response);
@(new SapiEmitter())->emit($response);
}

protected function getExceptionHandler(): HandlerInterface
Expand Down Expand Up @@ -122,16 +124,14 @@ public function handleShutdown()
*
* @param array $error
* @param int|null $traceOffset
* @return \Symfony\Component\Debug\Exception\FatalErrorException
* @return \Symfony\Component\ErrorHandler\Error\FatalError
*/
protected function fatalExceptionFromError(array $error, $traceOffset = null)
{
return new FatalErrorException(
return new FatalError(
$error['message'],
$error['type'],
0,
$error['file'],
$error['line'],
$error,
$traceOffset
);
}
Expand Down
2 changes: 1 addition & 1 deletion src/Bootstrappers/RegisterFacades.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,8 @@

namespace Rareloop\Lumberjack\Bootstrappers;

use Blast\Facades\FacadeFactory;
use Rareloop\Lumberjack\Application;
use Rareloop\Lumberjack\FacadeFactory;

class RegisterFacades
{
Expand Down
2 changes: 1 addition & 1 deletion src/Config.php
Original file line number Diff line number Diff line change
Expand Up @@ -9,7 +9,7 @@ class Config
{
private $data = [];

public function __construct(string $path = null)
public function __construct(?string $path = null)
{
if ($path) {
$this->load($path);
Expand Down
2 changes: 1 addition & 1 deletion src/Contracts/QueryBuilder.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@ public function offset($offset): QueryBuilder;

public function orderBy($orderBy, string $order = QueryBuilder::ASC): QueryBuilder;

public function orderByMeta($metaKey, string $order = QueryBuilder::ASC, string $type = null): QueryBuilder;
public function orderByMeta($metaKey, string $order = QueryBuilder::ASC, ?string $type = null): QueryBuilder;

public function whereIdIn(array $ids): QueryBuilder;

Expand Down
42 changes: 42 additions & 0 deletions src/Dcrypt/AesCbc.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,42 @@
<?php

/**
* AesCbc.php
*
* PHP version 7
*
* @category Dcrypt
* @package Dcrypt
* @author Michael Meyer (mmeyer2k) <m.meyer2k@gmail.com>
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @link https://github.com/mmeyer2k/dcrypt
*/

namespace Rareloop\Lumberjack\Dcrypt;

/**
* Symmetric AES-256-CBC encryption functions powered by OpenSSL.
*
* @category Dcrypt
* @package Dcrypt
* @author Michael Meyer (mmeyer2k) <m.meyer2k@gmail.com>
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @link https://github.com/mmeyer2k/dcrypt
* @link https://apigen.ci/github/mmeyer2k/dcrypt/namespace-Dcrypt.html
*/
class AesCbc extends OpensslBridge
{
/**
* AES-256 cipher identifier that will be passed to openssl
*
* @var string
*/
const CIPHER = 'aes-256-cbc';

/**
* Specify sha256 for message authentication
*
* @var string
*/
const CHKSUM = 'sha256';
}
35 changes: 35 additions & 0 deletions src/Dcrypt/AesCtr.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,35 @@
<?php

/**
* AesCtr.php
*
* PHP version 7
*
* @category Dcrypt
* @package Dcrypt
* @author Michael Meyer (mmeyer2k) <m.meyer2k@gmail.com>
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @link https://github.com/mmeyer2k/dcrypt
*/

namespace Rareloop\Lumberjack\Dcrypt;

/**
* Symmetric AES-256-CTR encryption functions powered by OpenSSL.
*
* @category Dcrypt
* @package Dcrypt
* @author Michael Meyer (mmeyer2k) <m.meyer2k@gmail.com>
* @license http://opensource.org/licenses/MIT The MIT License (MIT)
* @link https://github.com/mmeyer2k/dcrypt
* @link https://apigen.ci/github/mmeyer2k/dcrypt/namespace-Dcrypt.html
*/
class AesCtr extends AesCbc
{
/**
* AES-256 cipher identifier that will be passed to openssl
*
* @var string
*/
const CIPHER = 'aes-256-ctr';
}
Loading