使用CakePHP v3.x和Composer自动加载供应商

I'm trying to load this into my CakePHP 3.x app. I'm totally clueless as to how I might do this with composer. I've included other files with composer already but this wrapper doesn't seem to support it.

So, how do I either:

  • Do this with Composer
  • Manually load the Vendor in 3.x

It's all obviously changed since 2.x :(

Any pointers please?

The answer was under my nose, on the cake docs.

Manually required the wrapper:

define('VENDOR', ROOT . DS . 'vendor' . DS);
require(VENDOR . 'thoughtco' . DS . 'freeagent' . DS . 'Freeagent.php');

Then modded the wrapper to use namespace:

namespace Freeagent;

Then instantiated it in my component.

use Freeagent\Freeagent;
...
public function __construct()
    {
        $this->client = new Freeagent('id', 'key');
    }

Job done - maybe someone else might find it useful :)