mirror of
https://github.com/php/doc-pt_br.git
synced 2026-03-23 22:52:12 +01:00
initial translation of reference/uopz
This commit is contained in:
69
reference/uopz/book.xml
Normal file
69
reference/uopz/book.xml
Normal file
@@ -0,0 +1,69 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<book xml:id="book.uopz" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<?phpdoc extension-membership="pecl" ?>
|
||||
<title>Operações do usuário para Zend</title>
|
||||
<titleabbrev>uopz</titleabbrev>
|
||||
|
||||
<preface xml:id="intro.uopz">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
A extensão uopz - Operações do Usuário para Zend -
|
||||
expõe a funcionalidade do mecanismo Zend normalmente
|
||||
usada em tempo de compilação e execução para
|
||||
permitir a modificação das estruturas internas que representam o código PHP,
|
||||
e para que o código do usuário interaja com a Máquina Virtual.
|
||||
</para>
|
||||
<para>
|
||||
A uopz apoia as seguintes atividades:
|
||||
</para>
|
||||
<simplelist>
|
||||
<member>Sobrecarga de alguns opcodes, incluindo ZEND_EXIT e ZEND_NEW</member>
|
||||
<member>Funções e métodos de backup e restauração</member>
|
||||
<member>Renomeação de funções e métodos</member>
|
||||
<member>Cópia de funções e métodos</member>
|
||||
<member>Exclusão de funções e métodos</member>
|
||||
<member>Redefinição de constantes globais e de classe</member>
|
||||
<member>Exclusão de constantes globais e de classe</member>
|
||||
<member>Composição e modificação de classes em tempo de execução</member>
|
||||
</simplelist>
|
||||
<note>
|
||||
<para>
|
||||
Todas as atividades suportadas são compatíveis com opcache.
|
||||
</para>
|
||||
</note>
|
||||
<caution>
|
||||
<simpara>
|
||||
PECL uopz 6.1.1 não é compatível com Xdebug >= 2.9.4.
|
||||
Versões posteriores do uopz não são compatíveis com Xdebug < 2.9.4.
|
||||
</simpara>
|
||||
</caution>
|
||||
</preface>
|
||||
|
||||
&reference.uopz.setup;
|
||||
&reference.uopz.constants;
|
||||
&reference.uopz.reference;
|
||||
|
||||
</book>
|
||||
|
||||
<!-- 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
|
||||
-->
|
||||
37
reference/uopz/configure.xml
Normal file
37
reference/uopz/configure.xml
Normal file
@@ -0,0 +1,37 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: ec5fc8c5b78a28498a61be914cf970e09552d466 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<section xml:id="uopz.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
&reftitle.install;
|
||||
|
||||
<para>
|
||||
Use <option role="configure">--enable-uopz[=DIR]</option> ao compilar o PHP.
|
||||
</para>
|
||||
|
||||
<para>
|
||||
Usuários do Windows devem incluir <filename>php_uopz.dll</filename> no &php.ini;.
|
||||
</para>
|
||||
|
||||
</section>
|
||||
|
||||
|
||||
<!-- 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
|
||||
-->
|
||||
319
reference/uopz/constants.xml
Normal file
319
reference/uopz/constants.xml
Normal file
@@ -0,0 +1,319 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<appendix xml:id="uopz.constants" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
&reftitle.constants;
|
||||
&extension.constants;
|
||||
<para>
|
||||
Os seguintes opcodes são definidos como constantes pelo uopz antes da versão 5.0.0:
|
||||
</para>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry xml:id="constant.zend-exit">
|
||||
<term>
|
||||
<constant>ZEND_EXIT</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invocado por exit() e die(), não recebe argumentos.
|
||||
Retorna o booleano &true; para sair, &false; para continuar.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-new">
|
||||
<term>
|
||||
<constant>ZEND_NEW</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invocado pela construção do objeto,
|
||||
recebe a classe do objeto que está sendo criado como único argumento.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-throw">
|
||||
<term>
|
||||
<constant>ZEND_THROW</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invocado pela construção throw,
|
||||
recebe a classe da exceção lançada como único argumento.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-fetch-class">
|
||||
<term>
|
||||
<constant>ZEND_FETCH_CLASS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invocado após a composição,
|
||||
recebe o nome da classe que está sendo buscada como único argumento.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-add-trait">
|
||||
<term>
|
||||
<constant>ZEND_ADD_TRAIT</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invocado após a composição,
|
||||
recebe a classe à qual o Trait está sendo adicionada como o primeiro argumento,
|
||||
e o nome do Trait como o segundo argumento.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-add-interface">
|
||||
<term>
|
||||
<constant>ZEND_ADD_INTERFACE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invocado após a composição,
|
||||
recebe a classe à qual a interface está sendo adicionada como o primeiro argumento,
|
||||
e o nome da interface como o segundo argumento
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-instanceof">
|
||||
<term>
|
||||
<constant>ZEND_INSTANCEOF</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Invocado pelo operador instanceof,
|
||||
recebe o objeto a ser verificado como o primeiro argumento,
|
||||
e o nome da classe à qual esse objeto deve pertencer como o segundo argumento.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
As seguintes constantes controlam o comportamento da máquina virtual após a invocação de um manipulador de usuário.
|
||||
Tenha muito cuidado!
|
||||
Essas constantes foram removidas a partir do uopz 5.0.0.
|
||||
</para>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry xml:id="constant.zend-user-opcode-continue">
|
||||
<term>
|
||||
<constant>ZEND_USER_OPCODE_CONTINUE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Avança 1 opcode e continua.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-user-opcode-enter">
|
||||
<term>
|
||||
<constant>ZEND_USER_OPCODE_ENTER</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Entra em novo op_array sem recursão.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-user-opcode-leave">
|
||||
<term>
|
||||
<constant>ZEND_USER_OPCODE_LEAVE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Retorna para chamar op_array dentro do mesmo executor.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-user-opcode-dispatch">
|
||||
<term>
|
||||
<constant>ZEND_USER_OPCODE_DISPATCH</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Envia para o manipulador de opcode original.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-user-opcode-dispatch-to">
|
||||
<term>
|
||||
<constant>ZEND_USER_OPCODE_DISPATCH_TO</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Envia para um manipulador específico (operação OR com constante de opcode ZEND).
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-user-opcode-return">
|
||||
<term>
|
||||
<constant>ZEND_USER_OPCODE_RETURN</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Sai do executor (retorna da função).
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
<para>
|
||||
Os seguintes modificadores são registrados como constantes pelo uopz:
|
||||
</para>
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry xml:id="constant.zend-acc-public">
|
||||
<term>
|
||||
<constant>ZEND_ACC_PUBLIC</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as funções como públicas, o padrão.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-protected">
|
||||
<term>
|
||||
<constant>ZEND_ACC_PROTECTED</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as funções como protegidas.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-private">
|
||||
<term>
|
||||
<constant>ZEND_ACC_PRIVATE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as funções como privadas.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-static">
|
||||
<term>
|
||||
<constant>ZEND_ACC_STATIC</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as funções como estáticas.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-final">
|
||||
<term>
|
||||
<constant>ZEND_ACC_FINAL</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as funções como finais.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-abstract">
|
||||
<term>
|
||||
<constant>ZEND_ACC_ABSTRACT</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as funções como abstratas.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-class">
|
||||
<term>
|
||||
<constant>ZEND_ACC_CLASS</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Fictício registrado para consistência, o tipo padrão de entrada de classe.
|
||||
Removido a partir do uopz 5.0.0.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-interface">
|
||||
<term>
|
||||
<constant>ZEND_ACC_INTERFACE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as classes como interfaces.
|
||||
Removido a partir do uopz 5.0.0.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-trait">
|
||||
<term>
|
||||
<constant>ZEND_ACC_TRAIT</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Marca as classes como Traits.
|
||||
Removido a partir do uopz 5.0.0.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="constant.zend-acc-fetch">
|
||||
<term>
|
||||
<constant>ZEND_ACC_FETCH</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Usado somente para obtenção de sinalizadores.
|
||||
Removido a partir do uopz 5.0.0.
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</appendix>
|
||||
|
||||
<!-- 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
|
||||
-->
|
||||
143
reference/uopz/functions/uopz-add-function.xml
Normal file
143
reference/uopz/functions/uopz-add-function.xml
Normal file
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 3447c129e83d55ab8b0fd43fe673ce399ed314a4 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-add-function" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_add_function</refname>
|
||||
<refpurpose>Adiciona função ou método inexistente</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_add_function</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>Closure</type><parameter>handler</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">flags</parameter><initializer>ZEND_ACC_PUBLIC</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_add_function</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>Closure</type><parameter>handler</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">flags</parameter><initializer>ZEND_ACC_PUBLIC</initializer></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">all</parameter><initializer>&true;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Adiciona uma função ou um método inexistente.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função ou do método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>handler</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O <classname>Closure</classname> que define a nova função ou método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Sinalizadores a serem definidos para a nova função ou método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>all</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Informa se todas as classes que descendem de <parameter>class</parameter> também serão
|
||||
afetadas.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
<function>uopz_add_function</function> lança uma <classname>RuntimeException</classname>
|
||||
se a função ou método a ser adicionado já existir.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-add-function.example.basic">
|
||||
<title>Uso básico de <function>uopz_add_function</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_add_function('foo', function () {echo 'bar';});
|
||||
foo();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bar
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_del_function</function></member>
|
||||
<member><function>uopz_set_return</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
105
reference/uopz/functions/uopz-allow-exit.xml
Normal file
105
reference/uopz/functions/uopz-allow-exit.xml
Normal file
@@ -0,0 +1,105 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 961ac1b4419c41c51c599ac93cb9c9410827343f Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-allow-exit" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_allow_exit</refname>
|
||||
<refpurpose>Permite o controle sobre o código de operação de saída desabilitado</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description"><!-- {{{ -->
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>void</type><methodname>uopz_allow_exit</methodname>
|
||||
<methodparam><type>bool</type><parameter>allow</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Por padrão, o uopz desabilita o opcode de saída, então chamadas <function>exit</function>
|
||||
são praticamente ignoradas. <function>uopz_allow_exit</function>
|
||||
permite controlar esse comportamento.
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="parameters"><!-- {{{ -->
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>allow</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Informa se deve ou não ser permitida a execução de opcodes de saída.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="returnvalues"><!-- {{{ -->
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="examples"><!-- {{{ -->
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-allow-exit.example.basic"><!-- {{{ -->
|
||||
<title>Exemplo de <function>uopz_allow_exit</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
exit(1);
|
||||
echo 1;
|
||||
uopz_allow_exit(true);
|
||||
exit(2);
|
||||
echo 2;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
1
|
||||
]]>
|
||||
</screen>
|
||||
</example><!-- }}} -->
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="notes"><!-- {{{ -->
|
||||
&reftitle.notes;
|
||||
<caution>
|
||||
<para>
|
||||
<link linkend="book.opcache">OPcache</link> otimiza o código morto após a saída incondicional.
|
||||
</para>
|
||||
</caution>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="seealso"><!-- {{{ -->
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_get_exit_status</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
106
reference/uopz/functions/uopz-backup.xml
Normal file
106
reference/uopz/functions/uopz-backup.xml
Normal file
@@ -0,0 +1,106 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-backup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_backup</refname>
|
||||
<refpurpose>Faz backup de uma função</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_backup</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_backup</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Faz backup de uma função em tempo de execução, para ser restaurada no desligamento.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a função para backup
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_backup</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_backup("fgets");
|
||||
uopz_function("fgets", function(){
|
||||
return true;
|
||||
});
|
||||
var_dump(fgets());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
153
reference/uopz/functions/uopz-compose.xml
Normal file
153
reference/uopz/functions/uopz-compose.xml
Normal file
@@ -0,0 +1,153 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-compose" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_compose</refname>
|
||||
<refpurpose>Compõe uma classe</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_compose</methodname>
|
||||
<methodparam><type>string</type><parameter>name</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>classes</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>methods</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>array</type><parameter>properties</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Cria uma nova classe com o nome fornecido que implementa, estende ou usa todas as classes fornecidas.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Um nome de classe válido.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>classes</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Um array de nomes de classes, interfaces e traits.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>methods</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Um array associativa de métodos, os valores são Closures ou [modificadores => Closure].
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>properties</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Um array associativa de propriedades, chaves são nomes, valores são modificadores.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Tipo da entrada, por padrão ZEND_ACC_CLASS.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_compose</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class myClass {}
|
||||
trait myTrait {}
|
||||
interface myInterface {}
|
||||
|
||||
uopz_compose(
|
||||
Composed::class, [
|
||||
myClass::class,
|
||||
myTrait::class,
|
||||
myInterface::class
|
||||
], [
|
||||
"__construct" => function() {
|
||||
/* ... */
|
||||
}
|
||||
]);
|
||||
|
||||
var_dump(
|
||||
class_uses(Composed::class),
|
||||
class_parents(Composed::class),
|
||||
class_implements(Composed::class));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(1) {
|
||||
["myTrait"]=>
|
||||
string(7) "myTrait"
|
||||
}
|
||||
array(1) {
|
||||
["myClass"]=>
|
||||
string(7) "myClass"
|
||||
}
|
||||
array(1) {
|
||||
["myInterface"]=>
|
||||
string(11) "myInterface"
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
108
reference/uopz/functions/uopz-copy.xml
Normal file
108
reference/uopz/functions/uopz-copy.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-copy" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_copy</refname>
|
||||
<refpurpose>Copia uma função</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>Closure</type><methodname>uopz_copy</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>Closure</type><methodname>uopz_copy</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Copia uma função por nome.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a função a ser copiada.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Um Closure para a função especificada.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_copy</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$strtotime = uopz_copy('strtotime');
|
||||
|
||||
uopz_function("strtotime", function($arg1, $arg2) use($strtotime) {
|
||||
/* pode chamar o strtotime original daqui */
|
||||
var_dump($arg1);
|
||||
});
|
||||
|
||||
var_dump(strtotime('dummy'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
string(5) "dummy"
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
126
reference/uopz/functions/uopz-del-function.xml
Normal file
126
reference/uopz/functions/uopz-del-function.xml
Normal file
@@ -0,0 +1,126 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 3447c129e83d55ab8b0fd43fe673ce399ed314a4 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-del-function" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_del_function</refname>
|
||||
<refpurpose>Exclui função ou método adicionado anteriormente</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_del_function</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_del_function</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter role="reference">all</parameter><initializer>&true;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Exclui função ou método adicionado anteriormente.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função ou do método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>all</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Informa se todas as classes que descendem de <parameter>class</parameter> também serão
|
||||
afetadas.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
<function>uopz_del_function</function> lança uma <classname>RuntimeException</classname>
|
||||
se a função ou método a ser excluído não tiver sido adicionado por <function>uopz_add_function</function>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-del-function.example.basic">
|
||||
<title>Uso básico de <function>uopz_del_function</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_add_function('foo', function () {echo 'bar';});
|
||||
var_dump(function_exists('foo'));
|
||||
uopz_del_function('foo');
|
||||
var_dump(function_exists('foo'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(true)
|
||||
bool(false)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_add_function</function></member>
|
||||
<member><function>uopz_unset_return</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
124
reference/uopz/functions/uopz-delete.xml
Normal file
124
reference/uopz/functions/uopz-delete.xml
Normal file
@@ -0,0 +1,124 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-delete" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_delete</refname>
|
||||
<refpurpose>Exclui uma função</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_delete</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_delete</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Exclui uma função ou um método.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_delete</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_delete("strlen");
|
||||
|
||||
echo strlen("Hello World");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
PHP Fatal error: Call to undefined function strlen() in /path/to/script.php on line 4
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_delete</function> com uma classe</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My {
|
||||
public static function strlen($arg) {
|
||||
return strlen($arg);
|
||||
}
|
||||
}
|
||||
|
||||
uopz_delete(My::class, "strlen");
|
||||
|
||||
echo My::strlen("Hello World");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
PHP Fatal error: Call to undefined method My::strlen() in /path/to/script.php on line 10
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
110
reference/uopz/functions/uopz-extend.xml
Normal file
110
reference/uopz/functions/uopz-extend.xml
Normal file
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-extend" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_extend</refname>
|
||||
<refpurpose>Estende uma classe em tempo de execução</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_extend</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>parent</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Faz a classe em <parameter>class</parameter> estender a classe pai em <parameter>parent</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe a ser estendida.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>parent</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe a herdar.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<simpara>
|
||||
A partir do PHP 7.4.0, <function>uopz_extends</function> lança uma <classname>RuntimeException</classname>,
|
||||
se <link linkend="book.opcache">OPcache</link> estiver habilitado,
|
||||
e a entrada de classe de <parameter>class</parameter>
|
||||
ou <parameter>parent</parameter> (se for uma trait) for imutável.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_extend</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class A {}
|
||||
class B {}
|
||||
|
||||
uopz_extend(A::class, B::class);
|
||||
|
||||
var_dump(class_parents(A::class));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(1) {
|
||||
["B"]=>
|
||||
string(1) "B"
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
185
reference/uopz/functions/uopz-flags.xml
Normal file
185
reference/uopz/functions/uopz-flags.xml
Normal file
@@ -0,0 +1,185 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-flags" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_flags</refname>
|
||||
<refpurpose>Obtém ou define sinalizadores em função ou classe</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>uopz_flags</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>PHP_INT_MAX</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>int</type><methodname>uopz_flags</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter><initializer>PHP_INT_MAX</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Obtém ou define os sinalizadores em uma entrada de classe ou função em tempo de execução.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome de uma classe
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função. Se <parameter>class</parameter> for fornecido e uma string vazia
|
||||
for passada como <parameter>function</parameter>, <function>uopz_flags</function>
|
||||
obtém ou define os sinalizadores da entrada da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Um conjunto válido de sinalizadores ZEND_ACC_.
|
||||
Se omitido, <function>uopz_flags</function> atua como obtentora.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Se os sinalizadores estiverem sendo definidos, retorna os anteriores, senão retorna os atuais.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<simpara>
|
||||
A partir do PHP 7.4.0, se o parâmetro <parameter>flags</parameter> for passado,
|
||||
<function>uopz_flags</function> lança uma <classname>RuntimeException</classname>,
|
||||
se <link linkend="book.opcache">OPcache</link> estiver habilitado,
|
||||
e a entrada de classe de <parameter>class</parameter>
|
||||
ou a entrada de função de <parameter>function</parameter> for imutável.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>PECL uopz 5.0.0</entry>
|
||||
<entry>
|
||||
O parâmetro <parameter>flags</parameter> agora é opcional. Anteriormente,
|
||||
<constant>ZEND_ACC_FETCH</constant> precisava ser passado para usar <function>uopz_flags</function>
|
||||
como obtentora.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_flags</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Test {
|
||||
public function method() {
|
||||
return __CLASS__;
|
||||
}
|
||||
}
|
||||
|
||||
$flags = uopz_flags("Test", "method");
|
||||
|
||||
var_dump((bool) (uopz_flags("Test", "method") & ZEND_ACC_PRIVATE));
|
||||
var_dump((bool) (uopz_flags("Test", "method") & ZEND_ACC_STATIC));
|
||||
|
||||
var_dump(uopz_flags("Test", "method", $flags|ZEND_ACC_STATIC|ZEND_ACC_PRIVATE));
|
||||
|
||||
var_dump((bool) (uopz_flags("Test", "method") & ZEND_ACC_PRIVATE));
|
||||
var_dump((bool) (uopz_flags("Test", "method") & ZEND_ACC_STATIC));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(false)
|
||||
bool(false)
|
||||
int(1234567890)
|
||||
bool(true)
|
||||
bool(true)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>"Desfinalizando" uma classe</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
final class MyClass
|
||||
{
|
||||
}
|
||||
|
||||
$flags = uopz_flags(MyClass::class, '');
|
||||
uopz_flags(MyClass::class, '', $flags & ~ZEND_ACC_FINAL);
|
||||
var_dump((new ReflectionClass(MyClass::class))->isFinal());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(false)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
147
reference/uopz/functions/uopz-function.xml
Normal file
147
reference/uopz/functions/uopz-function.xml
Normal file
@@ -0,0 +1,147 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-function" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_function</refname>
|
||||
<refpurpose>Cria uma função em tempo de execução</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_function</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>Closure</type><parameter>handler</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>modifiers</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_function</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>Closure</type><parameter>handler</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>modifiers</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Cria uma função em tempo de execução.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que irá receber a nova função.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>handler</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O Closure para a função.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>modifiers</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Os modificadores para a função, por padrão copiados ou ZEND_ACC_PUBLIC.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_function</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_function("my_strlen", function($arg) {
|
||||
return strlen($arg);
|
||||
});
|
||||
echo my_strlen("Hello World");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
11
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_function</function> com uma classe</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My {}
|
||||
|
||||
uopz_function(My::class, "strlen", function($arg) {
|
||||
return strlen($arg);
|
||||
}, ZEND_ACC_STATIC);
|
||||
|
||||
echo My::strlen("Hello World");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
11
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
92
reference/uopz/functions/uopz-get-exit-status.xml
Normal file
92
reference/uopz/functions/uopz-get-exit-status.xml
Normal file
@@ -0,0 +1,92 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 961ac1b4419c41c51c599ac93cb9c9410827343f Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-get-exit-status" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_get_exit_status</refname>
|
||||
<refpurpose>Recupera o último status de saída definido</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description"><!-- {{{ -->
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>mixed</type><methodname>uopz_get_exit_status</methodname>
|
||||
<void />
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Recupera o último status de saída definido, ou seja, o valor passado para
|
||||
<function>exit</function>.
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="parameters"><!-- {{{ -->
|
||||
&reftitle.parameters;
|
||||
&no.function.parameters;
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="returnvalues"><!-- {{{ -->
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Esta função retorna o último status de saída, ou &null; se <function>exit</function>
|
||||
não tiver sido chamada.
|
||||
</para>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="examples"><!-- {{{ -->
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-get-exit-status.example.basic"><!-- {{{ -->
|
||||
<title>Exemplo de <function>uopz_get_exit_status</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
exit(123);
|
||||
echo uopz_get_exit_status();?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
123
|
||||
]]>
|
||||
</screen>
|
||||
</example><!-- }}} -->
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="notes"><!-- {{{ -->
|
||||
&reftitle.notes;
|
||||
<caution>
|
||||
<para>
|
||||
<link linkend="book.opcache">OPcache</link> otimiza o código morto após a saída incondicional.
|
||||
</para>
|
||||
</caution>
|
||||
</refsect1><!-- }}} -->
|
||||
|
||||
<refsect1 role="seealso"><!-- {{{ -->
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_allow_exit</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
110
reference/uopz/functions/uopz-get-hook.xml
Normal file
110
reference/uopz/functions/uopz-get-hook.xml
Normal file
@@ -0,0 +1,110 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 4754397753fd79f1c846868b66a2448babab1c54 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-get-hook" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_get_hook</refname>
|
||||
<refpurpose>Obtém o gancho previamente definido na função ou método</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>Closure</type><methodname>uopz_get_hook</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>Closure</type><methodname>uopz_get_hook</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Obtém o gancho previamente definido na função ou método.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função ou do método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Retorna o gancho definido anteriormente em uma função ou método, ou &null; se nenhum gancho
|
||||
tiver sido definido.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-get-hook.example.basic">
|
||||
<title>Uso básico de <function>uopz_get_hook</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function foo() {
|
||||
echo 'foo';
|
||||
}
|
||||
uopz_set_hook('foo', function () {echo 'bar';});
|
||||
var_dump(uopz_get_hook('foo'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
object(Closure)#2 (0) {
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_set_hook</function></member>
|
||||
<member><function>uopz_unset_hook</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
104
reference/uopz/functions/uopz-get-mock.xml
Normal file
104
reference/uopz/functions/uopz-get-mock.xml
Normal file
@@ -0,0 +1,104 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-get-mock" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_get_mock</refname>
|
||||
<refpurpose>Obtém o mock atual para uma classe</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>uopz_get_mock</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Retorna o mock atual para <parameter>class</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
The name of the mocked class.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Uma string contendo o nome do mock, ou um objeto,
|
||||
ou &null; se nenhum mock tiver sido definido.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_get_mock</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class A {
|
||||
public static function who() {
|
||||
echo "A";
|
||||
}
|
||||
}
|
||||
|
||||
class mockA {
|
||||
public static function who() {
|
||||
echo "mockA";
|
||||
}
|
||||
}
|
||||
|
||||
uopz_set_mock(A::class, mockA::class);
|
||||
echo uopz_get_mock(A::class);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
mockA
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso"><!-- {{{ -->
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_set_mock</function></member>
|
||||
<member><function>uopz_unset_mock</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
122
reference/uopz/functions/uopz-get-property.xml
Normal file
122
reference/uopz/functions/uopz-get-property.xml
Normal file
@@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 18f9cbcbc404fa3161104e4f3969531f686457af Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-get-property" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_get_property</refname>
|
||||
<refpurpose>Obtém o valor da propriedade de classe ou instância</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>mixed</type><methodname>uopz_get_property</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>property</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>mixed</type><methodname>uopz_get_property</methodname>
|
||||
<methodparam><type>object</type><parameter>instance</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>property</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Obtém o valor de uma propriedade de classe estática, se <parameter>class</parameter>
|
||||
for fornecido, ou o valor de uma propriedade de instância, se <parameter>instance</parameter>
|
||||
for fornecido.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>instance</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A instância do objeto.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>property</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da propriedade.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Retorna o valor da propriedade de classe ou instância, ou &null; se a propriedade
|
||||
não estiver definida.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-get-property.example.basic">
|
||||
<title>Uso básico de <function>uopz_get_property</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Foo {
|
||||
private static $staticBar = 10;
|
||||
private $bar = 100;
|
||||
}
|
||||
$foo = new Foo;
|
||||
var_dump(uopz_get_property('Foo', 'staticBar'));
|
||||
var_dump(uopz_get_property($foo, 'bar'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(10)
|
||||
int(100)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_set_property</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
98
reference/uopz/functions/uopz-get-return.xml
Normal file
98
reference/uopz/functions/uopz-get-return.xml
Normal file
@@ -0,0 +1,98 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-get-return" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_get_return</refname>
|
||||
<refpurpose>Obtém um valor de retorno definido anteriormente para uma função</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>uopz_get_return</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>mixed</type><methodname>uopz_get_return</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Obtém o valor de retorno da <parameter>função</parameter> definida anteriormente por <methodname>uopz_set_return</methodname>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a função.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
O valor de retorno ou Closure definido anteriormente.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_get_return</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_set_return("strlen", 42);
|
||||
echo uopz_get_return("strlen");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
42
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
117
reference/uopz/functions/uopz-get-static.xml
Normal file
117
reference/uopz/functions/uopz-get-static.xml
Normal file
@@ -0,0 +1,117 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: b5e484908859c4d96e212fb4ec6f5af2526db288 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-get-static" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_get_static</refname>
|
||||
<refpurpose>Obtém as variáveis estáticas do escopo da função ou método</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>array</type><methodname>uopz_get_static</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>array</type><methodname>uopz_get_static</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Obtém as variáveis estáticas do escopo da função ou método.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função ou do método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Retorna um <type>array</type> associativo de nomes de variáveis mapeados para seus
|
||||
valores atuais em caso de sucesso, ou &null; se a função ou método não existir.
|
||||
</para>
|
||||
<para>
|
||||
A partir do PHP 8.3.0, os inicializadores estáticos são computados durante o tempo de compilação,
|
||||
ou, se isso não for possível, somente quando a função ou método é executado pela primeira
|
||||
vez, caso em que o valor da variável estática é relatado como &null;
|
||||
antes da primeira invocação.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-get-static.example.basic">
|
||||
<title>Uso básico de <function>uopz_get_static</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function foo() {
|
||||
static $bar = 'baz';
|
||||
}
|
||||
var_dump(uopz_get_static('foo'));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(1) {
|
||||
["bar"]=>
|
||||
string(3) "baz"
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><methodname>ReflectionFunctionAbstract::getStaticVariables</methodname></member>
|
||||
<member><function>uopz_set_static</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
112
reference/uopz/functions/uopz-implement.xml
Normal file
112
reference/uopz/functions/uopz-implement.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-implement" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_implement</refname>
|
||||
<refpurpose>Implementa uma interface em tempo de execução</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_implement</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>interface</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Faz com que <parameter>class</parameter> implemente <parameter>interface</parameter>.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>interface</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<simpara>
|
||||
A partir do PHP 7.4.0, <function>uopz_implements</function> lança uma <classname>RuntimeException</classname>,
|
||||
se <link linkend="book.opcache">OPcache</link> estiver habilitado,
|
||||
e a entrada de classe de <parameter>class</parameter> for imutável.
|
||||
</simpara>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_implement</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
interface myInterface {}
|
||||
|
||||
class myClass {}
|
||||
|
||||
uopz_implement(myClass::class, myInterface::class);
|
||||
|
||||
var_dump(class_implements(myClass::class));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
array(1) {
|
||||
["myInterface"]=>
|
||||
string(11) "myInterface"
|
||||
}
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
101
reference/uopz/functions/uopz-overload.xml
Normal file
101
reference/uopz/functions/uopz-overload.xml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-overload" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_overload</refname>
|
||||
<refpurpose>Sobrecarrega um opcode da máquina virtual</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_overload</methodname>
|
||||
<methodparam><type>int</type><parameter>opcode</parameter></methodparam>
|
||||
<methodparam><type>Callable</type><parameter>callable</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Sobrecarrega o <parameter>opcode</parameter> especificado com a função definida pelo usuário.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>opcode</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Um opcode válido, veja constantes para detalhes dos códigos suportados.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>callable</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_overload</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_overload(ZEND_EXIT, function(){});
|
||||
|
||||
exit();
|
||||
echo "Hello World";
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Hello World
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
111
reference/uopz/functions/uopz-redefine.xml
Normal file
111
reference/uopz/functions/uopz-redefine.xml
Normal file
@@ -0,0 +1,111 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-redefine" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_redefine</refname>
|
||||
<refpurpose>Redefine uma constante</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_redefine</methodname>
|
||||
<methodparam><type>string</type><parameter>constant</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_redefine</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>constant</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Redefine a <parameter>constante</parameter> informada para o valor em <parameter>valor</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a constante.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>constant</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da constante.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>value</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O novo valor para a constante deve ser um tipo válido para uma variável constante.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_redefine</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
define("MY", 100);
|
||||
|
||||
uopz_redefine("MY", 1000);
|
||||
|
||||
echo MY;
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
1000
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
142
reference/uopz/functions/uopz-rename.xml
Normal file
142
reference/uopz/functions/uopz-rename.xml
Normal file
@@ -0,0 +1,142 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-rename" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_rename</refname>
|
||||
<refpurpose>Renomeia uma função em tempo de execução</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_rename</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>rename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_rename</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>rename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Renomeia a função <parameter>function</parameter> para o nome <parameter>rename</parameter>.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Se ambas as funções existirem, isso efetivamente troca seus nomes.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a função.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome de uma função existente
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>rename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O novo nome da função
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_rename</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_rename("strlen", "original_strlen");
|
||||
|
||||
echo original_strlen("Hello World");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
11
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_rename</function> com uma classe</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My {
|
||||
public function strlen($arg) {
|
||||
return strlen($arg);
|
||||
}
|
||||
}
|
||||
|
||||
uopz_rename(My::class, "strlen", "original_strlen");
|
||||
|
||||
echo My::original_strlen("Hello World");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
11
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
108
reference/uopz/functions/uopz-restore.xml
Normal file
108
reference/uopz/functions/uopz-restore.xml
Normal file
@@ -0,0 +1,108 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-restore" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_restore</refname>
|
||||
<refpurpose>Restaura uma função a partir de um backup</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsynopsisdiv>
|
||||
&uopz.warn.removed.function-5-0-0;
|
||||
</refsynopsisdiv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_restore</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_restore</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Restaura uma função a partir de um backup.
|
||||
</para>
|
||||
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a função a ser restaurada.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_restore</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_backup("fgets");
|
||||
uopz_function("fgets", function(){
|
||||
return true;
|
||||
});
|
||||
var_dump(fgets());
|
||||
uopz_restore('fgets');
|
||||
fgets();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs.similar;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Warning: fgets() expects at least 1 parameter, 0 given in /path/to/script.php on line 8
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
118
reference/uopz/functions/uopz-set-hook.xml
Normal file
118
reference/uopz/functions/uopz-set-hook.xml
Normal file
@@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 8e242d4d3941e1197850524ad8694a0665913f0b Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-set-hook" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_set_hook</refname>
|
||||
<refpurpose>Define o gancho a ser executado ao entrar em uma função ou método</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_set_hook</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>Closure</type><parameter>hook</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_set_hook</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>Closure</type><parameter>hook</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Define o gancho a ser executado ao entrar em uma função ou método.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função ou do método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>hook</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Um Closure ser executado ao entrar na função ou método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-set-hook.example.basic">
|
||||
<title>Uso básico de <function>uopz_set_hook</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function foo() {
|
||||
echo 'foo';
|
||||
}
|
||||
uopz_set_hook('foo', function () {echo 'bar';});
|
||||
foo();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
barfoo
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_get_hook</function></member>
|
||||
<member><function>uopz_unset_hook</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
217
reference/uopz/functions/uopz-set-mock.xml
Normal file
217
reference/uopz/functions/uopz-set-mock.xml
Normal file
@@ -0,0 +1,217 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 0545e305cf06937b14b3f0694d6e716c9881ffd7 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-set-mock" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_set_mock</refname>
|
||||
<refpurpose>Usa mock em vez de classe para novos objetos</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_set_mock</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>mock</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Se <parameter>mock</parameter> for uma string contendo o nome de uma classe, ela será instanciada em vez de
|
||||
<parameter>class</parameter>. <parameter>mock</parameter> também pode ser um objeto.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Somente o acesso dinâmico a propriedades e métodos utilizará o objeto <parameter>mock</parameter>.
|
||||
O acesso estático ainda utiliza a classe original do parâmetro <parameter>class</parameter>.
|
||||
Veja o <link linkend="uopz_set_mock.example.static">exemplo</link> abaixo.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe a ter o mock usado.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>mock</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O mock a ser usado é uma string contendo o nome da classe a ser usada ou de um objeto.
|
||||
Se uma string for passada, ela deve ser o nome completo da classe. É
|
||||
recomendado usar a constante mágica <code>::class</code> neste caso.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="changelog">
|
||||
&reftitle.changelog;
|
||||
<informaltable>
|
||||
<tgroup cols="2">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Version;</entry>
|
||||
<entry>&Description;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody>
|
||||
<row>
|
||||
<entry>PECL uopz 6.0.0</entry>
|
||||
<entry>
|
||||
Esta função não suporta mais o mock de membros estáticos.
|
||||
<function>uopz_redefine</function> e <function>uopz_set_return</function>,
|
||||
ou <link linkend="book.componere">Componere</link> podem ser usados em seu lugar.
|
||||
</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</informaltable>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_set_mock</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class A {
|
||||
public function who() {
|
||||
echo "A";
|
||||
}
|
||||
}
|
||||
|
||||
class mockA {
|
||||
public function who() {
|
||||
echo "mockA";
|
||||
}
|
||||
}
|
||||
|
||||
uopz_set_mock(A::class, mockA::class);
|
||||
(new A)->who();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
mockA
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_set_mock</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class A {
|
||||
public function who() {
|
||||
echo "A";
|
||||
}
|
||||
}
|
||||
|
||||
uopz_set_mock(A::class, new class {
|
||||
public function who() {
|
||||
echo "mockA";
|
||||
}
|
||||
});
|
||||
(new A)->who();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
mockA
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example xml:id="uopz_set_mock.example.static">
|
||||
<title><function>uopz_set_mock</function> e membros estáticos</title>
|
||||
<para>
|
||||
A partir do uopz 6.0.0, o mock de membros estáticos não é mais suportada.
|
||||
</para>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class A {
|
||||
const CON = 'A';
|
||||
public static function who() {
|
||||
echo "A";
|
||||
}
|
||||
}
|
||||
|
||||
uopz_set_mock(A::class, new class {
|
||||
const CON = 'mockA';
|
||||
public static function who() {
|
||||
echo "mockA";
|
||||
}
|
||||
});
|
||||
echo A::CON, PHP_EOL;
|
||||
A::who();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
A
|
||||
A
|
||||
]]>
|
||||
</screen>
|
||||
<para>
|
||||
Saída do exemplo acima no uopz 5:
|
||||
</para>
|
||||
<screen>
|
||||
<![CDATA[
|
||||
mockA
|
||||
mockA
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_get_mock</function></member>
|
||||
<member><function>uopz_unset_mock</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
139
reference/uopz/functions/uopz-set-property.xml
Normal file
139
reference/uopz/functions/uopz-set-property.xml
Normal file
@@ -0,0 +1,139 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 415ff8a05a90b91c09388f98b708b8c2b0acbe89 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-set-property" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_set_property</refname>
|
||||
<refpurpose>Define o valor da classe existente ou propriedade de instância</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>void</type><methodname>uopz_set_property</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>property</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>void</type><methodname>uopz_set_property</methodname>
|
||||
<methodparam><type>object</type><parameter>instance</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>property</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Define o valor de uma propriedade de classe estática existente, se <parameter>class</parameter>
|
||||
for fornecido, ou o valor de uma propriedade de instância (independentemente de a propriedade de instância já existir), se <parameter>instance</parameter>
|
||||
for fornecido.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>instance</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
A instância do objeto.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>property</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da propriedade.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>value</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O valor a ser atribuído à propriedade.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-set-property.example.basic">
|
||||
<title>Uso básico de <function>uopz_set_property</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Foo {
|
||||
private static $staticBar;
|
||||
private $bar;
|
||||
public static function testStaticBar() {
|
||||
return self::$staticBar;
|
||||
}
|
||||
public function testBar() {
|
||||
return $this->bar;
|
||||
}
|
||||
}
|
||||
$foo = new Foo;
|
||||
uopz_set_property('Foo', 'staticBar', 10);
|
||||
uopz_set_property($foo, 'bar', 100);
|
||||
var_dump(Foo::testStaticBar());
|
||||
var_dump($foo->testBar());
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
int(10)
|
||||
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_get_property</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
164
reference/uopz/functions/uopz-set-return.xml
Normal file
164
reference/uopz/functions/uopz-set-return.xml
Normal file
@@ -0,0 +1,164 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-set-return" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_set_return</refname>
|
||||
<refpurpose>Fornece um valor de retorno para uma função existente</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_set_return</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>execute</parameter><initializer>&false;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_set_return</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>execute</parameter><initializer>&false;</initializer></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Define o valor de retorno de <parameter>function</parameter> como <parameter>value</parameter>. Se <parameter>value</parameter>
|
||||
for um Closure e <parameter>execute</parameter> estiver definido, o Closure será executado no lugar da função original.
|
||||
É possível chamar a função original a partir do Closure.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Esta função substitui <methodname>uopz_rename</methodname>.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a função.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome de uma função existente.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>value</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O valor que a função deve retornar. Se um Closure for fornecido e o sinalizador de execução estiver definido, o Closure será executado no lugar da função original.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>execute</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Se for igual a true e um Closure tiver sido fornecido como valor, o Closure será executado no lugar da função original.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
True se for bem-sucedido, false caso contrário.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_set_return</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_set_return("strlen", 42);
|
||||
echo strlen("Banana");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
42
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_set_return</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_set_return("strlen", function($str) { return strlen($str) * 2; }, true );
|
||||
echo strlen("Banana");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
12
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_set_return</function> com uma classe</title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class My {
|
||||
public static function strlen($arg) {
|
||||
return strlen($arg);
|
||||
}
|
||||
}
|
||||
uopz_set_return(My::class, "strlen", function($str) { return strlen($str) * 2; }, true );
|
||||
echo My::strlen("Banana");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
12
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
101
reference/uopz/functions/uopz-undefine.xml
Normal file
101
reference/uopz/functions/uopz-undefine.xml
Normal file
@@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-undefine" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_undefine</refname>
|
||||
<refpurpose>Indefine uma constante</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_undefine</methodname>
|
||||
<methodparam><type>string</type><parameter>constant</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_undefine</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>constant</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Remove a constante em tempo de execução
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém <parameter>constant</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>constant</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome de uma constante existente.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_undefine</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
define("MY", true);
|
||||
|
||||
uopz_undefine("MY");
|
||||
|
||||
var_dump(defined("MY"));
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bool(false)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
112
reference/uopz/functions/uopz-unset-hook.xml
Normal file
112
reference/uopz/functions/uopz-unset-hook.xml
Normal file
@@ -0,0 +1,112 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 8e242d4d3941e1197850524ad8694a0665913f0b Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-unset-hook" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_unset_hook</refname>
|
||||
<refpurpose>Remove o gancho definido anteriormente na função ou método</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_unset_hook</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>bool</type><methodname>uopz_unset_hook</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Remove o gancho definido anteriormente na função ou método.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função ou do método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-unset-hook.example.basic">
|
||||
<title>Uso básico de <function>uopz_unset_hook</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function foo() {
|
||||
echo 'foo';
|
||||
}
|
||||
uopz_set_hook('foo', function () {echo 'bar';});
|
||||
foo();
|
||||
echo PHP_EOL;
|
||||
uopz_unset_hook('foo');
|
||||
foo();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
barfoo
|
||||
foo
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_set_hook</function></member>
|
||||
<member><function>uopz_get_hook</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
113
reference/uopz/functions/uopz-unset-mock.xml
Normal file
113
reference/uopz/functions/uopz-unset-mock.xml
Normal file
@@ -0,0 +1,113 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-unset-mock" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_unset_mock</refname>
|
||||
<refpurpose>Remove a definição de um mock previamente definido</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>void</type><methodname>uopz_unset_mock</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Remove a definição de um mock previamente definido para a classe em <parameter>class</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe com mock.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
<para>
|
||||
Uma <classname>RuntimeException</classname> é lançada se nenhum mock foi
|
||||
definido anteriormente para <parameter>class</parameter>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_unset_mock</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class A {
|
||||
public static function who() {
|
||||
echo "A";
|
||||
}
|
||||
}
|
||||
|
||||
class mockA {
|
||||
public static function who() {
|
||||
echo "mockA";
|
||||
}
|
||||
}
|
||||
|
||||
uopz_set_mock(A::class, mockA::class);
|
||||
uopz_unset_mock(A::class);
|
||||
A::who();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
A
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_set_mock</function></member>
|
||||
<member><function>uopz_get_mock</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
100
reference/uopz/functions/uopz-unset-return.xml
Normal file
100
reference/uopz/functions/uopz-unset-return.xml
Normal file
@@ -0,0 +1,100 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-unset-return" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_unset_return</refname>
|
||||
<refpurpose>Desfaz um valor de retorno previamente definido para uma função</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_unset_return</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>uopz_unset_return</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Desfaz o valor de retorno da função <parameter>function</parameter> definida anteriormente por <methodname>uopz_set_return</methodname>.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe que contém a função.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
True em caso de sucesso.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example>
|
||||
<title>Exemplo de <function>uopz_unset_return</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
uopz_set_return("strlen", 42);
|
||||
$len = strlen("Banana");
|
||||
uopz_unset_return("strlen");
|
||||
echo $len + strlen("Banana");
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
48
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</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
|
||||
-->
|
||||
119
reference/uopz/functions/uopz_set_static.xml
Normal file
119
reference/uopz/functions/uopz_set_static.xml
Normal file
@@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: ef509edbd73ea8f630c1e8f37dbf2d04d8c469e9 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<refentry xml:id="function.uopz-set-static" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<refnamediv>
|
||||
<refname>uopz_set_static</refname>
|
||||
<refpurpose>Define as variáveis estáticas no escopo da função ou método</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description"><!-- {{{ -->
|
||||
&reftitle.description;
|
||||
<methodsynopsis role="procedural">
|
||||
<type>void</type><methodname>uopz_set_static</methodname>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>static</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<methodsynopsis role="procedural">
|
||||
<type>void</type><methodname>uopz_set_static</methodname>
|
||||
<methodparam><type>string</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>function</parameter></methodparam>
|
||||
<methodparam><type>array</type><parameter>static</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Define as variáveis estáticas no escopo da função ou método.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da classe.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>function</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O nome da função ou do método.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>static</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
O <type>array</type> associativo de nomes de variáveis mapeados para seus
|
||||
valores.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.void;
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<example xml:id="uopz-set-static.example.basic">
|
||||
<title>Uso básico de <function>uopz_set_static</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
function foo() {
|
||||
static $bar = 'baz';
|
||||
var_dump($bar);
|
||||
}
|
||||
uopz_set_static('foo', ['bar' => 'qux']);
|
||||
foo();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
string(3) "qux"
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<simplelist>
|
||||
<member><function>uopz_get_static</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
||||
30
reference/uopz/reference.xml
Normal file
30
reference/uopz/reference.xml
Normal file
@@ -0,0 +1,30 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: ec5fc8c5b78a28498a61be914cf970e09552d466 Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<reference xml:id="ref.uopz" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
<title>&Functions; de Uopz</title>
|
||||
|
||||
&reference.uopz.entities.functions;
|
||||
|
||||
</reference>
|
||||
|
||||
<!-- 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
|
||||
-->
|
||||
143
reference/uopz/setup.xml
Normal file
143
reference/uopz/setup.xml
Normal file
@@ -0,0 +1,143 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: c9490d424ec11a4fe92f07f08cff95c85c7d22df Maintainer: leonardolara Status: ready -->
|
||||
|
||||
<chapter xml:id="uopz.setup" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
&reftitle.setup;
|
||||
|
||||
<section xml:id="uopz.requirements">
|
||||
&reftitle.required;
|
||||
<para>
|
||||
A partir do uopz 5.0, é necessário PHP 7.0. A partir do uopz 5.1, é necessário PHP 7.1+.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="uopz.installation">
|
||||
&reftitle.install;
|
||||
<para>
|
||||
As versões do uopz são hospedadas pelo PECL e o código-fonte pelo
|
||||
<link xlink:href="&url.git.hub;krakjoe/uopz">github</link>,
|
||||
o caminho mais fácil para a instalação é o caminho normal do PECL:
|
||||
<link xlink:href="&url.pecl.package;uopz">&url.pecl.package;uopz</link>.
|
||||
</para>
|
||||
<para>
|
||||
Usuários do Windows podem baixar binários de lançamento pré-compilados no site <link xlink:href="&url.pecl.package;uopz">PECL</link>.
|
||||
</para>
|
||||
<para>
|
||||
A partir do uopz 5.0.0 a extensão deveria ser carregada como
|
||||
<link linkend="ini.extension">extension</link>. Antes dessa versão, ela deveria ser
|
||||
carregada como <link linkend="ini.zend-extension">zend_extension</link>.
|
||||
</para>
|
||||
</section>
|
||||
|
||||
<section xml:id="uopz.configuration">
|
||||
&reftitle.runtime;
|
||||
&extension.runtime;
|
||||
<para>
|
||||
<table>
|
||||
<title>&ConfigureOptions; de uopz</title>
|
||||
<tgroup cols="4">
|
||||
<thead>
|
||||
<row>
|
||||
<entry>&Name;</entry>
|
||||
<entry>&Default;</entry>
|
||||
<entry>&Changeable;</entry>
|
||||
<entry>&Changelog;</entry>
|
||||
</row>
|
||||
</thead>
|
||||
<tbody xml:id="uopz.configuration.list">
|
||||
<row>
|
||||
<entry><link linkend="ini.uopz.disable">uopz.disable</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry><constant>INI_SYSTEM</constant></entry>
|
||||
<entry>Disponível a partir do uopz 5.0.2.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.uopz.exit">uopz.exit</link></entry>
|
||||
<entry>"0"</entry>
|
||||
<entry><constant>INI_SYSTEM</constant></entry>
|
||||
<entry>Disponível a partir do uopz 6.0.1.</entry>
|
||||
</row>
|
||||
<row>
|
||||
<entry><link linkend="ini.uopz.overloads">uopz.overloads</link></entry>
|
||||
<entry>"1"</entry>
|
||||
<entry><constant>INI_SYSTEM</constant></entry>
|
||||
<entry>Disponível a partir do uopz 2.0.2. Removida a partir do uopz 5.0.0.</entry>
|
||||
</row>
|
||||
</tbody>
|
||||
</tgroup>
|
||||
</table>
|
||||
&ini.php.constants;
|
||||
</para>
|
||||
|
||||
&ini.descriptions.title;
|
||||
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry xml:id="ini.uopz.disable">
|
||||
<term>
|
||||
<parameter>uopz.disable</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Se habilitada, o uopz não deverá mais ter qualquer efeito no mecanismo.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.uopz.exit">
|
||||
<term>
|
||||
<parameter>uopz.exit</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Permitir ou não a execução de opcodes de saída.
|
||||
Esta configuração pode ser substituída durante a execução chamando <function>uopz_allow_exit</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry xml:id="ini.uopz.overloads">
|
||||
<term>
|
||||
<parameter>uopz.overloads</parameter>
|
||||
<type>bool</type>
|
||||
</term>
|
||||
<listitem>
|
||||
<para>
|
||||
Habilita a capacidade de usar <function>uopz_overload</function>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
|
||||
<note>
|
||||
<simpara>
|
||||
Ao executar com o OPcache habilitado, pode ser necessário desabilitar todas as
|
||||
<link linkend="ini.opcache.optimization-level">otimizações do OPcache</link>
|
||||
(<code>opcache.optimization_level=0</code>).
|
||||
</simpara>
|
||||
</note>
|
||||
</section>
|
||||
|
||||
</chapter>
|
||||
|
||||
<!-- 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
|
||||
-->
|
||||
Reference in New Issue
Block a user