mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-24 07:02:09 +01:00
171 lines
4.2 KiB
XML
171 lines
4.2 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
|
<!-- EN-Revision: a331ac8a86bb5929b79be9a369fac1e3af516241 Maintainer: ae Status: ready --><!-- CREDITS: ae,fabioluciano -->
|
|
<refentry xml:id="function.apache-note" xmlns="http://docbook.org/ns/docbook">
|
|
<refnamediv>
|
|
<refname>apache_note</refname>
|
|
<refpurpose>Obtêm e configura notas de requisição</refpurpose>
|
|
</refnamediv>
|
|
|
|
<refsect1 role="description">
|
|
&reftitle.description;
|
|
<methodsynopsis>
|
|
<type class="union"><type>string</type><type>false</type></type><methodname>apache_note</methodname>
|
|
<methodparam><type>string</type><parameter>note_name</parameter></methodparam>
|
|
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>note_value</parameter><initializer>&null;</initializer></methodparam>
|
|
</methodsynopsis>
|
|
<para>
|
|
Esta função chama as funções <literal>table_get</literal> e
|
|
<literal>table_set</literal> do Apache. Edita as tabelas de notas que existem
|
|
durante uma requisição. O objetivo das tabelas é permitir que os módulos do Apache
|
|
se comuniquem entre entre si.
|
|
</para>
|
|
<para>
|
|
O principal uso da função <function>apache_note</function> é passar informações
|
|
de um módulo para outro dentro da mesma requisição.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="parameters">
|
|
&reftitle.parameters;
|
|
<para>
|
|
<variablelist>
|
|
<varlistentry>
|
|
<term><parameter>note_name</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O nome da nota.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
<varlistentry>
|
|
<term><parameter>note_value</parameter></term>
|
|
<listitem>
|
|
<para>
|
|
O valor da nota.
|
|
</para>
|
|
</listitem>
|
|
</varlistentry>
|
|
</variablelist>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="returnvalues">
|
|
&reftitle.returnvalues;
|
|
<para>
|
|
Se <parameter>note_value</parameter> for omitido ou &null;, retorna o valor atual da nota
|
|
<literal>note_name</literal>. Se chamado com dois argumentos,
|
|
define o valor da nota <literal>note_name</literal> para o valor
|
|
<literal>note_value</literal> e retorna o valor anterior da
|
|
nota <literal>note_name</literal>.
|
|
Se a nota não puder ser retornada &false; é retornado.
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="changelog">
|
|
&reftitle.changelog;
|
|
<informaltable>
|
|
<tgroup cols="2">
|
|
<thead>
|
|
<row>
|
|
<entry>&Version;</entry>
|
|
<entry>&Description;</entry>
|
|
</row>
|
|
</thead>
|
|
<tbody>
|
|
<row>
|
|
<entry>8.0.0</entry>
|
|
<entry>
|
|
<parameter>note_value</parameter> agora permite null.
|
|
</entry>
|
|
</row>
|
|
</tbody>
|
|
</tgroup>
|
|
</informaltable>
|
|
</refsect1>
|
|
|
|
<refsect1 role="examples">
|
|
&reftitle.examples;
|
|
<para>
|
|
<example>
|
|
<title>Passando informações entre PHP e Perl</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
apache_note('name', 'Fredrik Ekengren');
|
|
|
|
// Chama o script perl
|
|
virtual("/perl/some_script.pl");
|
|
|
|
$result = apache_note("resultdata");
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<programlisting role="perl">
|
|
<![CDATA[
|
|
# Obtém o objeto request do Apache
|
|
my $r = Apache->request()->main();
|
|
|
|
# Obtém o dado repassado
|
|
my $name = $r->notes('name');
|
|
|
|
# algum processamento
|
|
|
|
# Devolce o resultado ao PHP
|
|
$r->notes('resultdata', $result);
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
<para>
|
|
<example>
|
|
<title>Logar valores no access.log</title>
|
|
<programlisting role="php">
|
|
<![CDATA[
|
|
<?php
|
|
|
|
apache_note('sessionID', session_id());
|
|
|
|
?>
|
|
]]>
|
|
</programlisting>
|
|
<programlisting role="apache">
|
|
<![CDATA[
|
|
# "%{sessionID}n" pode ser utilizado numa diretiva LogFormat
|
|
]]>
|
|
</programlisting>
|
|
</example>
|
|
</para>
|
|
</refsect1>
|
|
|
|
<refsect1 role="seealso">
|
|
&reftitle.seealso;
|
|
<para>
|
|
<simplelist>
|
|
<member><function>virtual</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
|
|
-->
|