zen of coding

Goodbye vendor()

Looks like in the recent versions of CakePHP 1.2 the use of the vendor() method has been deprecated. Instead you are supposed to use App::import().
The syntax however, is very clunky and I really wish vendor() would remain as is. Maybe it will be changed back to something more user-friendly in the future.

So, if you need to include a IPReflectionClass.class.php file, which is located in the app/vendors/wshelper/lib/soap/ directory, you’d need to do something like this:

[sourcecode language=’php’]
App::import(‘Vendor’, ‘IPReflectionClass’, array(‘file’=> ‘wshelper’.DS.’lib’.DS.’soap’.DS.’IPReflectionClass.class.php’));
[/cc]

Yes, it’s pretty ugly… but that’s the way it is for now.

%d bloggers like this: