Skip to content

Commit

Permalink
Draft: Rebranding (#3)
Browse files Browse the repository at this point in the history
* Namespace change

* Exception rename

* Replace all old name entries

* Replace image in readme
  • Loading branch information
luzrain authored Mar 22, 2024
1 parent 01b878c commit efcdde4
Show file tree
Hide file tree
Showing 72 changed files with 247 additions and 247 deletions.
36 changes: 18 additions & 18 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,19 +1,19 @@
<p align="center">
<picture>
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/luzrain/phprunner/assets/25800964/b6d62fc9-d08b-4ac7-be0b-2da6653d4c6b">
<img alt="PhpRunner logo" align="center" src="https://github.com/luzrain/phprunner/assets/25800964/9107aca7-13e0-40a9-b107-7dde99f171d1">
<source media="(prefers-color-scheme: dark)" srcset="https://github.com/luzrain/phprunner/assets/25800964/3e1bb7da-5fa8-47cf-8c95-5454b8b5959f">
<img alt="PHPStreamServer logo" align="center" width="70%" src="https://github.com/luzrain/phprunner/assets/25800964/5664f293-41a5-424e-9f52-a403b222b17d">
</picture>
</p>

# PhpRunner - PHP Application Server
# PHPStreamServer - PHP Application Server
![PHP >=8.2](https://img.shields.io/badge/PHP->=8.2-777bb3.svg?style=flat)
[![Version](https://img.shields.io/github/v/tag/luzrain/phprunner?label=Version&filter=v*.*.*&sort=semver&color=374151)](../../releases)
[![Tests Status](https://img.shields.io/github/actions/workflow/status/luzrain/phprunner/tests.yaml?label=Tests&branch=master)](../../actions/workflows/tests.yaml)
[![Version](https://img.shields.io/github/v/tag/luzrain/phpstreamserver?label=Version&filter=v*.*.*&sort=semver&color=374151)](../../releases)
[![Tests Status](https://img.shields.io/github/actions/workflow/status/luzrain/phpstreamserver/tests.yaml?label=Tests&branch=master)](../../actions/workflows/tests.yaml)

PhpRunner is a high performance event-loop based process manager, TCP, and UDP server written in PHP.
PHPStreamServer is a high performance event-loop based process manager, TCP, and UDP server written in PHP.
With a built-in PSR-7 HTTP server you can easily integrate any PSR-7 compatible framework with it in no time.
The built-in HTTP server is memory efficient no matter how large your HTTP requests and responses you operate are.
PhpRunner is supports TLS encryption and the ability to implement custom protocols.
PHPStreamServer is supports TLS encryption and the ability to implement custom protocols.

#### Key features:
- Supervisor;
Expand All @@ -28,25 +28,25 @@ PhpRunner is supports TLS encryption and the ability to implement custom protoco
## Getting started
### Install composer packages
```bash
$ composer require luzrain/phprunner
$ composer require luzrain/phpstreamserver
```

### Configure server
Here is example of simple http server.
```php
// server.php

use Luzrain\PhpRunner\Exception\HttpException;
use Luzrain\PhpRunner\Listener;
use Luzrain\PhpRunner\Server;
use Luzrain\PhpRunner\Server\Connection\ConnectionInterface;
use Luzrain\PhpRunner\Server\Http\Psr7\Response;
use Luzrain\PhpRunner\Server\Protocols\Http;
use Luzrain\PhpRunner\WorkerProcess;
use Luzrain\PHPStreamServer\Exception\HttpException;
use Luzrain\PHPStreamServer\Listener;
use Luzrain\PHPStreamServer\Server;
use Luzrain\PHPStreamServer\Server\Connection\ConnectionInterface;
use Luzrain\PHPStreamServer\Server\Http\Psr7\Response;
use Luzrain\PHPStreamServer\Server\Protocols\Http;
use Luzrain\PHPStreamServer\WorkerProcess;
use Psr\Http\Message\ServerRequestInterface;

$phpRunner = new Server();
$phpRunner->addWorkers(
$server = new Server();
$server->addWorkers(
new WorkerProcess(
name: 'HTTP Server',
onStart: function (WorkerProcess $worker) {
Expand All @@ -65,7 +65,7 @@ $phpRunner->addWorkers(
},
),
);
exit($phpRunner->run());
exit($server->run());
```

### Run
Expand Down
10 changes: 5 additions & 5 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "luzrain/phprunner",
"name": "luzrain/phpstreamserver",
"description": "High performance PHP application server",
"keywords": ["phprunner", "async", "http", "server", "process"],
"homepage": "https://github.com/luzrain/phprunner",
"keywords": ["phpstreamserver", "async", "http", "server", "process", "socket", "stream"],
"homepage": "https://github.com/luzrain/phpstreamserver",
"type": "library",
"license": "MIT",
"authors": [
Expand Down Expand Up @@ -30,12 +30,12 @@
},
"autoload": {
"psr-4": {
"Luzrain\\PhpRunner\\": "src/"
"Luzrain\\PHPStreamServer\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Luzrain\\PhpRunner\\Test\\": "tests/"
"Luzrain\\PHPStreamServer\\Test\\": "tests/"
}
},
"suggest": {
Expand Down
12 changes: 6 additions & 6 deletions src/Command/ConnectionsCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Console\Table;
use Luzrain\PhpRunner\Internal\Functions;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PhpRunner\Server\Connection\ActiveConnection;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Console\Table;
use Luzrain\PHPStreamServer\Internal\Functions;
use Luzrain\PHPStreamServer\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Server\Connection\ActiveConnection;

final class ConnectionsCommand implements Command
{
Expand Down
12 changes: 6 additions & 6 deletions src/Command/ProcessesCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Console\Table;
use Luzrain\PhpRunner\Internal\Functions;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PhpRunner\Internal\Status\WorkerProcessStatus;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Console\Table;
use Luzrain\PHPStreamServer\Internal\Functions;
use Luzrain\PHPStreamServer\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Internal\Status\WorkerProcessStatus;

final class ProcessesCommand implements Command
{
Expand Down
6 changes: 3 additions & 3 deletions src/Command/ReloadCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Internal\MasterProcess;

final class ReloadCommand implements Command
{
Expand Down
12 changes: 6 additions & 6 deletions src/Command/StartCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Console\Table;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PhpRunner\Internal\Status\WorkerStatus;
use Luzrain\PhpRunner\Server;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Console\Table;
use Luzrain\PHPStreamServer\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Internal\Status\WorkerStatus;
use Luzrain\PHPStreamServer\Server;

final class StartCommand implements Command
{
Expand Down
12 changes: 6 additions & 6 deletions src/Command/StatusCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,13 +2,13 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Console\Table;
use Luzrain\PhpRunner\Internal\Functions;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PhpRunner\Server;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Console\Table;
use Luzrain\PHPStreamServer\Internal\Functions;
use Luzrain\PHPStreamServer\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Server;

final class StatusCommand implements Command
{
Expand Down
6 changes: 3 additions & 3 deletions src/Command/StatusJsonCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Internal\MasterProcess;

final class StatusJsonCommand implements Command
{
Expand Down
6 changes: 3 additions & 3 deletions src/Command/StopCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Internal\MasterProcess;

final class StopCommand implements Command
{
Expand Down
10 changes: 5 additions & 5 deletions src/Command/WorkersCommand.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Command;
namespace Luzrain\PHPStreamServer\Command;

use Luzrain\PhpRunner\Console\Command;
use Luzrain\PhpRunner\Console\Table;
use Luzrain\PhpRunner\Internal\MasterProcess;
use Luzrain\PhpRunner\Internal\Status\WorkerStatus;
use Luzrain\PHPStreamServer\Console\Command;
use Luzrain\PHPStreamServer\Console\Table;
use Luzrain\PHPStreamServer\Internal\MasterProcess;
use Luzrain\PHPStreamServer\Internal\Status\WorkerStatus;

final class WorkersCommand implements Command
{
Expand Down
6 changes: 3 additions & 3 deletions src/Console/App.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Console;
namespace Luzrain\PHPStreamServer\Console;

use Luzrain\PhpRunner\Internal\Functions;
use Luzrain\PhpRunner\Server;
use Luzrain\PHPStreamServer\Internal\Functions;
use Luzrain\PHPStreamServer\Server;

final class App
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Colorizer.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Console;
namespace Luzrain\PHPStreamServer\Console;

final class Colorizer
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Console;
namespace Luzrain\PHPStreamServer\Console;

interface Command
{
Expand Down
2 changes: 1 addition & 1 deletion src/Console/StdoutHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Console;
namespace Luzrain\PHPStreamServer\Console;

/**
* Handler for redirect standard output to custom stream
Expand Down
2 changes: 1 addition & 1 deletion src/Console/Table.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Console;
namespace Luzrain\PHPStreamServer\Console;

/**
* @internal
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/EncodeTypeError.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Exception;
namespace Luzrain\PHPStreamServer\Exception;

final class EncodeTypeError extends \TypeError
{
Expand Down
10 changes: 5 additions & 5 deletions src/Exception/HttpException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,12 +2,12 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Exception;
namespace Luzrain\PHPStreamServer\Exception;

use Luzrain\PhpRunner\Internal\Functions;
use Luzrain\PhpRunner\Server\Http\ErrorPage;
use Luzrain\PhpRunner\Server\Http\Psr7\Response;
use Luzrain\PhpRunner\Server\Http\Psr7\StringStream;
use Luzrain\PHPStreamServer\Internal\Functions;
use Luzrain\PHPStreamServer\Server\Http\ErrorPage;
use Luzrain\PHPStreamServer\Server\Http\Psr7\Response;
use Luzrain\PHPStreamServer\Server\Http\Psr7\StringStream;
use Psr\Http\Message\ResponseInterface;

final class HttpException extends \Exception
Expand Down
9 changes: 9 additions & 0 deletions src/Exception/PHPStreamServerException.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
<?php

declare(strict_types=1);

namespace Luzrain\PHPStreamServer\Exception;

final class PHPStreamServerException extends \RuntimeException
{
}
9 changes: 0 additions & 9 deletions src/Exception/PhpRunnerException.php

This file was deleted.

2 changes: 1 addition & 1 deletion src/Exception/SendTypeError.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Exception;
namespace Luzrain\PHPStreamServer\Exception;

final class SendTypeError extends \TypeError
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/TlsHandshakeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Exception;
namespace Luzrain\PHPStreamServer\Exception;

final class TlsHandshakeException extends \Exception
{
Expand Down
4 changes: 2 additions & 2 deletions src/Exception/TooLargePayload.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Exception;
namespace Luzrain\PHPStreamServer\Exception;

use Luzrain\PhpRunner\Internal\Functions;
use Luzrain\PHPStreamServer\Internal\Functions;

final class TooLargePayload extends \Exception
{
Expand Down
2 changes: 1 addition & 1 deletion src/Exception/UserChangeException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Exception;
namespace Luzrain\PHPStreamServer\Exception;

final class UserChangeException extends \Exception
{
Expand Down
8 changes: 4 additions & 4 deletions src/Internal/ErrorHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Luzrain\PhpRunner\Internal;
namespace Luzrain\PHPStreamServer\Internal;

use Luzrain\PhpRunner\Exception\HttpException;
use Luzrain\PhpRunner\Exception\TlsHandshakeException;
use Luzrain\PhpRunner\Exception\TooLargePayload;
use Luzrain\PHPStreamServer\Exception\HttpException;
use Luzrain\PHPStreamServer\Exception\TlsHandshakeException;
use Luzrain\PHPStreamServer\Exception\TooLargePayload;
use Psr\Log\LoggerInterface;
use Psr\Log\LogLevel;

Expand Down
Loading

0 comments on commit efcdde4

Please sign in to comment.