You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I'm working on an application that will facilitate reporting against multiple Meta integrations during the same request, but I quickly discovered that this is will cause issues if you keep one integration in memory and call it later after another one has been initialized. For example:
useFacebookAds\Api;
$one = Api::init(...);
$two = Api::init(...); // Overwrites the first$one->... // API calls will now actually occur on $two
I thought there would be a way around this by setting the HTTP client inside of the EventRequest manually:
Why is this the case? Why do all these static PHP singletons need to exist? This will surely cause issues for anyone running a PHP application from memory (Swoole, FrankenPHP, RoadRunner, etc.).
The text was updated successfully, but these errors were encountered:
I'm working on an application that will facilitate reporting against multiple Meta integrations during the same request, but I quickly discovered that this is will cause issues if you keep one integration in memory and call it later after another one has been initialized. For example:
I thought there would be a way around this by setting the HTTP client inside of the
EventRequest
manually:facebook-php-business-sdk/src/FacebookAds/Object/ServerSide/EventRequest.php
Lines 214 to 217 in f3eb099
But then the singletons are called regardless later on:
facebook-php-business-sdk/src/FacebookAds/Object/ServerSide/EventRequest.php
Lines 309 to 313 in f3eb099
facebook-php-business-sdk/src/FacebookAds/Object/ServerSide/EventRequest.php
Lines 316 to 320 in f3eb099
Why is this the case? Why do all these static PHP singletons need to exist? This will surely cause issues for anyone running a PHP application from memory (Swoole, FrankenPHP, RoadRunner, etc.).
The text was updated successfully, but these errors were encountered: