x3sphere
Active member
Is there anything special I need to do to access add-ons outside of XF? I've initialized the XF environment, but none of my add-ons are accessible through the models I'm extending. It appears the add-ons aren't loaded at all, not even the LoadClassModel is called. The add-ons work fine on actual XF pages, however.
Here's my initialization code:
LoadClassModel example:
Here's my initialization code:
Code:
$startTime = microtime(true);
$forumpath = 'path';
require_once($forumpath . '/library/XenForo/Autoloader.php');
XenForo_Autoloader::getInstance()->setupAutoloader($forumpath . '/library');
XenForo_Application::initialize($forumpath . '/library', $forumpath);
XenForo_Application::set('page_start_time', $startTime);
XenForo_Application::disablePhpErrorHandler();
XenForo_Application::setDebugMode(true);
LoadClassModel example:
Code:
class Exophase_Listener_LoadClassModel
{
public static function loadClassModel($class, &$extend)
{
if ($class == 'XenForo_Model_Post')
{
$extend[] = 'Exophase_Model_Post';
}
if ($class == 'XenForo_Model_User')
{
$extend[] = 'Exophase_Model_User';
}
}
}