mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
fixed untranslated sections/files
This commit is contained in:
@@ -51,7 +51,7 @@
|
||||
<tgroup cols="6">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>Expression</entry>
|
||||
<entry>Expressão</entry>
|
||||
<entry><function>gettype</function></entry>
|
||||
<entry><function>empty</function></entry>
|
||||
<entry><function>is_null</function></entry>
|
||||
@@ -85,7 +85,7 @@
|
||||
<entry>&false;</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><varname>$x</varname> is undefined</entry>
|
||||
<entry><varname>$x</varname> está indefinido</entry>
|
||||
<entry><type>NULL</type></entry>
|
||||
<entry>&true;</entry>
|
||||
<entry>&true;</entry>
|
||||
|
||||
@@ -257,7 +257,7 @@ $fp = fopen('php://output', 'w');
|
||||
stream_filter_append($fp, 'convert.iconv.utf-16le.utf-8');
|
||||
fwrite($fp, "T\0h\0i\0s\0 \0i\0s\0 \0a\0 \0t\0e\0s\0t\0.\0\n\0");
|
||||
fclose($fp);
|
||||
/* Outputs: This is a test. */
|
||||
/* Exibe: This is a test. */
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -528,7 +528,7 @@ O arquivo comprimido tem 1488 bytes.
|
||||
</para>
|
||||
|
||||
<example>
|
||||
<title>Criptografar/Descriptografar com Blowfish</title>
|
||||
<title>Criptografando/Descriptografando com Blowfish</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -542,12 +542,12 @@ stream_filter_append($fp, 'mcrypt.blowfish', STREAM_FILTER_WRITE, $opts);
|
||||
fwrite($fp, 'mensagem para criptografar');
|
||||
fclose($fp);
|
||||
|
||||
// descriptografar...
|
||||
// descriptografando...
|
||||
$fp = fopen('encrypted-file.enc', 'rb');
|
||||
$iv = fread($fp, $iv_size = mcrypt_get_iv_size(MCRYPT_BLOWFISH, MCRYPT_MODE_CBC));
|
||||
$opts = array('mode'=>'cbc','iv'=>$iv, 'key'=>$key);
|
||||
stream_filter_append($fp, 'mdecrypt.blowfish', STREAM_FILTER_READ, $opts);
|
||||
$data = rtrim(stream_get_contents($fp)); // retira o null padding
|
||||
$data = rtrim(stream_get_contents($fp)); // retira o preenchimento com null
|
||||
fclose($fp);
|
||||
echo $data;
|
||||
?>
|
||||
@@ -555,7 +555,7 @@ echo $data;
|
||||
</programlisting>
|
||||
</example>
|
||||
<example>
|
||||
<title>Criptografar arquivo usando CBC AES-128 com HMAC SHA256</title>
|
||||
<title>Criptografando arquivo usando CBC AES-128 com HMAC SHA256</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
@@ -571,7 +571,7 @@ class AES_CBC
|
||||
$fin = fopen($input_stream, "rb");
|
||||
$fc = fopen($aes_filename, "wb+");
|
||||
if (!empty($fin) && !empty($fc)) {
|
||||
fwrite($fc, str_repeat("_", 32) ); // placeholder, HMAC SHA256 será usado aqui mais tarde
|
||||
fwrite($fc, str_repeat("_", 32) ); // marcador, HMAC SHA256 será usado aqui mais tarde
|
||||
fwrite($fc, $hmac_salt = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM));
|
||||
fwrite($fc, $esalt = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM));
|
||||
fwrite($fc, $iv = mcrypt_create_iv($iv_size, MCRYPT_DEV_URANDOM));
|
||||
@@ -585,13 +585,13 @@ class AES_CBC
|
||||
fwrite($fc, $block);
|
||||
}
|
||||
$block_size = mcrypt_get_block_size(MCRYPT_RIJNDAEL_128, MCRYPT_MODE_CBC);
|
||||
$padding = $block_size - ($infilesize % $block_size);//$padding is a number from 1-16
|
||||
fwrite($fc, str_repeat(chr($padding), $padding) );//perform PKCS7 padding
|
||||
$padding = $block_size - ($infilesize % $block_size); // $padding é um número de 1 a 16
|
||||
fwrite($fc, str_repeat(chr($padding), $padding) ); // realiza um preenchimento PKCS7
|
||||
fclose($fin);
|
||||
fclose($fc);
|
||||
$hmac_raw = self::calculate_hmac_after_32bytes($password, $hmac_salt, $aes_filename);
|
||||
$fc = fopen($aes_filename, "rb+");
|
||||
fwrite($fc, $hmac_raw);//overwrite placeholder
|
||||
fwrite($fc, $hmac_raw); // sobrescreve o marcador
|
||||
fclose($fc);
|
||||
}
|
||||
}
|
||||
@@ -603,7 +603,7 @@ class AES_CBC
|
||||
$fc = fopen($aes_filename, "rb");
|
||||
$fout = fopen($out_stream, 'wb');
|
||||
if (!empty($fout) && !empty($fc) && self::hash_equals($hmac_raw,$hmac_calc)) {
|
||||
fread($fc, 32+$iv_size);//skip sha256 hmac and salt
|
||||
fread($fc, 32+$iv_size); // ignora hmac e salt do sha256
|
||||
$esalt = fread($fc, $iv_size);
|
||||
$iv = fread($fc, $iv_size);
|
||||
$ekey = hash_pbkdf2("sha256", $password, $esalt, $it=1000, self::key_size(), $raw=true);
|
||||
@@ -612,7 +612,7 @@ class AES_CBC
|
||||
while (!feof($fc)) {
|
||||
$block = fread($fc, 8192);
|
||||
if (feof($fc)) {
|
||||
$padding = ord($block[strlen($block) - 1]);//assume PKCS7 padding
|
||||
$padding = ord($block[strlen($block) - 1]); // assume preenchimento PKCS7
|
||||
$block = substr($block, 0, 0-$padding);
|
||||
}
|
||||
fwrite($fout, $block);
|
||||
|
||||
@@ -89,7 +89,7 @@ class ChildProducer extends Producer {
|
||||
<![CDATA[
|
||||
<?php
|
||||
$array['key'] ??= computeDefault();
|
||||
// is roughly equivalent to
|
||||
// é praticamente equivalente a
|
||||
if (!isset($array['key'])) {
|
||||
$array['key'] = computeDefault();
|
||||
}
|
||||
@@ -130,7 +130,7 @@ $fruits = ['banana', 'orange', ...$parts, 'watermelon'];
|
||||
6.674_083e-11; // float
|
||||
299_792_458; // decimal
|
||||
0xCAFE_F00D; // hexadecimal
|
||||
0b0101_1111; // binary
|
||||
0b0101_1111; // binário
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -361,9 +361,9 @@ proc_open(['php', '-r', 'echo "Hello World\n";'], $descriptors, $pipes);
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Like 2>&1 on the shell
|
||||
// Similar a 2>&1 no shell
|
||||
proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['redirect', 1]], $pipes);
|
||||
// Like 2>/dev/null or 2>nul on the shell
|
||||
// Similar a 2>/dev/null ou 2>nul no shell
|
||||
proc_open($cmd, [1 => ['pipe', 'w'], 2 => ['null']], $pipes);
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -39,13 +39,13 @@ A é igual a 5
|
||||
<![CDATA[
|
||||
<?php
|
||||
if ($a == 5):
|
||||
echo "a equals 5";
|
||||
echo "a é igual a 5";
|
||||
echo "...";
|
||||
elseif ($a == 6):
|
||||
echo "a equals 6";
|
||||
echo "a é igual a 6";
|
||||
echo "!!!";
|
||||
else:
|
||||
echo "a is neither 5 nor 6";
|
||||
echo "a não é 5 nem 6";
|
||||
endif;
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -44,24 +44,24 @@ do {
|
||||
<literal>do-while</literal>, que permite parar a execução no meio
|
||||
do bloco de códigos, encapsulando-os em um
|
||||
<literal>do-while</literal> (0), e usando o <link
|
||||
linkend="control-structures.break"><literal>break</literal></link>
|
||||
. O código a seguir demonstra isso:
|
||||
linkend="control-structures.break"><literal>break</literal></link>.
|
||||
O código a seguir demonstra isso:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
do {
|
||||
if ($i < 5) {
|
||||
echo "i is not big enough";
|
||||
echo "i não é grande o suficiente";
|
||||
break;
|
||||
}
|
||||
$i *= $factor;
|
||||
if ($i < $minimum_limit) {
|
||||
break;
|
||||
}
|
||||
echo "i is ok";
|
||||
echo "i está ok";
|
||||
|
||||
/* process i */
|
||||
/* processa i */
|
||||
|
||||
} while (0);
|
||||
?>
|
||||
@@ -72,7 +72,7 @@ do {
|
||||
<simpara>
|
||||
É possível usar o
|
||||
<link linkend="control-structures.goto"><literal>goto</literal></link>
|
||||
ao invés desse hack.
|
||||
ao invés desse truque.
|
||||
</simpara>
|
||||
</sect1>
|
||||
|
||||
|
||||
@@ -11,18 +11,18 @@
|
||||
estende a instrução <literal>if</literal> para executar outras
|
||||
caso a expressão no <literal>if</literal> retornar
|
||||
&false;. Por exemplo, o código a
|
||||
seguir exibirá <computeroutput>a is greater than
|
||||
seguir exibirá <computeroutput>a é maior que
|
||||
b</computeroutput> se <varname>$a</varname> for maior que
|
||||
<varname>$b</varname>, e <computeroutput>a is NOT greater
|
||||
than b</computeroutput> caso contrário:
|
||||
<varname>$b</varname>, e <computeroutput>a NÃO é maior
|
||||
que b</computeroutput> caso contrário:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if ($a > $b) {
|
||||
echo "a is greater than b";
|
||||
echo "a é maior que b";
|
||||
} else {
|
||||
echo "a is NOT greater than b";
|
||||
echo "a NÃO é maior que b";
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -52,7 +52,7 @@ $arr = array(1, 2, 3, 4);
|
||||
foreach ($arr as &$valor) {
|
||||
$valor = $valor * 2;
|
||||
}
|
||||
// $arr is now array(2, 4, 6, 8)
|
||||
// $arr agora é array(2, 4, 6, 8)
|
||||
unset($valor); // quebra a referência com o último elemento
|
||||
?>
|
||||
]]>
|
||||
@@ -129,7 +129,7 @@ foreach (array(1, 2, 3, 4) as &$valor) {
|
||||
$a = array(1, 2, 3, 17);
|
||||
|
||||
foreach ($a as $v) {
|
||||
echo "Current value of \$a: $v.\n";
|
||||
echo "Valor atual de \$a: $v.\n";
|
||||
}
|
||||
|
||||
/* Exemplo foreach 2: valor com acesso manual (apenas ilustrativo) */
|
||||
@@ -146,17 +146,17 @@ foreach ($a as $v) {
|
||||
/* Exemplo foreach 3: chave e valor */
|
||||
|
||||
$a = array(
|
||||
"one" => 1,
|
||||
"two" => 2,
|
||||
"three" => 3,
|
||||
"seventeen" => 17
|
||||
"um" => 1,
|
||||
"dois" => 2,
|
||||
"três" => 3,
|
||||
"dezessete" => 17
|
||||
);
|
||||
|
||||
foreach ($a as $k => $v) {
|
||||
echo "\$a[$k] => $v.\n";
|
||||
}
|
||||
|
||||
/* Exemplo foreach 4: arrays multi dimencionais */
|
||||
/* Exemplo foreach 4: arrays multi dimensionais */
|
||||
$a = array();
|
||||
$a[0][0] = "a";
|
||||
$a[0][1] = "b";
|
||||
|
||||
@@ -29,15 +29,15 @@ if (expr)
|
||||
</link>.
|
||||
</simpara>
|
||||
<para>
|
||||
O exemplo a seguir exibirá <computeroutput>a is bigger
|
||||
than b</computeroutput> se <varname>$a</varname> for maior
|
||||
O exemplo a seguir exibirá <computeroutput>a é maior
|
||||
que b</computeroutput> se <varname>$a</varname> for maior
|
||||
que <varname>$b</varname>:
|
||||
<informalexample>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
if ($a > $b)
|
||||
echo "a is bigger than b";
|
||||
echo "a é maior que b";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -48,7 +48,7 @@ if ($a > $b)
|
||||
executada. É claro que não é necessário envolver cada declaração
|
||||
em uma cláusula <literal>if</literal>. Em vez disso, pode-se agrupar
|
||||
várias declarações em grupos. Por exemplo, este código
|
||||
exibirá <computeroutput>a is bigger than b</computeroutput>
|
||||
exibirá <computeroutput>a é maior que b</computeroutput>
|
||||
se <varname>$a</varname> for maior que
|
||||
<varname>$b</varname>, e atribuirá o valor de
|
||||
<varname>$a</varname> em <varname>$b</varname>:
|
||||
@@ -57,7 +57,7 @@ if ($a > $b)
|
||||
<![CDATA[
|
||||
<?php
|
||||
if ($a > $b) {
|
||||
echo "a is bigger than b";
|
||||
echo "a é maior que b";
|
||||
$b = $a;
|
||||
}
|
||||
?>
|
||||
|
||||
@@ -103,10 +103,10 @@ function foo()
|
||||
echo "A $color $fruit";
|
||||
}
|
||||
|
||||
/* vars.php is in the scope of foo() so *
|
||||
* $fruit is NOT available outside of this *
|
||||
* scope. $color is because we declared it *
|
||||
* as global. */
|
||||
/* vars.php está no escopo de foo() por isso *
|
||||
* $fruit NÃO está disponível fora deste *
|
||||
* escopo. $color está, porque foi declarada *
|
||||
* como global. */
|
||||
|
||||
foo(); // A green apple
|
||||
echo "A $color $fruit"; // A green
|
||||
|
||||
@@ -92,7 +92,7 @@ pegar_uma_carta('Espadas');
|
||||
|
||||
<para>
|
||||
Por padrão, os casos não são internamente associados por um valor escalar. Ou seja, <literal>Naipe::Copas</literal>
|
||||
is not equal to <literal>"0"</literal>. Instead, each case is backed by a singleton object of that name. That means that:
|
||||
não é igual a <literal>"0"</literal>. Ao invés disso, cada caso é apoiado por um objeto único com esse nome. Isso significa que:
|
||||
</para>
|
||||
|
||||
<programlisting role="php">
|
||||
@@ -613,7 +613,7 @@ class Foo
|
||||
|
||||
// Isto é perfeitamente legal, porque não é uma expressão constante.
|
||||
$x = Direcao::Cima['curta'];
|
||||
var_dump("\$x is " . var_export($x, true));
|
||||
var_dump("\$x é " . var_export($x, true));
|
||||
|
||||
$foo = new Foo();
|
||||
?>
|
||||
|
||||
@@ -1235,7 +1235,7 @@ string(11) "hello world"
|
||||
// Um exemplo básico de carrinho de compras que contém uma lista de produtos
|
||||
// e a quantidade de cada produto. Inclui um método que
|
||||
// calcula o preço total dos itens no carrinho utilizando uma
|
||||
// closure como callback.
|
||||
// closure como função de retorno.
|
||||
class Cart
|
||||
{
|
||||
const PRICE_BUTTER = 1.00;
|
||||
@@ -1279,9 +1279,9 @@ $my_cart->add('butter', 1);
|
||||
$my_cart->add('milk', 3);
|
||||
$my_cart->add('eggs', 6);
|
||||
|
||||
// Print the total with a 5% sales tax.
|
||||
// Exibe o total com uma taxa de venda de 5%.
|
||||
print $my_cart->getTotal(0.05) . "\n";
|
||||
// The result is 54.29
|
||||
// O resultado é 54.29
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -81,11 +81,11 @@ namespace foo {
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
const ONE = 1;
|
||||
const UM = 1;
|
||||
class foo {
|
||||
const TWO = ONE * 2;
|
||||
const THREE = ONE + self::TWO;
|
||||
const SENTENCE = 'The value of THREE is '.self::THREE;
|
||||
const DOIS = UM * 2;
|
||||
const TRES = UM + self::DOIS;
|
||||
const FRASE = 'O valor de TRES é '.self::TRES;
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -82,7 +82,7 @@ class Foo
|
||||
|
||||
public function printPHP()
|
||||
{
|
||||
echo 'PHP is great.' . PHP_EOL;
|
||||
echo 'PHP é ótimo' . PHP_EOL;
|
||||
}
|
||||
}
|
||||
|
||||
@@ -96,10 +96,10 @@ class Bar extends Foo
|
||||
|
||||
$foo = new Foo();
|
||||
$bar = new Bar();
|
||||
$foo->printItem('baz'); // Output: 'Foo: baz'
|
||||
$foo->printPHP(); // Output: 'PHP is great'
|
||||
$bar->printItem('baz'); // Output: 'Bar: baz'
|
||||
$bar->printPHP(); // Output: 'PHP is great'
|
||||
$foo->printItem('baz'); // Saída: 'Foo: baz'
|
||||
$foo->printPHP(); // Saída: 'PHP é ótimo'
|
||||
$bar->printItem('baz'); // Saída: 'Bar: baz'
|
||||
$bar->printPHP(); // Saída: 'PHP é ótimo'
|
||||
|
||||
?>
|
||||
]]>
|
||||
@@ -173,7 +173,7 @@ class MeuDateTime extends DateTime
|
||||
public function modify(string $modifier) { return false; }
|
||||
}
|
||||
|
||||
// Nenhuma notícia é acionada
|
||||
// Nenhum aviso é emitido
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -135,50 +135,50 @@
|
||||
<?php
|
||||
class PropertyTest
|
||||
{
|
||||
/** Location for overloaded data. */
|
||||
/** Local para dados sobrecarregados. */
|
||||
private $data = array();
|
||||
|
||||
/** Overloading not used on declared properties. */
|
||||
/** Sobrecarga não usada em propriedades declaradas. */
|
||||
public $declared = 1;
|
||||
|
||||
/** Overloading only used on this when accessed outside the class. */
|
||||
/** Sobrecarga usada somente neste quando acessada fora da classe. */
|
||||
private $hidden = 2;
|
||||
|
||||
public function __set($name, $value)
|
||||
{
|
||||
echo "Setting '$name' to '$value'\n";
|
||||
echo "Definindo '$name' para '$value'\n";
|
||||
$this->data[$name] = $value;
|
||||
}
|
||||
|
||||
public function __get($name)
|
||||
{
|
||||
echo "Getting '$name'\n";
|
||||
echo "Obtendo '$name'\n";
|
||||
if (array_key_exists($name, $this->data)) {
|
||||
return $this->data[$name];
|
||||
}
|
||||
|
||||
$trace = debug_backtrace();
|
||||
trigger_error(
|
||||
'Undefined property via __get(): ' . $name .
|
||||
' in ' . $trace[0]['file'] .
|
||||
' on line ' . $trace[0]['line'],
|
||||
'Propriedade indefinida via __get(): ' . $name .
|
||||
' em ' . $trace[0]['file'] .
|
||||
' na linha ' . $trace[0]['line'],
|
||||
E_USER_NOTICE);
|
||||
return null;
|
||||
}
|
||||
|
||||
public function __isset($name)
|
||||
{
|
||||
echo "Is '$name' set?\n";
|
||||
echo "'$name' está definido?\n";
|
||||
return isset($this->data[$name]);
|
||||
}
|
||||
|
||||
public function __unset($name)
|
||||
{
|
||||
echo "Unsetting '$name'\n";
|
||||
echo "Removendo a definição de '$name'\n";
|
||||
unset($this->data[$name]);
|
||||
}
|
||||
|
||||
/** Not a magic method, just here for example. */
|
||||
/** Não é um método mágico, está aqui somente para exemplo. */
|
||||
public function getHidden()
|
||||
{
|
||||
return $this->hidden;
|
||||
@@ -200,10 +200,10 @@ echo "\n";
|
||||
|
||||
echo $obj->declared . "\n\n";
|
||||
|
||||
echo "Let's experiment with the private property named 'hidden':\n";
|
||||
echo "Privates are visible inside the class, so __get() not used...\n";
|
||||
echo "Vamos experimentar com a propriedade privada chamada 'hidden':\n";
|
||||
echo "Propriedades privadas são visíveis dentro da classe, por isso __get() não é usado...\n";
|
||||
echo $obj->getHidden() . "\n";
|
||||
echo "Privates not visible outside of class, so __get() is used...\n";
|
||||
echo "Propriedades privadas não são visíveis fora da classe, por isso __get() é usado...\n";
|
||||
echo $obj->hidden . "\n";
|
||||
?>
|
||||
]]>
|
||||
@@ -211,26 +211,26 @@ echo $obj->hidden . "\n";
|
||||
&example.outputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Setting 'a' to '1'
|
||||
Getting 'a'
|
||||
Definindo 'a' to '1'
|
||||
Obtendo 'a'
|
||||
1
|
||||
|
||||
Is 'a' set?
|
||||
'a' está definido?
|
||||
bool(true)
|
||||
Unsetting 'a'
|
||||
Is 'a' set?
|
||||
Removendo a definição de 'a'
|
||||
'a' está definido?
|
||||
bool(false)
|
||||
|
||||
1
|
||||
|
||||
Let's experiment with the private property named 'hidden':
|
||||
Privates are visible inside the class, so __get() not used...
|
||||
Vamos experimentar com a propriedade privada chamada 'hidden':
|
||||
Propriedades privadas são visíveis dentro da classe, por isso __get() não é usado...
|
||||
2
|
||||
Privates not visible outside of class, so __get() is used...
|
||||
Getting 'hidden'
|
||||
Propriedades privadas não são visíveis fora da classe, por isso __get() é usado...
|
||||
Obtendo 'hidden'
|
||||
|
||||
|
||||
Notice: Undefined property via __get(): hidden in <file> on line 70 in <file> on line 29
|
||||
Notice: Propriedade indefinida via __get(): hidden em <file> na linha 70 em <file> na linha 29
|
||||
]]>
|
||||
</screen>
|
||||
|
||||
@@ -280,31 +280,31 @@ class MethodTest
|
||||
{
|
||||
public function __call($name, $arguments)
|
||||
{
|
||||
// Note: value of $name is case sensitive.
|
||||
echo "Calling object method '$name' "
|
||||
// Observação: valor de $name é sensível a maiúsculas/minúsculas.
|
||||
echo "Chamando método '$name' do objeto "
|
||||
. implode(', ', $arguments). "\n";
|
||||
}
|
||||
|
||||
public static function __callStatic($name, $arguments)
|
||||
{
|
||||
// Note: value of $name is case sensitive.
|
||||
echo "Calling static method '$name' "
|
||||
// Observação: valor de $name é sensível a maiúsculas/minúsculas.
|
||||
echo "Chamando método '$name' estático "
|
||||
. implode(', ', $arguments). "\n";
|
||||
}
|
||||
}
|
||||
|
||||
$obj = new MethodTest;
|
||||
$obj->runTest('in object context');
|
||||
$obj->runTest('no contexto do objeto');
|
||||
|
||||
MethodTest::runTest('in static context');
|
||||
MethodTest::runTest('no contexto estático');
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Calling object method 'runTest' in object context
|
||||
Calling static method 'runTest' in static context
|
||||
Chamando método 'runTest' do objeto no contexto do objeto
|
||||
Chamando método 'runTest' estático no contexto estático
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -48,18 +48,18 @@
|
||||
|
||||
$a = new A;
|
||||
$s = serialize($a);
|
||||
// store $s somewhere where page2.php can find it.
|
||||
file_put_contents('store', $s);
|
||||
// armazena $s em algum lugar onde page2.php possa encontrar.
|
||||
file_put_contents('caixa', $s);
|
||||
|
||||
// page2.php:
|
||||
|
||||
// this is needed for the unserialize to work properly.
|
||||
// isto é necessário para que a desserialização funcione adequadamente.
|
||||
include "A.php";
|
||||
|
||||
$s = file_get_contents('store');
|
||||
$s = file_get_contents('caixa');
|
||||
$a = unserialize($s);
|
||||
|
||||
// now use the function show_one() of the $a object.
|
||||
// agora usa a função show_one() do objeto $a.
|
||||
$a->show_one();
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -350,7 +350,7 @@ $myclass->foo(); // Todos os acessos funcionam dentro do método
|
||||
*/
|
||||
class MyClass2 extends MyClass
|
||||
{
|
||||
// This is public
|
||||
// Isto é público
|
||||
function foo2()
|
||||
{
|
||||
echo self::MY_PUBLIC;
|
||||
@@ -361,7 +361,7 @@ class MyClass2 extends MyClass
|
||||
|
||||
$myclass2 = new MyClass2;
|
||||
echo MyClass2::MY_PUBLIC; // Funciona
|
||||
$myclass2->foo2(); // Public and Protected funcionam, mas não Private
|
||||
$myclass2->foo2(); // Public e Protected funcionam, mas não Private
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -21,12 +21,12 @@
|
||||
<row>
|
||||
<entry>$a == $b</entry>
|
||||
<entry>Igualdade</entry>
|
||||
<entry>&true; se <varname>$a</varname> e <varname>$b</varname> tem as mesmas chaves e valores.</entry>
|
||||
<entry>&true; se <varname>$a</varname> e <varname>$b</varname> têm as mesmas chaves e valores.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry>$a === $b</entry>
|
||||
<entry>Identidade</entry>
|
||||
<entry>&true; se <varname>$a</varname> e <varname>$b</varname> tem as mesmas chaves e valores, na mesma
|
||||
<entry>&true; se <varname>$a</varname> e <varname>$b</varname> têm as mesmas chaves e valores, na mesma
|
||||
ordem e com os mesmos tipos.</entry>
|
||||
</row>
|
||||
<row>
|
||||
@@ -61,16 +61,16 @@
|
||||
$a = array("a" => "apple", "b" => "banana");
|
||||
$b = array("a" => "pear", "b" => "strawberry", "c" => "cherry");
|
||||
|
||||
$c = $a + $b; // Union of $a and $b
|
||||
echo "Union of \$a and \$b: \n";
|
||||
$c = $a + $b; // União de $a e $b
|
||||
echo "União de \$a e \$b: \n";
|
||||
var_dump($c);
|
||||
|
||||
$c = $b + $a; // Union of $b and $a
|
||||
echo "Union of \$b and \$a: \n";
|
||||
$c = $b + $a; // União de $b e $a
|
||||
echo "União de \$b e \$a: \n";
|
||||
var_dump($c);
|
||||
|
||||
$a += $b; // Union of $a += $b is $a and $b
|
||||
echo "Union of \$a += \$b: \n";
|
||||
$a += $b; // União de $a += $b é $a e $b
|
||||
echo "União de \$a += \$b: \n";
|
||||
var_dump($a);
|
||||
?>
|
||||
]]>
|
||||
@@ -79,7 +79,7 @@ var_dump($a);
|
||||
Quando executado, o script produz uma saída assim:
|
||||
<screen role="php">
|
||||
<![CDATA[
|
||||
Union of $a and $b:
|
||||
União de $a e $b:
|
||||
array(3) {
|
||||
["a"]=>
|
||||
string(5) "apple"
|
||||
@@ -88,7 +88,7 @@ array(3) {
|
||||
["c"]=>
|
||||
string(6) "cherry"
|
||||
}
|
||||
Union of $b and $a:
|
||||
União de $b e $a:
|
||||
array(3) {
|
||||
["a"]=>
|
||||
string(4) "pear"
|
||||
@@ -97,7 +97,7 @@ array(3) {
|
||||
["c"]=>
|
||||
string(6) "cherry"
|
||||
}
|
||||
Union of $a += $b:
|
||||
União de $a += $b:
|
||||
array(3) {
|
||||
["a"]=>
|
||||
string(5) "apple"
|
||||
|
||||
@@ -266,11 +266,11 @@ echo $a <=> $b; // 1
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Bool e null são sempre comparados como booleanos
|
||||
var_dump(1 == TRUE); // TRUE - same as (bool) 1 == TRUE
|
||||
var_dump(0 == FALSE); // TRUE - same as (bool) 0 == FALSE
|
||||
var_dump(100 < TRUE); // FALSE - same as (bool) 100 < TRUE
|
||||
var_dump(-10 < FALSE);// FALSE - same as (bool) -10 < FALSE
|
||||
var_dump(min(-100, -10, NULL, 10, 100)); // NULL - (bool) NULL < (bool) -100 is FALSE < TRUE
|
||||
var_dump(1 == TRUE); // TRUE - o mesmo que (bool) 1 == TRUE
|
||||
var_dump(0 == FALSE); // TRUE - o mesmo que (bool) 0 == FALSE
|
||||
var_dump(100 < TRUE); // FALSE - o mesmo que (bool) 100 < TRUE
|
||||
var_dump(-10 < FALSE);// FALSE - o mesmo que (bool) -10 < FALSE
|
||||
var_dump(min(-100, -10, NULL, 10, 100)); // NULL - (bool) NULL < (bool) -100 é FALSE < TRUE
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -283,7 +283,7 @@ var_dump(min(-100, -10, NULL, 10, 100)); // NULL - (bool) NULL < (bool) -100 is
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Arrays são comparados assim quando utilizando-se os operadores padrão e operador spaceship
|
||||
// Arrays são comparados assim quando utilizando-se os operadores padrão e operador nave-espacial
|
||||
function standard_array_compare($op1, $op2)
|
||||
{
|
||||
if (count($op1) < count($op2)) {
|
||||
@@ -364,7 +364,7 @@ function standard_array_compare($op1, $op2)
|
||||
// Example usage for: Ternary Operator
|
||||
$action = (empty($_POST['action'])) ? 'default' : $_POST['action'];
|
||||
|
||||
// The above is identical to this if/else statement
|
||||
// O código acima é idêntico a esta instrução if/else
|
||||
if (empty($_POST['action'])) {
|
||||
$action = 'default';
|
||||
} else {
|
||||
@@ -503,7 +503,7 @@ if (isset($_POST['action'])) {
|
||||
// Emite um aviso que $name não está definido.
|
||||
print 'Mr. ' . $name ?? 'Anonymous';
|
||||
|
||||
// Imprime "Mr. Anonymous"
|
||||
// Exibe "Mr. Anonymous"
|
||||
print 'Mr. ' . ($name ?? 'Anonymous');
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -420,8 +420,8 @@ $arr[] = <replaceable>valor</replaceable>;
|
||||
// <replaceable>valor</replaceable> pode ser qualquer valor de qualquer tipo</synopsis>
|
||||
|
||||
<para>
|
||||
Se <varname>$arr</varname> não existir ou estiver preenchido com or is set to &null; or &false;, será criado, servindo como
|
||||
alternativa para criação de um <type>array</type>. Entretanto, essa prática é
|
||||
Se <varname>$arr</varname> ainda não existir ou estiver definido como &null; ou &false;, ele será criado, por isso também
|
||||
é uma alternativa para criação de um <type>array</type>. Entretanto, essa prática é
|
||||
desencorajada por que se <varname>$arr</varname> conter
|
||||
algum valor (por exemplo, uma <type>string</type> de uma variável de requisição), então este
|
||||
valor permanecerá e o <literal>[]</literal> funcionará como
|
||||
|
||||
@@ -1057,19 +1057,19 @@ echo "C:\\folder\\{$fantastico}.txt";
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Get the first character of a string
|
||||
$str = 'This is a test.';
|
||||
// Obtém o primeiro caractere de uma string
|
||||
$str = 'Isto é um teste.';
|
||||
$first = $str[0];
|
||||
|
||||
// Get the third character of a string
|
||||
// Obtém o terceiro caractere de uma string
|
||||
$third = $str[2];
|
||||
|
||||
// Get the last character of a string.
|
||||
$str = 'This is still a test.';
|
||||
// Obtém o último caractere de uma string
|
||||
$str = 'Isto ainda é um teste.';
|
||||
$last = $str[strlen($str)-1];
|
||||
|
||||
// Modify the last character of a string
|
||||
$str = 'Look at the sea';
|
||||
// Modifica o último caractere de uma string
|
||||
$str = 'Olhe para a onda';
|
||||
$str[strlen($str)-1] = 'e';
|
||||
|
||||
?>
|
||||
|
||||
@@ -16,22 +16,22 @@
|
||||
$filename = "/tmp/testfile.bz2";
|
||||
$str = "This is a test string.\n";
|
||||
|
||||
// open file for writing
|
||||
// abre o arquivo para escrita
|
||||
$bz = bzopen($filename, "w");
|
||||
|
||||
// write string to file
|
||||
// escreve string no arquivo
|
||||
bzwrite($bz, $str);
|
||||
|
||||
// close file
|
||||
// fecha o arquivo
|
||||
bzclose($bz);
|
||||
|
||||
// open file for reading
|
||||
// abre o arquivo para leitura
|
||||
$bz = bzopen($filename, "r");
|
||||
|
||||
// read 10 characters
|
||||
// lê 10 caracteres
|
||||
echo bzread($bz, 10);
|
||||
|
||||
// output until end of the file (or the next 1024 char) and close it.
|
||||
// exibe até o final do arquivo (ou os próximos 1024 caracteres) e o fecha.
|
||||
echo bzread($bz);
|
||||
|
||||
bzclose($bz);
|
||||
|
||||
@@ -4,7 +4,7 @@
|
||||
<refentry xml:id="function.cubrid-save-to-glo" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>cubrid_save_to_glo</refname>
|
||||
<refpurpose>Save requested file in a GLO instance</refpurpose>
|
||||
<refpurpose>Grava o arquivo solicitado em uma instância GLO</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
@@ -16,7 +16,7 @@
|
||||
<methodparam><type>string</type><parameter>file_name</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The <function>cubrid_save_to_glo</function> function is used to save requested file in a glo instance.
|
||||
A funçaõ <function>cubrid_save_to_glo</function> é usada para salvar o arquivo solicitado em uma instância GLO.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -34,7 +34,7 @@
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>file_name</parameter></term>
|
||||
<listitem><para>The name of the file that you want to save.</para></listitem>
|
||||
<listitem><para>O nome do arquivo a ser gravado.</para></listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
@@ -53,7 +53,7 @@
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title><function>cubrid_save_to_glo</function> example</title>
|
||||
<title>Exemplo de <function>cubrid_save_to_glo</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Each set of intervals is equal.
|
||||
// Cada conjunto de intervalos é igual.
|
||||
$i = new DateInterval('P1D');
|
||||
$i = DateInterval::createFromDateString('1 day');
|
||||
|
||||
|
||||
@@ -178,8 +178,8 @@ $nextyear = mktime (0, 0, 0, date("m"), date("d"), date("Y")+1);
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Assuming today is March 10th, 2001, 5:16:18 pm, and that we are in the
|
||||
// Mountain Standard Time (MST) Time Zone
|
||||
// Assumindo que hoje é dia 10 de março de 2001, 17:16:18, e que estamos no
|
||||
// fuso horário Mountain Standard Time (MST)
|
||||
|
||||
$today = date("F j, Y, g:i a"); // March 10, 2001, 5:16 pm
|
||||
$today = date("m.d.y"); // 03.10.01
|
||||
@@ -188,9 +188,9 @@ $today = date("Ymd"); // 20010310
|
||||
$today = date('h-i-s, j-m-y, it is w Day'); // 05-16-18, 10-03-01, 1631 1618 6 Satpm01
|
||||
$today = date('\i\t \i\s \t\h\e jS \d\a\y.'); // it is the 10th day.
|
||||
$today = date("D M j G:i:s T Y"); // Sat Mar 10 17:16:18 MST 2001
|
||||
$today = date('H:m:s \m \i\s\ \m\o\n\t\h'); // 17:03:18 m is month
|
||||
$today = date('H:m:s \m \i\s\ \m\o\n\t\h'); // 17:03:18 m é o mês
|
||||
$today = date("H:i:s"); // 17:16:18
|
||||
$today = date("Y-m-d H:i:s"); // 2001-03-10 17:16:18 (the MySQL DATETIME format)
|
||||
$today = date("Y-m-d H:i:s"); // 2001-03-10 17:16:18 (o formato DATETIME do MySQL)
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -151,7 +151,7 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Prints: July 1, 2000 is on a Saturday
|
||||
// Exibe: July 1, 2000 is on a Saturday
|
||||
echo "July 1, 2000 is on a " . date("l", gmmktime(0, 0, 0, 7, 1, 2000));
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -388,7 +388,7 @@
|
||||
(<type>int</type>)
|
||||
</entry>
|
||||
<entry>13</entry>
|
||||
<entry>If an attempt is made to modify the type of the underlying object.</entry>
|
||||
<entry>Se ocorrer a tentativa de modificar o tipo do objeto subjacente.</entry>
|
||||
</row>
|
||||
<row xml:id="constant.dom-namespace-err">
|
||||
<entry>
|
||||
@@ -397,7 +397,7 @@
|
||||
</entry>
|
||||
<entry>14</entry>
|
||||
<entry>
|
||||
Se uma tentativa de criar ou modificar um objeto incorretamente considerando
|
||||
Se ocorrer a tentativa de criar ou modificar um objeto incorretamente considerando
|
||||
namespaces.
|
||||
</entry>
|
||||
</row>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Dump XML para o exemplo abaixo
|
||||
// Despeja o XML para o exemplo abaixo
|
||||
$xml = <<<XML
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<root>
|
||||
@@ -46,13 +46,13 @@ $xml = <<<XML
|
||||
</root>
|
||||
XML;
|
||||
|
||||
// Crie uma nova instância de DOMDocument
|
||||
// Cria uma nova instância de DOMDocument
|
||||
$dom = new DOMDocument;
|
||||
|
||||
// Load the XML
|
||||
$dom->loadXML($xml);
|
||||
|
||||
// Imprima a linha onde o elemento 'node' foi definido
|
||||
// Imprime a linha onde o elemento 'node' foi definido
|
||||
printf('The <node> tag is defined on line %d', $dom->getElementsByTagName('node')->item(0)->getLineNo());
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -51,10 +51,10 @@
|
||||
<?php
|
||||
$vector = new \Ds\Vector(["a", "b", "c", "d"]);
|
||||
|
||||
$vector->rotate(1); // "a" is shifted, then pushed.
|
||||
$vector->rotate(1); // "a" é deslocado e incluído no final.
|
||||
print_r($vector);
|
||||
|
||||
$vector->rotate(2); // "b" and "c" are both shifted, the pushed.
|
||||
$vector->rotate(2); // "b" e "c" são ambos deslocados e incluídos no final.
|
||||
print_r($vector);
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -10,9 +10,9 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Wait until STDIN is readable
|
||||
// Espera até que STDIN esteja disponível para leitura
|
||||
$w = new EvIo(STDIN, Ev::READ, function ($watcher, $revents) {
|
||||
echo "STDIN is readable\n";
|
||||
echo "STDIN pode ser lida\n";
|
||||
});
|
||||
Ev::run(Ev::RUN_ONCE);
|
||||
?>
|
||||
|
||||
@@ -50,7 +50,6 @@
|
||||
<para>
|
||||
Retorna a posição do bit encontrado, como um <type>int</type>. A
|
||||
primeira posição é 0. Se nenhum bit 1 for encontrado, retorna -1.
|
||||
If no set bit is found, -1 is returned.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -214,7 +214,7 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Esta é nossa função para manipularThis is our function to handle
|
||||
// Esta é nossa função para manipular
|
||||
// falhas de asserção
|
||||
function assert_failure($file, $line, $assertion, $message)
|
||||
{
|
||||
|
||||
@@ -111,7 +111,7 @@
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Exemplo de carregar umas extensção com base no sistema operacional
|
||||
// Exemplo de carregamento de uma extensão com base no sistema operacional
|
||||
if (!extension_loaded('sqlite')) {
|
||||
if (strtoupper(substr(PHP_OS, 0, 3)) === 'WIN') {
|
||||
dl('php_sqlite.dll');
|
||||
@@ -120,7 +120,7 @@ if (!extension_loaded('sqlite')) {
|
||||
}
|
||||
}
|
||||
|
||||
// Or, the PHP_SHLIB_SUFFIX constant is available as of PHP 4.3.0
|
||||
// Ou, a constante PHP_SHLIB_SUFFIX está disponível desde o PHP 4.3.0
|
||||
if (!extension_loaded('sqlite')) {
|
||||
$prefix = (PHP_SHLIB_SUFFIX === 'dll') ? 'php_' : '';
|
||||
dl($prefix . 'sqlite.' . PHP_SHLIB_SUFFIX);
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<refentry xml:id="intlcalendar.getnow" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>IntlCalendar::getNow</refname>
|
||||
<refpurpose>Get number representing the current time</refpurpose>
|
||||
<refpurpose>Obtém um número representando o horário atual</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
@@ -23,8 +23,8 @@
|
||||
<void/>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
The number of milliseconds that have passed since the reference date. This
|
||||
number is derived from the system time.
|
||||
O número de milissegundos que se passaram desde a data de referência. Este
|
||||
número é derivado do horário do sistema.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
@@ -37,8 +37,8 @@
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
A <type>float</type> representing a number of milliseconds since the epoch,
|
||||
not counting leap seconds.
|
||||
Um <type>float</type> representando um número de milissegundos desde a época,
|
||||
sem contar os segundos intercalares.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title><function>IntlCalendar::getNow</function></title>
|
||||
<title>Exemplo de <function>IntlCalendar::getNow</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
@@ -3,7 +3,7 @@
|
||||
<refentry xml:id="intlcalendar.indaylighttime" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>IntlCalendar::inDaylightTime</refname>
|
||||
<refpurpose>Whether the objectʼs time is in Daylight Savings Time</refpurpose>
|
||||
<refpurpose>Informa se o horário do objeto está no horário de verão</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
@@ -23,8 +23,8 @@
|
||||
<methodparam><type>IntlCalendar</type><parameter>calendar</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Whether, for the instant represented by this object and for this objectʼs
|
||||
timezone, daylight saving time is in place.
|
||||
Informa se, para o instante representado por este objeto e para o fuso horário deste
|
||||
objeto, o horário de verão estaria em vigor.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
@@ -43,7 +43,7 @@
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Returns &true; if the date is in Daylight Savings Time, &false; otherwise.
|
||||
Retorna &true; se a data estiver no horário de verão, &false; caso contrário.
|
||||
</para>
|
||||
&intl.error.intl-calendar;
|
||||
</refsect1>
|
||||
@@ -61,18 +61,18 @@
|
||||
ini_set('date.timezone', 'Europe/Lisbon');
|
||||
ini_set('intl.default_locale', 'pt_PT');
|
||||
|
||||
$cal = new IntlGregorianCalendar(2013, 6 /* July */, 1, 4, 56, 31);
|
||||
$cal = new IntlGregorianCalendar(2013, 6 /* julho */, 1, 4, 56, 31);
|
||||
var_dump($cal->inDaylightTime()); // true
|
||||
$cal->set(IntlCalendar::FIELD_MONTH, 11 /* December */);
|
||||
$cal->set(IntlCalendar::FIELD_MONTH, 11 /* dezembro */);
|
||||
var_dump($cal->inDaylightTime()); // false
|
||||
|
||||
//DST end transition on 2013-10-27 at 0200 (wall time back 1 hour)
|
||||
// Horário de verão transiciona de volta no dia 2013-10-27 às 0200 (volta 1 hora)
|
||||
$cal = new IntlGregorianCalendar(2013, 9 /* October */, 27, 1, 30, 0);
|
||||
|
||||
var_dump($cal->inDaylightTime()); // false (default WALLTIME_LAST)
|
||||
var_dump($cal->inDaylightTime()); // false (padrãot WALLTIME_LAST)
|
||||
|
||||
$cal->setRepeatedWallTimeOption(IntlCalendar::WALLTIME_FIRST);
|
||||
$cal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 1); // force time recalculation
|
||||
$cal->set(IntlCalendar::FIELD_HOUR_OF_DAY, 1); // força recálculo do horário
|
||||
var_dump($cal->inDaylightTime()); // true
|
||||
|
||||
]]>
|
||||
|
||||
@@ -35,7 +35,7 @@
|
||||
<para>
|
||||
O novo valor para o mês, <constant>IntlGregorianCalendar::FIELD_MONTH</constant>.
|
||||
A sequência de meses é baseada em zero, isto é, janeiro é representado por 0,
|
||||
fevereiro por 1, …, dezembro é 11 e December is 11 and Undecember (se o calendário o
|
||||
fevereiro por 1, …, dezembro é 11 e e undecember (se o calendário o
|
||||
tiver) é 12.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
@@ -38,7 +38,7 @@
|
||||
<para>
|
||||
O novo valor para o mês, <constant>IntlGregorianCalendar::FIELD_MONTH</constant>.
|
||||
A sequência de meses é baseada em zero, isto é, janeiro é representado por 0,
|
||||
fevereiro por 1, …, dezembro é 11 e December is 11 and Undecember (se o calendário o
|
||||
fevereiro por 1, …, dezembro é 11 e undecember (se o calendário o
|
||||
tiver) é 12.
|
||||
</para>
|
||||
</listitem>
|
||||
|
||||
@@ -63,15 +63,15 @@
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
If <parameter>callbackfunc</parameter> is not &null; returns &true; on
|
||||
success.
|
||||
Se <parameter>callbackfunc</parameter> não for &null; retorna &true; em
|
||||
caso de sucesso.
|
||||
</para>
|
||||
<para>
|
||||
If <parameter>callbackfunc</parameter> is set to &null;, returns the
|
||||
extracted section as a string.
|
||||
Se <parameter>callbackfunc</parameter> estiver definido para &null;, returna a
|
||||
seção extraída como uma string.
|
||||
</para>
|
||||
<para>
|
||||
Returns &false; on error.
|
||||
Retorna &false; em caso de erro.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
|
||||
@@ -79,7 +79,7 @@ mailparse_stream_encode($fp, $dest, "quoted-printable");
|
||||
|
||||
rewind($dest);
|
||||
|
||||
// Exibir o conteúdo do novo arquivo
|
||||
// Exibe o conteúdo do novo arquivo
|
||||
fpassthru($dest);
|
||||
|
||||
?>
|
||||
|
||||
@@ -295,38 +295,38 @@
|
||||
<title>Exemplos de configuração do &php.ini;</title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
; Set default language
|
||||
mbstring.language = Neutral; Set default language to Neutral(UTF-8) (default)
|
||||
mbstring.language = English; Set default language to English
|
||||
mbstring.language = Japanese; Set default language to Japanese
|
||||
; Define idioma padrão
|
||||
mbstring.language = Neutral; Define o idioma padrão como neutro (UTF-8) (padrão)
|
||||
mbstring.language = English; Define o idioma padrão para inglês
|
||||
mbstring.language = Japanese; Define o idioma padrão para japonês
|
||||
|
||||
;; Set default internal encoding
|
||||
;; Note: Make sure to use character encoding works with PHP
|
||||
mbstring.internal_encoding = UTF-8 ; Set internal encoding to UTF-8
|
||||
;; Define a codificação interna padrão
|
||||
;; Nota: Certifique-se de usar a codificação de caracteres que funciona com PHP
|
||||
mbstring.internal_encoding = UTF-8 ; Define a codificação interna para UTF-8
|
||||
|
||||
;; HTTP input encoding translation is enabled.
|
||||
;; A tradução da codificação de entrada HTTP está habilitada.
|
||||
mbstring.encoding_translation = On
|
||||
|
||||
;; Set default HTTP input character encoding
|
||||
;; Note: Script cannot change http_input setting.
|
||||
mbstring.http_input = pass ; No conversion.
|
||||
mbstring.http_input = auto ; Set HTTP input to auto
|
||||
; "auto" is expanded according to mbstring.language
|
||||
mbstring.http_input = SJIS ; Set HTTP input to SJIS
|
||||
mbstring.http_input = UTF-8,SJIS,EUC-JP ; Specify order
|
||||
;; Define a codificação de caracteres de entrada HTTP padrão
|
||||
;; Nota: O script não pode alterar a configuração http_input.
|
||||
mbstring.http_input = pass ; Sem conversão.
|
||||
mbstring.http_input = auto ; Define a entrada HTTP como automática
|
||||
; "auto" é expandido de acordo com mbstring.language
|
||||
mbstring.http_input = SJIS ; Define a entrada HTTP para SJIS
|
||||
mbstring.http_input = UTF-8,SJIS,EUC-JP ; Especifica a ordenação
|
||||
|
||||
;; Set default HTTP output character encoding
|
||||
mbstring.http_output = pass ; No conversion
|
||||
mbstring.http_output = UTF-8 ; Set HTTP output encoding to UTF-8
|
||||
;; Define a codificação de caracteres de saída HTTP padrão
|
||||
mbstring.http_output = pass ; Sem conversão
|
||||
mbstring.http_output = UTF-8 ; Define a codificação de saída HTTP para UTF-8
|
||||
|
||||
;; Set default character encoding detection order
|
||||
mbstring.detect_order = auto ; Set detect order to auto
|
||||
mbstring.detect_order = ASCII,JIS,UTF-8,SJIS,EUC-JP ; Specify order
|
||||
;; Define a ordem de detecção de codificação de caracteres padrão
|
||||
mbstring.detect_order = auto ; Define a ordem de detecção como automática
|
||||
mbstring.detect_order = ASCII,JIS,UTF-8,SJIS,EUC-JP ; Especifica o pedido
|
||||
|
||||
;; Set default substitute character
|
||||
mbstring.substitute_character = 12307 ; Specify Unicode value
|
||||
mbstring.substitute_character = none ; Do not print character
|
||||
mbstring.substitute_character = long ; Long Example: U+3000,JIS+7E7E
|
||||
;; Define o caractere substituto padrão
|
||||
mbstring.substitute_character = 12307 ; Especifica o valor Unicode
|
||||
mbstring.substitute_character = none ; Não imprime caractere
|
||||
mbstring.substitute_character = long ; Exemplo longo: U+3000,JIS+7E7E
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
@@ -336,28 +336,28 @@ mbstring.substitute_character = long ; Long Example: U+3000,JIS+7E7E
|
||||
<title>&php.ini; configuração para usuários <literal>EUC-JP</literal></title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
;; Disable Output Buffering
|
||||
;; Desativa buffer de saída
|
||||
output_buffering = Off
|
||||
|
||||
;; Set HTTP header charset
|
||||
;; Define conjunto de caracteres do cabeçalho HTTP
|
||||
default_charset = EUC-JP
|
||||
|
||||
;; Set default language to Japanese
|
||||
;; Define o idioma padrão para japonês
|
||||
mbstring.language = Japanese
|
||||
|
||||
;; HTTP input encoding translation is enabled.
|
||||
;; A tradução da codificação de entrada HTTP está habilitada
|
||||
mbstring.encoding_translation = On
|
||||
|
||||
;; Set HTTP input encoding conversion to auto
|
||||
;; Define a conversão de codificação de entrada HTTP como automática
|
||||
mbstring.http_input = auto
|
||||
|
||||
;; Convert HTTP output to EUC-JP
|
||||
;; Converte saída HTTP para EUC-JP
|
||||
mbstring.http_output = EUC-JP
|
||||
|
||||
;; Set internal encoding to EUC-JP
|
||||
;; Define a codificação interna para EUC-JP
|
||||
mbstring.internal_encoding = EUC-JP
|
||||
|
||||
;; Do not print invalid characters
|
||||
;; Não imprime caracteres inválidos
|
||||
mbstring.substitute_character = none
|
||||
]]>
|
||||
</programlisting>
|
||||
@@ -368,28 +368,28 @@ mbstring.substitute_character = none
|
||||
<title>&php.ini; configuração para usuários <literal>SJIS</literal></title>
|
||||
<programlisting>
|
||||
<![CDATA[
|
||||
;; Enable Output Buffering
|
||||
;; Habilita buffer de saída
|
||||
output_buffering = On
|
||||
|
||||
;; Set mb_output_handler to enable output conversion
|
||||
;; Define mb_output_handler para ativar a conversão de saída
|
||||
output_handler = mb_output_handler
|
||||
|
||||
;; Set HTTP header charset
|
||||
;; Define o conjunto de caracteres do cabeçalho HTTP
|
||||
default_charset = Shift_JIS
|
||||
|
||||
;; Set default language to Japanese
|
||||
;; Define o idioma padrão para japonês
|
||||
mbstring.language = Japanese
|
||||
|
||||
;; Set http input encoding conversion to auto
|
||||
;; Define a conversão de codificação de entrada http como automática
|
||||
mbstring.http_input = auto
|
||||
|
||||
;; Convert to SJIS
|
||||
;; Converte para SJIS
|
||||
mbstring.http_output = SJIS
|
||||
|
||||
;; Set internal encoding to EUC-JP
|
||||
;; Define a codificação interna para EUC-JP
|
||||
mbstring.internal_encoding = EUC-JP
|
||||
|
||||
;; Do not print invalid characters
|
||||
;; Não imprime caracteres inválidos
|
||||
mbstring.substitute_character = none
|
||||
]]>
|
||||
</programlisting>
|
||||
|
||||
@@ -89,7 +89,7 @@
|
||||
<row>
|
||||
<entry>8.0.0</entry>
|
||||
<entry>
|
||||
<parameter>key</parameter> is now nullable.
|
||||
<parameter>key</parameter> agora pode ser nulo.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
||||
@@ -73,9 +73,9 @@
|
||||
<row>
|
||||
<entry>8.0.0</entry>
|
||||
<entry>
|
||||
If the constant is not defined, <function>constant</function> now throws an
|
||||
<classname>Error</classname> exception; previously an <constant>E_WARNING</constant>
|
||||
was generated, and &null; was returned.
|
||||
Se a constante não estiver definida, <function>constant</function> agora lança uma
|
||||
exceção <classname>Error</classname>; anteriormente um <constant>E_WARNING</constant>
|
||||
era gerado e &null; era retornado.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
||||
@@ -156,7 +156,7 @@
|
||||
<para>
|
||||
Identificador único universal (preterido em favor de
|
||||
<constant>MongoDB\BSON\Binary::TYPE_UUID</constant>). Ao usar este
|
||||
tipo, is dados binários precisam ter 16 bytes de comprimento.
|
||||
tipo, os dados binários precisam ter 16 bytes de comprimento.
|
||||
</para>
|
||||
<para>
|
||||
Historicamente, outros drivers codificaram valores com este tipo com base em suas
|
||||
|
||||
@@ -77,25 +77,25 @@
|
||||
<?php
|
||||
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
|
||||
if (!$link) {
|
||||
die('Could not connect: ' . mysql_error());
|
||||
die('Não foi possível conectar: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db('mydb');
|
||||
|
||||
/* this should return the correct numbers of deleted records */
|
||||
/* isso deve retornar os números corretos de registros excluídos */
|
||||
mysql_query('DELETE FROM mytable WHERE id < 10');
|
||||
printf("Records deleted: %d\n", mysql_affected_rows());
|
||||
printf("Registro excluídos: %d\n", mysql_affected_rows());
|
||||
|
||||
/* with a where clause that is never true, it should return 0 */
|
||||
/* com uma cláusula where que nunca é verdadeira, ela deve retornar 0 */
|
||||
mysql_query('DELETE FROM mytable WHERE 0');
|
||||
printf("Records deleted: %d\n", mysql_affected_rows());
|
||||
printf("Registro excluídos: %d\n", mysql_affected_rows());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Records deleted: 10
|
||||
Records deleted: 0
|
||||
Registro excluídos: 10
|
||||
Registro excluídos: 0
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
@@ -108,13 +108,13 @@ Records deleted: 0
|
||||
<?php
|
||||
$link = mysql_connect('localhost', 'mysql_user', 'mysql_password');
|
||||
if (!$link) {
|
||||
die('Could not connect: ' . mysql_error());
|
||||
die('Não foi possível conectar: ' . mysql_error());
|
||||
}
|
||||
mysql_select_db('mydb');
|
||||
|
||||
/* Update records */
|
||||
/* Atualiza registros */
|
||||
mysql_query("UPDATE mytable SET used=1 WHERE id < 10");
|
||||
printf ("Updated records: %d\n", mysql_affected_rows());
|
||||
printf ("Registros atualizados: %d\n", mysql_affected_rows());
|
||||
mysql_query("COMMIT");
|
||||
?>
|
||||
]]>
|
||||
@@ -122,7 +122,7 @@ mysql_query("COMMIT");
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Updated Records: 10
|
||||
Registros atualizados: 10
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
|
||||
@@ -65,21 +65,21 @@ set_time_limit(0);
|
||||
$conn = mysql_connect('localhost', 'mysqluser', 'mypass');
|
||||
$db = mysql_select_db('mydb');
|
||||
|
||||
/* Assuming this query will take a long time */
|
||||
/* Supondo que esta consulta levará muito tempo */
|
||||
$result = mysql_query($sql);
|
||||
if (!$result) {
|
||||
echo 'Query #1 failed, exiting.';
|
||||
exit;
|
||||
}
|
||||
|
||||
/* Make sure the connection is still alive, if not, try to reconnect */
|
||||
/* Certifique-se de que a conexão ainda esteja ativa; caso contrário, tente reconectar */
|
||||
if (!mysql_ping($conn)) {
|
||||
echo 'Lost connection, exiting after query #1';
|
||||
exit;
|
||||
}
|
||||
mysql_free_result($result);
|
||||
|
||||
/* So the connection is still alive, let's run another query */
|
||||
/* Então a conexão ainda está ativa, vamos executar outra consulta */
|
||||
$result2 = mysql_query($sql2);
|
||||
?>
|
||||
]]>
|
||||
|
||||
@@ -88,7 +88,7 @@
|
||||
</para>
|
||||
|
||||
<para>
|
||||
<emphasis role="bold">What is an Extension?</emphasis>
|
||||
<emphasis role="bold">O que é uma Extensão?</emphasis>
|
||||
</para>
|
||||
|
||||
<para>
|
||||
|
||||
@@ -199,8 +199,8 @@ fclose($stream);
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
/* In this example, there's a volume named multi_broken.part1.rar
|
||||
* whose next volume is named multi.part2.rar */
|
||||
/* Neste exemplo, há um volume chamado multi_broken.part1.rar
|
||||
* cujo próximo volume é denominado multi.part2.rar */
|
||||
function resolve($vol) {
|
||||
if (preg_match('/_broken/', $vol))
|
||||
return str_replace('_broken', '', $vol);
|
||||
|
||||
@@ -351,8 +351,8 @@
|
||||
<varlistentry xml:id="rarentry.constants.attribute-win-hidden">
|
||||
<term><constant>RarEntry::ATTRIBUTE_WIN_HIDDEN</constant></term>
|
||||
<listitem>
|
||||
<para>Bit that represents a Windows entry with a hidden attribute. To be used with
|
||||
<methodname>RarEntry::getAttr</methodname> on entries whose host OS is Microsoft Windows.</para>
|
||||
<para>Bit que representa uma entrada do Windows com um atributo oculto. Para ser usado com
|
||||
<methodname>RarEntry::getAttr</methodname> em entradas cujo sistema operacional host é o Microsoft Windows.</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
|
||||
@@ -143,7 +143,7 @@ Pragma: no-cache
|
||||
<row>
|
||||
<entry>8.0.0</entry>
|
||||
<entry>
|
||||
<parameter>value</parameter> is nullable now.
|
||||
<parameter>value</parameter> agora pode ser nulo.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
||||
@@ -65,7 +65,7 @@
|
||||
<row>
|
||||
<entry>8.0.0</entry>
|
||||
<entry>
|
||||
<parameter>path</parameter> is nullable now.
|
||||
<parameter>path</parameter> agora pode ser nulo.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
|
||||
@@ -209,9 +209,9 @@
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
This constant is only available on platforms that
|
||||
support the <constant>SO_REUSEPORT</constant> socket option: this
|
||||
includes Linux, macOS and *BSD, but does not include Windows.
|
||||
Esta constante está disponível apenas em plataformas que
|
||||
suportam a opção de soquete <constant>SO_REUSEPORT</constant>: isso inclui
|
||||
Linux, macOS e *BSD, mas não inclui Windows.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
@@ -15,7 +15,7 @@
|
||||
<methodparam><type>string</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Sets the query parameter to the specified value. This is used for parameters that can only be specified once. Subsequent calls with the same parameter name will override the existing value.
|
||||
Define o parâmetro de consulta para o valor especificado. Isso é usado para parâmetros que só podem ser especificados uma vez. As chamadas subsequentes com o mesmo nome de parâmetro substituirão o valor existente.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
@@ -10,7 +10,7 @@
|
||||
<para>
|
||||
Este módulo usa as funções da <link xlink:href="&url.zlib;">zlib</link>
|
||||
por Jean-loup Gailly e Mark Adler.
|
||||
A partir do PHP 8.4.0, a mínima versão da zlib requerida é is 1.2.11.
|
||||
A partir do PHP 8.4.0, a mínima versão da zlib requerida é 1.2.11.
|
||||
Antes do PHP 8.4.0, a mínima versão da zlib requerida era 1.2.0.4.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
Reference in New Issue
Block a user