<?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>Börngen-Schmidt IT Consulting &#187; Agavi</title>
	<atom:link href="http://www.boerngen-schmidt.de/tag/agavi/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.boerngen-schmidt.de</link>
	<description>Die Summe der Kleinigkeiten ergibt das Ganze.</description>
	<lastBuildDate>Mon, 07 Nov 2011 20:00:20 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>Der Agavi Filter VersuchPlaying with Agavi Filters</title>
		<link>http://www.boerngen-schmidt.de/2009/08/der-agavi-filter-versuch/</link>
		<comments>http://www.boerngen-schmidt.de/2009/08/der-agavi-filter-versuch/#comments</comments>
		<pubDate>Mon, 17 Aug 2009 14:58:19 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Internet]]></category>
		<category><![CDATA[Programmieren]]></category>
		<category><![CDATA[Agavi]]></category>
		<category><![CDATA[Filter]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.boerngen-schmidt.de/?p=169</guid>
		<description><![CDATA[Die Filter von Agavi sind ein mächtiges Werkzeug, wenn man weiß wie man sie einsetzen kann. Leider weiß ich das noch nicht so genau, werde mich aber heute im laufe des Artikel Schreibens damit beschäftigen.

Grundlegend kann man bei den Filtern in Globale und Action Filter unterscheiden welche wie eine Zwiebel aufgebaut sind und sich gegenseitig nach und nach aufrufen.


Keine verwandten Artikel gefunden.]]></description>
			<content:encoded><![CDATA[<p><!--:de--><br />
<h3>Generelles zu Filtern</h3>
<p>In der kleinen AsciiArt unten kann man erkennen wie Filter funktionieren. Von links kommt das Request an die Applikation, dieses wird vom Dispatcher bearbeitet, der das Request und seine Daten durch die Globalen Filter schickt, diese leiten es dann an die entsprechende Action weiter, welche wiederum das ganz durch ihre eigenen Filter schickt. Jetzt wird erst das Output generiert und die Filter werden danach in umgekehrter Reihenfolge wieder durchlaufen.</p>
<div id="attachment_174" class="wp-caption aligncenter" style="width: 479px"><img class="size-full wp-image-174 " title="Agavi_Filter" src="http://www.boerngen-schmidt.de/wp-content/uploads/2009/08/Agavi_Filter.gif" alt="Agavi's Filters are like an Onion" width="469" height="240" /><p class="wp-caption-text">Agavi&#39;s Filter sind wie eine Zwiebel</p></div>
<p>Bei allen Filtern ist es so, dass die <strong>Auflistung die Reihenfolge der Ausführung</strong> bestimmt. Weiter unten ein kleines Beispiel dazu.</p>
<h3>Globale Filter</h3>
<p><strong>Was sind globale Filter?</strong> &#8211; Globale Filter gelten für das Request an die Applikation. Als Beispiel kann hier der FormPopulationFiler dienen. Dieser Filter ist in der Lage eine HTML mit Werten zu füllen, was aber erst gemacht werden kann, nachdem das ganze Request durchgelaufen ist und das Output generiert worden ist. Somit ist es möglich in dem Request weitere ActionContainer zu kreieren und weiter Actions auszuführen.</p>
<p>Die Konfiguration der Globalen Filter findet in der global_filter.xml im Konfigurationsverzeichnis der Applikation statt. Hierbei bestimmt die Reihenfolge in welcher sie in der Datei aufgelistet werden in welcher Reihenfolge sie ausgeführt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;FirstFilter&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SecondFilter&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Hier würde der Filter mit dem Namen <em>FirstFilter</em> zuerst, danach dann der <em>SecondFilter</em> ausgeführt. Die Globalen Filter werden vom Controller geladen und auf gerufen. Hierbei gilt, dass der Controller explizit den Filter <em>AgaviDispatchFilter</em> registriert und ihn dann gleich danach aufruft. In diesem wird das Response gesetzt, aus dem was noch kommt.</p>
<h3>Action Filter</h3>
<p>Action Filter sind, wie der Name auch schon sagt, für die Action gedacht. Die Grafik oben verdeutlicht dieses sehr gut. Eine <em>Action</em> generiert uns ja in der passenden <em>View</em> das Output, welches vor der Ausgabe dann noch mit dem <em>FormPopulationFilter</em> bearbeitet wird.</p>
<p>Bei den Action Filtern gibt es eine Besonderheit. Zum einen gibt es die Action Filter, die für jede Action aufgerufen werden und Spezial Action Filter die nur für eine bestimmt Action aufgerufen werden. Die Spezialfilter werden im <em>app/Modulverzeichnis/config/action_filters.xml</em> spezifiziert. Die Filter die für alle Actions gelten sollen werden in <em>app/config/action_filters.xml</em> spezifiziert.<br />
Zur der Reihenfolge der Ausführung ist zu sagen, dass erst die generellen und dann die speziellen.</p>
<p>Noch etwas sehr wichtiges, dass man bei dem entwerfen eines Action Filters nicht vergessen darf, ist das jeder Slot, jede ForwardAction ihre eigene FilterChain hat, welche die Filter nochmal durchläuft. Deswegen gibt es zwei Verschiedene Methoden in der Klasse. Die eine, <strong>executeOnce</strong>, wird immer für die &#8220;main&#8221; Action auf gerufen, die andere <strong>execute</strong> wird dann in den restlichen FilterChains auf gerufen. Sollte man aber wollen, dass der Filter beim ersten bis zum letzten Aufruf immer gleich aufgerufen wird, bedient sich die Klasse <em>AgaviFilter</em> dem Trick, dass executeOnce einfach execute aufruft. ExecuteOnce muss als explizier überschrieben werden.</p>
<h3>Aufbau eines Filters</h3>
<p>Filter sollten immer die Klasse <em>AgaviFilter</em> erweitern. Dort sind schon einmal die grundlegenden Funktionen definiert wie die oben beschriebene executeOnce Methode.</p>
<p>In dem nachfolgenden Beispiel implementieren wir die Klasse FooBarFilter. Diese kann entweder wie im Beispiel ein Klasse sein die sowohl Global als aus Action Filter ist oder nur eines von beiden. (Hier ist es zu Demonstrationszwecken so gewählt)</p>

<div class="wp_syntax"><div 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> FooBarFilter <span style="color: #000000; font-weight: bold;">extends</span> AgaviFilter implements AgaviIActionFilter<span style="color: #339933;">,</span> AgaviIGlobalFilter <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeOnce<span style="color: #009900;">&#40;</span>AgaviFilterChain <span style="color: #000088;">$filterChain</span><span style="color: #339933;">,</span> AgaviExecutionContainer <span style="color: #000088;">$container</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">/* Stuff to be done before the Rest of filters and Output generation is executed */</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/* Now we continue with the other filters. THIS MUST BE DONE!!! */</span>
    <span style="color: #000088;">$filterChain</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$container</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/* now to the Stuff which needs to be done afterwards. ie. Output transformation etc. */</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Das Beispiel oben hat zu dem nur die Methode executeOnce, was also heißt das der Filter pro Kontext nur einmal ausgeführt würde.</p>
<p>Weiter Infos zu und um Agavi gibt es auf <a title="Agavi" href="http://www.agavi.org" target="_blank">http://www.agavi.org</a>. Auch zu empfehlen ist der <a href="http://www.mivesto.de/agavi/agavi-faq.html" target="_blank">Agavi FAQ</a> in dem einige interessante Themen rund um Agavi behandelt werde.<!--:--><!--:en--><br />
<h3 style="font-size: 1.17em;">ENGLISH TRANSLATION WILL FOLLOW!</h3>
<h3 style="font-size: 1.17em;">Generelles zu Filtern</h3>
<p>In der kleinen AsciiArt unten kann man erkennen wie Filter funktionieren. Von links kommt das Request an die Applikation, dieses wird vom Dispatcher bearbeitet, der das Request und seine Daten durch die Globalen Filter schickt, diese leiten es dann an die entsprechende Action weiter, welche wiederum das ganz durch ihre eigenen Filter schickt. Jetzt wird erst das Output generiert und die Filter werden danach in umgekehrter Reihenfolge wieder durchlaufen.</p>
<div style="text-align: center;">
<dl id="attachment_174" style="display: block; margin-left: auto; margin-right: auto; text-align: center; background-color: #f3f3f3; padding-top: 4px; margin-top: 10px; margin-bottom: 10px; -webkit-border-top-right-radius: 3px 3px; -webkit-border-top-left-radius: 3px 3px; -webkit-border-bottom-left-radius: 3px 3px; -webkit-border-bottom-right-radius: 3px 3px; width: 479px; border: 1px solid #dddddd;">
<dt><img style="padding: 0px; margin: 0px; border: 0px none initial;" title="Agavi_Filter" src="http://www.boerngen-schmidt.de/wp-content/uploads/2009/08/Agavi_Filter.gif" alt="Agavi's Filters are like an Onion" width="469" height="240" /></dt>
<dd style="font-size: 11px; line-height: 17px; padding-top: 0px; padding-right: 4px; padding-bottom: 5px; padding-left: 4px; margin: 0px;">Agavi&#8217;s Filter sind wie eine Zwiebel</dd>
</dl>
</div>
<p>Bei allen Filtern ist es so, dass die <strong>Auflistung die Reihenfolge der Ausführung</strong> bestimmt. Weiter unten ein kleines Beispiel dazu.</p>
<h3 style="font-size: 1.17em;">Globale Filter</h3>
<p><strong>Was sind globale Filter?</strong> &#8211; Globale Filter gelten für das Request an die Applikation. Als Beispiel kann hier der FormPopulationFiler dienen. Dieser Filter ist in der Lage eine HTML mit Werten zu füllen, was aber erst gemacht werden kann, nachdem das ganze Request durchgelaufen ist und das Output generiert worden ist. Somit ist es möglich in dem Request weitere ActionContainer zu kreieren und weiter Actions auszuführen.</p>
<p>Die Konfiguration der Globalen Filter findet in der global_filter.xml im Konfigurationsverzeichnis der Applikation statt. Hierbei bestimmt die Reihenfolge in welcher sie in der Datei aufgelistet werden in welcher Reihenfolge sie ausgeführt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;FirstFilter&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;filter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;SecondFilter&quot;</span><span style="color: #000000; font-weight: bold;">/&gt;</span></span></pre></div></div>

<p>Hier würde der Filter mit dem Namen <em>FirstFilter</em> zuerst, danach dann der <em>SecondFilter</em> ausgeführt. Die Globalen Filter werden vom Controller geladen und auf gerufen. Hierbei gilt, dass der Controller explizit den Filter <em>AgaviDispatchFilter</em>registriert und ihn dann gleich danach aufruft. In diesem wird das Response gesetzt, aus dem was noch kommt.</p>
<h3 style="font-size: 1.17em;">Action Filter</h3>
<p>Action Filter sind, wie der Name auch schon sagt, für die Action gedacht. Die Grafik oben verdeutlicht dieses sehr gut. Eine<em>Action</em> generiert uns ja in der passenden <em>View</em> das Output, welches vor der Ausgabe dann noch mit dem<em>FormPopulationFilter</em> bearbeitet wird.</p>
<p>Bei den Action Filtern gibt es eine Besonderheit. Zum einen gibt es die Action Filter, die für jede Action aufgerufen werden und Spezial Action Filter die nur für eine bestimmt Action aufgerufen werden. Die Spezialfilter werden im <em>app/Modulverzeichnis/config/action_filters.xml</em> spezifiziert. Die Filter die für alle Actions gelten sollen werden in<em>app/config/action_filters.xml</em> spezifiziert.<br />
Zur der Reihenfolge der Ausführung ist zu sagen, dass erst die generellen und dann die speziellen.</p>
<p>Noch etwas sehr wichtiges, dass man bei dem entwerfen eines Action Filters nicht vergessen darf, ist das jeder Slot, jede ForwardAction ihre eigene FilterChain hat, welche die Filter nochmal durchläuft. Deswegen gibt es zwei Verschiedene Methoden in der Klasse. Die eine, <strong>executeOnce</strong>, wird immer für die &#8220;main&#8221; Action auf gerufen, die andere <strong>execute</strong> wird dann in den restlichen FilterChains auf gerufen. Sollte man aber wollen, dass der Filter beim ersten bis zum letzten Aufruf immer gleich aufgerufen wird, bedient sich die Klasse <em>AgaviFilter</em> dem Trick, dass executeOnce einfach execute aufruft. ExecuteOnce muss als explizier überschrieben werden.</p>
<h3 style="font-size: 1.17em;">Aufbau eines Filters</h3>
<p>Filter sollten immer die Klasse <em>AgaviFilter</em> erweitern. Dort sind schon einmal die grundlegenden Funktionen definiert wie die oben beschriebene executeOnce Methode.</p>
<p>In dem nachfolgenden Beispiel implementieren wir die Klasse FooBarFilter. Diese kann entweder wie im Beispiel ein Klasse sein die sowohl Global als aus Action Filter ist oder nur eines von beiden. (Hier ist es zu Demonstrationszwecken so gewählt)</p>

<div class="wp_syntax"><div 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> FooBarFilter <span style="color: #000000; font-weight: bold;">extends</span> AgaviFilter implements AgaviIActionFilter<span style="color: #339933;">,</span> AgaviIGlobalFilter <span style="color: #009900;">&#123;</span>
&nbsp;
<span style="color: #000000; font-weight: bold;">public</span> <span style="color: #000000; font-weight: bold;">function</span> executeOnce<span style="color: #009900;">&#40;</span>AgaviFilterChain <span style="color: #000088;">$filterChain</span><span style="color: #339933;">,</span> AgaviExecutionContainer <span style="color: #000088;">$container</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
    <span style="color: #666666; font-style: italic;">/* Stuff to be done before the Rest of filters and Output generation is executed */</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/* Now we continue with the other filters. THIS MUST BE DONE!!! */</span>
    <span style="color: #000088;">$filterChain</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">execute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$container</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
    <span style="color: #666666; font-style: italic;">/* now to the Stuff which needs to be done afterwards. ie. Output transformation etc. */</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Das Beispiel oben hat zu dem nur die Methode executeOnce, was also heißt das der Filter pro Kontext nur einmal ausgeführt würde.</p>
<p>Weiter Infos zu und um Agavi gibt es auf <a title="Agavi" href="http://www.agavi.org" target="_blank">http://www.agavi.org</a>. Auch zu empfehlen ist der <a href="http://www.mivesto.de/agavi/agavi-faq.html" target="_blank">Agavi FAQ</a> in dem einige interessante Themen rund um Agavi behandelt werde.<!--:--></p>


<p>Keine verwandten Artikel gefunden.</p>]]></content:encoded>
			<wfw:commentRss>http://www.boerngen-schmidt.de/2009/08/der-agavi-filter-versuch/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Doctrine und Agavi</title>
		<link>http://www.boerngen-schmidt.de/2009/04/howto-configure-doctrine-and-agavi/</link>
		<comments>http://www.boerngen-schmidt.de/2009/04/howto-configure-doctrine-and-agavi/#comments</comments>
		<pubDate>Tue, 21 Apr 2009 22:06:59 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Allgemeines]]></category>
		<category><![CDATA[Agavi]]></category>
		<category><![CDATA[Doctrine]]></category>
		<category><![CDATA[HowTo]]></category>

		<guid isPermaLink="false">http://www.boerngen-schmidt.de/?p=141</guid>
		<description><![CDATA[Bei Agavi hat man die Qual der Wahl wie man eine Datenbankverbindung herstellt. Zum einen sind dort Propel und Doctrine als Verfechter der ORMs, zum anderen aber auch die klassischen Methode ala PDO.

Heute möchte ich gerne ein paar Worte dazu verlieren wie man Doctrine zusammen mit Agavi einrichtet und zum laufen bekommt.


Keine verwandten Artikel gefunden.]]></description>
			<content:encoded><![CDATA[<h2>Doctrine Librarys</h2>
<p>Als erstes sollte man sich die Librarys von Doctrine besorgen. Ich selber speichere alle externen librarys im Verzeichnis <strong>%project_dir%/libs</strong> ab.</p>
<p>svn co <a href="http://svn.doctrine-project.org/tags/1.1.0/lib/">http://svn.doctrine-project.org/tags/1.1.0/lib/</a> libs/doctrine</p>
<p>nun haben wir schon einmal die Librarys im Verzeichnis %project_dir%/lib/doctrine.</p>
<p><strong>Konfiguration in Agavi</strong></p>
<p>Damit Agavi nun diese auch läd müssen sie zur autoload.xml hinzugefügt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">&lt;!-- Doctrine --&gt;</span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;autoload</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;Doctrine&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>/path/to/project/libs/doctrine/Doctrine.php<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/autoload<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Zum anderen sollte in settings.xml <em>use_database</em> auf true gesetzt werden, damit Agavi überhaupt zu Datenbanken verbindet. Als nächstes ist nun die database.xml an der Reihe. Die hier angegebene Konfiguration sollte immer an die eingenen Wünsche angepasst werden!</p>

<div class="wp_syntax"><div class="code"><pre class="xml" style="font-family:monospace;"><span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;?xml</span> <span style="color: #000066;">version</span>=<span style="color: #ff0000;">&quot;1.0&quot;</span> <span style="color: #000066;">encoding</span>=<span style="color: #ff0000;">&quot;UTF-8&quot;</span><span style="color: #000000; font-weight: bold;">?&gt;</span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:configurations</span> <span style="color: #000066;">xmlns:ae</span>=<span style="color: #ff0000;">&quot;http://agavi.org/agavi/config/global/envelope/1.0&quot;</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://agavi.org/agavi/config/parts/databases/1.0&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;databases</span> <span style="color: #000066;">default</span>=<span style="color: #ff0000;">&quot;doctrine&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;database</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;doctrine&quot;</span> <span style="color: #000066;">class</span>=<span style="color: #ff0000;">&quot;AgaviDoctrineDatabase&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;dsn&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>mysql://<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;username<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>:<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;password<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>@<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;host<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>/<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;databasename<span style="color: #000000; font-weight: bold;">&gt;</span></span><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;attributes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AUTOLOAD_TABLE_CLASSES&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;VALIDATE&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>LENGTHS<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;AUTO_ACCESSOR_OVERRIDE&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>true<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;manager_attributes&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
							<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;model_loading&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>conservative<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
						<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
					<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;ae:parameter</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;load_models&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>%core.lib_dir%/doctrine<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameter<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
				<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:parameters<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
			<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/database<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
		<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/databases<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
	<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:configuration<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/ae:configurations<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<h2>Entwicklungsumgebung</h2>
<p>Hier habe ich mir angewöhnt die Sachen für die DB Entwicklung unter dev/db ab zuspeichern. Hier sollten folgende Verzeichnisse erstellt werden.</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;"><span style="color: #c20cb9; font-weight: bold;">mkdir</span> <span style="color: #660033;">-p</span> dev<span style="color: #000000; font-weight: bold;">/</span>db<span style="color: #000000; font-weight: bold;">/</span><span style="color: #7a0874; font-weight: bold;">&#123;</span>data,data<span style="color: #000000; font-weight: bold;">/</span>fixtures,data<span style="color: #000000; font-weight: bold;">/</span>sql,migrations,models,schema<span style="color: #7a0874; font-weight: bold;">&#125;</span></pre></div></div>

<p>Zudem erzeugen wir in dev/db noch die Datei doctrine.php, welches wir zur Konfiguration der Doctrine CLI verweden werden. Auch hier gilt, bitte anpassen!</p>

<div class="wp_syntax"><div class="code"><pre class="php" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span>
<span style="color: #666666; font-style: italic;">// Backup argv, otherwise stripped by agavi</span>
<span style="color: #000088;">$args</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'argv'</span><span style="color: #009900;">&#93;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../../libs/agavi/agavi.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #b1b100;">require</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'../../app/config.php'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
Agavi<span style="color: #339933;">::</span><span style="color: #004000;">bootstrap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'development.benjamin'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #990000;">spl_autoload_register</span><span style="color: #009900;">&#40;</span><span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Doctrine'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'autoload'</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;">// Let Agavi create the connection</span>
<span style="color: #000088;">$con</span> <span style="color: #339933;">=</span> AgaviContext<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'console'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getDatabaseConnection</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$dir</span> <span style="color: #339933;">=</span> <span style="color: #990000;">dirname</span><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
	<span style="color: #0000ff;">'data_fixtures_path'</span>  <span style="color: #339933;">=&gt;</span> AgaviConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'doctrine.fixture_dir'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/data/fixtures'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'models_path'</span> <span style="color: #339933;">=&gt;</span> AgaviConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'core.lib_dir'</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/doctrine'</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'migrations_path'</span> <span style="color: #339933;">=&gt;</span>  AgaviConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'doctrine.migration_dir'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/migrations'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'sql_path'</span> <span style="color: #339933;">=&gt;</span> AgaviConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'doctrine.migration_dir'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/data/sql'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'yaml_schema_path'</span> <span style="color: #339933;">=&gt;</span>  AgaviConfig<span style="color: #339933;">::</span><span style="color: #004000;">get</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'doctrine.schema_dir'</span><span style="color: #339933;">,</span> <span style="color: #000088;">$dir</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/schema/schema.yml'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
	<span style="color: #0000ff;">'generate_models_options'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #990000;">array</span><span style="color: #009900;">&#40;</span>
		<span style="color: #0000ff;">'suffix'</span> <span style="color: #339933;">=&gt;</span> <span style="color: #0000ff;">'.class.php'</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;">// Configure Doctrine Cli</span>
<span style="color: #000088;">$cli</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Doctrine_Cli<span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$cli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">run</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$args</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></div></div>

<p>Kommen wir nun zur letzten kleine Hürde. Wir brauchen noch eine entsprechende Datei die uns die doctrine.php von oben aufruft. Diese platziere ich immer in dev/ und sie sieht so aus.</p>
<pre lang="bash" file="doctrine">
#!/usr/bin/env php
<?PHP
chdir(dirname(__FILE__).'/db');
include('doctrine.php');
?>
</pre>
<p>Noch ein abschließendes chmod +x doctrine und man kann los legen.</p>


<p>Keine verwandten Artikel gefunden.</p>]]></content:encoded>
			<wfw:commentRss>http://www.boerngen-schmidt.de/2009/04/howto-configure-doctrine-and-agavi/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agavi FormPopulationFilter Tipps &amp; Tricks</title>
		<link>http://www.boerngen-schmidt.de/2008/12/agavi-fpf-tipps-und-tricks/</link>
		<comments>http://www.boerngen-schmidt.de/2008/12/agavi-fpf-tipps-und-tricks/#comments</comments>
		<pubDate>Sun, 07 Dec 2008 12:46:24 +0000</pubDate>
		<dc:creator>Benjamin</dc:creator>
				<category><![CDATA[Webdesign]]></category>
		<category><![CDATA[Agavi]]></category>
		<category><![CDATA[HTML]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.boerngen-schmidt.de/?p=112</guid>
		<description><![CDATA[Wenn man den FormPopulationFilter (kurz FPF) des Agavi Frameworks benutzt, gibt es einige Sachen auf die man achten sollte. Keine HTML Special Charaters verwenden Warum nicht? Nun ja, ich habe mein Output auf XHTML &#38; UTF-8 eingestellt, so dass ich mit dem FPF meine Formulare dynamische ausfüllen kann. Nun ist das Problem, wenn man z.B. <a href='http://www.boerngen-schmidt.de/2008/12/agavi-fpf-tipps-und-tricks/'>[...]</a>


Keine verwandten Artikel gefunden.]]></description>
			<content:encoded><![CDATA[<p>Wenn man den FormPopulationFilter (kurz FPF) des Agavi Frameworks benutzt, gibt es einige Sachen auf die man achten sollte.</p>
<h3>Keine HTML Special Charaters verwenden</h3>
<p>Warum nicht? Nun ja, ich habe mein Output auf XHTML &amp; UTF-8 eingestellt, so dass ich mit dem FPF meine Formulare dynamische ausfüllen kann. Nun ist das Problem, wenn man z.B. eine Navigation erstellt, dass man Sonderzeichen wie &#8220;&gt;&gt;&#8221; oder &#8220;&lt;&lt;&#8221; benutzen möchte für Vor und Zurück. Das Problem welches hierbei auftritt ist, dass der FPF denkt, dies seien Open- bzw. Endtags was ihn letztendlich aus der Bahn wirft und uns einer Exception beschert. Aber nicht nur diese Zeichen auch an &#8220;&amp;rarr;&#8221; verschluckt sich der FPF.</p>
<p>Deswegen ist es am besten, wenn man Sonderzeichen benutzen möchte, den numerischen Code dieser zu verwenden. Eine gut strukturierte Übersicht findet der interessierte Leser unter <a title="HTML Spechial Charater Codes" href="http://webdesign.about.com/library/bl_htmlcodes.htm" target="_blank">http://webdesign.about.com/library/bl_htmlcodes.htm</a></p>


<p>Keine verwandten Artikel gefunden.</p>]]></content:encoded>
			<wfw:commentRss>http://www.boerngen-schmidt.de/2008/12/agavi-fpf-tipps-und-tricks/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

