11<?xml version =" 1.0" encoding =" utf-8" ?>
2- <!-- EN-Revision: 4f5e2b22575131fa5e9c3004b1c874e1acb06573 Maintainer: nilgun Status: ready -->
2+ <!-- EN-Revision: c1f37a6c270aadbbb3da56a3973ffd62197adf2b Maintainer: nilgun Status: ready -->
33<refentry xml : id =" domxpath.registerphpfunctions" xmlns =" http://docbook.org/ns/docbook" xmlns : xlink =" http://www.w3.org/1999/xlink" >
44 <refnamediv >
55 <refname >DOMXPath::registerPhpFunctions</refname >
2727 <term ><parameter >sınırla</parameter ></term >
2828 <listitem >
2929 <para >
30- XPath ifadelerinde kullanmak üzere sadece belli işlevlere izin vermek için kullanılır.
30+ XPath ifadelerinde kullanmak üzere sadece belli işlevlere izin vermek
31+ için kullanılır.
3132 </para >
3233 <para >
33- Ya bir dizge (işlev ismi) ya da işlev isimlerini içeren bir dizi
34- olabilir.
34+ Değer şunlardan biri olabilir:
35+ <type >string</type > türünde bir işlev adı, işlev adlarını içeren
36+ indisli bir dizi veya anahtarları işlev isimlerinden, ilişkili
37+ değerleri <type >callable</type > türünde değerlerden oluşan bir
38+ ilişkisel dizi.
3539 </para >
3640 </listitem >
3741 </varlistentry >
4650 </para >
4751 </refsect1 >
4852
53+ <refsect1 role =" errors" xml : id =" domxpath.registerphpfunctions..errors" >
54+ &reftitle.errors;
55+ <itemizedlist >
56+ <listitem >
57+ <simpara >
58+ Geri çağırım işlevinin adı geçersiz ise
59+ <exceptionname >ValueError</exceptionname > istisnası oluşur.
60+ </simpara >
61+ </listitem >
62+ &dom.errors.compliant.common;
63+ <listitem >
64+ <simpara >
65+ Belirtilen .
66+ </simpara >
67+ </listitem >
68+ </itemizedlist >
69+ </refsect1 >
70+
71+ <refsect1 role =" changelog" >
72+ &reftitle.changelog;
73+ <informaltable >
74+ <tgroup cols =" 2" >
75+ <thead >
76+ <row >
77+ <entry >&Version; </entry >
78+ <entry >&Description; </entry >
79+ </row >
80+ </thead >
81+ <tbody >
82+ <row xml : id =" domxpath.registerphpfunctions..changelog.errors" >
83+ <entry >8.4.0</entry >
84+ <entry >
85+ Geçersiz geri çağırım işlevi adları artık
86+ <exceptionname >ValueError</exceptionname > istisnası oluşturuyor.
87+ Geri çağırım işlevi <type >callable</type > türünde değilse artık
88+ <exceptionname >TypeError</exceptionname > istisnası oluşuyor.
89+ </entry >
90+ </row >
91+ <row >
92+ <entry >8.4.0</entry >
93+ <entry >
94+ Geri çağırım işlevlerinin <type >callable</type > kısmı
95+ <parameter >sınırla</parameter > değeri olarak bir ilişkisel diziye
96+ belirtilebiliyor.
97+ </entry >
98+ </row >
99+ </tbody >
100+ </tgroup >
101+ </informaltable >
102+ </refsect1 >
103+
49104 <refsect1 role =" examples" >
50105 &reftitle.examples;
51106 <para >
79134 </para >
80135 <para >
81136 <example >
82- <title >- <methodname >DOMXPath::registerPHPFunctions </methodname > ve <literal >php:functionString</literal > kullanımı</title >
137+ <title >- <methodname >DOMXPath::registerPhpFunctions </methodname > ve <literal >php:functionString</literal > kullanımı</title >
83138 <programlisting role =" php" >
84139<![CDATA[
85140<?php
@@ -92,7 +147,7 @@ $xpath = new DOMXPath($doc);
92147$xpath->registerNamespace("php", "http://php.net/xpath");
93148
94149// PHP işlevlerini tanıt (sınırlama yok)
95- $xpath->registerPHPFunctions ();
150+ $xpath->registerPhpFunctions ();
96151
97152// substr işlevini book/title üzerinde kullan
98153$nodes = $xpath->query('//book[php:functionString("substr", title, 0, 3) = "PHP"]');
@@ -119,7 +174,7 @@ Jenny Smythe tarafından yazılan 'PHP Secrets'
119174 </para >
120175 <para >
121176 <example >
122- <title >- <methodname >DOMXPath::registerPHPFunctions </methodname > ve <literal >php:function</literal > kullanımı</title >
177+ <title >- <methodname >DOMXPath::registerPhpFunctions </methodname > ve <literal >php:function</literal > kullanımı</title >
123178 <programlisting role =" php" >
124179<![CDATA[
125180<?php
@@ -132,7 +187,7 @@ $xpath = new DOMXPath($doc);
132187$xpath->registerNamespace("php", "http://php.net/xpath");
133188
134189// PHP işlevlerini tanıt (sadece birden_fazla işlevi)
135- $xpath->registerPHPFunctions ("birden_fazla");
190+ $xpath->registerPhpFunctions ("birden_fazla");
136191
137192function birden_fazla($nodes) {
138193 // Bir yazardan fazla varsa true dönsün
@@ -158,6 +213,36 @@ PHP Basics
158213 </screen >
159214 </example >
160215 </para >
216+ <para >
217+ <example >
218+ <title >- Geri çağırımlı <methodname >DOMXPath::registerPhpFunctions</methodname ></title >
219+ <programlisting role =" php" >
220+ <![CDATA[
221+ <?php
222+ $doc = new DOMDocument;
223+ $doc->load('examples/book-simple.xml');
224+
225+ $xpath = new DOMXPath($doc);
226+
227+ // php: isim alanını tanıt (gerekli)
228+ $xpath->registerNamespace("php", "http://php.net/xpath");
229+
230+ // PHP işlevlerini tanıt (yalnızca birden_fazla)
231+ $xpath->registerPhpFunctions(["birden_fazla" => fn ($nodes) => count($nodes) > 1]);
232+
233+ // Birden fazla yazarlı kitapları ayır
234+ $books = $xpath->query('//book[php:function("birden_fazla", author)]');
235+
236+ echo "Birden fazla yazarlı kitaplar:\n";
237+ foreach ($books as $book) {
238+ echo $book->getElementsByTagName("title")->item(0)->nodeValue . "\n";
239+ }
240+
241+ ?>
242+ ]]>
243+ </programlisting >
244+ </example >
245+ </para >
161246 </refsect1 >
162247
163248 <refsect1 role =" seealso" >
@@ -167,6 +252,7 @@ PHP Basics
167252 <member ><methodname >DOMXPath::registerNamespace</methodname ></member >
168253 <member ><methodname >DOMXPath::query</methodname ></member >
169254 <member ><methodname >DOMXPath::evaluate</methodname ></member >
255+ <member ><methodname >XSLTProcessor::registerPHPFunctions</methodname ></member >
170256 </simplelist >
171257 </para >
172258 </refsect1 >
0 commit comments