Files
php-doc-ru/reference/spl/functions/spl-autoload.xml
2024-03-22 16:47:26 +03:00

114 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: 61a690b59cad3464ab823f6d0a2b5a16c9ca584c 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>
Со значением по умолчанию функция ищет в списке
include_path имена файлов,
которые состоят из имени класса в нижнем регистре
и расширения .inc и .php.
</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
-->