Reply
require_once()
Old 08-17-2007, 06:11 PM require_once()
Extreme Talker

Posts: 182
I have another one for you all. Maybe this one will get some more responses...

Can you overuse require_once()? I want to be sure every part of my app can stand on it's own.

Example:

In my header file I also include my database connection and other configurations. The db connection and other configurations are obviously used by other parts of the app. So if I was doing some testing or something and didn't include my header file, I would still want that part of the app to work; require_once() would save the day.

So is there a downside or any cautions to using it too much? I couldn't find any myself but I was just curious.

Thanks
bhgchris is offline
Reply With Quote
View Public Profile
 
When You Register, These Ads Go Away!
Old 08-17-2007, 06:42 PM Re: require_once()
tripy's Avatar
Fetchez la vache!

Posts: 2,171
Name: Thierry
Location: In the void
Nope, there is nothing like that.
Any call to require() can be replaced with require_once(), with this mega advantage that you don't risks to double include a file.

It's especially useful when you include a class or a file with only functions, as you would have an error if you included 2 times a file containing the same function / class name.
__________________
Listen to the ducky: "This is awesome!!!"

tripy is offline
Reply With Quote
View Public Profile
 
Old 08-18-2007, 12:53 PM Re: require_once()
Extreme Talker

Posts: 182
That's exactly what I was talking about, requiring classes and function libraries. Thanks!
bhgchris is offline
Reply With Quote
View Public Profile
 
Reply     « Reply to require_once()
 

Thread Tools

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are Off
Pingbacks are Off
Refbacks are Off


Webmaster Resources Marketplace:
Software Development Company | Webhosting.UK.com | Text Link Brokers 


   
RSS Feed  Feeds: RSS   JS   XML
RSS Feed  Feeds for this forum: RSS   JS   XML

 


Page generated in 0.11781 seconds with 12 queries