Every single page view in a PHP web application is an entirely new instance of the code execution - all the init() and construct() functions will get called. At the end of the script execution (e.g. viewing a page), the classes and variables are destroyed. PHP apps work entirely different to C programs, so that knowledge doesn't transfer exactly.
For your use case, you could move your function call to get_from_locker() to your login handling code, after verifying their password - so you only do it once you have a valid user. Then you don't need to call it again anywhere, and you don't need to do it in any init() or construct() calls.
If you do insist on doing it in those places, then use Sessions to keep track of whether or not you've got the image.