Skip to content

Commit

Permalink
Rename
Browse files Browse the repository at this point in the history
  • Loading branch information
luzrain committed Mar 22, 2024
1 parent 716a1d1 commit 4b45f15
Show file tree
Hide file tree
Showing 43 changed files with 129 additions and 129 deletions.
34 changes: 17 additions & 17 deletions README.md
Original file line number Diff line number Diff line change
@@ -1,15 +1,15 @@
# PhpRunner runtime for symfony applications
# PHPStreamServer runtime for symfony applications
![PHP >=8.2](https://img.shields.io/badge/PHP->=8.2-777bb3.svg?style=flat)
![Symfony ^7.0](https://img.shields.io/badge/Symfony-^7.0-374151.svg?style=flat)
[![Version](https://img.shields.io/github/v/tag/luzrain/phprunner-bundle?label=Version&filter=v*.*.*&sort=semver&color=374151)](../../releases)
[![Tests Status](https://img.shields.io/github/actions/workflow/status/luzrain/phprunner-bundle/tests.yaml?label=Tests&branch=master)](../../actions/workflows/tests.yaml)
[![Version](https://img.shields.io/github/v/tag/luzrain/phpstreamserver-bundle?label=Version&filter=v*.*.*&sort=semver&color=374151)](../../releases)
[![Tests Status](https://img.shields.io/github/actions/workflow/status/luzrain/phpstreamserver-bundle/tests.yaml?label=Tests&branch=master)](../../actions/workflows/tests.yaml)

This bundle provides a [PhpRunner](https://github.com/luzrain/phprunner) integration with Symfony framework to run your application in a highly efficient event-loop based runtime.
This bundle provides a [PHPStreamServer](https://github.com/luzrain/phpstreamserver) integration with Symfony framework to run your application in a highly efficient event-loop based runtime.

## Getting started
### Install composer packages
```bash
$ composer require luzrain/phprunner-bundle
$ composer require luzrain/phpstreamserver-bundle
```

### Enable the bundle
Expand All @@ -19,21 +19,21 @@ $ composer require luzrain/phprunner-bundle

return [
// ...
Luzrain\PhpRunnerBundle\PhpRunnerBundle::class => ['all' => true],
Luzrain\PHPStreamServerBundle\PHPStreamServerBundle::class => ['all' => true],
];
```

### Configure the bundle
A minimal configuration might look like this.
For all available options with documentation, see the command output.
```bash
$ bin/console config:dump-reference phprunner
$ bin/console config:dump-reference phpstreamserver
```

```yaml
# config/packages/phprunner.yaml
# config/packages/phpstreamserver.yaml

phprunner:
phpstreamserver:
servers:
- name: 'Webserver'
listen: http://0.0.0.0:80
Expand All @@ -42,7 +42,7 @@ phprunner:
### Start application
```bash
$ APP_RUNTIME=Luzrain\\PhpRunnerBundle\\Runtime php public/index.php start
$ APP_RUNTIME=Luzrain\\PHPStreamServerBundle\\Runtime php public/index.php start
```

\* For better performance, install the _php-uv_ extension.
Expand Down Expand Up @@ -71,13 +71,13 @@ The bundle provides several restart strategies that can be configured depending

See all available options for each strategy in the command output.
```bash
$ bin/console config:dump-reference phprunner reload_strategy
$ bin/console config:dump-reference phpstreamserver reload_strategy
```

```yaml
# config/packages/phprunner.yaml
# config/packages/phpstreamserver.yaml

phprunner:
phpstreamserver:
reload_strategy:
on_exception:
active: true
Expand All @@ -99,9 +99,9 @@ Schedule string can be formatted in several ways:
** Note that you need to install the [dragonmantank/cron-expression](https://github.com/dragonmantank/cron-expression) package if you want to use cron expressions as schedule strings
```yaml
# config/packages/phprunner.yaml
# config/packages/phpstreamserver.yaml

phprunner:
phpstreamserver:
tasks:
# Runs external program every 15 seconds
- name: 'Task 1'
Expand All @@ -120,9 +120,9 @@ It can also work with both external commands and internal Symfony commands.
To run a Symfony command, simply type the command name without any prefixes.
```yaml
# config/packages/phprunner.yaml
# config/packages/phpstreamserver.yaml

phprunner:
phpstreamserver:
processes:
# Runs external program
- name: 'External process'
Expand Down
14 changes: 7 additions & 7 deletions composer.json
Original file line number Diff line number Diff line change
@@ -1,8 +1,8 @@
{
"name": "luzrain/phprunner-bundle",
"description": "Phprunner runtime for symfony applications",
"keywords": ["phprunner", "symfony", "runtime", "php-runtime"],
"homepage": "https://github.com/luzrain/phprunner-bundle",
"name": "luzrain/phpstreamserver-bundle",
"description": "PHPStreamServer runtime for symfony applications",
"keywords": ["phpstreamserver", "symfony", "runtime", "php-runtime"],
"homepage": "https://github.com/luzrain/phpstreamserver-bundle",
"type": "symfony-bundle",
"license": "MIT",
"authors": [
Expand All @@ -15,7 +15,7 @@
"php": ">=8.2",
"ext-pcntl": "*",
"ext-posix": "*",
"luzrain/phprunner": "^0.1",
"luzrain/phpstreamserver": "^0.2.0",
"psr/http-factory": "^1.0",
"symfony/config": "^7.0",
"symfony/dependency-injection": "^7.0",
Expand All @@ -37,12 +37,12 @@
},
"autoload": {
"psr-4": {
"Luzrain\\PhpRunnerBundle\\": "src/"
"Luzrain\\PHPStreamServerBundle\\": "src/"
}
},
"autoload-dev": {
"psr-4": {
"Luzrain\\PhpRunnerBundle\\Test\\": "tests/"
"Luzrain\\PHPStreamServerBundle\\Test\\": "tests/"
}
},
"scripts": {
Expand Down
4 changes: 2 additions & 2 deletions phpunit.xml
Original file line number Diff line number Diff line change
Expand Up @@ -17,8 +17,8 @@
</include>
</source>
<php>
<env name="KERNEL_CLASS" value="Luzrain\PhpRunnerBundle\Test\App\Kernel" />
<env name="APP_RUNTIME" value="Luzrain\PhpRunnerBundle\Runtime" />
<env name="KERNEL_CLASS" value="Luzrain\PHPStreamServerBundle\Test\App\Kernel" />
<env name="APP_RUNTIME" value="Luzrain\PHPStreamServerBundle\Runtime" />
<env name="APP_ENV" value="test" />
<env name="SHELL_VERBOSITY" value="1" />
</php>
Expand Down
6 changes: 3 additions & 3 deletions src/ConfigLoader.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle;
namespace Luzrain\PHPStreamServerBundle;

use Symfony\Component\Config\ConfigCache;
use Symfony\Component\Config\Resource\DirectoryResource;
Expand All @@ -15,7 +15,7 @@ final class ConfigLoader implements CacheWarmerInterface

public function __construct(private string $projectDir, string $cacheDir, bool $isDebug)
{
$this->cache = new ConfigCache(\sprintf('%s/phprunner_config.cache.php', $cacheDir), $isDebug);
$this->cache = new ConfigCache(\sprintf('%s/phpss_config.cache.php', $cacheDir), $isDebug);
}

public function isOptional(): bool
Expand All @@ -26,7 +26,7 @@ public function isOptional(): bool
public function warmUp(string $cacheDir, string $buildDir = null): array
{
$packagesDir = \sprintf('%s/config/packages', $this->projectDir);
$metadata = \is_dir($packagesDir) ? [new DirectoryResource($packagesDir, '/phprunner/')] : [];
$metadata = \is_dir($packagesDir) ? [new DirectoryResource($packagesDir, '/phpstreamserver/')] : [];
$this->cache->write(\sprintf('<?php return %s;', \var_export($this->config, true)), $metadata);

return [];
Expand Down
4 changes: 2 additions & 2 deletions src/Event/HttpServerStartEvent.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\Event;
namespace Luzrain\PHPStreamServerBundle\Event;

use Luzrain\PhpRunner\WorkerProcess;
use Luzrain\PHPStreamServer\WorkerProcess;
use Symfony\Contracts\EventDispatcher\Event;

final class HttpServerStartEvent extends Event
Expand Down
2 changes: 1 addition & 1 deletion src/FileMonitorWatcher/FileMonitorWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\FileMonitorWatcher;
namespace Luzrain\PHPStreamServerBundle\FileMonitorWatcher;

use Psr\Log\LoggerInterface;
use Revolt\EventLoop\Driver;
Expand Down
2 changes: 1 addition & 1 deletion src/FileMonitorWatcher/InotifyMonitorWatcher.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\FileMonitorWatcher;
namespace Luzrain\PHPStreamServerBundle\FileMonitorWatcher;

use Revolt\EventLoop\Driver;

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

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\FileMonitorWatcher;
namespace Luzrain\PHPStreamServerBundle\FileMonitorWatcher;

use Revolt\EventLoop\Driver;

Expand Down
4 changes: 2 additions & 2 deletions src/Http/HttpRequestHandler.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\Http;
namespace Luzrain\PHPStreamServerBundle\Http;

use Luzrain\PhpRunner\WorkerProcess;
use Luzrain\PHPStreamServer\WorkerProcess;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Http/MimeTypeMapper.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\Http;
namespace Luzrain\PHPStreamServerBundle\Http;

final class MimeTypeMapper
{
Expand Down
8 changes: 4 additions & 4 deletions src/Http/Psr17Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\Http;
namespace Luzrain\PHPStreamServerBundle\Http;

use Luzrain\PhpRunner\Server\Http\Psr7\ResourceStream;
use Luzrain\PhpRunner\Server\Http\Psr7\Response;
use Luzrain\PhpRunner\Server\Http\Psr7\StringStream;
use Luzrain\PHPStreamServer\Server\Http\Psr7\ResourceStream;
use Luzrain\PHPStreamServer\Server\Http\Psr7\Response;
use Luzrain\PHPStreamServer\Server\Http\Psr7\StringStream;
use Psr\Http\Message\ResponseFactoryInterface;
use Psr\Http\Message\ResponseInterface;
use Psr\Http\Message\ServerRequestFactoryInterface;
Expand Down
2 changes: 1 addition & 1 deletion src/Internal/Functions.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\Internal;
namespace Luzrain\PHPStreamServerBundle\Internal;

/**
* @internal
Expand Down
6 changes: 3 additions & 3 deletions src/Internal/WorkerConfigurator.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,9 +2,9 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\Internal;
namespace Luzrain\PHPStreamServerBundle\Internal;

use Luzrain\PhpRunner\WorkerProcess;
use Luzrain\PHPStreamServer\WorkerProcess;
use Psr\Log\LoggerInterface;
use Symfony\Component\ErrorHandler\ErrorHandler;
use Symfony\Component\HttpKernel\KernelInterface;
Expand All @@ -22,7 +22,7 @@ public function configure(WorkerProcess $worker): void
* @psalm-suppress UndefinedInterfaceMethod
*/
if ($this->logger instanceof \Monolog\Logger) {
$this->logger = $this->logger->withName('phprunner');
$this->logger = $this->logger->withName('phpstreamserver');
}

$errorHandler = ErrorHandler::register(null, false);
Expand Down
2 changes: 1 addition & 1 deletion src/KernelFactory.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,7 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle;
namespace Luzrain\PHPStreamServerBundle;

use Symfony\Component\HttpKernel\KernelInterface;

Expand Down
6 changes: 3 additions & 3 deletions src/PhpRunnerBundle.php → src/PHPStreamServerBundle.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,16 +2,16 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle;
namespace Luzrain\PHPStreamServerBundle;

use Symfony\Component\Config\Definition\Configurator\DefinitionConfigurator;
use Symfony\Component\DependencyInjection\ContainerBuilder;
use Symfony\Component\DependencyInjection\Loader\Configurator\ContainerConfigurator;
use Symfony\Component\HttpKernel\Bundle\AbstractBundle;

final class PhpRunnerBundle extends AbstractBundle
final class PHPStreamServerBundle extends AbstractBundle
{
protected string $extensionAlias = 'phprunner';
protected string $extensionAlias = 'phpstreamserver';

public function configure(DefinitionConfigurator $definition): void
{
Expand Down
6 changes: 3 additions & 3 deletions src/ReloadStrategy/OnEachRequest.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\ReloadStrategy;
namespace Luzrain\PHPStreamServerBundle\ReloadStrategy;

use Luzrain\PhpRunner\ReloadStrategy\EachRequestReloadStrategy;
use Luzrain\PhpRunnerBundle\Event\HttpServerStartEvent;
use Luzrain\PHPStreamServer\ReloadStrategy\EachRequestReloadStrategy;
use Luzrain\PHPStreamServerBundle\Event\HttpServerStartEvent;

final class OnEachRequest extends EachRequestReloadStrategy
{
Expand Down
8 changes: 4 additions & 4 deletions src/ReloadStrategy/OnException.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,11 +2,11 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\ReloadStrategy;
namespace Luzrain\PHPStreamServerBundle\ReloadStrategy;

use Luzrain\PhpRunner\Exception\HttpException;
use Luzrain\PhpRunner\ReloadStrategy\ReloadStrategyInterface;
use Luzrain\PhpRunnerBundle\Event\HttpServerStartEvent;
use Luzrain\PHPStreamServer\Exception\HttpException;
use Luzrain\PHPStreamServer\ReloadStrategy\ReloadStrategyInterface;
use Luzrain\PHPStreamServerBundle\Event\HttpServerStartEvent;
use Symfony\Component\HttpKernel\Event\ExceptionEvent;
use Symfony\Component\HttpKernel\Exception\HttpExceptionInterface;
use Symfony\Component\HttpKernel\HttpKernelInterface;
Expand Down
6 changes: 3 additions & 3 deletions src/ReloadStrategy/OnMemoryLimit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\ReloadStrategy;
namespace Luzrain\PHPStreamServerBundle\ReloadStrategy;

use Luzrain\PhpRunner\ReloadStrategy\MaxMemoryReloadStrategy;
use Luzrain\PhpRunnerBundle\Event\HttpServerStartEvent;
use Luzrain\PHPStreamServer\ReloadStrategy\MaxMemoryReloadStrategy;
use Luzrain\PHPStreamServerBundle\Event\HttpServerStartEvent;

final class OnMemoryLimit extends MaxMemoryReloadStrategy
{
Expand Down
6 changes: 3 additions & 3 deletions src/ReloadStrategy/OnRequestsLimit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\ReloadStrategy;
namespace Luzrain\PHPStreamServerBundle\ReloadStrategy;

use Luzrain\PhpRunner\ReloadStrategy\MaxRequestsReloadStrategy;
use Luzrain\PhpRunnerBundle\Event\HttpServerStartEvent;
use Luzrain\PHPStreamServer\ReloadStrategy\MaxRequestsReloadStrategy;
use Luzrain\PHPStreamServerBundle\Event\HttpServerStartEvent;

final class OnRequestsLimit extends MaxRequestsReloadStrategy
{
Expand Down
6 changes: 3 additions & 3 deletions src/ReloadStrategy/OnTTLLimit.php
Original file line number Diff line number Diff line change
Expand Up @@ -2,10 +2,10 @@

declare(strict_types=1);

namespace Luzrain\PhpRunnerBundle\ReloadStrategy;
namespace Luzrain\PHPStreamServerBundle\ReloadStrategy;

use Luzrain\PhpRunner\ReloadStrategy\TTLReloadStrategy;
use Luzrain\PhpRunnerBundle\Event\HttpServerStartEvent;
use Luzrain\PHPStreamServer\ReloadStrategy\TTLReloadStrategy;
use Luzrain\PHPStreamServerBundle\Event\HttpServerStartEvent;

final class OnTTLLimit extends TTLReloadStrategy
{
Expand Down
Loading

0 comments on commit 4b45f15

Please sign in to comment.