DragonPrime - LoGD Resource Community
Welcome Guest
  • Good evening, Guest.
    Please log in, or register.
  • September 19, 2018, 08:08:38 PM
Home Forums News Downloads Login Register Advanced Search
* * *
DragonPrime Menu
Login
 
 
Resource Pages
Search

Pages: [1]   Go Down
  Print  
Author Topic: functions  (Read 4095 times)
0 Members and 1 Guest are viewing this topic.
Dhampir
Guest
« on: October 06, 2005, 04:00:46 PM »

Hello,

I was just coding earlier, and I thought of something..

Where exactly are things like, httpget();, addnav(); blocknav();, and things of that nature defined?

I can recall a time when i've come over them.
Logged
Sichae
iMod God
SVN Users
Mod God
*
Offline Offline

Posts: 3458


If ya didn't get it by now... you're hopeless...


View Profile WWW
« Reply #1 on: October 06, 2005, 05:10:01 PM »

httpget -> lib/http.php

addnav, blocknav -> lib/output.php

They are already called in runmodule.php, so Modules do not need to require them. It would just be redundant.
« Last Edit: October 06, 2005, 05:10:37 PM by Sichae » Logged

If you didn't understand anything in the above post, don't try to attempt anything suggested.

Kendaer
Guest
« Reply #2 on: October 07, 2005, 11:04:23 AM »

requiring them is redundant, but assuming you use require_once, imposed no additional load on the server if they are already included.

It's also not always obvious which ones are or aren't already included.

The best rule of thumb is, include it if you aren't sure that it's already there in all cases. Smiley
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #3 on: October 07, 2005, 11:28:36 AM »

requiring them is redundant, but assuming you use require_once, imposed no additional load on the server if they are already included.
No significant load...

The linker has to jump around a little more... testing if this already has been required or not... Wink
Logged

Running for more than three years now:
Kendaer
Guest
« Reply #4 on: October 09, 2005, 04:50:03 PM »

No significant load...

The linker has to jump around a little more... testing if this already has been required or not... Wink

Actually, it doesn't.  PHP keeps a hash of all included files.. So the 'cost' of this, is a simple lookup in a hash table.  this is *VERY FAST* to the point where I would call it no load.
Logged
XChrisX
Global Moderator
Mod God
*****
Offline Offline

Posts: 4647

Be aware of the squirrel!


View Profile WWW
« Reply #5 on: October 09, 2005, 11:27:03 PM »

Every picosecond counts!!! *waaah*

You are right... I use require_once too, because it's simply better than "require"... But in some cases "require()" is needed

If you include a file with a variable
Code:
require_once("$filename.php");
And if you come across that call again during runtime with a different $filename... But that's not the problem here... Wink
Logged

Running for more than three years now:
Pages: [1]   Go Up
  Print  
 
Jump to:  


*
DragonPrime Notices
Play LoGD on Dragonprime

Support Us
No funds raised yet this year
Your help is greatly appreciated!
Recent Topics
DragonPrime LoGD
Who's Online
35 Guests, 0 Users
Home Forums News Downloads Login Register Advanced Search