[SOLVED] Custom Fusion Object for facebook graph API integration - require autoload.php

Good Morning,

I want to integrate the facebook php-graph-sdk by using a Custom Fusion Object (recommended way?).
I installed the Facebook SDK by composer so that there’s a directory “facebook” in /Packages/Libaries.

Now I have to make sure to include the autoload.php like described in the getting_started.md of the SDK.
If I set require_once __DIR__ . '/vendor/autoload.php'; in the Fusion Object Class like this…

namespace Vendor\Site\Fusion;

use Neos\Flow\Annotations as Flow;
use Neos\Fusion\FusionObjects\AbstractFusionObject;

class GravatarImplementation extends AbstractFusionObject {
        public function evaluate() {
                require_once __DIR__ . '/vendor/autoload.php';
        }
}

…“of course” I get a HTTP ERROR 500 - the apache error log says

PHP Fatal error:  Vendor\\Site\\Fusion\\FacebookImplementation_Original::evaluate(): Failed opening required '/var/www/html/site/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/vendor/autoload.php' (include_path='.:/usr/share/php') in /var/www/html/site/Data/Temporary/Development/Cache/Code/Flow_Object_Classes/Vendor_Site_Fusion_FacebookImplementation.php on line 13

Maybe I have to use autoloading like described here?

When using composer you are using autoloading, so no need to do the manual install with the autoload require.

Just do a $fb = new \Facebook\Facebook\...

Ah, ok - thank you!!