3.4.4.5 Loading Vendor Files

The vendor() function has been deprecated. Vendor files should now be loaded through App::import() as well. The syntax and additional arguments are slightly different, as vendor file structures can differ greatly, and not all vendor files contain classes.

The following examples illustrate how to load vendor files from a number of path structures. These vendor files could be located in any of the vendor folders.

3.4.4.5.1 Vendor examples

To load vendors/geshi.php

App::import('Vendor', 'geshi');
  1. App::import('Vendor', 'geshi');

To load vendors/flickr/flickr.php

App::import('Vendor', 'flickr/flickr');
  1. App::import('Vendor', 'flickr/flickr');

To load vendors/some.name.php

App::import('Vendor', 'SomeName', array('file' => 'some.name.php'));
  1. App::import('Vendor', 'SomeName', array('file' => 'some.name.php'));

To load vendors/services/well.named.php

App::import('Vendor', 'WellNamed', array('file' => 'services'.DS.'well.named.php'));
  1. App::import('Vendor', 'WellNamed', array('file' => 'services'.DS.'well.named.php'));