I'm trying to integrate a proprietary third-party library into my CakePHP app. All I could find in the manual is the App Class section but it's basically a set of examples rather than a proper explanation so I'm trying to guess.
I got the impression that you should use the App::uses() alternative when possible and at first I thought I was lucky because this code:
App::build(
array(
'Vendor' => array(
APP . 'Vendor' . DS . 'Acme' . DS. 'API-1.0' . DS . 'base',
APP . 'Vendor' . DS . 'Acme' . DS. 'API-1.0' . DS . 'foo',
APP . 'Vendor' . DS . 'Acme' . DS. 'API-1.0' . DS . 'bar',
)
)
);
debug(App::objects('Vendor'));
... produces this output:
array(
(int) 0 => 'Autoload',
(int) 1 => 'ConstantsBase',
(int) 2 => 'Foo',
(int) 3 => 'Bar',
)
However, I can't do anything like this:
App::uses('Foo', 'Vendor');
new Foo();
... triggers:
Error: Class 'Foo' not found
How comes CakePHP does know about the library classes but won't load them?
composer.jsonfiles all around but I'm not familiar with it. - Álvaro González