Jump to content

Recommended Posts

Posted

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.

Posted

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.

Posted

Well, the only place I can really think of is from your config.php file - but in that case you might as well just put your spl_autoload_register() directly in there.

Should be safe from core upgrades too.

  • Like 2
Posted

>Should be safe from core upgrades too.

That's the thing - making certain changes aren't overwritten. Thanks for your help - I now have a couple of options! :)

Cheers.

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
  • Recently Browsing   0 members

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