Re: svn: /phpdoc/en/trunk/ appendices/ini.xml language/control-structures/include.xml

From: Date: Wed, 12 Aug 2009 18:57:19 +0000
Subject: Re: svn: /phpdoc/en/trunk/ appendices/ini.xml language/control-structures/include.xml
References: 1  Groups: php.doc.cvs 
Request: Send a blank email to doc-cvs+get-4658@lists.php.net to get a copy of this message
On Wed, Aug 12, 2009 at 13:53, Brandon Savage<brandon@php.net> wrote: > brandon                                  Wed, 12 Aug 2009 11:53:57 +0000 > > Revision: > http://svn.php.net/viewvc?view=revision&revision=287153 > > Log: > Updating include and include_path documentation to be more clear and explicit. > > Changed paths: >    U   phpdoc/en/trunk/appendices/ini.xml >    U   phpdoc/en/trunk/language/control-structures/include.xml > > Modified: phpdoc/en/trunk/appendices/ini.xml > =================================================================== > --- phpdoc/en/trunk/appendices/ini.xml  2009-08-12 11:07:15 UTC (rev 287152) > +++ phpdoc/en/trunk/appendices/ini.xml  2009-08-12 11:53:57 UTC (rev 287153) > @@ -4639,6 +4639,16 @@ >         separated with a colon in Unix or semicolon in Windows. >        </para> >        <para> > +        PHP considers each entry in the include path separately when looking for > +        files to include. It will check the first path, and if it doesn't find > +        it, check the next path, until it either locates the included file or > +        returns with a > +        <link > linkend="errorfunc.constants.errorlevels.e-warning">warning</link> > +        or an <link > linkend="errorfunc.constants.errorlevels.e-error">error</link>. > +        You may modify or set your include path at runtime using > +        <function>set_include_path</function>. > +       </para> > +       <para> >         <example> >          <title>Unix include_path</title> >          <programlisting role="php.ini"> > > Modified: phpdoc/en/trunk/language/control-structures/include.xml [...] > -  Be warned that parse error in included file doesn't cause processing halting > -  in PHP versions prior to PHP 4.3.5. Since this version, it does. This should be moved into a changelog entry, not removed completely. >  <simpara> > -  Files for including are first looked for in each include_path entry > -  relative to the current working directory, and then in the directory of > -  current script. > -  E.g. if your include_path > -  is <literal>libraries</literal>, current working directory is <filename > class="directory">/www/</filename>, > -  you included <filename>include/a.php</filename> and there is > <literal>include "b.php"</literal> > -  in that file, <filename>b.php</filename> is first looked in <filename > class="directory">/www/libraries/</filename> > -  and then in <filename class="directory">/www/include/</filename>. > -  If filename begins with <literal>./</literal> or > <literal>../</literal>, it > -  is looked for only in the current working directory or parent of the > -  current working directory, respectively. And this probably made into an <example>? > +  Files are included based on the file path given or, if none is given, the > +  <link linkend="ini.include-path">include_path</link> specified. The To me "file path" is path/to/file.php, so "none" means nothing.. nada. nix. include ""; > +  cannot find a file; this is different behavior from <function>require</a>, Heh... that </a> should be </function> > +  If a path is defined (full or relative), the > +  <link linkend="ini.include-path">include_path</link> will be ignored > altogether. > +  For example, if a filename begins with <literal>../</literal>, the parser will > +  look in the parent directory to find the requested file. Parent directory of.. what? The current working directory? Parent to the web root? Currently executing script? ... > + <simpara> > +  For more information on how PHP handles including files and the include path, > +  see the documentation for <link > linkend="ini.include-path">include_path</link>. > + </simpara> This should been an seealso section (yeah, I know this isn't refentry, but we should try to keep the same structure though). -Hannes

« previous php.doc.cvs (#4658) next »