You are here: Re: require_once() and Subdirectories « PHP Programming Language « IT news, forums, messages
Re: require_once() and Subdirectories

Posted by David T. Ashley on 06/07/07 15:44

"Ivαn Sαnchez Ortega" <ivansanchez-alg@rroba-escomposlinux.-.punto.-.org>
wrote in message news:f4979g$8j9$1@hercules.cohp1...
> David T. Ashley wrote:
>
>> Does require_once() treat "file.inc" and "subdirectory/file.inc" as the
>> same things or different?
>
> Different, of course.
>
>> The reason for my question is that I'd like to organize my PHP library
>> into subdirectories, and if I accidentally have a naming collision, I'm
>> curious how require_once() will behave.
>
> As usual: It will look for the specified filename in the current working
> directory, then in the directories specified in the "Include dirs"
> configuration directive.
>
> Please RTFM for specifics.

Thanks for your reply.

My question was subtly different.

I have no doubt that require_once() will open and include the correct file.

I was concerned about it possibly believing that "/dir1/file.inc" had been
included when it was "/dir2/file.inc". In other words, I was concerned
about the "once" part of it and how it remembers what has already been
included.

My question was about the "once" part of it.

Thanks, Dave.

 

Navigation:

[Reply to this message]


УдалСнная Ρ€Π°Π±ΠΎΡ‚Π° для программистов  •  Как Π·Π°Ρ€Π°Π±ΠΎΡ‚Π°Ρ‚ΡŒ Π½Π° Google AdSense  •  England, UK  •  ΡΡ‚Π°Ρ‚ΡŒΠΈ Π½Π° английском  •  PHP MySQL CMS Apache Oscommerce  •  Online Business Knowledge Base  •  DVD MP3 AVI MP4 players codecs conversion help
Home  •  Search  •  Site Map  •  Set as Homepage  •  Add to Favourites

Copyright © 2005-2006 Powered by Custom PHP Programming

Π‘Π°ΠΉΡ‚ ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ Π² Π‘Ρ‚ΡƒΠ΄ΠΈΠΈ Π’Π°Π»Π΅Π½Ρ‚ΠΈΠ½Π° ΠŸΠ΅Ρ‚Ρ€ΡƒΡ‡Π΅ΠΊΠ°
ΠΈΠ·Π³ΠΎΡ‚ΠΎΠ²Π»Π΅Π½ΠΈΠ΅ ΠΈ ΠΏΠΎΠ΄Π΄Π΅Ρ€ΠΆΠΊΠ° Π²Π΅Π±-сайтов, Ρ€Π°Π·Ρ€Π°Π±ΠΎΡ‚ΠΊΠ° ΠΏΡ€ΠΎΠ³Ρ€Π°ΠΌΠΌΠ½ΠΎΠ³ΠΎ обСспСчСния, поисковая оптимизация