1
0
mirror of https://github.com/php/doc-ru.git synced 2026-04-23 23:38:07 +02:00
Files
archived-doc-ru/reference/spl/functions/spl-autoload.xml
T
Mikhail Alferov b3aa94daf1 Updated to English (#967)
* Update to English incompatible.xml

* Update to English variables.xml

* Update goto.xml

* Update to English class-alias.xml

* Update to English spl-autoload-register.xml

Слово true стало переменной &true; до изменения в англ. версии; обновление только номера ревизии

* Update to English spl-autoload.xml

* Update to English configure.xml

* Update to English getarchiveflag.xml

* Update to English database.xml
2024-04-13 04:16:55 +03:00

114 lines
3.7 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- EN-Revision: 450d2085da9bba991afb9c68d9c94fc06a67a8a7 Maintainer: rjhdby Status: ready -->
<!-- Reviewed: no -->
<refentry xml:id="function.spl-autoload" xmlns="http://docbook.org/ns/docbook">
<refnamediv>
<refname>spl_autoload</refname>
<refpurpose>Выступает в роли функции по умолчанию для функций __autoload()</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>void</type><methodname>spl_autoload</methodname>
<methodparam><type>string</type><parameter>class</parameter></methodparam>
<methodparam choice="opt"><type class="union"><type>string</type><type>null</type></type><parameter>file_extensions</parameter><initializer>&null;</initializer></methodparam>
</methodsynopsis>
<para>
Назначение функции — быть функцией по умолчанию для автозагрузки классов,
как функция <function>__autoload</function>.
PHP будет вызывать функцию <function>spl_autoload</function>
каждый раз, когда вызывалась функция <function>__autoload</function>,
если другие автозагрузчики не регистрировались
и функцию <function>spl_autoload_register</function> вызвали без аргументов.
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<para>
<variablelist>
<varlistentry>
<term><parameter>class</parameter></term>
<listitem>
<para>
Имя класса (и пространства имён), которое требуется загрузить.
</para>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>file_extensions</parameter></term>
<listitem>
<para>
По умолчанию функция проверяет пути директивы
<link linkend="ini.include-path">include_path</link> на наличие имён файлов,
которые состоят из имени класса в нижнем регистре
и расширения <literal>.inc</literal> или <literal>.php</literal>.
</para>
</listitem>
</varlistentry>
</variablelist>
</para>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.void;
</para>
</refsect1>
<refsect1 role="errors">
&reftitle.errors;
<para>
Функция выбрасывает исключение <classname>LogicException</classname>,
если не смогла найти класс и не регистрировались другие автозагрузчики.
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<para>
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.0.0</entry>
<entry>
Параметр <parameter>file_extensions</parameter> теперь принимает
значение null.
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</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:"~/.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
-->