<?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>Kommentare zu: Strings bequem formatieren</title>
	<atom:link href="http://yoda.neun12.de/artikel-63/feed" rel="self" type="application/rss+xml" />
	<link>http://yoda.neun12.de/artikel-63</link>
	<description>Debuggen du musst</description>
	<lastBuildDate>Sat, 25 Jul 2015 23:05:49 +0000</lastBuildDate>
		<sy:updatePeriod>hourly</sy:updatePeriod>
		<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=3.9.40</generator>
	<item>
		<title>Von: Templating mit WordPress &#8211; Yoda Condition</title>
		<link>http://yoda.neun12.de/artikel-63#comment-28</link>
		<dc:creator><![CDATA[Templating mit WordPress &#8211; Yoda Condition]]></dc:creator>
		<pubDate>Sat, 26 May 2012 23:37:24 +0000</pubDate>
		<guid isPermaLink="false">http://yoda.neun12.de/?p=63#comment-28</guid>
		<description><![CDATA[[...] ersten Teil hatte ich einen Formatter vorgestellt mit dem ich auf vergleichsweise einfache und flexible Art aus Daten eine Ausgabe machen kann. Im [...]]]></description>
		<content:encoded><![CDATA[<p>[...] ersten Teil hatte ich einen Formatter vorgestellt mit dem ich auf vergleichsweise einfache und flexible Art aus Daten eine Ausgabe machen kann. Im [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Trenne Ausgabe und Logik &#8211; Yoda Condition</title>
		<link>http://yoda.neun12.de/artikel-63#comment-25</link>
		<dc:creator><![CDATA[Trenne Ausgabe und Logik &#8211; Yoda Condition]]></dc:creator>
		<pubDate>Sun, 01 Apr 2012 02:23:07 +0000</pubDate>
		<guid isPermaLink="false">http://yoda.neun12.de/?p=63#comment-25</guid>
		<description><![CDATA[[...] Yoda Condition Debuggen du musst   Gehe zum Beitrag AboutKontaktImpressum     &#171; Strings bequem formatieren [...]]]></description>
		<content:encoded><![CDATA[<p>[...] Yoda Condition Debuggen du musst   Gehe zum Beitrag AboutKontaktImpressum     &laquo; Strings bequem formatieren [...]</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: Ralf</title>
		<link>http://yoda.neun12.de/artikel-63#comment-24</link>
		<dc:creator><![CDATA[Ralf]]></dc:creator>
		<pubDate>Tue, 20 Mar 2012 06:56:28 +0000</pubDate>
		<guid isPermaLink="false">http://yoda.neun12.de/?p=63#comment-24</guid>
		<description><![CDATA[Ähmm ne. Ich würde eine WordPressException schreiben die sich um das Geraffel kümmert. Da ich es bisher noch nicht gemacht habe, habe ich einfach eine normale Exception verwendet.
Die __toString()-Methode hat auch ganz andere Aufgaben. Im Prinzip ist es ein Type-Casting. Deswegen würde ich es nicht &quot;missbrauchen&quot; wollen.]]></description>
		<content:encoded><![CDATA[<p>Ähmm ne. Ich würde eine WordPressException schreiben die sich um das Geraffel kümmert. Da ich es bisher noch nicht gemacht habe, habe ich einfach eine normale Exception verwendet.<br />
Die __toString()-Methode hat auch ganz andere Aufgaben. Im Prinzip ist es ein Type-Casting. Deswegen würde ich es nicht &#8220;missbrauchen&#8221; wollen.</p>
]]></content:encoded>
	</item>
	<item>
		<title>Von: kaiser</title>
		<link>http://yoda.neun12.de/artikel-63#comment-23</link>
		<dc:creator><![CDATA[kaiser]]></dc:creator>
		<pubDate>Sun, 18 Mar 2012 17:46:24 +0000</pubDate>
		<guid isPermaLink="false">http://yoda.neun12.de/?p=63#comment-23</guid>
		<description><![CDATA[Hey Ralf,

wie immer ein schöner, gut durchdachter und interessanter Artikel. Schau Dir vielleicht einmal die native Php-Funktion &lt;code&gt;strtr()&lt;/code&gt; an :) 

Eine andere php 5.x+ Methode könnte Dir auch Spaß machen: &lt;code&gt;__toString();&lt;/code&gt;

An Stelle der Exceptions würde ich folgendes Konstrukt innerhalb von &lt;code&gt;__toString()&lt;/code&gt; vorschlagen. Einfach vorher &lt;code&gt;new WP_Error( &#039;code&#039;, &#039;message&#039;, $data );&lt;/code&gt; setzen und dann so auswerten:

&lt;code&gt;
	public function __toString()
	{
		$output = self :: sprintf();

		if ( is_wp_error( $output ) )
		{
			// No error message for Guests or Subscribers or anyone below admin capability &quot;manage_options&quot;
			// Assuming that no one has activated caching plugins when debugging
			// and not set WP_DEBUG to TRUE on a live site
			if ( 
				! is_user_logged_in()
				AND ! current_user_can( &#039;manage_options&#039; ) 
				AND ( ! defined( &#039;WP_DEBUG&#039; ) OR ! WP_DEBUG )
			)
				return &#039;&#039;;

			return &quot;{$output-&gt;get_error_message( &#039;no_attachment&#039; )}: {$output-&gt;get_error_data()}&quot;;
		}

		return $output;
	}
&lt;/code&gt;

Beste Grüße!]]></description>
		<content:encoded><![CDATA[<p>Hey Ralf,</p>
<p>wie immer ein schöner, gut durchdachter und interessanter Artikel. Schau Dir vielleicht einmal die native Php-Funktion <code>strtr()</code> an <img src="http://yoda.neun12.de/wp-includes/images/smilies/icon_smile.gif" alt=":)" class="wp-smiley" />  </p>
<p>Eine andere php 5.x+ Methode könnte Dir auch Spaß machen: <code>__toString();</code></p>
<p>An Stelle der Exceptions würde ich folgendes Konstrukt innerhalb von <code>__toString()</code> vorschlagen. Einfach vorher <code>new WP_Error( 'code', 'message', $data );</code> setzen und dann so auswerten:</p>
<p><code><br />
	public function __toString()<br />
	{<br />
		$output = self :: sprintf();</p>
<p>		if ( is_wp_error( $output ) )<br />
		{<br />
			// No error message for Guests or Subscribers or anyone below admin capability "manage_options"<br />
			// Assuming that no one has activated caching plugins when debugging<br />
			// and not set WP_DEBUG to TRUE on a live site<br />
			if (<br />
				! is_user_logged_in()<br />
				AND ! current_user_can( 'manage_options' )<br />
				AND ( ! defined( 'WP_DEBUG' ) OR ! WP_DEBUG )<br />
			)<br />
				return '';</p>
<p>			return "{$output-&gt;get_error_message( 'no_attachment' )}: {$output-&gt;get_error_data()}";<br />
		}</p>
<p>		return $output;<br />
	}<br />
</code></p>
<p>Beste Grüße!</p>
]]></content:encoded>
	</item>
</channel>
</rss>
