<?xml version="1.0" encoding="UTF-8"?>
<rss version="2.0"
	xmlns:content="http://purl.org/rss/1.0/modules/content/"
	xmlns:wfw="http://wellformedweb.org/CommentAPI/"
	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/"
	xmlns:slash="http://purl.org/rss/1.0/modules/slash/"
	>

<channel>
	<title>Benjamin Mock &#187; codeigniter</title>
	<atom:link href="http://benjaminmock.de/tag/codeigniter/feed/" rel="self" type="application/rss+xml" />
	<link>http://benjaminmock.de</link>
	<description>web &#38; mobile development</description>
	<lastBuildDate>Mon, 06 Sep 2010 00:05:09 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.8.4</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Eclipse Autocomplete für CodeIgniter</title>
		<link>http://benjaminmock.de/eclipse-autocomplete-fuer-codeigniter/</link>
		<comments>http://benjaminmock.de/eclipse-autocomplete-fuer-codeigniter/#comments</comments>
		<pubDate>Sat, 24 Jul 2010 16:24:13 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[autocomplete]]></category>
		<category><![CDATA[codeigniter]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=254</guid>
		<description><![CDATA[Ich verwende für so ziemlich alle meine Programmierarbeiten die Eclipse IDE. Leider hatte ich bisher noch keinen Weg gekannt das Autocomplete für CodeIgniter-Projekte zu aktivieren. Die Dokumentation von CodeIgniter ist zwar richtig gut, dennoch kostet das Nachschlagen seltener verwendeter Methoden doch immer recht viel Zeit. Ein Autocomplete ist für die CodeIgniter Methoden ist daher eine [...]]]></description>
			<content:encoded><![CDATA[<p>Ich verwende für so ziemlich alle meine Programmierarbeiten die Eclipse IDE. Leider hatte ich bisher noch keinen Weg gekannt das Autocomplete für CodeIgniter-Projekte zu aktivieren. Die Dokumentation von CodeIgniter ist zwar richtig gut, dennoch kostet das Nachschlagen seltener verwendeter Methoden doch immer recht viel Zeit. Ein Autocomplete ist für die CodeIgniter Methoden ist daher eine echte Erleichterung. <a href="http://www.gostomski.co.uk/codeigniter/getting-full-auto-complete-with-codeigniter-in-eclipse">Damian Gostomski</a> erklärt in diesem Post wie es geht. Auch wenn man das Projekt cleanen muss und Eclipse neustarten muss &#8211; irgendwann funktioniert es. Also am besten einfach mal austesten:</p>
<p>1) In system/codeigniter/Base5.php (bzw. Base4.php) am Ende des Konstruktors den folgenden Code einbinden:</p>
<p><code><br />
if(false) { // eclipse autocomplete<br />
			$agent = new CI_User_agent();<br />
			$benchmark = new CI_Benchmark();<br />
			$calendar = new CI_Calendar();<br />
			$cart = new CI_Cart();<br />
			$config = new CI_Config();<br />
			$db = new CI_DB_active_record();<br />
			$email = new CI_Email();<br />
			$encrypt = new CI_Encrypt();<br />
			$form_validation = new CI_Form_validation();<br />
			$ftp = new CI_FTP();<br />
			$image_lib = new CI_Image_lib();<br />
			$input = new CI_Input();<br />
			$lang = new CI_Language();<br />
			$output = new CI_Output();<br />
			$pagination = new CI_Pagination();<br />
			$parser = new CI_Parser();<br />
			$session = new CI_Session();<br />
			$table = new CI_Table();<br />
			$trackback = new CI_Trackback();<br />
			$typography = new CI_Typography();<br />
			$unit = new CI_Unit_test();<br />
			$upload = new CI_Upload();<br />
			$uri = new CI_URI();<br />
			$xmlrpc = new CI_Xmlrpc();<br />
			$xmlrpcs = new CI_Xmlrpcs();<br />
			$zip = new CI_Zip();<br />
		}<br />
</code></p>
<p>2) Project -> clean<br />
3) Eclipse neu starten<br />
4) falls das Autocomplete nicht erscheint den Shortcut Strg + Leer testen</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/eclipse-autocomplete-fuer-codeigniter/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Validation-Library Probleme mit PHP 4</title>
		<link>http://benjaminmock.de/codeigniter-validation-library-probleme-mit-php-4/</link>
		<comments>http://benjaminmock.de/codeigniter-validation-library-probleme-mit-php-4/#comments</comments>
		<pubDate>Thu, 22 Oct 2009 10:53:00 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=185</guid>
		<description><![CDATA[Die CodeIgniter-Validation-Library zum Überprüfen von Formularen hat mit PHP 4 ein Problem.
Wer die Fehlermeldung

Message: Undefined property: ...

in seiner View erhält kann sich mit 

$data['this'] = $this;

 im Controller behelfen. So wird das $this in der View erreichbar und somit sind auch die Validation-Values zugreifbar.
]]></description>
			<content:encoded><![CDATA[<p>Die CodeIgniter-Validation-Library zum Überprüfen von Formularen hat mit PHP 4 ein Problem.</p>
<p>Wer die Fehlermeldung</p>
<pre language="php">
Message: Undefined property: ...
</pre>
<p>in seiner View erhält kann sich mit </p>
<pre language="php">
$data['this'] = $this;
</pre>
<p> im Controller behelfen. So wird das <b>$this</b> in der View erreichbar und somit sind auch die Validation-Values zugreifbar.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/codeigniter-validation-library-probleme-mit-php-4/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mischen von Query-Strings und URL-Segmenten</title>
		<link>http://benjaminmock.de/mischen-von-query-strings-und-url-segmenten/</link>
		<comments>http://benjaminmock.de/mischen-von-query-strings-und-url-segmenten/#comments</comments>
		<pubDate>Tue, 21 Jul 2009 16:07:54 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[query_string]]></category>
		<category><![CDATA[uri_protocol]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=152</guid>
		<description><![CDATA[CodeIgniter ist auf saubere URLs ausgelegt. Das heißt, dass Daten entweder per post durch Formulare oder per URL-Segment übergeben werden. Ein Zugriff auf das $_GET-Array ist in der Standardkonfiguration nicht vorgesehen. Dennoch kann es nötig sein eben dieses $_GET-Array zu nutzen. Eine Suchfunktion kann zum Beispiel ein Grund dafür sein. Zwar könnte der Suchstring auch [...]]]></description>
			<content:encoded><![CDATA[<p>CodeIgniter ist auf saubere URLs ausgelegt. Das heißt, dass Daten entweder per post durch Formulare oder per URL-Segment übergeben werden. Ein Zugriff auf das <b>$_GET</b>-Array ist in der Standardkonfiguration nicht vorgesehen. Dennoch kann es nötig sein eben dieses <b>$_GET</b>-Array zu nutzen. Eine Suchfunktion kann zum Beispiel ein Grund dafür sein. Zwar könnte der Suchstring auch mit post aus dem Formular übergeben werden, jedoch gäbe es keine Ergebnis-URLs, die z.B. vom Benutzer kopiert werden könnten. Entweder man kodiert den Suchstring mit base64 und nutzt diesen dann als URL Segment, so dass eindeutige URLs entstehen für alle Suchanfragen, allerdings ist diese URL dann natürlich nicht mehr lesbar. Will man lesbare URLs, muss man zwangsläufig auf die <b>Get-Methode</b> zurückgreifen.</p>
<p>Dazu setzt man in <b>system/application/config/config.php</b> den Wert von uri_protocol von AUTO auf PATH_INFO.</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'uri_protocol'</span><span style="color: #009900;">&#93;</span>	<span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;PATH_INFO&quot;</span><span style="color: #339933;">;</span></pre></div></div>

<p>In den Controllern, in denen nun das $_GET-Array genutzt werden soll muss folgende Zeile in den Konstruktor:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">parse_str</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'QUERY_STRING'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">,</span><span style="color: #000088;">$_GET</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Damit kann dann in diesen Controllern ganz normal auf $_GET zugegriffen werden. Dennoch bleiben auch die URL-Segmente aktiviert und können weiter genutzt werden.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/mischen-von-query-strings-und-url-segmenten/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter error reporting / logging</title>
		<link>http://benjaminmock.de/codeigniter-error-reporting-logging/</link>
		<comments>http://benjaminmock.de/codeigniter-error-reporting-logging/#comments</comments>
		<pubDate>Mon, 20 Jul 2009 20:11:36 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[error_reporting]]></category>
		<category><![CDATA[fehler]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=149</guid>
		<description><![CDATA[CodeIgniter wurde so entwickelt, dass es auf möglichst vielen Servern ohne Probleme läuft. Daher wird die Serverumgebung als unbekannt vorausgesetzt. Einstellungen wie display_error werden daher nicht beachtet. Vielmehr wird bei jedem Seitenaufruf die PHP-Funktion error_reporting aufgerufen. Wer die Einstellungen von error_reporting aber in der config.php sucht, wird vergeblich suchen. Eingestellt wird das error_reporting in der [...]]]></description>
			<content:encoded><![CDATA[<p>CodeIgniter wurde so entwickelt, dass es auf möglichst vielen Servern ohne Probleme läuft. Daher wird die Serverumgebung als unbekannt vorausgesetzt. Einstellungen wie <i>display_error</i> werden daher nicht beachtet. Vielmehr wird bei jedem Seitenaufruf die PHP-Funktion <i>error_reporting</i> aufgerufen. Wer die Einstellungen von error_reporting aber in der config.php sucht, wird vergeblich suchen. Eingestellt wird das error_reporting in der index.php im root-Verzeichnis.</p>
<p>Für den Test- und Entwicklungsbetrieb eignet sich</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">E_ALL</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Für den Produktivbetrieb, sollte diese Einstellung aber auf jeden Fall in</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #990000;">error_reporting</span><span style="color: #009900;">&#40;</span>0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>geändert werden. Generell sollten zwar so wenig Fehler wie möglich auftreten, leider gibt es aber doch immer wieder Unvorhersehbarkeiten, die durch das Error Reporting sensible Daten aufdecken könnten.</p>
<p>Allerdings ist es allein mit dem Error Reporting noch nicht getan, denn Datenbankfehler werden dennoch angezeigt. Um auch diese im Produktivbetrieb auszuschalten muss in  <b>system/application/database.php</b></p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'db_debug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">TRUE</span><span style="color: #339933;">;</span></pre></div></div>

<p>in</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$db</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'default'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'db_debug'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">FALSE</span><span style="color: #339933;">;</span></pre></div></div>

<p>geändert werden. </p>
<p>Zwei einfache Handgriffe, die in jedem Fall zur Sicherheit der Applikation und des Servers beitragen und niemals vergessen werden sollten. Am besten aktiviert man, wenn man schon dabei ist in <b>system/application/config.php</b> das <b>Fehler Logging</b>. Dazu wird</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'log_threshold'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span></pre></div></div>

<p>auf</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'log_threshold'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">1</span><span style="color: #339933;">;</span></pre></div></div>

<p>gesetzt. So werden alle aufgetretenen PHP-Fehler in <b>system/logs/</b> geloggt.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/codeigniter-error-reporting-logging/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Codeigniter imagettftext() Problem &#8211; Could not read font</title>
		<link>http://benjaminmock.de/codeigniter-imagettftext-problem/</link>
		<comments>http://benjaminmock.de/codeigniter-imagettftext-problem/#comments</comments>
		<pubDate>Tue, 23 Jun 2009 13:18:50 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[bild]]></category>
		<category><![CDATA[bug]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[imagettftext]]></category>
		<category><![CDATA[schrift]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=101</guid>
		<description><![CDATA[Wer mit Codeigniter (1.7.1) und der PHP-Funktion imagettftext() versucht Text in ein Bild zu schreiben wird &#8211; zumindest wenn er eine XAMPP Umgebung unter Windows nutzt &#8211; auf seltsame Probleme stoßen.
Trotz korrektem Pfad zur integrierten Schrift, der texb.ttf, tritt nämlich die Fehlermeldung imagettftext: Could not read font auf. Da hilft kein experimentieren oder ändern des [...]]]></description>
			<content:encoded><![CDATA[<p>Wer mit Codeigniter (1.7.1) und der PHP-Funktion <strong>imagettftext()</strong> versucht Text in ein Bild zu schreiben wird &#8211; zumindest wenn er eine XAMPP Umgebung unter Windows nutzt &#8211; auf seltsame Probleme stoßen.</p>
<p>Trotz korrektem Pfad zur integrierten Schrift, der <strong>texb.ttf</strong>, tritt nämlich die Fehlermeldung <strong>imagettftext: Could not read font</strong> auf. Da hilft kein experimentieren oder ändern des Pfades, es hilft nur eine neue Schriftart, denn offensichtlich ist diese Schriftart defekt oder funktioniert unter Windows nicht korrekt (unter Linux habe ich es noch nicht getestet). Massig coole Schriftarten gibt&#8217;s übrigens bei <a href="http://dafont.com/">dafont</a>. Die neue Schriftart sollte dann im dafür vorgesehenen Ordner <strong>system/fonts/</strong> gespeichert werden.</p>
<p>Und hier nochmal ein kleines Snippet, das zeigt wie man dann mit der neuen Schriftart Texte in Bilder schreibt:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// Bild erzeugen, Farbe allokieren</span>
<span style="color: #000088;">$width</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">400</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$height</span> <span style="color: #339933;">=</span> <span style="color: #cc66cc;">100</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$im</span> <span style="color: #339933;">=</span> <span style="color: #990000;">imagecreate</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$width</span><span style="color: #339933;">,</span> <span style="color: #000088;">$height</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$background_color</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageColorAllocate</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> 255<span style="color: #339933;">,</span> 255<span style="color: #339933;">,</span> 255<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$text_color</span> <span style="color: #339933;">=</span> <span style="color: #990000;">ImageColorAllocate</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> 0<span style="color: #339933;">,</span>0<span style="color: #339933;">,</span>0<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// schreiben</span>
<span style="color: #000088;">$text</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'TEXT'</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$font_size</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">60</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$angle</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">0</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$x</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">30</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$y</span><span style="color: #339933;">=</span><span style="color: #cc66cc;">80</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$font_path</span>     <span style="color: #339933;">=</span> <span style="color: #0000ff;">'./system/fonts/neue_schriftart.ttf'</span><span style="color: #339933;">;</span>
<span style="color: #990000;">imagettftext</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font_size</span><span style="color: #339933;">,</span> <span style="color: #000088;">$angle</span><span style="color: #339933;">,</span> <span style="color: #000088;">$x</span><span style="color: #339933;">,</span> <span style="color: #000088;">$y</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text_color</span><span style="color: #339933;">,</span> <span style="color: #000088;">$font_path</span><span style="color: #339933;">,</span> <span style="color: #000088;">$text</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Bild ausgeben</span>
<span style="color: #990000;">header</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;Content-type: image/png&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ImagePNG</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">ImageDestroy</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$im</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Ich habe in diesem Fall ein <strong>png</strong> erstellt. Den Code umzubauen, so dass ein gif oder jpeg erzeugt wird, sollte aber kein Problem sein.</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/codeigniter-imagettftext-problem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Umlaute (und Pluszeichen +) in CodeIgniter URLs</title>
		<link>http://benjaminmock.de/umlaute-in-codeigniter-urls/</link>
		<comments>http://benjaminmock.de/umlaute-in-codeigniter-urls/#comments</comments>
		<pubDate>Mon, 08 Jun 2009 11:22:49 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[permitted_uri_chars]]></category>
		<category><![CDATA[umlaut]]></category>
		<category><![CDATA[uri]]></category>
		<category><![CDATA[url]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=72</guid>
		<description><![CDATA[Von Hause aus ist CodeIgniter so konfiguriert, dass keine Umlaute und auch kein Pluszeichen in der URL erlaubt sind. Allerdings lässt sich das in system/application/config/config.php ändern.
Dazu ersatz man die Zeile mit permitted_uri_chars durch das folgende Snippet:

$config&#91;'permitted_uri_chars'&#93; = 'a-z 0-9~%.:_+\-äöüß-';

Das erlaubt dann URLs auch in einem Format wie controller/methode/ö+ä/. Die Verwendung von Umlauten ist allerdings nicht [...]]]></description>
			<content:encoded><![CDATA[<p>Von Hause aus ist <strong>CodeIgniter </strong>so konfiguriert, dass keine <strong>Umlaute</strong> und auch kein Pluszeichen in der URL erlaubt sind. Allerdings lässt sich das in <strong>system/application/config/config.php</strong> ändern.</p>
<p>Dazu ersatz man die Zeile mit <strong>permitted_uri_chars</strong> durch das folgende Snippet:</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$config</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'permitted_uri_chars'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">'a-z 0-9~%.:_+\-äöüß-'</span><span style="color: #339933;">;</span></pre></div></div>

<p>Das erlaubt dann URLs auch in einem Format wie <strong>controller/methode/ö+ä/</strong>. Die Verwendung von Umlauten ist allerdings nicht unbedingt zu empfehlen. Manche Foren und Blogs enkodieren die Umlaute anders, genauso wie manche Browser. Man sollte bei der Verwendung also zumindest darauf achten auch die URLs, die mit UTF-8 enkodiert wurden (z.B. %C3%B6 für ö), entsprechend umzuleiten.</p>
<p>Ganz zufrieden bin ich mit dieser Lösung noch nicht, wer also bessere Ideen für eine Lösung des <strong>CodeIgniter-Umlaut-URL-Problem</strong> hat, darf diese natürlich gerne hier posten!</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/umlaute-in-codeigniter-urls/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>CodeIgniter Suchmaschine mit Lucene aus dem Zend-Framework</title>
		<link>http://benjaminmock.de/codeigniter-suchmaschine-mit-lucene-aus-dem-zend-framework/</link>
		<comments>http://benjaminmock.de/codeigniter-suchmaschine-mit-lucene-aus-dem-zend-framework/#comments</comments>
		<pubDate>Mon, 01 Jun 2009 19:03:23 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Coding]]></category>
		<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[lucene]]></category>
		<category><![CDATA[mysql]]></category>
		<category><![CDATA[suchmaschine]]></category>
		<category><![CDATA[volltextsuche]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://benjaminmock.de/?p=56</guid>
		<description><![CDATA[Um eine ordentliche Suchfunktion in das eigene Web-Projekt zu integrieren bedarf es entweder einer Menge Arbeit oder der Nutzung von Lucene. Bei Lucene handelt es sich um eine plattformunabhängige Such- und Index-Programmierschnittstelle der Apache Software Foundation. Die Wikipedia setzt beispielsweise Lucene zur Volltextsuche ein.
Der einfachste Weg Lucene in CodeIgniter zu integrieren ist die Verwendung der [...]]]></description>
			<content:encoded><![CDATA[<p>Um eine ordentliche Suchfunktion in das eigene Web-Projekt zu integrieren bedarf es entweder einer Menge Arbeit oder der Nutzung von <a href="http://lucene.apache.org/java/docs/index.html">Lucene</a>. Bei Lucene handelt es sich um eine plattformunabhängige Such- und Index-Programmierschnittstelle der Apache Software Foundation. Die Wikipedia setzt beispielsweise Lucene zur Volltextsuche ein.</p>
<p>Der einfachste Weg Lucene in CodeIgniter zu integrieren ist die Verwendung der Zend-Lucene-Bibliothek. Dazu gibt es ein gutes Tutorial von <a href="http://www.beyondcoding.com/2008/02/21/using-zend-framework-with-codeigniter/">Fred Wu</a>, das ich hier kurz zusammenfassen und um die Suchfunktionalität erweitern werde.</p>
<h2>Zend-Bibliotheken in CodeIgniter integrieren</h2>
<ol>
<li>Aktuelle Version des Zend-Frameworks <a href="http://framework.zend.com/download/current/">hier</a> herunterladen</li>
<li>Paket entpacken und den Ordner <strong>Zend</strong> (unter <strong>Library</strong>) in das CodeIgniter-Verzeichnis <strong>application/libraries/</strong> kopieren</li>
<li>Das unten angegebene Script in das gleiche Verzeichnis kopieren(<strong>application/libraries/</strong>)</li>
</ol>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #009933; font-style: italic;">/**
* Zend Framework Loader
*
* Put the 'Zend' folder (unpacked from the Zend Framework package, under 'Library')
* in CI installation's 'application/libraries' folder
* You can put it elsewhere but remember to alter the script accordingly
*
* Usage:
*   1) $this-&amp;gt;load-&amp;gt;library('zend', 'Zend/Package/Name');
*   or
*   2) $this-&amp;gt;load-&amp;gt;library('zend');
*      then $this-&amp;gt;zend-&amp;gt;load('Zend/Package/Name');
*
* * the second usage is useful for autoloading the Zend Framework library
* * Zend/Package/Name does not need the '.php' at the end
*/</span>
<span style="color: #000000; font-weight: bold;">class</span> CI_Zend
<span style="color: #009900;">&#123;</span>
<span style="color: #009933; font-style: italic;">/**
* Constructor
*
* @param	string $class class name
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> __construct<span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span> <span style="color: #339933;">=</span> <span style="color: #009900; font-weight: bold;">NULL</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #666666; font-style: italic;">// include path for Zend Framework</span>
<span style="color: #666666; font-style: italic;">// alter it accordingly if you have put the 'Zend' folder elsewhere</span>
<span style="color: #990000;">ini_set</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include_path'</span><span style="color: #339933;">,</span>
<span style="color: #990000;">ini_get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'include_path'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> PATH_SEPARATOR <span style="color: #339933;">.</span> APPPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'libraries'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;&lt;/</span>code<span style="color: #339933;">&gt;</span>
&nbsp;
<span style="color: #339933;">&lt;</span>code<span style="color: #339933;">&gt;</span>if <span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> EXT<span style="color: #339933;">;</span>
log_message<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'debug'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Zend Class <span style="color: #006699; font-weight: bold;">$class</span> Loaded&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #b1b100;">else</span>
<span style="color: #009900;">&#123;</span>
log_message<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'debug'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Zend Class Initialized&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
&nbsp;
<span style="color: #009933; font-style: italic;">/**
* Zend Class Loader
*
* @param	string $class class name
*/</span>
<span style="color: #000000; font-weight: bold;">function</span> load<span style="color: #009900;">&#40;</span><span style="color: #000088;">$class</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
<span style="color: #b1b100;">require_once</span> <span style="color: #009900;">&#40;</span>string<span style="color: #009900;">&#41;</span> <span style="color: #000088;">$class</span> <span style="color: #339933;">.</span> EXT<span style="color: #339933;">;</span>
log_message<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'debug'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">&quot;Zend Class <span style="color: #006699; font-weight: bold;">$class</span> Loaded&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
?<span style="color: #339933;">&amp;</span>gt<span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Das war&#8217;s schon! Damit können jetzt die Bibliotheken des Zend-Frameworks in CodeIgniter genutzt werden. Man lädt die Bibliotheken folgendermaßen:</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'zend'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">zend</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zend/Name_der_Bibliothek'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></td></tr></table></div>

<p>Die Endung .php wird bei der Angabe des Bibliotheksnamen nicht benötigt.</p>
<h3>Suchfunktionalität mittels Lucene in Codeiginter integrieren</h3>
<p>Da jetzt die Zend-Bibliotheken in CodeIgniter nutzbar sind, steht einer Nutzung von Lucene ebenfalls nicht mehr im Weg. Schauen wir uns einmal den dazu benötigten Controller an (suche.php):</p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
</pre></td><td class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #000000; font-weight: bold;">class</span> Suche <span style="color: #000000; font-weight: bold;">extends</span> Controller <span style="color: #009900;">&#123;</span>
&nbsp;
    <span style="color: #000000; font-weight: bold;">function</span> Suche<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		parent<span style="color: #339933;">::</span><span style="color: #004000;">Controller</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Zends Lucene-Bibliothek laden</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">library</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'zend'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">zend</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Zend/Search/Lucene'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Suchindex festelegen</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">search_index</span> <span style="color: #339933;">=</span> APPPATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'search/index'</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> index<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'search_view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> index_it<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #666666; font-style: italic;">// Index erstellen (bisheriger Index wird gelöscht)</span>
		<span style="color: #000088;">$index</span> <span style="color: #339933;">=</span> Zend_Search_Lucene<span style="color: #339933;">::</span><span style="color: #004000;">create</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">search_index</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Content, der indexiert werden soll aus DB auslesen</span>
		<span style="color: #000088;">$query</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">db</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'brand_content'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// Alle Content-Instanzen zum Index hinzufügen</span>
		<span style="color: #b1b100;">foreach</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$query</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">result</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$item</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Lucene Document für diese Content-Instanz erstellen</span>
			<span style="color: #000088;">$doc</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Search_Lucene_Document<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// dieser Titel wird in den Suchergebnissen angezeigt</span>
			<span style="color: #000088;">$doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addField</span><span style="color: #009900;">&#40;</span>Zend_Search_Lucene_Field<span style="color: #339933;">::</span><span style="color: #004000;">Text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'title'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// mit diesem Pfad werden die Suchergebnisse verknüpft</span>
			<span style="color: #000088;">$doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addField</span><span style="color: #009900;">&#40;</span>Zend_Search_Lucene_Field<span style="color: #339933;">::</span><span style="color: #004000;">Text</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'path'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'/brand/'</span><span style="color: #339933;">.</span><span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">parent</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">slug</span><span style="color: #339933;">.</span><span style="color: #0000ff;">'/'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #666666; font-style: italic;">// dieser Inhalt wird neben dem Titel indexiert</span>
			<span style="color: #000088;">$doc</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addField</span><span style="color: #009900;">&#40;</span>Zend_Search_Lucene_Field<span style="color: #339933;">::</span><span style="color: #004000;">UnStored</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'content'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$item</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #666666; font-style: italic;">// zum Index hinzufügen</span>
			<span style="color: #000088;">$index</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">addDocument</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$doc</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
			<span style="color: #b1b100;">echo</span> <span style="color: #0000ff;">'Added '</span> <span style="color: #339933;">.</span> <span style="color: #000088;">$article</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">title</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">' to index.&lt;br /&gt;'</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #000088;">$index</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">optimize</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
&nbsp;
	<span style="color: #000000; font-weight: bold;">function</span> result<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'results'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #666666; font-style: italic;">// falls der &quot;search_query&quot;-Parameter übergeben wurde Suche ausführen</span>
		<span style="color: #b1b100;">if</span> <span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'search_query'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span> <span style="color: #009900;">&#123;</span>
			<span style="color: #666666; font-style: italic;">// Index analysieren; Suchergebnisse auslesen</span>
			<span style="color: #000088;">$index</span> <span style="color: #339933;">=</span> Zend_Search_Lucene<span style="color: #339933;">::</span><span style="color: #004000;">open</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">search_index</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
			<span style="color: #000088;">$data</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'results'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$index</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">find</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">input</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">post</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'search_query'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
		<span style="color: #666666; font-style: italic;">// View mit Suchergebnissen anzeigen</span>
		<span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">load</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">view</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'search_view'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$data</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span></pre></td></tr></table></div>

<p>Im Konstruktor wird die Lucene-Bibliothek wie bereits gezeigt geladen und der Ort des Suchindexes festegelegt. Mit der Funktion <strong>index_it</strong> wird der Index aufgebaut. Diese Funktion hat natürlich nichts in einem öffentlich zugänglichen Controller verloren und ist hier nur aus Gründen der Einfachheit im Controller enthalten.</p>
<p>Die View, die von diesem Controller aufgerufen wird enthält ein Formular mit einem Feld Namens <strong>search_query</strong>. Dieses muss wie bei CodeIgniter üblich per <strong>POST</strong> an suche/result/ übergeben werden, wo die Auswertung des Indexes stattfindet. Die View folgt hier noch einmal kurz im Überblick (search_view.php).</p>
<p> </p>

<div class="wp_syntax"><table><tr><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
</pre></td><td class="code"><pre class="html" style="font-family:monospace;">&lt;html&gt;
&lt;head&gt;
	&lt;title&gt;Suche&lt;/title&gt;
&lt;/head&gt;
&lt;body&gt;
&nbsp;
&lt;h1&gt;Suche&lt;/h1&gt;
&nbsp;
&lt;?php if (empty($_POST['search_query'])):?&gt;
&nbsp;
&lt;p&gt;Bitte Suchbegriff eingeben!&lt;/p&gt;
&lt;form method=&quot;post&quot; action=&quot;&lt;?=base_url()?&gt;suche/result/&quot;&gt;
  &lt;input type=&quot;text&quot; name=&quot;search_query&quot; value=&quot;&quot; size=&quot;40&quot; maxlength=&quot;40&quot;/&gt;
  &lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;suchen&quot;/&gt;
&lt;/form&gt;
&nbsp;
&lt;?php else:?&gt;
	&lt;?php if (count($results)):?&gt;
&lt;p&gt;&lt;?php echo count($results) ?&gt; Ergebnis(se) f&amp;uuml;r die Suchanfrage &lt;b&gt;&lt;?php echo $_POST['search_query'];?&gt;&lt;/b&gt;&lt;/p&gt;
&lt;ul&gt;
	&lt;?php foreach($results as $result):?&gt;
	&lt;li&gt;&lt;?=anchor(site_url($result-&gt;path), $result-&gt;title);?&gt; (&lt;?php echo round($result-&gt;score, 2) * 100;?&gt;%)&lt;/li&gt;
	&lt;?php endforeach;?&gt;
&lt;/ul&gt;
	&lt;?php else:?&gt;
&lt;p&gt;Keine Ergebnisse f&amp;uuml;r die Suchanfrage &lt;b&gt;&lt;?php echo $_POST['search_query'];?&gt;&lt;/b&gt;&lt;/p&gt;
	&lt;?php endif;?&gt;
&lt;?php endif;?&gt;
&nbsp;
&lt;/body&gt;
&lt;/html&gt;</pre></td></tr></table></div>

<p> </p>
<p>Fragen und Anregungen oder Verbesserungsvorschläge zu diesem Code können natürlich gerne in den Kommentaren abgegeben werden.</p>
<p>Sollten Sie einen <a href="http://benjaminmock.de/codeigniter-entwickler/">CodeIgniter-Entwickler</a> für eines Ihrer Projekte suchen, dürfen Sie mich gerne kontaktieren!</p>
]]></content:encoded>
			<wfw:commentRss>http://benjaminmock.de/codeigniter-suchmaschine-mit-lucene-aus-dem-zend-framework/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
