Skip to content

Commit 295be8d

Browse files
committed
refactor: remove Swoole extension checks and legacy compatibility logic
Signed-off-by: mmalac <[email protected]>
1 parent e05fada commit 295be8d

File tree

6 files changed

+2
-43
lines changed

6 files changed

+2
-43
lines changed

docs/book/v4/intro.md

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -13,10 +13,6 @@ $ pecl install swoole
1313

1414
For more information on the extension, [visit its package details on PECL](https://pecl.php.net/package/swoole).
1515

16-
> ### Legacy Swoole compatibility
17-
>
18-
> Since version 3.4.0, mezzio-swoole can work with either the original [Swoole](https://github.com/swoole/swoole-src) extension or the new community Swoole extension, as each defines the same classes, interfaces, and constants consumed by mezzio-swoole.
19-
2016
## Install mezzio-swoole
2117

2218
To install this package, use [Composer](https://getcomposer.org/):
@@ -27,7 +23,7 @@ $ composer require mezzio/mezzio-swoole
2723

2824
## Swoole with Mezzio
2925

30-
mezzio-swoole enables an Mezzio application to be executed with the [Swoole](https://wiki.swoole.com/) or original [Swoole](https://github.com/swoole/swoole-src) extensions.
26+
mezzio-swoole enables an Mezzio application to be executed with the [Swoole](https://github.com/swoole/swoole-src) extension.
3127
This means you can run the application from the command line, **without requiring a web server**.
3228

3329
You can run the application using the following command:

phpunit.xml.dist

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
<phpunit
33
xmlns:xsi="http://www.w3.org/2001/XMLSchema-instance"
44
xsi:noNamespaceSchemaLocation="vendor/phpunit/phpunit/phpunit.xsd"
5-
bootstrap="test/bootstrap.php"
5+
bootstrap="vendor/autoload.php"
66
cacheDirectory=".phpunit.cache"
77
displayDetailsOnIncompleteTests="true"
88
displayDetailsOnSkippedTests="true"

src/ConfigProvider.php

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,6 @@
3737
use Mezzio\Swoole\Event\WorkerStartEvent;
3838
use Mezzio\Swoole\Event\WorkerStartListener;
3939
use Mezzio\Swoole\Event\WorkerStartListenerFactory;
40-
use Mezzio\Swoole\Exception\ExtensionNotLoadedException;
4140
use Mezzio\Swoole\HotCodeReload\FileWatcher\InotifyFileWatcher;
4241
use Mezzio\Swoole\HotCodeReload\FileWatcherInterface;
4342
use Mezzio\Swoole\Log\AccessLogFactory;
@@ -53,7 +52,6 @@
5352
use Psr\Http\Message\ServerRequestInterface;
5453
use Swoole\Http\Server as SwooleHttpServer;
5554

56-
use function extension_loaded;
5755
use function getcwd;
5856

5957
use const PHP_SAPI;
@@ -69,14 +67,6 @@ class ConfigProvider
6967
{
7068
public function __invoke(): array
7169
{
72-
if (! extension_loaded('swoole')) {
73-
throw new ExtensionNotLoadedException(
74-
'One of either the Swoole (https://github.com/swoole/swoole-src) or'
75-
. ' Open Swoole (https://www.swoole.co.uk) extensions must be loaded'
76-
. ' to use mezzio/mezzio-swoole'
77-
);
78-
}
79-
8070
$config = PHP_SAPI === 'cli'
8171
? ['dependencies' => $this->getDependencies()]
8272
: [];

src/SwooleEmitter.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,6 @@
1414
use Psr\Http\Message\ResponseInterface;
1515
use Swoole\Http\Response as SwooleHttpResponse;
1616

17-
use function extension_loaded;
1817
use function implode;
1918
use function substr;
2019

@@ -40,10 +39,6 @@ public function __construct(private SwooleHttpResponse $swooleResponse)
4039
*/
4140
public function emit(ResponseInterface $response): bool
4241
{
43-
if (! extension_loaded('swoole')) {
44-
return false;
45-
}
46-
4742
if (PHP_SAPI !== 'cli') {
4843
return false;
4944
}

test/SwooleStreamTest.php

Lines changed: 0 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -15,7 +15,6 @@
1515
use RuntimeException;
1616
use Swoole\Http\Request as SwooleHttpRequest;
1717

18-
use function extension_loaded;
1918
use function strlen;
2019
use function substr;
2120

@@ -36,10 +35,6 @@ class SwooleStreamTest extends TestCase
3635

3736
protected function setUp(): void
3837
{
39-
if (! extension_loaded('swoole')) {
40-
$this->markTestSkipped('The Swoole extension is not available');
41-
}
42-
4338
$this->request = $this->createMock(SwooleHttpRequest::class);
4439
$this->request
4540
->method('rawContent')

test/bootstrap.php

Lines changed: 0 additions & 17 deletions
This file was deleted.

0 commit comments

Comments
 (0)