2010-03-28 22:10:10 +00:00
|
|
|
<?xml version="1.0" encoding="utf-8"?>
|
2009-07-11 07:47:57 +00:00
|
|
|
<!-- $Revision$ -->
|
2007-06-20 22:25:43 +00:00
|
|
|
<refentry xml:id="function.set-include-path" xmlns="http://docbook.org/ns/docbook">
|
2007-02-04 22:46:33 +00:00
|
|
|
<refnamediv>
|
|
|
|
<refname>set_include_path</refname>
|
|
|
|
<refpurpose>Sets the include_path configuration option</refpurpose>
|
|
|
|
</refnamediv>
|
2007-02-04 22:46:34 +00:00
|
|
|
|
|
|
|
<refsect1 role="description">
|
|
|
|
&reftitle.description;
|
2007-02-04 22:46:33 +00:00
|
|
|
<methodsynopsis>
|
|
|
|
<type>string</type><methodname>set_include_path</methodname>
|
|
|
|
<methodparam><type>string</type><parameter>new_include_path</parameter></methodparam>
|
|
|
|
</methodsynopsis>
|
2007-02-04 22:46:34 +00:00
|
|
|
<para>
|
2007-02-04 22:46:33 +00:00
|
|
|
Sets the <link linkend="ini.include-path">include_path</link>
|
2007-02-04 22:46:34 +00:00
|
|
|
configuration option for the duration of the script.
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="parameters">
|
|
|
|
&reftitle.parameters;
|
|
|
|
<para>
|
|
|
|
<variablelist>
|
|
|
|
<varlistentry>
|
|
|
|
<term><parameter>new_include_path</parameter></term>
|
|
|
|
<listitem>
|
|
|
|
<para>
|
|
|
|
The new value for the <link
|
|
|
|
linkend="ini.include-path">include_path</link>
|
|
|
|
</para>
|
|
|
|
</listitem>
|
|
|
|
</varlistentry>
|
|
|
|
</variablelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="returnvalues">
|
|
|
|
&reftitle.returnvalues;
|
|
|
|
<para>
|
|
|
|
Returns the old <link linkend="ini.include-path">include_path</link> on
|
2009-11-09 10:26:08 +00:00
|
|
|
success&return.falseforfailure;.
|
2007-02-04 22:46:34 +00:00
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
|
|
|
<refsect1 role="examples">
|
|
|
|
&reftitle.examples;
|
2007-02-04 22:46:33 +00:00
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title><function>set_include_path</function> example</title>
|
|
|
|
<programlisting role="php">
|
2003-05-16 03:06:25 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
// Works as of PHP 4.3.0
|
2011-07-18 19:54:32 +00:00
|
|
|
set_include_path('/usr/lib/pear');
|
2003-05-16 03:06:25 +00:00
|
|
|
|
|
|
|
// Works in all PHP versions
|
2011-07-18 19:54:32 +00:00
|
|
|
ini_set('include_path', '/usr/lib/pear');
|
2003-05-16 03:06:25 +00:00
|
|
|
?>
|
2004-11-04 03:40:37 +00:00
|
|
|
]]>
|
2007-02-04 22:46:33 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
<para>
|
|
|
|
<example>
|
|
|
|
<title>Adding to the include path</title>
|
|
|
|
<para>
|
2007-02-04 22:46:34 +00:00
|
|
|
Making use of the <constant>PATH_SEPARATOR</constant> constant, it is
|
|
|
|
possible to extend the include path regardless of the operating system.
|
2004-11-04 03:40:37 +00:00
|
|
|
</para>
|
|
|
|
<para>
|
2007-02-04 22:46:34 +00:00
|
|
|
In this example we add <filename>/usr/lib/pear</filename> to the end of
|
|
|
|
the existing <literal>include_path</literal>.
|
2007-02-04 22:46:33 +00:00
|
|
|
</para>
|
|
|
|
<programlisting role="php">
|
2004-11-04 03:40:37 +00:00
|
|
|
<![CDATA[
|
|
|
|
<?php
|
|
|
|
$path = '/usr/lib/pear';
|
|
|
|
set_include_path(get_include_path() . PATH_SEPARATOR . $path);
|
|
|
|
?>
|
2003-05-16 03:06:25 +00:00
|
|
|
]]>
|
2007-02-04 22:46:33 +00:00
|
|
|
</programlisting>
|
|
|
|
</example>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
2007-02-04 22:46:34 +00:00
|
|
|
|
|
|
|
<refsect1 role="seealso">
|
|
|
|
&reftitle.seealso;
|
|
|
|
<para>
|
|
|
|
<simplelist>
|
|
|
|
<member><function>ini_set</function></member>
|
|
|
|
<member><function>get_include_path</function></member>
|
|
|
|
<member><function>restore_include_path</function></member>
|
2012-04-15 21:45:34 +00:00
|
|
|
<member><function>include</function></member>
|
2007-02-04 22:46:34 +00:00
|
|
|
</simplelist>
|
|
|
|
</para>
|
|
|
|
</refsect1>
|
|
|
|
|
2007-02-04 22:46:33 +00:00
|
|
|
</refentry>
|
2003-05-16 03:06:25 +00:00
|
|
|
|
|
|
|
<!-- Keep this comment at the end of the file
|
|
|
|
Local variables:
|
|
|
|
mode: sgml
|
|
|
|
sgml-omittag:t
|
|
|
|
sgml-shorttag:t
|
|
|
|
sgml-minimize-attributes:nil
|
|
|
|
sgml-always-quote-attributes:t
|
|
|
|
sgml-indent-step:1
|
|
|
|
sgml-indent-data:t
|
|
|
|
indent-tabs-mode:nil
|
|
|
|
sgml-parent-document:nil
|
2009-09-25 07:04:39 +00:00
|
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
2003-05-16 03:06:25 +00:00
|
|
|
sgml-exposed-tags:nil
|
|
|
|
sgml-local-catalogs:nil
|
|
|
|
sgml-local-ecat-files:nil
|
|
|
|
End:
|
|
|
|
vim600: syn=xml fen fdm=syntax fdl=2 si
|
|
|
|
vim: et tw=78 syn=sgml
|
|
|
|
vi: ts=1 sw=1
|
|
|
|
-->
|