<?xml version="1.0" encoding="UTF-8"?><rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:dc="http://purl.org/dc/elements/1.1/"
	xmlns:atom="http://www.w3.org/2005/Atom"
	xmlns:sy="http://purl.org/rss/1.0/modules/syndication/"
		>
<channel>
	<title>Comments on: PHP de hata fırlatmak ( Exception kullanımı )</title>
	<atom:link href="http://www.ersindogan.com/php-web-programlama/php-de-hata-firlatmak/feed" rel="self" type="application/rss+xml" />
	<link>http://www.ersindogan.com/php-web-programlama/php-de-hata-firlatmak</link>
	<description></description>
	<lastBuildDate>Thu, 26 Jan 2012 09:56:05 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=007</generator>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
		<item>
		<title>By: engin</title>
		<link>http://www.ersindogan.com/php-web-programlama/php-de-hata-firlatmak/comment-page-1#comment-549</link>
		<dc:creator>engin</dc:creator>
		<pubDate>Sat, 14 Jan 2012 17:37:23 +0000</pubDate>
		<guid isPermaLink="false">http://www.ersindogan.com/?p=112#comment-549</guid>
		<description>teşekkür ederim hocam sağolun.</description>
		<content:encoded><![CDATA[<p>teşekkür ederim hocam sağolun.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: Ersin</title>
		<link>http://www.ersindogan.com/php-web-programlama/php-de-hata-firlatmak/comment-page-1#comment-548</link>
		<dc:creator>Ersin</dc:creator>
		<pubDate>Sat, 14 Jan 2012 15:53:50 +0000</pubDate>
		<guid isPermaLink="false">http://www.ersindogan.com/?p=112#comment-548</guid>
		<description>Php nin az bölümlerinde try catch blogunu kullanabiliyoruz, bu yüzden bir istisna (exception) fırlatmayan (throw) yerlerde kendi istisna yöntemimizi oluşturmamız gerekiyor. Şöyle ki :

&lt;?php

class sinif

{

  function dosya() {
     $content = file_get_contents();
     if(empty($content)) throw new Exception(&quot;İçerik alınamadı&quot;);
     return $content;
  }
}
$sinif = new sinif();

try {
 $icerik = $sinif-&gt;dosya();
}catch(Exception $e){
   echo &quot;Hata oldu. Hata Mesajı : &quot;.$e-&gt;getMessage();
}
?&gt;

Bu mantık ile kendi try catch yapımızı oluşturabiliriz.</description>
		<content:encoded><![CDATA[<p>Php nin az bölümlerinde try catch blogunu kullanabiliyoruz, bu yüzden bir istisna (exception) fırlatmayan (throw) yerlerde kendi istisna yöntemimizi oluşturmamız gerekiyor. Şöyle ki :</p>
<p>< ?php</p>
<p>class sinif</p>
<p>{</p>
<p>  function dosya() {<br />
     $content = file_get_contents();<br />
     if(empty($content)) throw new Exception("İçerik alınamadı");<br />
     return $content;<br />
  }<br />
}<br />
$sinif = new sinif();</p>
<p>try {<br />
 $icerik = $sinif->dosya();<br />
}catch(Exception $e){<br />
   echo &#8220;Hata oldu. Hata Mesajı : &#8220;.$e->getMessage();<br />
}<br />
?></p>
<p>Bu mantık ile kendi try catch yapımızı oluşturabiliriz.</p>
]]></content:encoded>
	</item>
	<item>
		<title>By: engin</title>
		<link>http://www.ersindogan.com/php-web-programlama/php-de-hata-firlatmak/comment-page-1#comment-545</link>
		<dc:creator>engin</dc:creator>
		<pubDate>Sat, 14 Jan 2012 15:42:57 +0000</pubDate>
		<guid isPermaLink="false">http://www.ersindogan.com/?p=112#comment-545</guid>
		<description>Ersin hocam merhaba, bu konuda birşey sormak istiyorum size. bu try catch olayını bir sınıf içine nasıl ekleyebiliriz? mesela

&lt;?php

class sinif

{

function dosya() {

file_get_contents();

}

function query() {

mysql_query();

return $veri

}

function isimyaz() {

echo $this-&gt;isim;

}

}

?&gt;

böyle uzayıp giden bir sınıfımız var. sınıfta __construct __destruct falan da var diyelim. fonksiyonlar veri yada truee false döndürüyor. buraya mantıklı bir şekilde nasıl eklenir try catch? bir örnek verebilirseniz sevinirim hocam.</description>
		<content:encoded><![CDATA[<p>Ersin hocam merhaba, bu konuda birşey sormak istiyorum size. bu try catch olayını bir sınıf içine nasıl ekleyebiliriz? mesela</p>
<p>&lt;?php</p>
<p>class sinif</p>
<p>{</p>
<p>function dosya() {</p>
<p>file_get_contents();</p>
<p>}</p>
<p>function query() {</p>
<p>mysql_query();</p>
<p>return $veri</p>
<p>}</p>
<p>function isimyaz() {</p>
<p>echo $this-&gt;isim;</p>
<p>}</p>
<p>}</p>
<p>?&gt;</p>
<p>böyle uzayıp giden bir sınıfımız var. sınıfta __construct __destruct falan da var diyelim. fonksiyonlar veri yada truee false döndürüyor. buraya mantıklı bir şekilde nasıl eklenir try catch? bir örnek verebilirseniz sevinirim hocam.</p>
]]></content:encoded>
	</item>
</channel>
</rss>

