mirror of
https://github.com/php/doc-tr.git
synced 2026-03-24 07:12:18 +01:00
164 lines
4.5 KiB
XML
164 lines
4.5 KiB
XML
<?xml version="1.0" encoding="utf-8"?>
|
||
<!-- EN-Revision: 210d382b5b139444fe2e16a5a3211076a65ff2ba Maintainer: nilgun Status: ready -->
|
||
<refentry xml:id="function.trigger-error" xmlns="http://docbook.org/ns/docbook">
|
||
<refnamediv>
|
||
<refname>trigger_error</refname>
|
||
<refpurpose>Kullanıcı seviyesinde bir hata/uyarı/bilgi iletisi üretir
|
||
</refpurpose>
|
||
</refnamediv>
|
||
|
||
<refsect1 role="description">
|
||
&reftitle.description;
|
||
<methodsynopsis>
|
||
<type>true</type><methodname>trigger_error</methodname>
|
||
<methodparam><type>string</type><parameter>ileti</parameter></methodparam>
|
||
<methodparam choice="opt"><type>int</type><parameter>hata_seviyesi</parameter><initializer><constant>E_USER_NOTICE</constant></initializer></methodparam>
|
||
</methodsynopsis>
|
||
<para>
|
||
Bir kullanıcı hatası durumunu tetiklemek için kullanır. Yerleşik bir hata
|
||
eylemcisi ile birlikte kullanılabileceği gibi
|
||
(<function>set_error_handler</function> ile) yeni bir hata eylemcisi olarak
|
||
bildirilmiş bir kullanıcı tanımlı işlev ile birlikte de kullanılabilir.
|
||
</para>
|
||
<para>
|
||
Bu işlev çalışma anında, bir olağandışılık durumunda, belli bir yanıt
|
||
üretmek gerektiğinde çok kullanışlıdır.
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="parameters">
|
||
&reftitle.parameters;
|
||
<para>
|
||
<variablelist>
|
||
<varlistentry>
|
||
<term><parameter>ileti</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Tetiklenen hata için tasarlanmış hata iletisi. En fazla 1024 bayt
|
||
uzunluğunda olabilir. 1024 bayttan sonraki karakterler kırpılır.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
<varlistentry>
|
||
<term><parameter>hata_seviyesi</parameter></term>
|
||
<listitem>
|
||
<para>
|
||
Tetiklenen hata için tasarlanmış hata türü. Sadece
|
||
<constant>E_USER_</constant>* ailesinden sabitler belirtilebilir.
|
||
<constant>E_USER_NOTICE</constant> öntanımlıdır.
|
||
</para>
|
||
</listitem>
|
||
</varlistentry>
|
||
</variablelist>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="returnvalues">
|
||
&reftitle.returnvalues;
|
||
<para>
|
||
&return.true.always;
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="errors">
|
||
&reftitle.errors;
|
||
<para>
|
||
<parameter>hata_seviyesi</parameter> şunlardan biri değilse
|
||
<classname>ValueError</classname> oluşur:
|
||
<constant>E_USER_ERROR</constant>,
|
||
<constant>E_USER_WARNING</constant>,
|
||
<constant>E_USER_NOTICE</constant>,
|
||
<constant>E_USER_DEPRECATED</constant>.
|
||
</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.0.0</entry>
|
||
<entry>
|
||
Geçersiz bir <parameter>hata_seviyesi</parameter> belirtilirse artık
|
||
<classname>ValueError</classname> oluşuyor. Evvelce &false; dönerdi.
|
||
</entry>
|
||
</row>
|
||
</tbody>
|
||
</tgroup>
|
||
</informaltable>
|
||
</refsect1>
|
||
|
||
<refsect1 role="examples">
|
||
&reftitle.examples;
|
||
<para>
|
||
<example>
|
||
<title>- <function>trigger_error</function> örneği</title>
|
||
<para>
|
||
Daha kapsamlı bir örnek için <function>set_error_handler</function>
|
||
işlevine bakınız.
|
||
</para>
|
||
<programlisting role="php">
|
||
<![CDATA[
|
||
<?php
|
||
if ($divisor == 0) {
|
||
trigger_error("Sıfır bir bölen olamaz", E_USER_ERROR);
|
||
}
|
||
?>
|
||
]]>
|
||
</programlisting>
|
||
</example>
|
||
</para>
|
||
</refsect1>
|
||
|
||
<refsect1 role="notes">
|
||
&reftitle.notes;
|
||
<warning>
|
||
<para>
|
||
<parameter>ileti</parameter> içindeki HTML öğeleri öncelenmez. Hata
|
||
tarayıcıda gösterilecekse <function>htmlentities</function> kullanın.
|
||
</para>
|
||
</warning>
|
||
</refsect1>
|
||
|
||
<refsect1 role="seealso">
|
||
&reftitle.seealso;
|
||
<para>
|
||
<simplelist>
|
||
<member><function>error_reporting</function></member>
|
||
<member><function>set_error_handler</function></member>
|
||
<member><function>restore_error_handler</function></member>
|
||
<member><link linkend="errorfunc.constants">Hata seviyesi
|
||
sabitleri</link></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
|
||
-->
|