Turned out to be pretty easy to re-purpose what Jeremy did and use it for CakePHP instead. Like Jeremy's code I used two files a config file though rather than adding to the library I did the other file as a component.
In the config file I used the WWW_ROOT constant for the file directory so that I didn't need to update the path between my development and live environments:
The only main thing I had to change in the component file (other than normal cakephp component things) was to do with Xen's error management. It started throwing up quite a few Strict errors over cake's code (as far as I could tell) so I put the following three lines just after the initialize function call (in the authenticateSession function):
Whether you'll need to do that yourself or not I'm not sure.
And then in my app controller I just told it to use the component I'd defined and I was ready to go. I'm still not really convinced on using Xen's own auto loaders but I'll see how it goes performance wise. Makes things easier from a programming point of view but using two frameworks must cause extra processing.
In the config file I used the WWW_ROOT constant for the file directory so that I didn't need to update the path between my development and live environments:
PHP:
$config['xf']['fileDir'] = WWW_ROOT.'/community';
The only main thing I had to change in the component file (other than normal cakephp component things) was to do with Xen's error management. It started throwing up quite a few Strict errors over cake's code (as far as I could tell) so I put the following three lines just after the initialize function call (in the authenticateSession function):
PHP:
//restore cake's error handling
restore_error_handler();
restore_exception_handler();
error_reporting(E_ALL & ~E_DEPRECATED);
Whether you'll need to do that yourself or not I'm not sure.
And then in my app controller I just told it to use the component I'd defined and I was ready to go. I'm still not really convinced on using Xen's own auto loaders but I'll see how it goes performance wise. Makes things easier from a programming point of view but using two frameworks must cause extra processing.