Jump to content

Best Place in PW to have custom spl_autoload_register


Gazley
 Share

Recommended Posts

Hi there,

From within PW, I call another framework that writes an object to a session variable.

The problem is that PW starts the session before the other framework is called. As a result, when the called framework tries to use the session variable, the class on which the session variable is based was not loaded when PW started the session. As a result, the session variable is set to __PHP_Incomplete_Class.

I'd like to specify my own spl_autoload_register in PW so that I can handle this situation but I'm not sure where the best place is to do this. Any advice much appreciated.

Thanks.

Link to comment
Share on other sites

Hi @netcarver,

No, I haven't but that sounds like a great (and now you say it, very obvious) place to start :)

I've not really used hooks - would you specify that in the page template that ultimately calls the framework or just create some kind of basic autoload module and shove it in there?

Thanks for your quick response!

Cheers.

Link to comment
Share on other sites

Create an account or sign in to comment

You need to be a member in order to leave a comment

Create an account

Sign up for a new account in our community. It's easy!

Register a new account

Sign in

Already have an account? Sign in here.

Sign In Now
 Share

  • Recently Browsing   0 members

    • No registered users viewing this page.
×
×
  • Create New...