Skip to content

Octane with Swoole - Defaultvalues in Signature prevent uses config values #1064

@ml4u

Description

@ml4u

Octane Version

2.11.0

Laravel Version

12.33.0

PHP Version

8.4.10

What server type are you using?

Swoole

Server Version

Database Driver & Version

Description

Hi,
i found a bug in StartCommand Class of Octane.

    protected function startSwooleServer()
    {
        return $this->call('octane:swoole', [
            '--host' => $this->getHost(),
            '--port' => $this->getPort(),
            '--workers' => $this->option('workers') ?: config('octane.workers', 'auto'),
            '--task-workers' => $this->option('task-workers') ?: config('octane.task_workers', 'auto'),
            '--max-requests' => $this->option('max-requests') ?: config('octane.max_requests', 500),
            '--watch' => $this->option('watch'),
            '--poll' => $this->option('poll'),
        ]);
    }

Because of defaultvalues in $signature, will the option() call never be null and skips the config values.

Steps To Reproduce

You can set in config/octane.php

  • workers: 100

dump what you call in startSwooleServer(). Workers will be auto.
Only overrideable with explicit argument like
$ php artisan octane:start --server=swoole --workers=100

Metadata

Metadata

Assignees

No one assigned

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions