Skip to content

Commit

Permalink
sync with en rev
Browse files Browse the repository at this point in the history
  • Loading branch information
leonardolara committed Feb 25, 2025
1 parent 9822a9c commit c434020
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 21 deletions.
21 changes: 9 additions & 12 deletions reference/curl/functions/curl-share-init-persistent.xml
Original file line number Diff line number Diff line change
@@ -1,4 +1,4 @@
<?xml version="1.0" encoding="utf-8"?><!-- EN-Revision: 01d19a544891db839e36de8316e78f81de56c1ca Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara -->
<?xml version="1.0" encoding="utf-8"?><!-- EN-Revision: 9e08f606a38fb7c0de98b42375636692d43d7040 Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara -->
<refentry xml:id="function.curl-share-init-persistent" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>curl_share_init_persistent</refname>
Expand Down Expand Up @@ -94,28 +94,25 @@
</simpara>

<programlisting role="php">
<![CDATA[
<![CDATA[
<?php
// Cria ou recupera um identificador de compartilhamento cURL persistente definido para compartilhar pesquisas e conexões de DNS.
$sh = curl_share_init([CURL_LOCK_DATA_DNS, CURL_LOCK_DATA_CONNECT]);
// Inicializa o primeiro identificador cURL e atribui a ele o identificador de compartilhamento.
// Cria ou recupera um identificador de compartilhamento cURL persistente definido para compartilhar pesquisas e conexões de DNS
$sh = curl_share_init_persistent([CURL_LOCK_DATA_DNS, CURL_LOCK_DATA_CONNECT]);
// Inicializa o primeiro identificador cURL e atribui a ele o identificador de compartilhamento
$ch1 = curl_init("http://example.com/");
curl_setopt($ch1, CURLOPT_SHARE, $sh);
// Executa o primeiro identificador cURL. Isto pode reutilizar a conexão de uma solicitação SAPI anterior.
// Executa o primeiro identificador cURL que pode reutilizar a conexão de uma solicitação SAPI anterior
curl_exec($ch1);
// Inicializa o segundo identificador cURL e atribui o identificador de compartilhamento a ele.
// Inicializa o segundo identificador cURL e atribui o identificador de compartilhamento a ele
$ch2 = curl_init("http://example.com/");
curl_setopt($ch2, CURLOPT_SHARE, $sh);
// Executa o segundo identificador cURL. Isso reutilizará a conexão de $ch1.
// Executa o segundo identificador cURL. Isso reutilizará a conexão de $ch1
curl_exec($ch2);
// Fecha os identificadores cURL
curl_close($ch1);
curl_close($ch2);
?>
]]>
Expand Down
4 changes: 2 additions & 2 deletions reference/dom/domxpath/registerphpfunctionns.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 01904e809eaf0aa60e7ce0524400ddd5681c9541 Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara -->
<!-- EN-Revision: db4a10ffdc22db3b49ea7fc01c36d21180c339b8 Maintainer: leonardolara Status: ready --><!-- CREDITS: leonardolara -->
<refentry xml:id="domxpath.registerphpfunctionns" xmlns="http://docbook.org/ns/docbook" xmlns:xi="http://www.w3.org/2001/XInclude">
<refnamediv>
<refname>DOMXPath::registerPhpFunctionNS</refname>
Expand Down Expand Up @@ -96,7 +96,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("my", "urn:my.ns");
// Registra funções PHP (sem restrições)
$xpath->registerPHPFunctionNS(
$xpath->registerPhpFunctionNS(
'urn:my.ns',
'substring',
fn (array $arg1, int $start, int $length) => substr($arg1[0]->textContent, $start, $length)
Expand Down
14 changes: 7 additions & 7 deletions reference/dom/domxpath/registerphpfunctions.xml
Original file line number Diff line number Diff line change
@@ -1,5 +1,5 @@
<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 01904e809eaf0aa60e7ce0524400ddd5681c9541 Maintainer: leonardolara Status: ready --><!-- CREDITS: fernandowobeto, leonardolara -->
<!-- EN-Revision: db4a10ffdc22db3b49ea7fc01c36d21180c339b8 Maintainer: leonardolara Status: ready --><!-- CREDITS: fernandowobeto, leonardolara -->
<refentry xml:id="domxpath.registerphpfunctions" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>DOMXPath::registerPhpFunctions</refname>
Expand Down Expand Up @@ -132,7 +132,7 @@
</para>
<para>
<example>
<title><methodname>DOMXPath::registerPHPFunctions</methodname> com <literal>php:functionString</literal></title>
<title><methodname>DOMXPath::registerPhpFunctions</methodname> com <literal>php:functionString</literal></title>
<programlisting role="php">
<![CDATA[
<?php
Expand All @@ -145,7 +145,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("php", "http://php.net/xpath");
// Registra funções PHP (sem restrições)
$xpath->registerPHPFunctions();
$xpath->registerPhpFunctions();
// hama a função substr no título do livro
$nodes = $xpath->query('//book[php:functionString("substr", title, 0, 3) = "PHP"]');
Expand All @@ -172,7 +172,7 @@ PHP Secrets by Jenny Smythe
</para>
<para>
<example>
<title><methodname>DOMXPath::registerPHPFunctions</methodname> com <literal>php:function</literal></title>
<title><methodname>DOMXPath::registerPhpFunctions</methodname> com <literal>php:function</literal></title>
<programlisting role="php">
<![CDATA[
<?php
Expand All @@ -185,7 +185,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("php", "http://php.net/xpath");
// Registra funções PHP (apenas has_multiple)
$xpath->registerPHPFunctions("has_multiple");
$xpath->registerPhpFunctions("has_multiple");
function has_multiple($nodes) {
// Retorna true se mais de um autor
Expand Down Expand Up @@ -213,7 +213,7 @@ PHP Basics
</para>
<para>
<example>
<title><methodname>DOMXPath::registerPHPFunctions</methodname> com um <type>callable</type></title>
<title><methodname>DOMXPath::registerPhpFunctions</methodname> com um <type>callable</type></title>
<programlisting role="php">
<![CDATA[
<?php
Expand All @@ -226,7 +226,7 @@ $xpath = new DOMXPath($doc);
$xpath->registerNamespace("php", "http://php.net/xpath");
// Registra funções PHP (somente has_multiple)
$xpath->registerPHPFunctions(["has_multiple" => fn ($nodes) => count($nodes) > 1]);
$xpath->registerPhpFunctions(["has_multiple" => fn ($nodes) => count($nodes) > 1]);
// Filtra livros com múltiplos autores
$books = $xpath->query('//book[php:function("has_multiple", author)]');
Expand Down

0 comments on commit c434020

Please sign in to comment.