1
0
mirror of https://github.com/php/doc-ja.git synced 2026-03-24 07:02:08 +01:00
Files
archived-doc-ja/reference/libxml/functions/libxml-set-external-entity-loader.xml
KentarouTakeda bede85bf76 戻り値型 bool→true 同期・return type sync 40 件 (#357)
## 翻訳内容

### reference/image(34件)— return type アノテーション修正

- reference/image/functions/imageresolution.xml — 戻り値型を `array|bool` から `array|true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagealphablending.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imageantialias.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagearc.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagechar.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecharup.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecolordeallocate.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecolormatch.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecopy.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecopymerge.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecopymergegray.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecopyresampled.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagecopyresized.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagedashedline.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagedestroy.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imageellipse.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagefill.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagefilledarc.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagefilledellipse.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagefilledrectangle.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagefilltoborder.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imageflip.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagegammacorrect.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagelayereffect.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imageline.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagerectangle.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagesavealpha.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagesetbrush.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagesetclip.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagesetpixel.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagesetthickness.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagesettile.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagestring.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214
- reference/image/functions/imagestringup.xml — 戻り値型を `bool` から `true` に修正
  1. php/doc-en@fcd9214

### 独立ファイル

- reference/array/functions/array-multisort.xml — 戻り値型を `bool` から `true` に変更、8.5.0 changelog 追加
  1. php/doc-en@5b76466
- reference/fileinfo/functions/finfo-close.xml — 戻り値型を `true` に変更、NOP化・非推奨の changelog 追加
  1. php/doc-en@fcd9214
  2. php/doc-en@34bd6f0
  3. php/doc-en@5b76466
- reference/ftp/functions/ftp-set-option.xml — 戻り値型を `true` に変更、errors セクション追加、8.5.0 changelog 追加
  1. php/doc-en@fcd9214
  2. php/doc-en@5b76466
- reference/sem/functions/shm-detach.xml — 戻り値型を `bool` から `true` に変更、8.5.0 changelog 追加
  1. php/doc-en@5b76466
- reference/pcntl/functions/pcntl-exec.xml — 戻り値型を `bool` から `false` に修正、エンティティエンコーディング修正
  1. php/doc-en@fcd9214
- reference/libxml/functions/libxml-set-external-entity-loader.xml — 戻り値型を `bool` から `true` に変更、8.5.0 changelog 追加
  1. php/doc-en@5b76466
2026-03-16 21:02:10 +09:00

191 lines
5.5 KiB
XML

<?xml version="1.0" encoding="utf-8"?>
<!-- $Revision$ -->
<!-- EN-Revision: 5b7646656eb183ea568b8261d6d87a10a1b961c7 Maintainer: takagi Status: ready -->
<!-- Credits: mumumu -->
<refentry xml:id="function.libxml-set-external-entity-loader" xmlns="http://docbook.org/ns/docbook" xmlns:xlink="http://www.w3.org/1999/xlink">
<refnamediv>
<refname>libxml_set_external_entity_loader</refname>
<refpurpose>デフォルトの外部エンティティローダーを変更する</refpurpose>
</refnamediv>
<refsect1 role="description">
&reftitle.description;
<methodsynopsis>
<type>true</type><methodname>libxml_set_external_entity_loader</methodname>
<methodparam><type class="union"><type>callable</type><type>null</type></type><parameter>resolver_function</parameter></methodparam>
</methodsynopsis>
<para>
デフォルトの外部エンティティローダーを変更します。
たとえ <constant>LIBXML_NOENT</constant> が個別のXMLの操作に設定されている場合でも、
XXE攻撃を避けるために、任意の外部エンティティの展開を抑制するために使うことができます。
また、 <function>libxml_disable_entity_loader</function> を呼び出すことよりも、この関数を呼び出すほうが通常は好ましいです。
</para>
</refsect1>
<refsect1 role="parameters">
&reftitle.parameters;
<variablelist>
<varlistentry>
<term><parameter>resolver_function</parameter></term>
<listitem>
<para>
次のシグネチャを持つ <type>callable</type> を指定します。:
<methodsynopsis>
<type class="union"><type>resource</type><type>string</type><type>null</type></type><methodname><replaceable>resolver</replaceable></methodname>
<methodparam><type class="union"><type>string</type><type>null</type></type><parameter>public_id</parameter></methodparam>
<methodparam><type>string</type><parameter>system_id</parameter></methodparam>
<methodparam><type>array</type><parameter>context</parameter></methodparam>
</methodsynopsis>
<variablelist>
<varlistentry>
<term><parameter>public_id</parameter></term>
<listitem>
<simpara>
パブリック ID
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>system_id</parameter></term>
<listitem>
<simpara>
システムID
</simpara>
</listitem>
</varlistentry>
<varlistentry>
<term><parameter>context</parameter></term>
<listitem>
<simpara>
4つのキーを持つ配列。
キーは <literal>"directory"</literal>, <literal>"intSubName"</literal>,
<literal>"extSubURI"</literal>, <literal>"extSubSystem"</literal> です。
</simpara>
</listitem>
</varlistentry>
</variablelist>
この <type>callable</type> は、
リソースまたはリソースをオープンできる文字列あるいは
&null; でなければなりません。&null; を返す場合、エンティティ参照の解決は失敗します。
</para>
</listitem>
</varlistentry>
</variablelist>
</refsect1>
<refsect1 role="returnvalues">
&reftitle.returnvalues;
<para>
&return.true.always;
</para>
</refsect1>
<refsect1 role="changelog">
&reftitle.changelog;
<informaltable>
<tgroup cols="2">
<thead>
<row>
<entry>&Version;</entry>
<entry>&Description;</entry>
</row>
</thead>
<tbody>
<row>
<entry>8.5.0</entry>
<entry>
戻り値の型が、&true; になりました。これより前のバージョンでは、<type>bool</type> でした。
</entry>
</row>
</tbody>
</tgroup>
</informaltable>
</refsect1>
<refsect1 role="examples">
&reftitle.examples;
<para>
<example>
<title><function>libxml_set_external_entity_loader</function> の例</title>
<programlisting role="php">
<![CDATA[
<?php
$xml = <<<XML
<!DOCTYPE foo PUBLIC "-//FOO/BAR" "http://example.com/foobar">
<foo>bar</foo>
XML;
$dtd = <<<DTD
<!ELEMENT foo (#PCDATA)>
DTD;
libxml_set_external_entity_loader(
function ($public, $system, $context) use($dtd) {
var_dump($public);
var_dump($system);
var_dump($context);
$f = fopen("php://temp", "r+");
fwrite($f, $dtd);
rewind($f);
return $f;
}
);
$dd = new DOMDocument;
$r = $dd->loadXML($xml);
var_dump($dd->validate());
?>
]]>
</programlisting>
&example.outputs;
<screen>
<![CDATA[
string(10) "-//FOO/BAR"
string(25) "http://example.com/foobar"
array(4) {
["directory"] => NULL
["intSubName"] => NULL
["extSubURI"] => NULL
["extSubSystem"] => NULL
}
bool(true)
]]>
</screen>
</example>
</para>
</refsect1>
<refsect1 role="seealso">
&reftitle.seealso;
<para>
<simplelist>
<member><function>libxml_disable_entity_loader</function></member>
<member><function>libxml_get_external_entity_loader</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:"~/.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
-->