mirror of
https://github.com/php/doc-zh.git
synced 2026-03-24 15:12:20 +01:00
129 lines
3.2 KiB
XML
129 lines
3.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- $Revision$ -->
|
|
<!-- EN-Revision: b8758b0605e80c4e3610137b7502a6abeea5c69b Maintainer: hytest Status: ready -->
|
|
<!-- Reviewed: no -->
|
|
|
|
<!-- splitted from ./en/functions/apache.xml, last change in rev 1.7 -->
|
|
<refentry xml:id="function.apache-setenv" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>apache_setenv</refname>
|
|
<refpurpose>设置 Apache 子进程环境变量</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type>bool</type><methodname>apache_setenv</methodname>
|
|
<methodparam><type>string</type><parameter>variable</parameter></methodparam>
|
|
<methodparam><type>string</type><parameter>value</parameter></methodparam>
|
|
<methodparam choice="opt"><type>bool</type><parameter>walk_to_top</parameter><initializer>&false;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
<function>apache_setenv</function> 设置由<parameter>variable</parameter>指定的 Apache
|
|
环境变量值。
|
|
</para>
|
|
<note>
|
|
<para>
|
|
当设置了某 Apache 环境变量, 相应的
|
|
<varname>$_SERVER</varname>
|
|
变量不会改变。
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>variable</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
将被设置的环境变量。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
新 <parameter>variable</parameter> 值。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>walk_to_top</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
是否将所设置的顶层变量应用到所有 Apache 层。
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
&return.success;
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>使用 <function>apache_setenv</function> 设置一个 Apache 环境变量 </title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
apache_setenv("EXAMPLE_VAR", "Example Value");
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="notes">
|
|
&reftitle.notes;
|
|
<note>
|
|
<para>
|
|
<function>apache_setenv</function> 可与
|
|
<function>apache_getenv</function> 配合使用,以在不同页面间传递变量,或将 PHP 脚本中已设置变量传入 Server Side Includes (.shtml)页面。
|
|
</para>
|
|
</note>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>apache_getenv</function></member>
|
|
</simplelist>
|
|
</para>
|
|
</refsect1>
|
|
</refentry>
|
|
|
|
<!-- 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
|
|
sgml-default-dtd-file:"~/.phpdoc/manual.ced"
|
|
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
|
|
-->
|