Document parsekit extension

git-svn-id: https://svn.php.net/repository/phpdoc/en/trunk@167322 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
Sara Golemon 2004-08-26 19:45:42 +00:00
parent ba3d020e5b
commit 153fd35c51
7 changed files with 2423 additions and 0 deletions

View file

@ -0,0 +1,37 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<section id="parsekit.installation">
&reftitle.install;
<para>
&pecl.moved;
</para>
<para>
&pecl.info;
<ulink url="&url.pecl.package;parsekit">&url.pecl.package;parsekit</ulink>.
</para>
<para>
&pecl.windows.download;
</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:"../../../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
-->

File diff suppressed because it is too large Load diff

View file

@ -0,0 +1,3 @@
&reference.parsekit.functions.parsekit-compile-file;
&reference.parsekit.functions.parsekit-compile-string;
&reference.parsekit.functions.parsekit-func-arginfo;

View file

@ -0,0 +1,117 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.parsekit-compile-file">
<refnamediv>
<refname>parsekit_compile_file</refname>
<refpurpose>Compile a string of PHP code and return the resulting op array</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>parsekit_compile_file</methodname>
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>&errors</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1>
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>filename</parameter></term>
<listitem>
<para>
A string containing the name of the file to compile.
Similar to the argument to <function>include</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>&errors</parameter></term>
<listitem>
<para>
A 2D hash of errors (including fatal errors) encountered during compilation.
Returned by reference.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
One of either <constant>PARSEKIT_QUIET</constant> or
<constant>PARSEKIT_SIMPLE</constant>. To produce varying
degrees of verbosity in the returned output.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
&reftitle.returnvalues;
<para>
Returns a complex multi-layer array structure as detailed below.
</para>
</refsect1>
<!-- No changelog: it's only in PECL. -->
<refsect1>
&reftitle.examples;
<para>
<example>
<title><function>parsekit_compile_file</function> example</title>
<programlisting role="php">
<?php
var_dump(parsekit_compile_file('hello_world.php', $errors, PARSEKIT_SIMPLE));
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(5) {
[0]=>
string(37) "ZEND_ECHO UNUSED 'Hello World' UNUSED"
[1]=>
string(30) "ZEND_RETURN UNUSED NULL UNUSED"
[2]=>
string(42) "ZEND_HANDLE_EXCEPTION UNUSED UNUSED UNUSED"
["function_table"]=>
NULL
["class_table"]=>
NULL
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>parsekit_compile_string</function>
</para>
</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:"../../../../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
-->

View file

@ -0,0 +1,207 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.parsekit-compile-string">
<refnamediv>
<refname>parsekit_compile_string</refname>
<refpurpose>Compile a string of PHP code and return the resulting op array</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>parsekit_compile_string</methodname>
<methodparam><type>string</type><parameter>phpcode</parameter></methodparam>
<methodparam choice="opt"><type>array</type><parameter>&errors</parameter></methodparam>
<methodparam choice="opt"><type>int</type><parameter>options</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1>
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>phpcode</parameter></term>
<listitem>
<para>
A string containing phpcode. Similar to the argument to <function>eval</function>.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>&errors</parameter></term>
<listitem>
<para>
A 2D hash of errors (including fatal errors) encountered during compilation.
Returned by reference.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>options</parameter></term>
<listitem>
<para>
One of either <constant>PARSEKIT_QUIET</constant> or
<constant>PARSEKIT_SIMPLE</constant>. To produce varying
degrees of verbosity in the returned output.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
&reftitle.returnvalues;
<para>
Returns a complex multi-layer array structure as detailed below.
</para>
</refsect1>
<!-- No changelog: it's only in PECL. -->
<refsect1>
&reftitle.examples;
<para>
<example>
<title><function>parsekit_compile_string</function> example</title>
<programlisting role="php">
<?php
<?php
$ops = parsekit_compile_string('
echo "Foo\n";
', $errors, PARSEKIT_QUIET);
var_dump($ops);
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(20) {
["type"]=>
int(4)
["type_name"]=>
string(14) "ZEND_EVAL_CODE"
["fn_flags"]=>
int(0)
["num_args"]=>
int(0)
["required_num_args"]=>
int(0)
["pass_rest_by_reference"]=>
bool(false)
["uses_this"]=>
bool(false)
["line_start"]=>
int(0)
["line_end"]=>
int(0)
["return_reference"]=>
bool(false)
["refcount"]=>
int(1)
["last"]=>
int(3)
["size"]=>
int(3)
["T"]=>
int(0)
["last_brk_cont"]=>
int(0)
["current_brk_cont"]=>
int(-1)
["backpatch_count"]=>
int(0)
["done_pass_two"]=>
bool(true)
["filename"]=>
string(17) "Parsekit Compiler"
["opcodes"]=>
array(3) {
[8594800]=>
array(5) {
["opcode"]=>
int(40)
["opcode_name"]=>
string(9) "ZEND_ECHO"
["flags"]=>
int(768)
["op1"]=>
array(3) {
["type"]=>
int(1)
["type_name"]=>
string(8) "IS_CONST"
["constant"]=>
&string(4) "Foo
"
}
["lineno"]=>
int(2)
}
["859484C"]=>
array(6) {
["opcode"]=>
int(62)
["opcode_name"]=>
string(11) "ZEND_RETURN"
["flags"]=>
int(16777984)
["op1"]=>
array(3) {
["type"]=>
int(1)
["type_name"]=>
string(8) "IS_CONST"
["constant"]=>
&NULL
}
["extended_value"]=>
int(0)
["lineno"]=>
int(3)
}
[8594898]=>
array(4) {
["opcode"]=>
int(149)
["opcode_name"]=>
string(21) "ZEND_HANDLE_EXCEPTION"
["flags"]=>
int(0)
["lineno"]=>
int(3)
}
}
}
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1>
&reftitle.seealso;
<para>
<function>parsekit_compile_file</function>
</para>
</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:"../../../../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
-->

View file

@ -0,0 +1,120 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<refentry id="function.parsekit-func-arginfo">
<refnamediv>
<refname>parsekit_func_arginfo</refname>
<refpurpose>Return information regarding function argument(s)</refpurpose>
</refnamediv>
<refsect1>
&reftitle.description;
<methodsynopsis>
<type>array</type><methodname>parsekit_func_arginfo</methodname>
<methodparam><type>mixed</type><parameter>function</parameter></methodparam>
</methodsynopsis>
&warn.experimental.func;
</refsect1>
<refsect1>
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>function</parameter></term>
<listitem>
<para>
A string describing a function, or an array describing a class/method.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1>
&reftitle.returnvalues;
<para>
Returns an array containing argument information.
</para>
</refsect1>
<!-- No changelog: it's only in PECL. -->
<refsect1>
&reftitle.examples;
<para>
<example>
<title><function>parsekit_func_arginfo</function> example</title>
<programlisting role="php">
<?php
function foo($bar, stdClass $baz, &$bomb, $bling = false) {
}
var_dump(parsekit_func_arginfo('foo'));
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
array(4) {
[0]=>
array(3) {
["name"]=>
string(3) "bar"
["allow_null"]=>
bool(true)
["pass_by_reference"]=>
bool(false)
}
[1]=>
array(4) {
["name"]=>
string(3) "baz"
["class_name"]=>
string(8) "stdClass"
["allow_null"]=>
bool(false)
["pass_by_reference"]=>
bool(false)
}
[2]=>
array(3) {
["name"]=>
string(4) "bomb"
["allow_null"]=>
bool(true)
["pass_by_reference"]=>
bool(true)
}
[3]=>
array(3) {
["name"]=>
string(5) "bling"
["allow_null"]=>
bool(true)
["pass_by_reference"]=>
bool(false)
}
}
]]>
</screen>
</example>
</para>
</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:"../../../../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
-->

View file

@ -0,0 +1,49 @@
<?xml version="1.0" encoding="iso-8859-1"?>
<!-- $Revision: 1.1 $ -->
<reference id="ref.parsekit">
<title>Parsekit Functions</title>
<titleabbrev>Parsekit</titleabbrev>
<partintro>
<section id="parsekit.intro">
&reftitle.intro;
<para>
These functions allow runtime analysis of opcodes compiled from PHP scripts.
</para>
</section>
&reference.parsekit.configure;
&reference.parsekit.ini;
<section id="parsekit.resources">
&reftitle.resources;
&no.resource;
</section>
&reference.parsekit.constants;
</partintro>
&reference.parsekit.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:"../../../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
-->