Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Error in getValidAliases() when running with swoole installed #1476

Open
TimoFrenzel opened this issue Oct 30, 2023 · 1 comment
Open

Error in getValidAliases() when running with swoole installed #1476

TimoFrenzel opened this issue Oct 30, 2023 · 1 comment

Comments

@TimoFrenzel
Copy link
Contributor

Since the package cannot work with swoole,
It would make sense in the Generator.php method getValidAliases()

Not only to skip predis, but also swoole.

if ($facade == 'SwooleTW\Http\Server\Facades\Server' && $name == 'Server' && !class_exists('Swoole\Http\Server')) {
                 continue;
             }
@mfn
Copy link
Collaborator

mfn commented Nov 1, 2023

I understand this pattern is also used this way, e.g.

// Skip the Redis facade, if not available (otherwise Fatal PHP Error)
if ($facade == 'Illuminate\Support\Facades\Redis' && $name == 'Redis' && !class_exists('Predis\Client')) {
continue;

Isn't there a way to more generically solve this?

Can you show a complete stacktrace? Maybe it's smarter to just add a try/catch in the foreach and emit a brief console message (instead of aborting) everything, WDYT?

@mfn mfn changed the title swoole Error in getValidAliases() when running with swoole installed Nov 1, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

No branches or pull requests

2 participants