-
-
Notifications
You must be signed in to change notification settings - Fork 933
Closed
Description
API Platform version(s) affected: 3.1.6 - 3.1.7
Description
After upgrading to v3.1.7 api-platform crashes on production where opcache.prelaod is enabled. On v3.1.5 worked fine.
Warning: Cannot declare interface ApiPlatform\Api\FilterInterface, because the name is already in use
Error similar to api-platform/api-platform#2284
How to reproduce
- Upgrade to v3.1.7
- Make sure opcache.preload is enabled. (I use the Symfony's default preload script);
- opcache.preload_user=www-data
- opcache.preload=/var/www/config/preload.php
- Open /api or any api-platform endpoint
Possible Solution
Check if interface exist before declaration.
src/Metadata/FilterInterface.php
class_alias(FilterInterface::class, \ApiPlatform\Api\FilterInterface::class);
to
if (!interface_exists(\ApiPlatform\Api\FilterInterface::class)) {
class_alias(FilterInterface::class, \ApiPlatform\Api\FilterInterface::class);
}
Metadata
Metadata
Assignees
Labels
No labels