SMF Community Helpers > SMF Documentation Help
Administration - Deleted Admin
Arantor:
No, it loads the compatibility even for 4.3 and 4.4 seeing how there are 5.0 only routines in SMF.
And actually, you can do OOP in PHP 4, but it's somewhat poor. Which is why there's a custom class loader that tries to load PHP 5-style classes in a PHP 4 manner, see loadClassFile().
I do have to say though, putting things in OOP for one-shot scripts seems like a lot of complication for very little benefit, especially as that if you want to do things in pre-5.0 compatibility they need to be separate files and loaded via loadClassFile instead of just being single files.
Yoshi:
--- Quote from: Arantor on May 09, 2012, 11:36:38 AM ---No, it loads the compatibility even for 4.3 and 4.4 seeing how there are 5.0 only routines in SMF.
--- End quote ---
That's why I said "5.1 or earlier"...
--- Quote ---I do have to say though, putting things in OOP for one-shot scripts seems like a lot of complication for very little benefit, especially as that if you want to do things in pre-5.0 compatibility they need to be separate files and loaded via loadClassFile instead of just being single files.
--- End quote ---
For one it keeps your code organized and you aren't having to fiddle with crap to get your variables. That seems like a huge benefit to me. Plus it's up to the creator to decide what way he/she codes it...
Though I just looked at the code of index.php and I think if you use SSI.php it will load the compatibility layer with it, since SSI.php and index.php are pretty similiar.
Labradoodle-360:
Although he is right in the sense of compatibility. It's more work, plus if I lose compatibility, it might be worth just keeping it in procedural for now.
Arantor:
--- Quote from: Yoshi2889 on May 09, 2012, 11:43:41 AM ---That's why I said "5.1 or earlier"...
--- End quote ---
You edited after I started posting as you first started out by saying 4.2 instead.
--- Quote ---Though I just looked at the code of index.php and I think if you use SSI.php it will load the compatibility layer with it, since SSI.php and index.php are pretty similiar.
--- End quote ---
loadClassFile is always loaded, you're supposed to use it to load class files like you do with loadTemplate - nothing to do with the Compat code.
Navigation
[0] Message Index
[*] Previous page
Go to full version