<?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>WEBPIRATEN &#187; Agavi</title>
	<atom:link href="http://webpiraten.de/index.php/category/frameworks/agavi-framework/feed/" rel="self" type="application/rss+xml" />
	<link>http://webpiraten.de</link>
	<description>TECHNOLOGIE-BLOG</description>
	<lastBuildDate>Sun, 20 Jun 2010 19:00:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.0</generator>
		<item>
		<title>Agavi Custom Logger implementieren</title>
		<link>http://webpiraten.de/index.php/2010/05/agavi-custom-logger-implementieren/</link>
		<comments>http://webpiraten.de/index.php/2010/05/agavi-custom-logger-implementieren/#comments</comments>
		<pubDate>Fri, 07 May 2010 15:15:57 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[Agavi]]></category>
		<category><![CDATA[Debugging]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Shell]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[agavi]]></category>
		<category><![CDATA[bash]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[logger]]></category>
		<category><![CDATA[logging]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=252</guid>
		<description><![CDATA[Um in Agavi custom logfiles zu erstellen, benötigt man einen eigens erstellten logger + appender in der app/config/logger.xml. &#60;!-- logs only custom messages in a custom log --&#62; &#60;logger name=&#34;custom&#34; class=&#34;AgaviLogger&#34; level=&#34;'custom'&#34;&#62; &#60;appenders&#62; &#60;appender&#62;CustomLogAppender&#60;/appender&#62; &#60;/appenders&#62; &#60;/logger&#62; &#60;appender name=&#34;CustomLogAppender&#34; class=&#34;AgaviFileLoggerAppender&#34; layout=&#34;DateTimeLayout&#34;&#62; &#60;ae:parameters&#62; &#60;ae:parameter name=&#34;file&#34;&#62;%core.app_dir%/log/custom.log&#60;/ae:parameter&#62; &#60;/ae:parameters&#62; &#60;/appender&#62; Dann kann man den Logger quasi überall wo der LoggerManager [...]]]></description>
			<content:encoded><![CDATA[<p>Um in Agavi custom logfiles zu erstellen, benötigt man einen eigens erstellten logger + appender in der <strong>app/config/logger.xml</strong>.</p>
<pre class="brush: xml;">
&lt;!-- logs only custom messages in a custom log --&gt;
&lt;logger name=&quot;custom&quot; class=&quot;AgaviLogger&quot; level=&quot;'custom'&quot;&gt;
    &lt;appenders&gt;
        &lt;appender&gt;CustomLogAppender&lt;/appender&gt;
    &lt;/appenders&gt;
&lt;/logger&gt;

&lt;appender name=&quot;CustomLogAppender&quot; class=&quot;AgaviFileLoggerAppender&quot; layout=&quot;DateTimeLayout&quot;&gt;
    &lt;ae:parameters&gt;
        &lt;ae:parameter name=&quot;file&quot;&gt;%core.app_dir%/log/custom.log&lt;/ae:parameter&gt;
    &lt;/ae:parameters&gt;
&lt;/appender&gt;
</pre>
<p>Dann kann man den Logger quasi überall wo der LoggerManager verfügbar ist benutzen.</p>
<pre class="brush: php;">
$message = 'Custom logging message';
$this-&gt;getContext()-&gt;getLoggerManager()-&gt;log(new AgaviLoggerMessage($message, 'custom'), 'custom');
</pre>
<p>Und in der bash das logfile einsehen.</p>
<pre class="brush: bash;">
tail -f app/log/custom.log
</pre>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/2010/05/agavi-custom-logger-implementieren/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agavi routing specials</title>
		<link>http://webpiraten.de/index.php/2010/05/agavi-routing-specials/</link>
		<comments>http://webpiraten.de/index.php/2010/05/agavi-routing-specials/#comments</comments>
		<pubDate>Mon, 03 May 2010 13:32:32 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[Agavi]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[agavi]]></category>
		<category><![CDATA[ajax]]></category>
		<category><![CDATA[header]]></category>
		<category><![CDATA[http]]></category>
		<category><![CDATA[http_accept]]></category>
		<category><![CDATA[http_x_requested_with]]></category>
		<category><![CDATA[json]]></category>
		<category><![CDATA[output]]></category>
		<category><![CDATA[routing]]></category>
		<category><![CDATA[specials]]></category>
		<category><![CDATA[types]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=245</guid>
		<description><![CDATA[Um bestimmte Agavi output_types bei speziellen routings zu bedienen kann man die routing.xml wie folgt anpassen. &#60;!-- cut out leading slash --&#62; &#60;route name=&#34;slasher&#34; pattern=&#34;^/&#34; stop=&#34;false&#34; imply=&#34;true&#34; cut=&#34;true&#34; /&#62; &#60;!-- match ajax calls with special http header --&#62; &#60;route pattern=&#34;XMLHttpRequest&#34; source=&#34;_SERVER[HTTP_X_REQUESTED_WITH]&#34; stop=&#34;false&#34; output_type=&#34;ajax&#34; /&#62; &#60;!-- match json calls with special http header --&#62; &#60;route pattern=&#34;application/json&#34; [...]]]></description>
			<content:encoded><![CDATA[<p>Um bestimmte Agavi output_types bei speziellen routings zu bedienen kann man die routing.xml wie folgt anpassen.</p>
<pre class="brush: xml;">
&lt;!-- cut out leading slash --&gt;
&lt;route name=&quot;slasher&quot; pattern=&quot;^/&quot; stop=&quot;false&quot; imply=&quot;true&quot; cut=&quot;true&quot; /&gt;

&lt;!-- match ajax calls with special http header --&gt;
&lt;route pattern=&quot;XMLHttpRequest&quot; source=&quot;_SERVER[HTTP_X_REQUESTED_WITH]&quot; stop=&quot;false&quot; output_type=&quot;ajax&quot; /&gt;

&lt;!-- match json calls with special http header --&gt;
&lt;route pattern=&quot;application/json&quot; source=&quot;_SERVER[HTTP_ACCEPT]&quot; stop=&quot;false&quot; output_type=&quot;json&quot; /&gt;

&lt;!-- cut out special pointer --&gt;
&lt;route name=&quot;portal&quot; pattern=&quot;^({portal:[a-zA-Z]{3}}/)?&quot; stop=&quot;false&quot; imply=&quot;true&quot; cut=&quot;true&quot;&gt;
    &lt;callbacks&gt;
        &lt;callback class=&quot;RoutingCallback&quot; /&gt;
    &lt;/callbacks&gt;
&lt;/route&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/2010/05/agavi-routing-specials/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Eigene Configs in Agavi nutzen</title>
		<link>http://webpiraten.de/index.php/2009/11/eigene-configs-in-agavi-nutze/</link>
		<comments>http://webpiraten.de/index.php/2009/11/eigene-configs-in-agavi-nutze/#comments</comments>
		<pubDate>Tue, 10 Nov 2009 00:15:31 +0000</pubDate>
		<dc:creator>graste</dc:creator>
				<category><![CDATA[Agavi]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[XML]]></category>
		<category><![CDATA[agavi]]></category>
		<category><![CDATA[ConfigHandler]]></category>
		<category><![CDATA[Konfiguration]]></category>
		<category><![CDATA[Schema]]></category>
		<category><![CDATA[Validierung]]></category>
		<category><![CDATA[XSD]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=191</guid>
		<description><![CDATA[Eigene XML-Konfigurationsdateien mit Agavi definieren, validieren und verwenden. Eine kurze Einführung mit Beispielnutzung des AgaviReturnArrayConfigHandler.]]></description>
			<content:encoded><![CDATA[<p>Für diverse Aufgaben in größeren Projekten ist es notwendig, eigene XML-Konfigurationsdateien zu nutzen. Die Definition umfangreicher Einstellungen in der settings.xml wird schnell anstrengend und das Holen der Werte per <code>AgaviConfig::get('setting.name', 'default');</code> unübersichtlich. Agavi bietet es aber an, eigene Konfigurationsdateien zu erstellen und diese nicht nur zu validieren, sondern auch zur Wiederverwendung zu cachen.<br />
In der <a href="http://www.mivesto.de/agavi/agavi-faq.html#general_22">Agavi FAQ</a> habe ich dazu mal ein Beispiel verfasst.</p>
<p>Einfach einen Config-Handler in der <code>config_handlers.xml</code> definieren:</p>
<pre class="brush: xml;">
&lt;handler pattern=&quot;%core.config_dir%/project/foo/*.xml&quot; class=&quot;AgaviReturnArrayConfigHandler&quot; /&gt;
</pre>
<p>und dann direkt in den Actions, Views und Models benutzen:</p>
<pre class="brush: php;">
if (!isset($config['baz']))
{
    throw new LogicException('baz is missing!');
}

if (isset($config['bars']))
{
    foreach ($config['bars'] as $foo =&gt; $data)
    {
        $this-&gt;doSomethingWithEach($foo, $data);
    }
}
</pre>
<p>Die XML-Datei für den obigen Code könnte beispielweise so aussehen:</p>
<pre class="brush: xml;">
&lt;ae:configurations&gt;
    &lt;ae:configuration&gt;
        &lt;baz&gt;asdf&lt;/baz&gt;
        &lt;foo&gt;-1&lt;/foo&gt;
        &lt;bars&gt;
            &lt;some&gt;...more data and xml...&lt;/some&gt;
            &lt;more&gt;...more data and xml...&lt;/more&gt;
            &lt;deep&gt;...more data and xml...&lt;/deep&gt;
            &lt;structs&gt;...more data and xml...&lt;/structs&gt;
        &lt;/bars&gt;
    &lt;/ae:configuration&gt;
    &lt;ae:configuration environment=&quot;production.*&quot;&gt;
        &lt;baz&gt;bleh&lt;/baz&gt;
        &lt;foo&gt;1&lt;/foo&gt;
    &lt;/ae:configuration&gt;
&lt;/ae:configurations&gt;
</pre>
<p>Gut zu erkennen ist der Vorteil eigener Configs: Man kann die Agavi-Features für Konfigurationsdateien nutzen und auf einfache Art und Weise environmentspezifische Einstellungen vornehmen (z.B. in &#8220;Production&#8221; andere Werte für Logdateien, URLs oder Einstellungen nutzen als während der Entwicklung oder beim Testen).</p>
<p>Ebenfalls gut zu erkennen im PHP-Code ist, dass man lauter Abfragen über die Existenz bestimmer Elemente macht, die man sich mit vernünftiger Validierung sparen kann, da invalide XML-Dokumente gar nicht erst als korrekt angesehen werden von Agavi. Um seine XML-Strukturen zu validieren definiert man per <code>validation</code> Parameter ein XML-Schema und definiert noch gleich einen eigenen ConfigHandler, den man schreibt und per <code>autoload.xml</code> bekannt macht:</p>
<pre class="brush: xml;">
&lt;handler pattern=&quot;%core.config_dir%/project/foo/*.foo.xml&quot; class=&quot;FooDefinitionConfigHandler&quot;&gt;
    &lt;validation&gt;%core.config_dir%/xsd/foo_definition.xsd&lt;/validation/&gt;
&lt;/handler&gt;
</pre>
<p>Der ConfigHandler könnte so beginnen:</p>
<pre class="brush: php;">
class FooDefinitionConfigHandler extends AgaviXmlConfigHandler
{
    // notwendige Methoden implementieren und XML-Struktur validieren...
}
</pre>
<p>Für Beispiele einfach in die in Agavi verwendeten XSDs und entsprechende ConfigHandler sehen. Viel Spaß. :)</p>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/2009/11/eigene-configs-in-agavi-nutze/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>die inoffizielle Agavi FAQ</title>
		<link>http://webpiraten.de/index.php/2009/10/die-inoffizielle-agavi-faq/</link>
		<comments>http://webpiraten.de/index.php/2009/10/die-inoffizielle-agavi-faq/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 17:35:04 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[Agavi]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[agavi]]></category>
		<category><![CDATA[dokumentation]]></category>
		<category><![CDATA[faq]]></category>
		<category><![CDATA[framework]]></category>
		<category><![CDATA[hilfe]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=79</guid>
		<description><![CDATA[Allen die immernoch sehnsüchtig auf eine offizielle Agavi Doku warten, sei hier die inoffizielle FAQ Variante von mivesto ans Herz gelegt. mivesto.de/agavi/agavi-faq]]></description>
			<content:encoded><![CDATA[<p><a href="http://mivesto.de/agavi/agavi-faq.html" target="_blank" title="inoffizielle Agavi FAQ"><img src="http://webpiraten.de/wp-content/uploads/2009/10/mivesto_agavi_faq-300x268.png" alt="inoffizielle Agavi FAQ" title="mivesto_agavi_faq" width="300" height="268" class="alignleft size-medium wp-image-33" /></a></p>
<p>Allen die immernoch sehnsüchtig auf eine offizielle Agavi Doku warten, sei hier die inoffizielle FAQ Variante von mivesto ans Herz gelegt.</p>
<p><a href="http://mivesto.de/agavi/agavi-faq.html" target="_blank" title="inoffizielle Agavi FAQ">mivesto.de/agavi/agavi-faq</a></p>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/2009/10/die-inoffizielle-agavi-faq/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Agavi auf XAMPP und Windows</title>
		<link>http://webpiraten.de/index.php/2009/10/agavi-auf-xampp-und-windows/</link>
		<comments>http://webpiraten.de/index.php/2009/10/agavi-auf-xampp-und-windows/#comments</comments>
		<pubDate>Sun, 25 Oct 2009 15:29:09 +0000</pubDate>
		<dc:creator>sägefisch</dc:creator>
				<category><![CDATA[Agavi]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Frameworks]]></category>
		<category><![CDATA[agavi]]></category>
		<category><![CDATA[installation]]></category>
		<category><![CDATA[pear]]></category>
		<category><![CDATA[phing]]></category>
		<category><![CDATA[windows]]></category>
		<category><![CDATA[xampp]]></category>

		<guid isPermaLink="false">http://webpiraten.de/?p=68</guid>
		<description><![CDATA[Nachdem ich das offizielle Agavi DOC durchforstet habe und keine Lösung für meine Testumgebung fand, stieß ich auf diesen Link hier: simonholywell.com/article/installing-agavi-on-xampp-windows Herr Holywell selbst hat eine prima Einführung in die Installation von Agavi auf XAMPP und Windows geliefert. Hier der Post im Original: Having recently heard of the Agavi project from a web framework [...]]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich das offizielle Agavi DOC durchforstet habe und keine Lösung für meine Testumgebung fand, stieß ich auf diesen Link hier:</p>
<p><a href="http://www.simonholywell.com/article/installing-agavi-on-xampp-windows.html">simonholywell.com/article/installing-agavi-on-xampp-windows</a></p>
<p>Herr Holywell selbst hat eine prima Einführung in die Installation von Agavi auf XAMPP und Windows geliefert.</p>
<p><strong>Hier der Post im Original:</strong></p>
<p>Having recently heard of the Agavi project from a web framework showdown at a PHP conference in the UK I have decided to trial it. My setup is a WinXP computer with a default install of the latest XAMPP which has thrown up some issues with installing and building Agavi. Please see my hints below to overcome these issues.</p>
<p>   1. Open a command prompt (type cmd in the run console)<br />
   2. Navigate to your XAMMP PHP directory. Mine is C:\xampp-test\php<br />
   3. Execute pear.bat channel-discover pear.agavi.org<br />
   4. Execute pear.bat install agavi/agavi</p>
<p>Agavi is now installed! Now we just need a new default project to work from.</p>
<p>Agavi needs to be told where the phing batch file is stored.</p>
<p>   1. Edit the agavi.bat file in the XAMPP php directory. Mine is C:\xampp-test\php\agavi.bat<br />
   2. Change set PHING_COMMAND=phing to contain the full absolute path to phing.bat which is in the XAMPP php folder. Mine looks like this: set PHING_COMMAND=C:\xampp-test\php\phing.bat</p>
<p>Begin setting up your project directory.</p>
<p>   1. Create a new directory in your XAMPP directory. Mine is C:xampp-testhtdocssimonholywell.com<br />
   2. Create an empty text file called build.properties in the directory (this banishes a build error where phing fails if it cannot find the file)<br />
   3. Open a command prompt and navigate to the new directory<br />
   4. Execute agavi.bat project The agavi.bat file is stored in the XAMPP php folder. My command looked like this: C:\xampp-test\php\agavi.bat project<br />
   5. Follow the prompts the installer gives you (hitting enter will supply the installer with the [default] value)</p>
<p>Agavi should now be setup for your project. View it in your browser to verify.</p>
]]></content:encoded>
			<wfw:commentRss>http://webpiraten.de/index.php/2009/10/agavi-auf-xampp-und-windows/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
