mirror of
https://github.com/php/doc-ru.git
synced 2025-08-15 23:42:35 +00:00
add new translations by Alexander Vorotnikov
git-svn-id: https://svn.php.net/repository/phpdoc/ru/trunk@257445 c90b9560-bf6c-de11-be94-00142212c4b1
This commit is contained in:
125
reference/array/functions/array-fill-keys.xml
Normal file
125
reference/array/functions/array-fill-keys.xml
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.6 Status: ready -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.array-fill-keys" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>array_fill_keys</refname>
|
||||
<refpurpose>Создать массив и заполнить его значениями, с определенными ключами</refpurpose>
|
||||
</refnamediv>
|
||||
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>array_fill_keys</methodname>
|
||||
<methodparam><type>array</type><parameter>keys</parameter></methodparam>
|
||||
<methodparam><type>mixed</type><parameter>value</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Создает и заполняет массив значением параметра <parameter>value</parameter>,
|
||||
используя значения массива <parameter>keys</parameter> в качестве ключей.
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>keys</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Массив значений, которые будут использованы в качестве ключей
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
<varlistentry>
|
||||
<term><parameter>value</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Строка или массив значений
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Возвращает заполненный массив
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<!--
|
||||
<refsect1 role="errors">
|
||||
&reftitle.errors;
|
||||
&errors.no.unusual.warnings;
|
||||
</refsect1>
|
||||
-->
|
||||
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>array_fill_keys</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
$keys = array('foo', 5, 10, 'bar');
|
||||
$a = array_fill_keys($keys, 'banana');
|
||||
print_r($a);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Array
|
||||
(
|
||||
[foo] => banana
|
||||
[5] => banana
|
||||
[10] => banana
|
||||
[bar] => banana
|
||||
)
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
z<simplelist>
|
||||
<member><function>array_fill</function></member>
|
||||
<member><function>array_combine</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
51
reference/classkit/book.xml
Normal file
51
reference/classkit/book.xml
Normal file
@ -0,0 +1,51 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<!-- Purpose: basic.vartype -->
|
||||
<!-- Membership: pecl -->
|
||||
|
||||
<book xml:id="book.classkit" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>&Functions; classkit</title>
|
||||
<titleabbrev>Classkit</titleabbrev>
|
||||
|
||||
<preface xml:id="intro.classkit">
|
||||
&reftitle.intro;
|
||||
<para>
|
||||
Эти функции позволяют управлять классами PHP.
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Этот модуль был заменен модулем <link linkend="book.runkit">runkit</link>,
|
||||
который не ограничивается управлением классами, а умеет управлять так же
|
||||
и функциями.
|
||||
</para>
|
||||
</note>
|
||||
</preface>
|
||||
|
||||
&reference.classkit.setup;
|
||||
&reference.classkit.constants;
|
||||
&reference.classkit.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:"../../../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
|
||||
-->
|
||||
|
38
reference/classkit/configure.xml
Normal file
38
reference/classkit/configure.xml
Normal file
@ -0,0 +1,38 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<section xml:id="classkit.installation" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
|
||||
&reftitle.install;
|
||||
<para>
|
||||
&pecl.moved;
|
||||
</para>
|
||||
<para>
|
||||
&pecl.info;
|
||||
<link xlink:href="&url.pecl.package;classkit">&url.pecl.package;classkit</link>.
|
||||
</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
|
||||
-->
|
64
reference/classkit/constants.xml
Normal file
64
reference/classkit/constants.xml
Normal file
@ -0,0 +1,64 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<appendix xml:id="classkit.constants" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.constants;
|
||||
&extension.constants;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>CLASSKIT_ACC_PRIVATE</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Помечает метод, как <literal>private</literal>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>CLASSKIT_ACC_PROTECTED</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Помечает метод, как <literal>protected</literal>
|
||||
</simpara>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term>
|
||||
<constant>CLASSKIT_ACC_PUBLIC</constant>
|
||||
(<type>int</type>)
|
||||
</term>
|
||||
<listitem>
|
||||
<simpara>
|
||||
Помечает метод, как <literal>public</literal>
|
||||
</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:"../../../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/classkit/functions/classkit-import.xml
Normal file
122
reference/classkit/functions/classkit-import.xml
Normal file
@ -0,0 +1,122 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.4 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.classkit-import" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>classkit_import</refname>
|
||||
<refpurpose>Импортирует определения методов нового класса из файла</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>array</type><methodname>classkit_import</methodname>
|
||||
<methodparam><type>string</type><parameter>filename</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
¬e.classkit.selfmanipulation;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>filename</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя файла с определениями методов класса
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Ассоциативный массив импортированных методов
|
||||
</para>
|
||||
</refsect1>
|
||||
<!-- No changelog: it's only in PECL. -->
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>classkit_import</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// file: newclass.php
|
||||
class Example {
|
||||
function foo() {
|
||||
return "bar!\n";
|
||||
}
|
||||
}
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// требуется newclass.php (см. выше)
|
||||
class Example {
|
||||
function foo() {
|
||||
return "foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
$e = new Example();
|
||||
|
||||
// вывод оригинала
|
||||
echo $e->foo();
|
||||
|
||||
// импорт замещающего метода
|
||||
classkit_import('newclass.php');
|
||||
|
||||
// вывод импортированного метода
|
||||
echo $e->foo();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
foo!
|
||||
bar!
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>classkit_method_add</function></member>
|
||||
<member><function>classkit_method_copy</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
157
reference/classkit/functions/classkit-method-add.xml
Normal file
157
reference/classkit/functions/classkit-method-add.xml
Normal file
@ -0,0 +1,157 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.6 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.classkit-method-add" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>classkit_method_add</refname>
|
||||
<refpurpose>Динамически добавляет новый метод в заданный класс</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>classkit_method_add</methodname>
|
||||
<methodparam><type>string</type><parameter>classname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>methodname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>args</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>code</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>classname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Класс, в который этот метод будет добавлен
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>methodname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя добавляемого метода
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>args</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Список аргументов для созданного метода с разделителем ","
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>code</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Код, который будет выполняться во время вызова <parameter>methodname</parameter>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Тип создаваемого метода, может быть
|
||||
<constant>CLASSKIT_ACC_PUBLIC</constant>,
|
||||
<constant>CLASSKIT_ACC_PROTECTED</constant> или
|
||||
<constant>CLASSKIT_ACC_PRIVATE</constant>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Этот параметр используется только в PHP начиная с 5 версии,
|
||||
поскольку в предыдущих версиях все методы были общедоступными.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<!-- No changelog: it's only in PECL. -->
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>classkit_method_add</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Example {
|
||||
function foo() {
|
||||
echo "foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
// создается объект Example
|
||||
$e = new Example();
|
||||
|
||||
// Добавляется новый общедоступный метод
|
||||
classkit_method_add(
|
||||
'Example',
|
||||
'add',
|
||||
'$num1, $num2',
|
||||
'return $num1 + $num2;',
|
||||
CLASSKIT_ACC_PUBLIC
|
||||
);
|
||||
|
||||
// сложение 12 + 4
|
||||
echo $e->add(12, 4);
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
16
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>classkit_method_copy</function></member>
|
||||
<member><function>classkit_method_redefine</function></member>
|
||||
<member><function>classkit_method_remove</function></member>
|
||||
<member><function>classkit_method_rename</function></member>
|
||||
<member><function>create_function</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
134
reference/classkit/functions/classkit-method-copy.xml
Normal file
134
reference/classkit/functions/classkit-method-copy.xml
Normal file
@ -0,0 +1,134 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.3 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.classkit-method-copy" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>classkit_method_copy</refname>
|
||||
<refpurpose>Копирует метод из одного класса в другой</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>classkit_method_copy</methodname>
|
||||
<methodparam><type>string</type><parameter>dClass</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>dMethod</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>sClass</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>string</type><parameter>sMethod</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>dClass</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Класс, в который необходимо скопировать метод
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>dMethod</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя нового метода после копирования
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>sClass</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Исходный класс, содержащий копируемый метод
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>sMethod</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя копируемого метода из исходного класса. Если этот параметр
|
||||
не указан, предполагается значение <parameter>dMethod</parameter>.
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<!-- No changelog: it's only in PECL. -->
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>classkit_method_copy</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Foo {
|
||||
function example() {
|
||||
return "foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
class Bar {
|
||||
// изначально без методов
|
||||
}
|
||||
|
||||
// копируется метод example() из класса Foo в класс Bar, с новым именем baz()
|
||||
classkit_method_copy('Bar', 'baz', 'Foo', 'example');
|
||||
|
||||
// вывод скопированной функции
|
||||
echo Bar::baz();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
foo!
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>classkit_method_add</function></member>
|
||||
<member><function>classkit_method_redefine</function></member>
|
||||
<member><function>classkit_method_remove</function></member>
|
||||
<member><function>classkit_method_rename</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
161
reference/classkit/functions/classkit-method-redefine.xml
Normal file
161
reference/classkit/functions/classkit-method-redefine.xml
Normal file
@ -0,0 +1,161 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.6 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.classkit-method-redefine" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>classkit_method_redefine</refname>
|
||||
<refpurpose>Динамически меняет код заданного метода</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>classkit_method_redefine</methodname>
|
||||
<methodparam><type>string</type><parameter>classname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>methodname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>args</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>code</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>int</type><parameter>flags</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
¬e.classkit.selfmanipulation;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>classname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Класс, в котором необходимо переопределить метод
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>methodname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя переопределяемого метода
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>args</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Список аргументов переопределяемого метода с разделителем ","
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>code</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Новый код, который будет выполняться во время вызова <parameter>methodname</parameter>
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>flags</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Переопределяемый метод может быть
|
||||
<constant>CLASSKIT_ACC_PUBLIC</constant>,
|
||||
<constant>CLASSKIT_ACC_PROTECTED</constant> или
|
||||
<constant>CLASSKIT_ACC_PRIVATE</constant>
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
Этот параметр используется только в PHP начиная с 5 версии,
|
||||
поскольку в предыдущих версиях все методы были общедоступными.
|
||||
</para>
|
||||
</note>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<!-- No changelog: it's only in PECL. -->
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>classkit_method_redefine</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Example {
|
||||
function foo() {
|
||||
return "foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
// создается объект Example
|
||||
$e = new Example();
|
||||
|
||||
// вывод Example::foo() (до переопределения)
|
||||
echo "Before: " . $e->foo();
|
||||
|
||||
// Переопределение метода 'foo'
|
||||
classkit_method_redefine(
|
||||
'Example',
|
||||
'foo',
|
||||
'',
|
||||
'return "bar!\n";',
|
||||
CLASSKIT_ACC_PUBLIC
|
||||
);
|
||||
|
||||
// вывод Example::foo() (после переопределения)
|
||||
echo "After: " . $e->foo();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
Before: foo!
|
||||
After: bar!
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>classkit_method_add</function></member>
|
||||
<member><function>classkit_method_copy</function></member>
|
||||
<member><function>classkit_method_remove</function></member>
|
||||
<member><function>classkit_method_rename</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
119
reference/classkit/functions/classkit-method-remove.xml
Normal file
119
reference/classkit/functions/classkit-method-remove.xml
Normal file
@ -0,0 +1,119 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.7 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.classkit-method-remove" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>classkit_method_remove</refname>
|
||||
<refpurpose>Динамически удаляет заданный метод</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>classkit_method_remove</methodname>
|
||||
<methodparam><type>string</type><parameter>classname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>methodname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
¬e.classkit.selfmanipulation;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>classname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Класс, в котором необходимо удалить метод
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>methodname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя удаляемого метода
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<!-- No changelog: it's only in PECL. -->
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>classkit_method_remove</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Example {
|
||||
function foo() {
|
||||
return "foo!\n";
|
||||
}
|
||||
|
||||
function bar() {
|
||||
return "bar!\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Удаление метода 'foo'
|
||||
classkit_method_remove(
|
||||
'Example',
|
||||
'foo'
|
||||
);
|
||||
|
||||
echo implode(' ', get_class_methods('Example'));
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
bar
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>classkit_method_add</function></member>
|
||||
<member><function>classkit_method_copy</function></member>
|
||||
<member><function>classkit_method_redefine</function></member>
|
||||
<member><function>classkit_method_rename</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
125
reference/classkit/functions/classkit-method-rename.xml
Normal file
125
reference/classkit/functions/classkit-method-rename.xml
Normal file
@ -0,0 +1,125 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1r7 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.classkit-method-rename" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>classkit_method_rename</refname>
|
||||
<refpurpose>Динамически меняет имя заданного метода</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>classkit_method_rename</methodname>
|
||||
<methodparam><type>string</type><parameter>classname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>methodname</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>newname</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
¬e.classkit.selfmanipulation;
|
||||
&warn.experimental.func;
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>classname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Класс, в котором необходимо переименовать метод
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>methodname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя переименовываемого метода
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>newname</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Новое имя метода после переименования
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
&return.success;
|
||||
</para>
|
||||
</refsect1>
|
||||
<!-- No changelog: it's only in PECL. -->
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>classkit_method_rename</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
class Example {
|
||||
function foo() {
|
||||
return "foo!\n";
|
||||
}
|
||||
}
|
||||
|
||||
// Переименование метода 'foo' в 'bar'
|
||||
classkit_method_rename(
|
||||
'Example',
|
||||
'foo',
|
||||
'bar'
|
||||
);
|
||||
|
||||
// вывод переименованной функции
|
||||
echo Example::bar();
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
&example.outputs;
|
||||
<screen>
|
||||
<![CDATA[
|
||||
foo!
|
||||
]]>
|
||||
</screen>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>classkit_method_add</function></member>
|
||||
<member><function>classkit_method_copy</function></member>
|
||||
<member><function>classkit_method_redefine</function></member>
|
||||
<member><function>classkit_method_remove</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
28
reference/classkit/ini.xml
Normal file
28
reference/classkit/ini.xml
Normal file
@ -0,0 +1,28 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.2 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<section xml:id="classkit.configuration" xmlns="http://docbook.org/ns/docbook">
|
||||
&reftitle.runtime;
|
||||
&no.config;
|
||||
</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
|
||||
-->
|
32
reference/classkit/reference.xml
Normal file
32
reference/classkit/reference.xml
Normal file
@ -0,0 +1,32 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.8 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<reference xml:id="ref.classkit" xmlns="http://docbook.org/ns/docbook">
|
||||
<title>&Functions; classkit</title>
|
||||
|
||||
&reference.classkit.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:"../../../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
|
||||
-->
|
||||
|
44
reference/classkit/setup.xml
Normal file
44
reference/classkit/setup.xml
Normal file
@ -0,0 +1,44 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.2 Status: ready $ -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
|
||||
<chapter xml:id="classkit.setup">
|
||||
&reftitle.setup;
|
||||
|
||||
<section xml:id="classkit.requirements">
|
||||
&reftitle.required;
|
||||
&no.requirement;
|
||||
</section>
|
||||
|
||||
&reference.classkit.configure;
|
||||
|
||||
&reference.classkit.ini;
|
||||
|
||||
<section xml:id="classkit.resources">
|
||||
&reftitle.resources;
|
||||
&no.resource;
|
||||
</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:"../../../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/classobj/functions/interface-exists.xml
Normal file
101
reference/classobj/functions/interface-exists.xml
Normal file
@ -0,0 +1,101 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.5 Status: ready -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.interface-exists" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>interface_exists</refname>
|
||||
<refpurpose>Проверяет, определен ли интерфейс</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>interface_exists</methodname>
|
||||
<methodparam><type>string</type><parameter>interface_name</parameter></methodparam>
|
||||
<methodparam choice="opt"><type>bool</type><parameter>autoload</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Проверяет, определен ли указанный интерфейс.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>interface_name</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя интерфейса
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>autoload</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Определяет, использовать ли &link.autoload; или нет (по умолчанию нет)
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Возвращает &true; если интерфейс, заданный именем
|
||||
<parameter>interface_name</parameter> был определен, &false; в остальных случаях.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>interface_exists</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
// Проверка существования интерфейса перед его использованием
|
||||
if (interface_exists('MyInterface')) {
|
||||
class MyClass implements MyInterface
|
||||
{
|
||||
// Методы
|
||||
}
|
||||
}
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>class_exists</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
118
reference/classobj/functions/property-exists.xml
Normal file
118
reference/classobj/functions/property-exists.xml
Normal file
@ -0,0 +1,118 @@
|
||||
<?xml version="1.0" encoding="utf-8"?>
|
||||
<!-- EN-Revision: 1.7 Status: ready -->
|
||||
<!-- $Revision: 1.1 $ -->
|
||||
<refentry xml:id="function.property-exists" xmlns="http://docbook.org/ns/docbook">
|
||||
<refnamediv>
|
||||
<refname>property_exists</refname>
|
||||
<refpurpose>
|
||||
Проверяет, содержит ли объект или класс указанный атрибут
|
||||
</refpurpose>
|
||||
</refnamediv>
|
||||
<refsect1 role="description">
|
||||
&reftitle.description;
|
||||
<methodsynopsis>
|
||||
<type>bool</type><methodname>property_exists</methodname>
|
||||
<methodparam><type>mixed</type><parameter>class</parameter></methodparam>
|
||||
<methodparam><type>string</type><parameter>property</parameter></methodparam>
|
||||
</methodsynopsis>
|
||||
<para>
|
||||
Функция проверяет, существует ли атрибут <parameter>property</parameter>
|
||||
в определенном классе (и доступно ли оно из текущей области видимости).
|
||||
</para>
|
||||
<note>
|
||||
<para>
|
||||
В противоположность <function>isset</function>,
|
||||
<function>property_exists</function> возвращает &true; даже если свойство
|
||||
имеет значение &null;.
|
||||
</para>
|
||||
</note>
|
||||
</refsect1>
|
||||
<refsect1 role="parameters">
|
||||
&reftitle.parameters;
|
||||
<para>
|
||||
<variablelist>
|
||||
<varlistentry>
|
||||
<term><parameter>class</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя класса или объекта класса для проверки
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
<varlistentry>
|
||||
<term><parameter>property</parameter></term>
|
||||
<listitem>
|
||||
<para>
|
||||
Имя свойства
|
||||
</para>
|
||||
</listitem>
|
||||
</varlistentry>
|
||||
</variablelist>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="returnvalues">
|
||||
&reftitle.returnvalues;
|
||||
<para>
|
||||
Возвращает &true;, если свойство существует, &false; - если оно не существует или
|
||||
&null; в случае ошибки.
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="examples">
|
||||
&reftitle.examples;
|
||||
<para>
|
||||
<example>
|
||||
<title>Пример использования <function>property_exists</function></title>
|
||||
<programlisting role="php">
|
||||
<![CDATA[
|
||||
<?php
|
||||
|
||||
class myClass {
|
||||
public $mine;
|
||||
private $xpto;
|
||||
|
||||
static function test() {
|
||||
var_dump(property_exists('myClass', 'xpto')); // true, отсюда есть доступ к свойству
|
||||
}
|
||||
}
|
||||
|
||||
var_dump(property_exists('myClass', 'mine')); //true
|
||||
var_dump(property_exists(new myClass, 'mine')); //true
|
||||
var_dump(property_exists('myClass', 'xpto')); //false, свойство не public
|
||||
myClass::test();
|
||||
|
||||
?>
|
||||
]]>
|
||||
</programlisting>
|
||||
</example>
|
||||
</para>
|
||||
</refsect1>
|
||||
<refsect1 role="seealso">
|
||||
&reftitle.seealso;
|
||||
<para>
|
||||
<simplelist>
|
||||
<member><function>method_exists</function></member>
|
||||
</simplelist>
|
||||
</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
|
||||
-->
|
Reference in New Issue
Block a user