Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Tradução cURL. #257

Merged
merged 15 commits into from
Aug 14, 2023
60 changes: 42 additions & 18 deletions reference/curl/functions/curl-exec.xml
Original file line number Diff line number Diff line change
@@ -1,23 +1,23 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: b7f8c11e56ff1c57a2993e2ed7e5c5ace18637fd Maintainer: enzogamads Status: ready --><!-- CREDITS: enzogamads,fernandoc,ae -->
<refentry xml:id="function.curl-exec" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>curl_exec</refname>
<refpurpose>Perform a cURL session</refpurpose>
<refpurpose>Executa uma sessão cURL</refpurpose>
</refnamediv>

<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>mixed</type><methodname>curl_exec</methodname>
<methodparam><type>resource</type><parameter>ch</parameter></methodparam>
<type class="union"><type>string</type><type>bool</type></type><methodname>curl_exec</methodname>
<methodparam><type>CurlHandle</type><parameter>handle</parameter></methodparam>
</methodsynopsis>
<para>
Execute the given cURL session.
Execute a sessão cURL fornecida.
</para>
<para>
This function should be called after initializing a cURL session and all
the options for the session are set.
Esta função deve ser chamada após inicializar uma sessão cURL e todas
as opções para a sessão são definidas.
</para>
</refsect1>

Expand All @@ -33,39 +33,64 @@
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.success; However, if the <constant>CURLOPT_RETURNTRANSFER</constant>
option is <link linkend="function.curl-setopt">set</link>, it will return
the result on success, &false; on failure.
&return.success; No entanto, se a opção <constant>CURLOPT_RETURNTRANSFER</constant>
estiver <link linkend="function.curl-setopt">definida</link>, ela retornará
o resultado em caso de sucesso, &false; em caso de falha.
</para>
&return.falseproblem;
<note>
<para>
Observe que os códigos de retorno que indicam erros (como por exemplo <literal>404
Not found</literal>) não são tratados como falhas.
Use <function>curl_getinfo</function> para verificar esses casos.
</para>
</note>
</refsect1>


<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
&curl.changelog.handle-param;
</tbody>
</tgroup>
</informaltable>
</refsect1>

<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title>Fetching a web page</title>
<title>Obtendo uma página da web</title>
<programlisting role="php">
<![CDATA[
<?php
// create a new cURL resource
// Cria um novo recurso cURL
$ch = curl_init();

// set URL and other appropriate options
// Confiura a URL e opções
curl_setopt($ch, CURLOPT_URL, "http://www.example.com/");
curl_setopt($ch, CURLOPT_HEADER, 0);

// grab URL and pass it to the browser
// Obtem os dados
curl_exec($ch);

// close cURL resource, and free up system resources
// Fecha o recurso e libera recursos internos
curl_close($ch);
?>
]]>
</programlisting>
</example>
</para>
</refsect1>

<refsect1 role="seealso">
&reftitle.seealso;
<para>
Expand All @@ -76,7 +101,6 @@ curl_close($ch);
</refsect1>

</refentry>

<!-- Keep this comment at the end of the file
Local variables:
mode: sgml
Expand Down
Loading