Howdy, Stranger!

It looks like you're new here. If you want to get involved, click one of these buttons!

Try Vanilla Forums Cloud product
After February 6, this site will no longer have Facebook, Twitter, or OpenID sign-in options. Read our announcement about social media SSO support in 2.8 for more info.

Make sure you have a current, valid email address set in your profile and set a password so you can login without it. If you get locked out after that time, you can choose "Forgot Password" to fix it as long as a valid email is on your account.
Please upgrade to 2.3 here. The 2.2 and earlier branches are no longer being updated.

Problems with Autoloader...can anyone help please?

Hi all, i'm having a nightmare with the Gdn Autoloader. The problem is that I am running Vanilla alongside our existing app which is based on Zend Framework (v1) and which registered its own autoloader.

If I push Gdn_Autoloader::Lookup onto the Zend Autoloader stack, then it allows me to call Gdn classes directly from within the Zend app.

However, when I try to include the Gdn framework (for things like logging users in/out) then I get errors such as...

include_once(MenuModule.php): failed to open stream: No such file or directory

This has something to do with both autoloaders co-existing, because if I de-register the Zend autoloader before including the Gdn framework then all works as expected, but then the Zend app fails to work...

BTW i'm including the Gdn framework like so...

        define('APPLICATION', 'Vanilla');
        define('APPLICATION_VERSION', '2.1.9');
        define('PATH_ROOT', PUBLIC_PATH.'/community');

        ob_start(); // Buffer the output of the code below.
        require_once(PATH_ROOT . '/bootstrap.php'); // Require the bootstrap for the framework used by Vanilla.
        $Dispatcher = Gdn::Dispatcher(); // Declare an alias for the dispatcher.
        // Set up the dispatcher.
        $EnabledApplications = Gdn::ApplicationManager()->EnabledApplicationFolders();
        $Dispatcher->PassProperty('EnabledApplications', $EnabledApplications);
        // Mimic the DiscussionsController().
        $Controller = new DiscussionsController();
        ob_end_flush(); // Stop and send the buffer for the code above.

Most Gdn classes seem to load ok, but the MenuModule.php and similar classes don't.

Any ideas? Thanks.


Sign In or Register to comment.