Textpattern CMS support forum
You are not logged in. Register | Login | Help
- Topics: Active | Unanswered
#1 2007-12-14 16:36:14
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
rev2747
Err, sorry to keep asking silly questions about the recent revisions, but I think I have another one!
If txplib_db.php
has dependencies on the routines/defines/vars in txplib_misc.php
(or any other files) wouldn’t it be better to list those dependencies explicitly at the start of txplib_db.php
rather than relying on the external calling context to be correct?
Wouldn’t putting this…
include_once txpath.'/lib/txplib_misc.php';
… at the start of txplib_db.php
solve the issue more effectively? For example, by removing any such ordering errors in the includes that might also exist on the admin side of the dev 4 branch and both public and admin sides in crockery?
Last edited by net-carver (2007-12-14 16:36:54)
— Steve
Offline
Re: rev2747
No, because then we’d try to include the txplib_misc.php more than once which is not as efficient as loading it just once (even though include_once only includes a file once, regardless of the amount of times you try to include that file, even the failed, duplicate attempts take time).
Thanks for looking at the changesets though!
Offline
#3 2007-12-14 17:34:39
- net-carver
- Archived Plugin Author
- Registered: 2006-03-08
- Posts: 1,648
Re: rev2747
Hi Ruud,
thought that might be the answer.
Whilst it’s not (quite) so efficient, my main point is that it would prevent errors, of exactly the type that this changeset is addressing, from occurring in the first place. [I don’t know but I would guess that subsequent include_once()
calls would actually be pretty snappy.] Anyway, I guess I’m asking if it’s a trade-off that would be worth making?
Great work dev team, don’t get disheartened by this guy’s comments, I want to see Txp be the best product it can be; but it means I might bug you with multiple posts like these!
— Steve
Offline
Re: rev2747
I don’t mind the comments. It forces us to think about these things a bit more, which is good.
Offline