Files
php-doc-ru/reference/reflection/examples.xml
2011-08-25 06:45:26 +00:00

157 lines
3.6 KiB
XML
Raw Blame History

This file contains ambiguous Unicode characters

This file contains Unicode characters that might be confused with other characters. If you think that this is intentional, you can safely ignore this warning. Use the Escape button to reveal them.

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: b71e8b802f19ebed1067898d628e8a03b0550a11 Maintainer: aur Status: ready -->
<!-- Reviewed: yes -->
<!-- $Revision$ -->
<chapter xml:id="reflection.examples" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
&reftitle.examples;
<para>
В документации по Reflection вы сможете
встретить множество примеров, чаще всего в описании конструкторов классов.
</para>
<example>
<title>Пример использования Reflection из shell (Терминала)</title>
<programlisting role="shell">
<![CDATA[
$ php --rf strlen
$ php --rc finfo
$ php --re json
$ php --ri dom
]]>
</programlisting>
&example.outputs.similar;
<screen>
<![CDATA[
Function [ <internal:Core> function strlen ] {
- Parameters [1] {
Parameter #0 [ <required> $str ]
}
}
Class [ <internal:fileinfo> class finfo ] {
- Constants [0] {
}
- Static properties [0] {
}
- Static methods [0] {
}
- Properties [0] {
}
- Methods [4] {
Method [ <internal:fileinfo, ctor> public method finfo ] {
- Parameters [2] {
Parameter #0 [ <optional> $options ]
Parameter #1 [ <optional> $arg ]
}
}
Method [ <internal:fileinfo> public method set_flags ] {
- Parameters [1] {
Parameter #0 [ <required> $options ]
}
}
Method [ <internal:fileinfo> public method file ] {
- Parameters [3] {
Parameter #0 [ <required> $filename ]
Parameter #1 [ <optional> $options ]
Parameter #2 [ <optional> $context ]
}
}
Method [ <internal:fileinfo> public method buffer ] {
- Parameters [3] {
Parameter #0 [ <required> $string ]
Parameter #1 [ <optional> $options ]
Parameter #2 [ <optional> $context ]
}
}
}
}
Extension [ <persistent> extension #23 json version 1.2.1 ] {
- Constants [10] {
Constant [ integer JSON_HEX_TAG ] { 1 }
Constant [ integer JSON_HEX_AMP ] { 2 }
Constant [ integer JSON_HEX_APOS ] { 4 }
Constant [ integer JSON_HEX_QUOT ] { 8 }
Constant [ integer JSON_FORCE_OBJECT ] { 16 }
Constant [ integer JSON_ERROR_NONE ] { 0 }
Constant [ integer JSON_ERROR_DEPTH ] { 1 }
Constant [ integer JSON_ERROR_STATE_MISMATCH ] { 2 }
Constant [ integer JSON_ERROR_CTRL_CHAR ] { 3 }
Constant [ integer JSON_ERROR_SYNTAX ] { 4 }
}
- Functions {
Function [ <internal:json> function json_encode ] {
- Parameters [2] {
Parameter #0 [ <required> $value ]
Parameter #1 [ <optional> $options ]
}
}
Function [ <internal:json> function json_decode ] {
- Parameters [3] {
Parameter #0 [ <required> $json ]
Parameter #1 [ <optional> $assoc ]
Parameter #2 [ <optional> $depth ]
}
}
Function [ <internal:json> function json_last_error ] {
- Parameters [0] {
}
}
}
}
dom
DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.7.3
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled
]]>
</screen>
</example>
</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
-->