<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd"> <HTML ><HEAD ><TITLE >runkit Functions</TITLE ><META NAME="GENERATOR" CONTENT="Modular DocBook HTML Stylesheet Version 1.79"><LINK REL="HOME" TITLE="Manual do PHP" HREF="index.html"><LINK REL="UP" TITLE="Referência das Funções" HREF="funcref.html"><LINK REL="PREVIOUS" TITLE="rpm_version" HREF="function.rpm-version.html"><LINK REL="NEXT" TITLE="Runkit_Sandbox" HREF="runkit.sandbox.html"><META HTTP-EQUIV="Content-type" CONTENT="text/html; charset=UTF-8"></HEAD ><BODY CLASS="reference" BGCOLOR="#FFFFFF" TEXT="#000000" LINK="#0000FF" VLINK="#840084" ALINK="#0000FF" ><DIV CLASS="NAVHEADER" ><TABLE SUMMARY="Header navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TH COLSPAN="3" ALIGN="center" >Manual do PHP</TH ></TR ><TR ><TD WIDTH="10%" ALIGN="left" VALIGN="bottom" ><A HREF="function.rpm-version.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="80%" ALIGN="center" VALIGN="bottom" ></TD ><TD WIDTH="10%" ALIGN="right" VALIGN="bottom" ><A HREF="runkit.sandbox.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ></TABLE ><HR ALIGN="LEFT" WIDTH="100%"></DIV ><DIV CLASS="reference" ><A NAME="ref.runkit" ></A ><DIV CLASS="TITLEPAGE" ><H1 CLASS="title" >CXXXIX. runkit Functions</H1 ><DIV CLASS="PARTINTRO" ><A NAME="AEN193659" ></A ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="runkit.intro" >Introdução</A ></H1 ><P > The runkit extension provides means to modify constants, user-defined functions, and user-defined classes. It also provides for custom superglobal variables and embeddable sub-interpreters via sandboxing. </P ><P > Informações para a instalação desta extensão PECL podem ser encontradas no manual no capitulo entitulado <A HREF="install.pecl.html" >Instalação de extensões PECL</A >. Informações adicionais como novas versões, downloads, arquivos fontes, manutenções, e um Changelog, podem ser obtidos aqui: <A HREF="http://pecl.php.net/package/runkit" TARGET="_top" >http://pecl.php.net/package/runkit</A >. </P ><P > This package is meant as a feature added replacement for the <A HREF="http://pecl.php.net/package/classkit" TARGET="_top" >classkit</A > package. When compiled with the <TT CLASS="literal" >--enable-runkit=classkit</TT > option to ./configure, it will export classkit compatible function definitions and constants. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="runkit.installation" >Instalação</A ></H1 ><P > Esta estensão <A HREF="http://pecl.php.net" TARGET="_top" >PECL</A > não vem compilada com o PHP. </P ><P > Informações para a instalação desta extensão PECL podem ser encontradas no manual no capitulo entitulado <A HREF="install.pecl.html" >Instalação de extensões PECL</A >. Informações adicionais como novas versões, downloads, arquivos fontes, manutenções, e um Changelog, podem ser obtidos aqui: <A HREF="http://pecl.php.net/package/runkit" TARGET="_top" >http://pecl.php.net/package/runkit</A >. </P ><P > Você pode baixar esta extensão <ACRONYM CLASS="acronym" >PECL</ACRONYM > <ACRONYM CLASS="acronym" >DLL</ACRONYM > a apartir de <A HREF="http://www.php.net/downloads.php" TARGET="_top" > downloads PHP</A > ou em <A HREF="http://snaps.php.net/" TARGET="_top" > http://snaps.php.net/</A >. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="runkit.requirements" >Dependências</A ></H1 ><P > <SPAN CLASS="emphasis" ><I CLASS="emphasis" >Modifying Constants, Functions, Classes, and Methods</I ></SPAN > works with all releases of PHP 4 and PHP 5. No special requirements are necessary. </P ><P > <SPAN CLASS="emphasis" ><I CLASS="emphasis" >Custom Superglobals</I ></SPAN > are only available in PHP 4.2.0 or later. </P ><P > <SPAN CLASS="emphasis" ><I CLASS="emphasis" >Sandboxing</I ></SPAN > requires PHP 5.1.0 or later, or PHP 5.0.0 with a special TSRM patch applied. Regardless of which version of PHP is in use it must be compiled with the <TT CLASS="literal" >--enable-maintainer-zts</TT > option. See the <TT CLASS="literal" >README</TT > file in the runkit package for additional information. </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="runkit.configuration" >Configurações em execução</A ></H1 ><P > O comportamento dessas funções podem ser modificado pelas configurações do <TT CLASS="filename" >php.ini</TT >. </P ><P > <DIV CLASS="table" ><A NAME="AEN193696" ></A ><P ><B >Tabela 1. Runkit Configuration Options</B ></P ><TABLE BORDER="1" CLASS="CALSTABLE" ><COL><COL><COL><COL><THEAD ><TR ><TH >Name</TH ><TH >Default</TH ><TH >Changeable</TH ><TH >Changelog</TH ></TR ></THEAD ><TBODY ><TR ><TD >runkit.superglobal</TD ><TD >""</TD ><TD >PHP_INI_PERDIR</TD ><TD > </TD ></TR ><TR ><TD >runkit.internal_override</TD ><TD >"0"</TD ><TD >PHP_INI_SYSTEM</TD ><TD > </TD ></TR ></TBODY ></TABLE ></DIV > Para mais detalhes e definições das constantes PHP_INI_*, veja <A HREF="ini.html" >Apêndice H</A >. </P ><P >Breve descrição das diretivas de configuração.</P ><P > <P ></P ><DIV CLASS="variablelist" ><DL ><DT ><A NAME="ini.runkit.superglobal" ></A ><CODE CLASS="parameter" >runkit.superglobal</CODE > <A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A ></DT ><DD ><P > Comma-separated list of variable names to be treated as superglobals. This value should be set in the systemwide php.ini file, but may work in perdir configuration contexts depending on your SAPI. </P ><TABLE WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" CLASS="EXAMPLE" ><TR ><TD ><DIV CLASS="example" ><A NAME="AEN193726" ></A ><P ><B >Exemplo 1. Custom Superglobals with runkit.superglobal=_FOO,_BAR in php.ini</B ></P ><TABLE BORDER="0" BGCOLOR="#E0E0E0" CELLPADDING="5" ><TR ><TD ><code><font color="#000000"> <font color="#0000BB"><?php<br /></font><font color="#007700">function </font><font color="#0000BB">show_values</font><font color="#007700">() {<br /> echo </font><font color="#DD0000">"Foo is $_FOO</font><font color="#007700">\n</font><font color="#DD0000">"</font><font color="#007700">;<br /> echo </font><font color="#DD0000">"Bar is $_BAR</font><font color="#007700">\n</font><font color="#DD0000">"</font><font color="#007700">;<br /> echo </font><font color="#DD0000">"Baz is $_BAZ</font><font color="#007700">\n</font><font color="#DD0000">"</font><font color="#007700">;<br />}<br /><br /></font><font color="#0000BB">$_FOO </font><font color="#007700">= </font><font color="#DD0000">'foo'</font><font color="#007700">;<br /></font><font color="#0000BB">$_BAR </font><font color="#007700">= </font><font color="#DD0000">'bar'</font><font color="#007700">;<br /></font><font color="#0000BB">$_BAZ </font><font color="#007700">= </font><font color="#DD0000">'baz'</font><font color="#007700">;<br /><br /></font><font color="#FF8000">/* Displays foo and bar, but not baz */<br /></font><font color="#0000BB">show_values</font><font color="#007700">();<br /></font><font color="#0000BB">?></font> </font> </code></TD ></TR ></TABLE ></DIV ></TD ></TR ></TABLE ></DD ></DL ></DIV > </P ></DIV ><DIV CLASS="section" ><H1 CLASS="section" ><A NAME="runkit.constants" >Constantes pré-definidas</A ></H1 ><P > As contantes abaixo são definidas por esta extensão e somente estarão disponíveis quando a extensão foi compilada com o PHP ou carregada dinamicamente durante a execução. </P ><P ></P ><DIV CLASS="variablelist" ><DL ><DT ><TT CLASS="constant" ><B >RUNKIT_IMPORT_FUNCTIONS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > <A HREF="function.runkit-import.html" ><B CLASS="function" >runkit_import()</B ></A > flag indicating that normal functions should be imported from the specified file. </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_IMPORT_CLASS_METHODS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > <A HREF="function.runkit-import.html" ><B CLASS="function" >runkit_import()</B ></A > flag indicating that class methods should be imported from the specified file. </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_IMPORT_CLASS_CONSTS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > <A HREF="function.runkit-import.html" ><B CLASS="function" >runkit_import()</B ></A > flag indicating that class constants should be imported from the specified file. Note that this flag is only meaningful in PHP versions 5.1.0 and above. </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_IMPORT_CLASS_PROPS</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > <A HREF="function.runkit-import.html" ><B CLASS="function" >runkit_import()</B ></A > flag indicating that class standard properties should be imported from the specified file. </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_IMPORT_CLASSES</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > <A HREF="function.runkit-import.html" ><B CLASS="function" >runkit_import()</B ></A > flag representing a bitwise OR of the <TT CLASS="constant" ><B >RUNKIT_IMPORT_CLASS_*</B ></TT > constants. </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_IMPORT_OVERRIDE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > <A HREF="function.runkit-import.html" ><B CLASS="function" >runkit_import()</B ></A > flag indicating that if any of the imported functions, methods, constants, or properties already exist, they should be replaced with the new definitions. If this flag is not set, then any imported definitions which already exist will be discarded. </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_ACC_PUBLIC</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > PHP 5 specific flag to <A HREF="function.runkit-method-add.html" ><B CLASS="function" >runkit_method_add()</B ></A > </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_ACC_PROTECTED</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > PHP 5 specific flag to <A HREF="function.runkit-method-add.html" ><B CLASS="function" >runkit_method_add()</B ></A > </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_ACC_PRIVATE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > PHP 5 specific flag to <A HREF="function.runkit-method-add.html" ><B CLASS="function" >runkit_method_add()</B ></A > </P ></DD ><DT ><TT CLASS="constant" ><B >CLASSKIT_ACC_PUBLIC</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > PHP 5 specific flag to <A HREF="function.classkit-method-add.html" ><B CLASS="function" >classkit_method_add()</B ></A > Only defined when classkit compatibility is enabled. </P ></DD ><DT ><TT CLASS="constant" ><B >CLASSKIT_ACC_PROTECTED</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > PHP 5 specific flag to <A HREF="function.classkit-method-add.html" ><B CLASS="function" >classkit_method_add()</B ></A > Only defined when classkit compatibility is enabled. </P ></DD ><DT ><TT CLASS="constant" ><B >CLASSKIT_ACC_PRIVATE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > PHP 5 specific flag to <A HREF="function.classkit-method-add.html" ><B CLASS="function" >classkit_method_add()</B ></A > Only defined when classkit compatibility is enabled. </P ></DD ><DT ><TT CLASS="constant" ><B >CLASSKIT_AGGREGATE_OVERRIDE</B ></TT > (<A HREF="language.types.integer.html" ><B CLASS="type" >integer</B ></A >)</DT ><DD ><P > PHP 5 specific flag to <A HREF="function.classkit-import.html" ><B CLASS="function" >classkit_import()</B ></A > Only defined when classkit compatibility is enabled. </P ></DD ><DT ><TT CLASS="constant" ><B >RUNKIT_VERSION</B ></TT > (<A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A >)</DT ><DD ><P > Defined to the current version of the runkit package. </P ></DD ><DT ><TT CLASS="constant" ><B >CLASSKIT_VERSION</B ></TT > (<A HREF="language.types.string.html" ><B CLASS="type" >string</B ></A >)</DT ><DD ><P > Defined to the current version of the runkit package. Only defined when classkit compatibility is enabled. </P ></DD ></DL ></DIV ></DIV ></DIV ><DIV CLASS="TOC" ><DL ><DT ><B >Índice</B ></DT ><DT ><A HREF="runkit.sandbox.html" >Runkit_Sandbox</A > -- Runkit Sandbox Class -- PHP Virtual Machine </DT ><DT ><A HREF="runkit.sandbox-parent.html" >Runkit_Sandbox_Parent</A > -- Runkit Anti-Sandbox Class </DT ><DT ><A HREF="function.runkit-class-adopt.html" >runkit_class_adopt</A > -- Convert a base class to an inherited class, add ancestral methods when appropriate </DT ><DT ><A HREF="function.runkit-class-emancipate.html" >runkit_class_emancipate</A > -- Convert an inherited class to a base class, removes any method whose scope is ancestral </DT ><DT ><A HREF="function.runkit-constant-add.html" >runkit_constant_add</A > -- Similar to define(), but allows defining in class definitions as well </DT ><DT ><A HREF="function.runkit-constant-redefine.html" >runkit_constant_redefine</A > -- Redefine an already defined constant </DT ><DT ><A HREF="function.runkit-constant-remove.html" >runkit_constant_remove</A > -- Remove/Delete an already defined constant </DT ><DT ><A HREF="function.runkit-function-add.html" >runkit_function_add</A > -- Add a new function, similar to <A HREF="function.create-function.html" ><B CLASS="function" >create_function()</B ></A > </DT ><DT ><A HREF="function.runkit-function-copy.html" >runkit_function_copy</A > -- Copy a function to a new function name </DT ><DT ><A HREF="function.runkit-function-redefine.html" >runkit_function_redefine</A > -- Replace a function definition with a new implementation </DT ><DT ><A HREF="function.runkit-function-remove.html" >runkit_function_remove</A > -- Remove a function definition </DT ><DT ><A HREF="function.runkit-function-rename.html" >runkit_function_rename</A > -- Change a function's name </DT ><DT ><A HREF="function.runkit-import.html" >runkit_import</A > -- Process a PHP file importing function and class definitions, overwriting where appropriate </DT ><DT ><A HREF="function.runkit-lint-file.html" >runkit_lint_file</A > -- Check the PHP syntax of the specified file </DT ><DT ><A HREF="function.runkit-lint.html" >runkit_lint</A > -- Check the PHP syntax of the specified php code </DT ><DT ><A HREF="function.runkit-method-add.html" >runkit_method_add</A > -- Dynamically adds a new method to a given class</DT ><DT ><A HREF="function.runkit-method-copy.html" >runkit_method_copy</A > -- Copies a method from class to another</DT ><DT ><A HREF="function.runkit-method-redefine.html" >runkit_method_redefine</A > -- Dynamically changes the code of the given method</DT ><DT ><A HREF="function.runkit-method-remove.html" >runkit_method_remove</A > -- Dynamically removes the given method</DT ><DT ><A HREF="function.runkit-method-rename.html" >runkit_method_rename</A > -- Dynamically changes the name of the given method</DT ><DT ><A HREF="function.runkit-return-value-used.html" >runkit_return_value_used</A > -- Determines if the current functions return value will be used</DT ><DT ><A HREF="function.runkit-sandbox-output-handler.html" >runkit_sandbox_output_handler</A > -- Specify a function to capture and/or process output from a runkit sandbox </DT ><DT ><A HREF="function.runkit-superglobals.html" >runkit_superglobals</A > -- Return numerically indexed array of registered superglobals </DT ></DL ></DIV ></DIV ></DIV ><DIV CLASS="NAVFOOTER" ><HR ALIGN="LEFT" WIDTH="100%"><TABLE SUMMARY="Footer navigation table" WIDTH="100%" BORDER="0" CELLPADDING="0" CELLSPACING="0" ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" ><A HREF="function.rpm-version.html" ACCESSKEY="P" >Anterior</A ></TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="index.html" ACCESSKEY="H" >Principal</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" ><A HREF="runkit.sandbox.html" ACCESSKEY="N" >Próxima</A ></TD ></TR ><TR ><TD WIDTH="33%" ALIGN="left" VALIGN="top" >rpm_version</TD ><TD WIDTH="34%" ALIGN="center" VALIGN="top" ><A HREF="funcref.html" ACCESSKEY="U" >Acima</A ></TD ><TD WIDTH="33%" ALIGN="right" VALIGN="top" >Runkit_Sandbox</TD ></TR ></TABLE ></DIV ></BODY ></HTML >