Gazley Posted October 7, 2014 Share Posted October 7, 2014 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 More sharing options...
netcarver Posted October 7, 2014 Share Posted October 7, 2014 Hi @Gazley, have you tried a before hook on session::init() ? 2 Link to comment Share on other sites More sharing options...
Gazley Posted October 7, 2014 Author Share Posted October 7, 2014 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 More sharing options...
netcarver Posted October 7, 2014 Share Posted October 7, 2014 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. 2 Link to comment Share on other sites More sharing options...
Gazley Posted October 7, 2014 Author Share Posted October 7, 2014 >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. Link to comment Share on other sites More sharing options...
Recommended Posts
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 accountSign in
Already have an account? Sign in here.
Sign In Now