Skip to content

Commit

Permalink
Update: Decoupling octane and built
Browse files Browse the repository at this point in the history
  • Loading branch information
cclilshy committed Feb 8, 2025
1 parent 4f0ade1 commit c2bfcab
Show file tree
Hide file tree
Showing 24 changed files with 43 additions and 40 deletions.
5 changes: 3 additions & 2 deletions src/Command.php → src/Built/Command.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,8 +10,9 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple;
namespace Laravel\Ripple\Built;

use Laravel\Ripple\Inspector\Client;
use Ripple\Utils\Output;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
Expand Down Expand Up @@ -52,7 +53,7 @@ public function initialize(InputInterface $input, OutputInterface $output): void
/**
* 运行服务
*
* @param \Laravel\Ripple\Client $client
* @param \Laravel\Ripple\Inspector\Client $client
*
* @return void
*/
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Coroutine;
namespace Laravel\Ripple\Built\Coroutine;

use Fiber;
use Illuminate\Container\Container;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Coroutine;
namespace Laravel\Ripple\Built\Coroutine;

use Fiber;
use Illuminate\Container\Container;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Events;
namespace Laravel\Ripple\Built\Events;

use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,15 +10,15 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Events;
namespace Laravel\Ripple\Built\Events;

use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
use Laravel\Ripple\Coroutine\ContextManager;
use Laravel\Ripple\Listeners\FlushAuthenticationState;
use Laravel\Ripple\Listeners\FlushQueuedCookies;
use Laravel\Ripple\Listeners\FlushSessionState;
use Laravel\Ripple\Built\Coroutine\ContextManager;
use Laravel\Ripple\Built\Listeners\FlushAuthenticationState;
use Laravel\Ripple\Built\Listeners\FlushQueuedCookies;
use Laravel\Ripple\Built\Listeners\FlushSessionState;
use Ripple\Utils\Output;

class RequestReceived
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,11 +10,11 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Events;
namespace Laravel\Ripple\Built\Events;

use Illuminate\Foundation\Application;
use Illuminate\Http\Request;
use Laravel\Ripple\Coroutine\ContextManager;
use Laravel\Ripple\Built\Coroutine\ContextManager;
use Symfony\Component\HttpFoundation\Response;

/**
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,10 +10,10 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Events;
namespace Laravel\Ripple\Built\Events;

use Illuminate\Foundation\Application;
use Laravel\Ripple\Coroutine\ContextManager;
use Laravel\Ripple\Built\Coroutine\ContextManager;
use Throwable;

class WorkerErrorOccurred
Expand Down
2 changes: 1 addition & 1 deletion src/Factory.php → src/Built/Factory.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple;
namespace Laravel\Ripple\Built;

use Illuminate\Foundation\Application;
use Ripple\File\File;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Listeners;
namespace Laravel\Ripple\Built\Listeners;

use function with;

Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Listeners;
namespace Laravel\Ripple\Built\Listeners;

class FlushQueuedCookies
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Listeners;
namespace Laravel\Ripple\Built\Listeners;

class FlushSessionState
{
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Response;
namespace Laravel\Ripple\Built\Response;

use Closure;
use Iterator;
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple\Traits;
namespace Laravel\Ripple\Built\Traits;

use Illuminate\Contracts\Events\Dispatcher;
use Illuminate\Foundation\Application;
Expand Down
2 changes: 1 addition & 1 deletion src/Config/ripple.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@
use Illuminate\Support\Env;

return [
'HTTP_LISTEN' => Env::get('RIP_HTTP_LISTEN', 'http://127.0.0.1:8008'),
'HTTP_LISTEN' => Env::get('RIP_HTTP_LISTEN', 'http://127.0.0.1:8000'),
'HTTP_WORKERS' => Env::get('RIP_HTTP_WORKERS', 1),
'WATCH' => Env::get('RIP_WATCH', 1)
];
13 changes: 7 additions & 6 deletions src/HttpWorker.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,12 +16,13 @@
use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Contracts\Http\Kernel;
use Illuminate\Foundation\Application;
use Laravel\Ripple\Events\RequestHandled;
use Laravel\Ripple\Events\RequestReceived;
use Laravel\Ripple\Events\RequestTerminated;
use Laravel\Ripple\Events\WorkerErrorOccurred;
use Laravel\Ripple\Response\IteratorResponse;
use Laravel\Ripple\Traits\DispatchesEvents;
use Laravel\Ripple\Built\Events\RequestHandled;
use Laravel\Ripple\Built\Events\RequestReceived;
use Laravel\Ripple\Built\Events\RequestTerminated;
use Laravel\Ripple\Built\Events\WorkerErrorOccurred;
use Laravel\Ripple\Built\Factory;
use Laravel\Ripple\Built\Response\IteratorResponse;
use Laravel\Ripple\Built\Traits\DispatchesEvents;
use Ripple\Http\Server;
use Ripple\Http\Server\Request;
use Ripple\Stream\Exception\ConnectionException;
Expand Down
8 changes: 4 additions & 4 deletions src/Client.php → src/Inspector/Client.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple;
namespace Laravel\Ripple\Inspector;

use Illuminate\Support\Facades\Config;
use Laravel\Ripple\Virtual\Virtual;
Expand Down Expand Up @@ -38,7 +38,7 @@

class Client
{
/*** @var \Laravel\Ripple\Inspector */
/*** @var \Laravel\Ripple\Inspector\Inspector */
public readonly Inspector $inspector;

/*** @var \Ripple\Channel\Channel */
Expand Down Expand Up @@ -95,7 +95,7 @@ public function start(bool $daemon = false): void

$this->owner = true;
$this->lock->exclusion(false);
$this->virtual = new Virtual(__DIR__ . '/Virtual/server.bin.php');
$this->virtual = new Virtual(__DIR__ . '/../Virtual/server.bin.php');
$this->virtual->launch([
'RIP_PROJECT_PATH' => base_path(),
'RIP_VIRTUAL_ID' => $this->virtual->id,
Expand All @@ -122,7 +122,7 @@ public function start(bool $daemon = false): void
Output::write("\033c");

$oldVirtual = $this->virtual;
$virtual = new Virtual(__DIR__ . '/Virtual/server.bin.php');
$virtual = new Virtual(__DIR__ . '/../Virtual/server.bin.php');
$virtual->launch([
'RIP_PROJECT_PATH' => base_path(),
'RIP_VIRTUAL_ID' => $virtual->id,
Expand Down
2 changes: 1 addition & 1 deletion src/Inspector.php → src/Inspector/Inspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@
* Contributions, suggestions, and feedback are always welcome!
*/

namespace Laravel\Ripple;
namespace Laravel\Ripple\Inspector;

use function base_path;
use function Co\channel;
Expand Down
2 changes: 1 addition & 1 deletion src/Octane/Bin/ripple-server.bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,7 @@
use Laravel\Octane\ApplicationFactory;
use Laravel\Octane\RequestContext;
use Laravel\Octane\Worker;
use Laravel\Ripple\Factory;
use Laravel\Ripple\Built\Factory;
use Laravel\Ripple\HttpWorker;
use Laravel\Ripple\Octane\RippleClient;
use Laravel\Ripple\Util;
Expand Down
2 changes: 1 addition & 1 deletion src/Octane/Bin/ripple-ware.bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,7 +14,7 @@

use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Foundation\Console\Kernel as ConsoleKernel;
use Laravel\Ripple\Factory;
use Laravel\Ripple\Built\Factory;
use Laravel\Ripple\Virtual\Virtual;
use Ripple\Utils\Output;

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

use Illuminate\Contracts\Container\BindingResolutionException;
use Laravel\Octane\Commands\StopCommand;
use Laravel\Ripple\Inspector;
use Laravel\Ripple\Inspector\Inspector;
use Symfony\Component\Console\Attribute\AsCommand;

use function app;
Expand Down
2 changes: 1 addition & 1 deletion src/Octane/RippleClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
use Laravel\Octane\Contracts\Client;
use Laravel\Octane\OctaneResponse;
use Laravel\Octane\RequestContext;
use Laravel\Ripple\Response\IteratorResponse;
use Laravel\Ripple\Built\Response\IteratorResponse;
use Ripple\Utils\Output;
use Symfony\Component\HttpFoundation\BinaryFileResponse;
use Throwable;
Expand Down
4 changes: 2 additions & 2 deletions src/Octane/RippleServerProcessInspector.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,15 +13,15 @@
namespace Laravel\Ripple\Octane;

use Laravel\Octane\Contracts\ServerProcessInspector as ServerProcessInspectorContract;
use Laravel\Ripple\Client;
use Laravel\Ripple\Inspector\Client;

/**
*
*/
class RippleServerProcessInspector implements ServerProcessInspectorContract
{
/**
* @param \Laravel\Ripple\Client $client
* @param \Laravel\Ripple\Inspector\Client $client
*/
public function __construct(protected readonly Client $client)
{
Expand Down
1 change: 1 addition & 0 deletions src/Provider.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,6 +14,7 @@

use Composer\InstalledVersions;
use Illuminate\Support\ServiceProvider;
use Laravel\Ripple\Built\Command;
use Laravel\Ripple\Octane\RippleProvider;

use function config_path;
Expand Down
4 changes: 2 additions & 2 deletions src/Virtual/server.bin.php
Original file line number Diff line number Diff line change
Expand Up @@ -14,8 +14,8 @@

use Illuminate\Contracts\Container\BindingResolutionException;
use Illuminate\Foundation\Console\Kernel;
use Laravel\Ripple\Coroutine\ContextManager;
use Laravel\Ripple\Factory;
use Laravel\Ripple\Built\Coroutine\ContextManager;
use Laravel\Ripple\Built\Factory;
use Laravel\Ripple\HttpWorker;
use Laravel\Ripple\Util;
use Ripple\Utils\Output;
Expand Down

0 comments on commit c2bfcab

Please sign in to comment.