<?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>Tobias Seckinger</title>
	<atom:link href="http://tobias-seckinger.de/feed/" rel="self" type="application/rss+xml" />
	<link>http://tobias-seckinger.de</link>
	<description>Ein paar Worte zu PHP, Contao, Typo3 und der ganze Rest...</description>
	<lastBuildDate>Fri, 04 May 2012 21:33:53 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.2</generator>
		<item>
		<title>Contao 2.11.3 ist verfügbar</title>
		<link>http://tobias-seckinger.de/2012/05/contao-2-11-3-ist-verfugbar/</link>
		<comments>http://tobias-seckinger.de/2012/05/contao-2-11-3-ist-verfugbar/#comments</comments>
		<pubDate>Fri, 04 May 2012 21:33:53 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Contao]]></category>
		<category><![CDATA[Update]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=863</guid>
		<description><![CDATA[Das kleine Update behebt wieder mal einige Fehler im Core. Außerdem wurde die .htaccess.default angepasst. Es wird empfohlen die Änderungen in eine ggf. eigene .htaccess zu übernehmen. Das hier einiges geändert wurde zeigt ein Ausschnitt aus einem SVN-Vergleich: Noch ein &#8230; <a href="http://tobias-seckinger.de/2012/05/contao-2-11-3-ist-verfugbar/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Das kleine Update behebt wieder mal einige Fehler im Core. Außerdem wurde die <em>.htaccess.default</em> angepasst. Es wird empfohlen die Änderungen in eine ggf. eigene .htaccess zu übernehmen. Das hier einiges geändert wurde zeigt ein Ausschnitt aus einem SVN-Vergleich:</p>
<div id="attachment_864" class="wp-caption alignnone" style="width: 1207px"><a href="http://tobias-seckinger.de/wp-content/uploads/2012/05/contao-2.11.3-update.png"><img class="size-full wp-image-864" title="Htaccess Änderungen in Contao-2.11.3" src="http://tobias-seckinger.de/wp-content/uploads/2012/05/contao-2.11.3-update.png" alt="Htaccess Änderungen in Contao-2.11.3" width="1197" height="832" /></a><p class="wp-caption-text">Htaccess Änderungen in Contao-2.11.3</p></div>
<p>Noch ein paar weitere Änderungen in der folgenden Aufzählung.</p>
<ul>
<li>Die Dropdown-Menüs im Modulwizard (Seitenlayout) werden nun korrekt dupliziert</li>
<li>Die Dropdown-Menüs werden nun korrekt ausgerichtet</li>
<li>Die Mediabox unterstützt nun wieder .mp4-Dateien</li>
<li>Hochgeladene Bilder werden jetzt korrekt verkleinert (maximale Abmessungen)</li>
<li>Die E-Mail-Adresse aus dem Startpunkt wird als Absender von Formularen verwendet</li>
<li>Die IDNA-Bibliothek (URLs mit Umlauten) ist nun mit PHP 5.2 kompatibel</li>
<li>Das FAQ- und Kommentarmodul geben keinen Fehler mehr aus wenn sie leer sind</li>
<li>Der Erweiterungsmanager überspringt keine Module mehr bei der runonce.php-Abfrage</li>
</ul>
<p>Alle weiteren Anpassungen finden sich wie immer im <a title="Changelog Contao" href="http://www.contao.org/de/changelog/versions/2.11.html" target="_blank">Changelog</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/05/contao-2-11-3-ist-verfugbar/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Mehr CSS &#8211; mit Less?</title>
		<link>http://tobias-seckinger.de/2012/05/mehr-css-mit-less/</link>
		<comments>http://tobias-seckinger.de/2012/05/mehr-css-mit-less/#comments</comments>
		<pubDate>Wed, 02 May 2012 20:29:00 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[css]]></category>
		<category><![CDATA[Layout]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=856</guid>
		<description><![CDATA[Nach dem ich mit Bootstrap von Twitter in Berührung kam, stieß ich auch auf Less. Bootstrap selbst bietet bereits einfache und flexible HTML, CSS und Javascript Kompontenten und setzt bei CSS auf Less, das CSS um Variablen, Operationen, Funktionen, Mixins und &#8230; <a href="http://tobias-seckinger.de/2012/05/mehr-css-mit-less/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Nach dem ich mit <a title="2. Zend Tutorial" href="http://tobias-seckinger.de/2012/04/2-zend-tutorial/" target="_blank"><em>Bootstrap</em> </a>von Twitter in Berührung kam, stieß ich auch auf Less<em></em>. Bootstrap selbst bietet bereits einfache und flexible HTML, CSS und Javascript Kompontenten und setzt bei CSS auf Less, das CSS um Variablen, Operationen, Funktionen, Mixins und einiges mehr, erweitert.</p>
<p>Im Prinzip wird die erweiterte Syntax von einem Compiler in reguläres CSS überführt. Die Vorteile liegen scheinbar auf der Hand:</p>
<ul>
<li>Variablen können ausgelagert werden, somit können z. B. unterschiedliche Farbgebungen oder Layout-Breiten realisiert werden.</li>
<li>Während der Programmierung können codesparende Techniken genutzt werden z. B. ermöglichen die sogenannten <a title="Begriffserklärung Mixin" href="http://de.wikipedia.org/wiki/Mixin" target="_blank">Mixins </a>eine Wiederverwendung von bereits genutzten Anweisungen.</li>
<li>Mehrere Less-Definitionen können durch die import-Anweisung in eine CSS-Datei kompiliert werden.</li>
<li>Das CSS kann optional durch den Compiler minimiert werden,</li>
<li>Es können Berechnungen durchgeführt werden, &#8230;</li>
</ul>
<p>Im Gegenzug sehe ich jedoch auch ein paar Probleme. Zum einem muß ein zusätzliches CSS-Framework (?) in den Entwicklungsprozess eingebettet werden. Zum anderen gefällt mir eine entscheidende Funktionalität nicht besonders. Dazu gleich mehr. Jetzt erstmal alle Nachteile die ich sehe:</p>
<ul>
<li>Überschreiben von 3rdparty-Less-Definitionen (was für ein Wort&#8230;) ist umständlich bzw. erzeugt unnötigen Code.</li>
<li>Erschwertes Debuggen, da die Zeilennummern des generierten CSS nicht mit denen der Less-Definition übereinstimmen.</li>
<li>Aufwand für die Einarbeitung.</li>
<li>Die Kompilier sind teilweise fehleranfällig (z. B. werden keine Schleifen bei den import-Anweisungen erkannt).</li>
</ul>
<p>Nun zu dem erwähnten Beispiel. Wir haben z. B. fremden Code z. B. Twitter Bootstrap in unser Projekt eingebunden. Wir hüten uns natürlich davor diesen Code zu verändern, damit er leicht zu aktualisieren bleibt (z. B. könnte auch über svn:externals Code eingebunden werden). Nun möchten wir das Layout entsprechend den eigenen Designvorstellungen anpassen. Ich nehme exemplarisch folgende Konstellation an:</p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/05/less-example.png"><img class="alignnone size-full wp-image-857" title="Less Beispiel" src="http://tobias-seckinger.de/wp-content/uploads/2012/05/less-example.png" alt="Less Beispiel" width="145" height="108" /></a></p>
<p>Die Datei <em>new/default.less</em> stellt die neu zu schreibende Less-Definition dar, die Datei <em>3rdparty/lib.css</em> ist eine Definition einer Fremdbibliothek.</p>
<p>Der Inhalt der Dateien nehme ich wie folgt an:</p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/05/less-files.png"><img class="alignnone size-full wp-image-858" title="Less Dateien" src="http://tobias-seckinger.de/wp-content/uploads/2012/05/less-files.png" alt="Less Dateien in der Gegenüberstellung" width="896" height="208" /></a></p>
<p>Im Compiler (WinLess) wird nur die Datei <em>new/default.less</em> angegeben und kompiliert:</p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/05/less-compiler.png"><img class="alignnone size-full wp-image-859" title="Less Kompilierer" src="http://tobias-seckinger.de/wp-content/uploads/2012/05/less-compiler.png" alt="Less Kompilierer" width="862" height="538" /></a></p>
<p>Nun die spannende Frage: Was wird wohl rauskommen? Unter der Annahme, dass der Kompilierer zuerst die 3rdparty-Datei abarbeitet und anschließend alle weiteren Dateien (override.less und enthaltene Anweisungen) könnte man meinen, er würde im schlechtesten Fall einfach alle Anweisungen nacheinander aufreihen. Im besten Fall würde eine einzige body-Anweisung erzeugt werden, die lautet</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;">body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span><span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;">;</span> // übersetzter Wert <span style="color: #ff0000;">&quot;red&quot;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span><span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span>verdana<span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span><span style="color: #933;">500px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Das Ergebnis sieht &#8211; wie vermutet &#8211; folgendermaßen aus:</p>

<div class="wp_syntax"><div class="code"><pre class="css" style="font-family:monospace;"><span style="color: #808080; font-style: italic;">/* Einbinden fremde Definition */</span>
body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">font-family</span><span style="color: #00AA00;">:</span> verdana<span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #933;">1px</span> <span style="color: #993333;">solid</span> <span style="color: #000000; font-weight: bold;">black</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* Überschreiben */</span>
body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">background-color</span><span style="color: #00AA00;">:</span> <span style="color: #cc00cc;">#ff0000</span><span style="color: #00AA00;">;</span>
  <span style="color: #000000; font-weight: bold;">border</span><span style="color: #00AA00;">:</span> <span style="color: #993333;">none</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span>
<span style="color: #808080; font-style: italic;">/* neue Anweisungen */</span>
body <span style="color: #00AA00;">&#123;</span>
  <span style="color: #000000; font-weight: bold;">width</span><span style="color: #00AA00;">:</span> <span style="color: #933;">500px</span><span style="color: #00AA00;">;</span>
<span style="color: #00AA00;">&#125;</span></pre></div></div>

<p>Von schlankem CSS will ich hier nicht sprechen. Außerdem ist nicht mehr ersichtlich, dass der Hintergrund in der ursprünglichen Anweisung den Wert &#8220;#5B83AD&#8221; hatte.</p>
<h2>Fazit</h2>
<p>Auf den ersten Blick erscheint eine zusätzliche Abstraktionsschicht interessant, insbesondere die Verwendung der Variablen und der sogenannten Mixins. In der Praxis erhöht sich der Entwicklungsaufwand jedoch nicht unerheblich (Stichwort: Debugging und Integration) und das erzeugte CSS ist in den meisten Fällen nicht kleiner als eigener Code. Der eigentlich Kernnutzen für mich läge im einfachen und optimierten Überschreiben von bestehenden Less-Definitionen. Leider sind dafür die Kompilier noch nicht optimiert.</p>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/05/mehr-css-mit-less/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Nikto2</title>
		<link>http://tobias-seckinger.de/2012/04/nikto2/</link>
		<comments>http://tobias-seckinger.de/2012/04/nikto2/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 20:54:27 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[Apache]]></category>
		<category><![CDATA[Tools]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=854</guid>
		<description><![CDATA[Notiz an mich: Das Tool Nikto2 testet Webserver, insbesondere um verwundbare CGI-Verzeichnisse und Skripte aufzufinden.]]></description>
			<content:encoded><![CDATA[<p>Notiz an mich: Das Tool Nikto2 testet Webserver, insbesondere um verwundbare CGI-Verzeichnisse und Skripte aufzufinden.</p>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/04/nikto2/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>4. Zend Tutorial</title>
		<link>http://tobias-seckinger.de/2012/04/4-zend-tutorial/</link>
		<comments>http://tobias-seckinger.de/2012/04/4-zend-tutorial/#comments</comments>
		<pubDate>Sun, 29 Apr 2012 20:29:28 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Zend]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=848</guid>
		<description><![CDATA[Nachdem ich im dritten Tutorial erklärt hatte, wie die (vorläufige) Struktur der Datenbank aussieht, müssen wir noch ein paar Vorbereitungen schaffen, damit wir einfach unsere Datenbank aktualisieren können. Das ganze habe ich bereits in meinem Artikel Zend Framework und Liquibase &#8230; <a href="http://tobias-seckinger.de/2012/04/4-zend-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Nachdem ich im <a title="3. Zend Tutorial" href="http://tobias-seckinger.de/2012/04/3-zend-tutorial/" target="_blank">dritten </a>Tutorial erklärt hatte, wie die (vorläufige) Struktur der Datenbank aussieht, müssen wir noch ein paar Vorbereitungen schaffen, damit wir einfach unsere Datenbank aktualisieren können. Das ganze habe ich bereits in meinem Artikel <a title="Permalink to Zend Framework und Liquibase" href="../2011/10/zend-framework-und-liquibase/" rel="bookmark">Zend Framework und Liquibase</a> beschrieben. Ich möchte dazu auch nur die Abweichungen niederschreiben.</p>
<h2>Ant Build Datei</h2>
<p>Die Ant-Build-Datei sieht folgendermaßen aus:</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;project</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;liquibase-test&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    Zend Framework Tutorial
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/description<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- prepare --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;prepare&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;path</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;library.classpath&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;library/3rdparty/mysql&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;fileset</span> <span style="color: #000066;">dir</span>=<span style="color: #ff0000;">&quot;library/3rdparty/liquibase&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;*.jar&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/fileset<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/path<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;taskdef</span> <span style="color: #000066;">resource</span>=<span style="color: #ff0000;">&quot;liquibasetasks.properties&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;classpath</span> <span style="color: #000066;">refid</span>=<span style="color: #ff0000;">&quot;library.classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/taskdef<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- set global properties for this build --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;changelog.file&quot;</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;db/changelog.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;base.path&quot;</span> <span style="color: #000066;">location</span>=<span style="color: #ff0000;">&quot;.&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- properties --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;properties_development&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;prepare&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;database.driver&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;com.mysql.jdbc.Driver&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;database.url&quot;</span> </span>
<span style="color: #009900;">       <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;jdbc:mysql://localhost/zend_volleyball&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;database.user&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;root&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;property</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;database.password&quot;</span> <span style="color: #000066;">value</span>=<span style="color: #ff0000;">&quot;&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #808080; font-style: italic;">&lt;!-- development --&gt;</span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;target</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;development&quot;</span> <span style="color: #000066;">depends</span>=<span style="color: #ff0000;">&quot;properties_development&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;updateDatabase</span> <span style="color: #000066;">changeLogFile</span>=<span style="color: #ff0000;">&quot;${changelog.file}&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">driver</span>=<span style="color: #ff0000;">&quot;${database.driver}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">url</span>=<span style="color: #ff0000;">&quot;${database.url}&quot;</span> <span style="color: #000066;">username</span>=<span style="color: #ff0000;">&quot;${database.user}&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">password</span>=<span style="color: #ff0000;">&quot;${database.password}&quot;</span></span>
<span style="color: #009900;">      <span style="color: #000066;">classpathref</span>=<span style="color: #ff0000;">&quot;library.classpath&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/target<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/project<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Damit das ganze funktioniert müssen folgende Voraussetzungen erfüllt sein:</p>
<ul>
<li>Im Ordner <em>library/3rdparty/mysql</em> muß ein <a title="Connector/J 5.1.18" href="http://www.mysql.de/downloads/connector/j/" target="_blank">MySQL-Connector</a> verfügbar sein,</li>
<li>Im Ornder <em>library/3rdparty/liquidbase</em> muss Liquidbase verfügbar sein,</li>
<li>Ant muss installiert sein. Das habe ich in <a title="Ant unter Windows 7 installieren" href="http://tobias-seckinger.de/2011/09/ant-unter-windows-7-installieren/" target="_blank">Ant unter Windows 7 installieren</a> bereits beschrieben.</li>
<li>Java muß auf dem System installiert sein.</li>
<li>Die Datei <em>db/changelog.xml</em> muss angelegt werden. Inhalt wie nachfolgend beschrieben.</li>
</ul>
<h2>Liquidbase</h2>
<p>Die Datei changelog.xml stellt den Einstiegspunkt  für Liquidbase dar. Dort referenzieren wir bisher nur eine weitere Datei:</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;databaseChangeLog</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.liquibase.org/xml/ns/dbchangelog&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.liquibase.org/xml/ns/dbchangelog</span>
<span style="color: #009900;">    http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
 
 <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;include</span> <span style="color: #000066;">file</span>=<span style="color: #ff0000;">&quot;/db/001.setup.xml&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span> 
 
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/databaseChangeLog<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>Nun formulieren wir unser Datenbank Model in Liquidbase:</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>
&nbsp;
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;databaseChangeLog</span> <span style="color: #000066;">xmlns</span>=<span style="color: #ff0000;">&quot;http://www.liquibase.org/xml/ns/dbchangelog&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xmlns:xsi</span>=<span style="color: #ff0000;">&quot;http://www.w3.org/2001/XMLSchema-instance&quot;</span></span>
<span style="color: #009900;">  <span style="color: #000066;">xsi:schemaLocation</span>=<span style="color: #ff0000;">&quot;http://www.liquibase.org/xml/ns/dbchangelog</span>
<span style="color: #009900;">         http://www.liquibase.org/xml/ns/dbchangelog/dbchangelog-2.0.xsd&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;preConditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;dbms</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;mysql&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/preConditions<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;changeSet</span> <span style="color: #000066;">id</span>=<span style="color: #ff0000;">&quot;10&quot;</span> <span style="color: #000066;">author</span>=<span style="color: #ff0000;">&quot;set&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- Team --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;createTable</span> <span style="color: #000066;">tableName</span>=<span style="color: #ff0000;">&quot;volleyball_team&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- common --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;id&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;int&quot;</span> <span style="color: #000066;">autoIncrement</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraints</span> <span style="color: #000066;">primaryKey</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">nullable</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;varchar(255)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraints</span> <span style="color: #000066;">nullable</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;available&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;fee_paid&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;boolean&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;competition_id&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;int&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;group_id&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;int&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/createTable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
&nbsp;
    <span style="color: #808080; font-style: italic;">&lt;!-- Competition --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;createTable</span> <span style="color: #000066;">tableName</span>=<span style="color: #ff0000;">&quot;volleyball_competition&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- common --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;id&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;int&quot;</span> <span style="color: #000066;">autoIncrement</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraints</span> <span style="color: #000066;">primaryKey</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">nullable</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;varchar(255)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraints</span> <span style="color: #000066;">nullable</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;start&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;datetime&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;single_duration&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;time&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;number_of_sets&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;int&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/createTable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    
    <span style="color: #808080; font-style: italic;">&lt;!-- Group --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;createTable</span> <span style="color: #000066;">tableName</span>=<span style="color: #ff0000;">&quot;volleyball_group&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
      <span style="color: #808080; font-style: italic;">&lt;!-- common --&gt;</span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;id&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;int&quot;</span> <span style="color: #000066;">autoIncrement</span>=<span style="color: #ff0000;">&quot;true&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraints</span> <span style="color: #000066;">primaryKey</span>=<span style="color: #ff0000;">&quot;true&quot;</span> <span style="color: #000066;">nullable</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;column</span> <span style="color: #000066;">name</span>=<span style="color: #ff0000;">&quot;name&quot;</span> <span style="color: #000066;">type</span>=<span style="color: #ff0000;">&quot;varchar(255)&quot;</span><span style="color: #000000; font-weight: bold;">&gt;</span></span>
        <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;constraints</span> <span style="color: #000066;">nullable</span>=<span style="color: #ff0000;">&quot;false&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
      <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/column<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/createTable<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
    
    <span style="color: #808080; font-style: italic;">&lt;!-- Fremdschlüssel --&gt;</span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;addForeignKeyConstraint</span> <span style="color: #000066;">constraintName</span>=<span style="color: #ff0000;">&quot;fk_competition_team&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">baseTableName</span>=<span style="color: #ff0000;">&quot;volleyball_team&quot;</span> <span style="color: #000066;">baseColumnNames</span>=<span style="color: #ff0000;">&quot;competition_id&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">referencedTableName</span>=<span style="color: #ff0000;">&quot;volleyball_competition&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">referencedColumnNames</span>=<span style="color: #ff0000;">&quot;id&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
    <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;addForeignKeyConstraint</span> <span style="color: #000066;">constraintName</span>=<span style="color: #ff0000;">&quot;fk_group_team&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">baseTableName</span>=<span style="color: #ff0000;">&quot;volleyball_team&quot;</span> <span style="color: #000066;">baseColumnNames</span>=<span style="color: #ff0000;">&quot;group_id&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">referencedTableName</span>=<span style="color: #ff0000;">&quot;volleyball_group&quot;</span> </span>
<span style="color: #009900;">      <span style="color: #000066;">referencedColumnNames</span>=<span style="color: #ff0000;">&quot;id&quot;</span> <span style="color: #000000; font-weight: bold;">/&gt;</span></span>
  <span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/changeSet<span style="color: #000000; font-weight: bold;">&gt;</span></span></span>
<span style="color: #009900;"><span style="color: #000000; font-weight: bold;">&lt;/databaseChangeLog<span style="color: #000000; font-weight: bold;">&gt;</span></span></span></pre></div></div>

<p>An sich nichts spannendes. Wenn man sich ein bisschen in die Dokumentation von Liquidbase einliest, ist das kein Problem mehr. Wenn alles richtig gemacht wurde können wir das Ant-Skript in der Konsole starten und sollten folgende Ausgabe erhalten:</p>
<div id="attachment_850" class="wp-caption alignnone" style="width: 684px"><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-volleyball-liquidbase-run1.png"><img class="size-full wp-image-850" title="Ant Skript ausführen" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-volleyball-liquidbase-run1.png" alt="Ant Skript ausführen" width="674" height="322" /></a><p class="wp-caption-text">So sollte die Ausgabe in der Konsole aussehen.</p></div>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/04/4-zend-tutorial/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>3. Zend Tutorial</title>
		<link>http://tobias-seckinger.de/2012/04/3-zend-tutorial/</link>
		<comments>http://tobias-seckinger.de/2012/04/3-zend-tutorial/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 19:17:06 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Datenbanken]]></category>
		<category><![CDATA[Zend]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=840</guid>
		<description><![CDATA[Im ersten und zweiten Tutorial haben wir die Grundlagen geschaffen, nun will ich mit der Planung bzw. Architektur zu der Beispiel-Anwendung beginnen. Ich habe mir eine Turnier-Verwaltung ausgedacht, da man sich darin gleich reindenken kann und die Anforderungen zu Beginn &#8230; <a href="http://tobias-seckinger.de/2012/04/3-zend-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Im <a title="1. Zend Tutorial" href="http://tobias-seckinger.de/2012/04/1-zend-tutorial/">ersten </a>und <a title="2. Zend Tutorial" href="http://tobias-seckinger.de/2012/04/2-zend-tutorial/">zweiten </a>Tutorial haben wir die Grundlagen geschaffen, nun will ich mit der Planung bzw. Architektur zu der Beispiel-Anwendung beginnen. Ich habe mir eine Turnier-Verwaltung ausgedacht, da man sich darin gleich reindenken kann und die Anforderungen zu Beginn nicht zu hoch sind. Also was brauchen wir auf Datenbank-Ebene? Eine Tabelle für die Mannschaften und eine für die Turniere. Außerdem möchte ich die Mannschaften einer Gruppe zuordnen können (Gruppierung). Somit sieht das erste Datenbank-Diagramm folgendermaßen aus:</p>
<div id="attachment_841" class="wp-caption alignnone" style="width: 490px"><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/volleyball_db.png"><img class="size-full wp-image-841" title="Erstes Datenbankschema der Beispielanwendung" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/volleyball_db.png" alt="Erstes Datenbankschema der Beispielanwendung" width="480" height="260" /></a><p class="wp-caption-text">Erstes Datenbankschema der Beispielanwendung</p></div>
<p>Zur Tabelle <em>Competition</em>: Auch ein Turnier hat einen Namen und ein geplanten Startermin. Für das Turnier wird auch festgelegt, wie lange ein Spiel gehen soll (single_duration) und wieviele Sätze pro Spiel gemacht werden (number_of_sets). Das wären z. B. beim Volleyball die einzelnen Sätze eines Spiels.</p>
<p>Zur Tabelle <em>Team</em>: Ein Team besteht aus einem Namen und muß am Tag des Turniers auch da sein (<em>available</em>). Außerdem muß vorher eine Gebühr bezahlt werden (<em>fee_paid</em>). Diese zwei Spalten speichern lediglich Bool-Werte ab.</p>
<p>Zur Tabelle <em>Group</em>: Eine Gruppe hat lediglich einen Namen. Dadurch kann z. B. gekennzeichnet werden, dass ein Verein mehrere Mannschaften stellen kann. Dies kann dann später im Spielplan berücksichtigt werden.</p>
<p>Der Zend-Server kann gleich mit einer mySql-Datenbank installiert werden. Deswegen werde ich diese Datenbank zugrunde legen.</p>
<h2>Datenbankverbindung</h2>
<p>Eine Datenbankverbindung kann über das zf-Tool eingerichtet werden. Ich habe das schon in dem Artikel <a title="Permalink to Datenbank unter Zend" href="../2012/03/datenbank-unter-zend/" rel="bookmark">Datenbank unter Zend</a> ausführlich beschrieben.</p>
<h2>ORM</h2>
<p><abbr title="object relational mapping">ORM</abbr> steht für <strong>Object-Relational Mapping</strong> und ist nichts anderes, als dass rationale Datenbanken auf Objekte abgebildet werden. Im offiziellen Zend-Tutorial werden dazu Model-, Mapper-, und Table-Klassen verwendet. Nachfolgende Skizze soll das verdeutlichen:</p>
<div id="attachment_842" class="wp-caption alignnone" style="width: 350px"><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend_mapping_schema.png"><img class="size-full wp-image-842" title="Zend Datenbank Abbildungen" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend_mapping_schema.png" alt="Zend Datenbank Abbildungen" width="340" height="440" /></a><p class="wp-caption-text">Prinzip des Zend Datenbank ORM</p></div>
<p>Im Pseudocode der Funktion <em>fetchAll</em> sehen wir, dass im Mapper eine Instanz der Datenbank-Abstraktion geholt wird (z. B. eine MySql-Adapter-Klasse) über die Daten von der Datenbank geholt wird. Anschließend werden die Daten auf das Model abgebildet und zurückgegeben.</p>
<h2>zf-Tool</h2>
<p>Den Adapter konfigurieren und die ersten Klassen anlegen können wir einfach mit dem zf-Tool erledigen:</p>
<pre>zf configure dbadapter "adapter=Pdo_Mysql&amp;username=test&amp;
                        password=test&amp;dbname=zend_volleyball"
zf create db-table Team team
zf create db-table Competition competition
zf create db-table Group group
zf create model Team
zf create model Competition
zf create model Group</pre>
<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/04/3-zend-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>SVN Externals</title>
		<link>http://tobias-seckinger.de/2012/04/svn-externals/</link>
		<comments>http://tobias-seckinger.de/2012/04/svn-externals/#comments</comments>
		<pubDate>Wed, 25 Apr 2012 17:45:46 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Allgemein]]></category>
		<category><![CDATA[SVN]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=835</guid>
		<description><![CDATA[Meistens gibt es in einer Anwendung Bestandteile, die man immer wieder benötigt z. B. eine externe Bibliothek oder ähnliches. Dies sollte man nicht jedesmal von neuem in den SVN Zweig einspielen, sondern über die Properties svn:externals als externe Resource einbinden. &#8230; <a href="http://tobias-seckinger.de/2012/04/svn-externals/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Meistens gibt es in einer Anwendung Bestandteile, die man immer wieder benötigt z. B. eine externe Bibliothek oder ähnliches. Dies sollte man nicht jedesmal von neuem in den SVN Zweig einspielen, sondern über die Properties svn:externals als externe Resource einbinden. Unter Eclipse ist das ganz einfach:</p>
<ul>
<li>Den übergeordneten Ordner selektieren</li>
<li>Rechtsklick -&gt; Team -&gt; &#8220;Set property&#8230;&#8221; auswählen</li>
<li>Dort svn:externals auswählen</li>
<li>Als Wert die externe Resource hinterlegen z. B. [Zielordner] [SVN-URL]</li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/04/svn-externals/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>2. Zend Tutorial</title>
		<link>http://tobias-seckinger.de/2012/04/2-zend-tutorial/</link>
		<comments>http://tobias-seckinger.de/2012/04/2-zend-tutorial/#comments</comments>
		<pubDate>Tue, 24 Apr 2012 20:41:14 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Zend]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=827</guid>
		<description><![CDATA[Heute will ich die Grundlage des Layouts auf ordentliche Füße stellen. In meinen letzten Projekten habe ich mit dem HTML Kickstarter 99limes gearbeitet und möchte nun etwas anderes probieren. Ich habe von Twitter Bootstrap gelesen und die Webseite macht für &#8230; <a href="http://tobias-seckinger.de/2012/04/2-zend-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Heute will ich die Grundlage des Layouts auf ordentliche Füße stellen. In meinen letzten Projekten habe ich mit dem <a title="Ultra–Lean HTML Building Blocks for Rapid Website Production" href="http://www.99lime.com/" target="_blank">HTML Kickstarter 99limes</a> gearbeitet und möchte nun etwas anderes probieren. Ich habe von <a title="imple and flexible HTML, CSS, and Javascript for popular user interface components and interactions." href="http://twitter.github.com/bootstrap/index.html" target="_blank">Twitter Bootstrap</a> gelesen und die Webseite macht für mich einen guten Eindruck. Wir laden im ersten Schritt den Quellcode von der Webseite. Das ist eine einzelne Zip-Datei, die wir im public verzeichnis unserer Applikation entpacken &#8211; genauer gesagt werden die Dateien im Verzeichnis /public/3rdparty/twitter/bootstrap entpackt.</p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-twitter-bootstrap.png"><img class="alignnone size-full wp-image-828" title="Twitter Bootstrap Verzeichnisstruktur" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-twitter-bootstrap.png" alt="Twitter Bootstrap Verzeichnisstruktur" width="309" height="344" /></a></p>
<p>Wie integrieren wir das nun in unser Projekt? Richtig! In der Bootstrap.php ergänzen wir die folgenden zwei Zeilen:</p>

<div class="wp_syntax"><div class="code"><pre class="php-brief" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">// css</span>
<span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headLink</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendStylesheet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/3rdparty/twitter/bootstrap/css/bootstrap.min.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #666666; font-style: italic;">// js</span>
<span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headScript</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendStylesheet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/3rdparty/twitter/bootstrap/js/bootstrap.min.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span></pre></div></div>

<p>Wir haben noch das Problem, dass wir mit dem falschen Doctype arbeiten. Wir müssen das also in der settings.ini anpassen:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">resources.view.doctype<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">HTML5</span></pre></div></div>

<p>Es lohnt sich übrigens in die Framework-Datei /Zend/View/Helper/Doctype.php zu schauen. Dort sind diese Konstanten vordefiniert.</p>
<p>Nun können wir noch etwas Beispiel HTML-Code in unsere index.phtml einfügen und schon erhalten wir eine schöne Ausgabe. Der Quellcode für die Datei /application/views/scripts/index/index.phtml hab ich aufgrund der Menge mal <a title="Demo Inhalt" href="/demo/zend-tutorial-2-html.txt" target="_blank">hier </a>hinterlegt.</p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-index-view-example.png"><img class="alignnone size-full wp-image-830" title="Zend Beispiel Inhalt" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-index-view-example.png" alt="end Beispiel Inhalt" width="1301" height="717" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/04/2-zend-tutorial/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>1. Zend Tutorial</title>
		<link>http://tobias-seckinger.de/2012/04/1-zend-tutorial/</link>
		<comments>http://tobias-seckinger.de/2012/04/1-zend-tutorial/#comments</comments>
		<pubDate>Mon, 23 Apr 2012 20:08:02 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Zend]]></category>
		<category><![CDATA[Tutorial]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=813</guid>
		<description><![CDATA[Mal sehen wie weit ich komme, aber ich möchte für mich den Einstieg ins Zend Framework dokumentieren. Das ist der erste Artikel eine hoffentlich längeren Serie. Voraussetzung Die Voraussetzung für dieses Tutorial ist eine Zend Server CE Installation mit einer &#8230; <a href="http://tobias-seckinger.de/2012/04/1-zend-tutorial/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Mal sehen wie weit ich komme, aber ich möchte für mich den Einstieg ins Zend Framework dokumentieren. Das ist der erste Artikel eine hoffentlich längeren Serie.</p>
<h2>Voraussetzung</h2>
<p>Die Voraussetzung für dieses Tutorial ist eine Zend Server CE Installation mit einer MySQL Installation und ein wenig Grundwissen in PHP.</p>
<h2>Einrichtung</h2>
<p>Wir beginnen mit der Einrichtung des Vhost-Eintrags zu meinem Beispiel-Projekt:</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">&lt;<span style="color: #000000; font-weight:bold;">VirtualHost</span> *:<span style="color: #ff0000;">80</span>&gt;
   <span style="color: #00007f;">ServerAdmin</span> kontakt@tobias-seckinger.de
   <span style="color: #00007f;">DocumentRoot</span> <span style="color: #7f007f;">&quot;C:/wwwroot/zend_volleyball/public&quot;</span>
   <span style="color: #00007f;">ServerName</span> volleyball.local   
   &lt;<span style="color: #000000; font-weight:bold;">Directory</span> <span style="color: #7f007f;">&quot;C:/wwwroot/zend_volleyball/public&quot;</span>&gt;
        <span style="color: #00007f;">Options</span> <span style="color: #0000ff;">Indexes</span> <span style="color: #0000ff;">FollowSymLinks</span> <span style="color: #0000ff;">Includes</span> +ExecCGI
        <span style="color: #00007f;">AllowOverride</span> <span style="color: #0000ff;">All</span>
        <span style="color: #00007f;">Order</span> <span style="color: #00007f;">allow</span>,<span style="color: #00007f;">deny</span>
        <span style="color: #00007f;">Allow</span> from <span style="color: #0000ff;">all</span>
    &lt;/<span style="color: #000000; font-weight:bold;">Directory</span>&gt;
&lt;/<span style="color: #000000; font-weight:bold;">VirtualHost</span>&gt;</pre></div></div>

<p>Ich habe also im Verzeichnis</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">C:/wwwroot/</pre></div></div>

<p>erstmal nur ein Ordner zend_volleyball angelegt. Anschließend erstellen wir im Verzeichnis</p>

<div class="wp_syntax"><div class="code"><pre class="apache" style="font-family:monospace;">C:\Program Files (x86)\Zend\ZendServer/etc/sites.d/</pre></div></div>

<p>eine Datei mit dem Namen <em>vhost_volleyball.conf</em> mit dem obigen Inhalt. Die Datei wird nach dem Apache-Neustart ausgelesen, weil der Zend-Server in der <em>httpd.conf</em> folgende Zeile enthält:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">Include &quot;C:\Program Files (x86)\Zend\ZendServer/etc/sites.d/vhost_*.conf&quot;</pre></div></div>

<p>Nun öffnen wir ein Windows Konsole und wechseln in das Verzeichnis</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">C:/wwwroot/</pre></div></div>

<p>und tippen:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">zf create project zend_volleyball</pre></div></div>

<p>Anschließend aktivieren wir noch ein Standard-Layout. Dazu wechseln wir aber erst ins Verzeichnis zend_volleyball und tippen:</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">zf enable layout</pre></div></div>

<p>Wir müssen ggf. noch die hosts Datei von Windows ergänzen, damit die Seite lokal geladen wird. Wir öffnen die Datei</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">C:\Windows\System32\drivers\etc\hosts</pre></div></div>

<p>und ergänzen folgende Zeile</p>

<div class="wp_syntax"><div class="code"><pre class="batch" style="font-family:monospace;">127.0.0.1           volleyball.local</pre></div></div>

<p>Achso: Den Apache Neustart nicht vergessen.</p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-cmd-part1.png"><img class="alignnone size-full wp-image-815" title="Zend Konsolen Start" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-cmd-part1.png" alt="" width="672" height="253" /></a></p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-browser-part1.png"><img class="alignnone size-full wp-image-816" title="Zend Start - Ansicht im Browser" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-browser-part1.png" alt="" width="622" height="485" /></a></p>
<h2>Grundgerüst</h2>
<p>Wir wollen natürlich ein schönes HTML Grundgerüst haben inklusive eigenen Javascript und CSS-Dateien. Zuerst ergänzen wir unsere Bootstrap-Datei um folgende Methode (/application/Bootstrap.php):</p>

<div class="wp_syntax"><div class="code"><pre class="php-brief" style="font-family:monospace;">protected <span style="color: #000000; font-weight: bold;">function</span> _initApplication<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
<span style="color: #009900;">&#123;</span>
  <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bootstrap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">=</span><span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResource</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headMeta</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendHttpEquiv</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Content-Type'</span><span style="color: #339933;">,</span>
                                     <span style="color: #0000ff;">'text/html;charset=utf-8'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// meta</span>
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headMeta</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendName</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'keywords'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'Zend, Tutorial, Volleyball'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// css</span>
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headLink</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendStylesheet</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/css/default.css'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// js</span>
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headScript</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">appendFile</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'/js/common.js'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #666666; font-style: italic;">// title</span>
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setSeparator</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">' - '</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headTitle</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'Volleyball - Zend-Tutorial'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Damit das auch ausgegen werden kann, müssen wir in unserem Layout auch die passenden Anweisungen integrieren (/application/layouts/scripts/layout.phtml):</p>

<div class="wp_syntax"><div class="code"><pre class="php-brief" style="font-family:monospace;"><span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doctype</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;html xmlns=&quot;http://www.w3.org/1999/xhtml&quot; lang=&quot;de&quot;&gt;
&lt;head&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headTitle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headMeta</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headLink</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headStyle</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">headScript</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/head&gt;
&lt;body&gt;
  <span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">layout</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">content</span><span style="color: #339933;">;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&lt;/body&gt;
&lt;/html&gt;</pre></div></div>

<p>Wenn wir nun die Seite neu laden erhalten wir erstmal eine Fehlermeldung. Wir müssen noch eine Kleinigkeit in der application.ini ergänzen:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">resources.view<span style="">&#91;</span><span style="">&#93;</span> <span style="color: #000066; font-weight:bold;">=</span>
<span style="color: #666666; font-style: italic;">; Doctype setzen</span>
resources.view.doctype<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">xhtml1_strict</span></pre></div></div>

<p>Außerdem müssen wir die CSS und Javascript-Dateien anlegen:</p>
<ul>
<li>/public/css/common.css</li>
<li>/public/js/common.js</li>
</ul>
<p>Die Datei /application/views/scripts/index/index.phtml können wir aufräumen:</p>

<div class="wp_syntax"><div class="code"><pre class="html4strict" style="font-family:monospace;"><span style="color: #009900;">&lt;<span style="color: #000000; font-weight: bold;">div</span>&gt;</span>
  Übersicht
<span style="color: #009900;">&lt;<span style="color: #66cc66;">/</span><span style="color: #000000; font-weight: bold;">div</span>&gt;</span></pre></div></div>

<p>Anschließend sollten wir ungefähr folgende Ausgabe im Browser erhalten:</p>
<p><a href="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-setup-application-part1.png"><img class="alignnone size-full wp-image-824" title="Die Ausgabe nach kleineren Anpassungen" src="http://tobias-seckinger.de/wp-content/uploads/2012/04/zend-setup-application-part1.png" alt="" width="1006" height="574" /></a></p>
<p>Weiterführende Informationen:</p>
<ul>
<li><a title="Permalink to Verwendung von Zend_Tools" href="../2011/08/verwendung-von-zend_tools/" rel="bookmark">Verwendung von Zend_Tools</a></li>
<li><a title="Permalink to Das Zend Framework – Ein Startversuch" href="../2011/09/das-zend-framework-ein-startversuch/" rel="bookmark">Das Zend Framework – Ein Startversuch</a></li>
<li><a title="Permalink to Doctype unter Zend setzen" href="../2012/03/doctype-unter-zend-setzen/" rel="bookmark">Doctype unter Zend setzen</a></li>
</ul>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/04/1-zend-tutorial/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Lokale Datenbank mit JavaScript &#8211; LocalStorage</title>
		<link>http://tobias-seckinger.de/2012/03/lokale-datenbank-mit-javascript-localstorage/</link>
		<comments>http://tobias-seckinger.de/2012/03/lokale-datenbank-mit-javascript-localstorage/#comments</comments>
		<pubDate>Tue, 20 Mar 2012 21:48:14 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Datenbanken]]></category>
		<category><![CDATA[Javascript]]></category>
		<category><![CDATA[Datenbank]]></category>
		<category><![CDATA[Html5]]></category>
		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=803</guid>
		<description><![CDATA[Mit jStorage steht eine Javascript-Bibliothek, die den lokalen Speichermechanismus von HTML5 abstrahiert. Es werden sogar ältere Browser unterstützt, jedoch muß dann mit einer Speicherplatzbeschänkung gerechnet werden. Es gibt einige Vorteile die für diese Technologie sprechen: Cookies können nur eine sehr &#8230; <a href="http://tobias-seckinger.de/2012/03/lokale-datenbank-mit-javascript-localstorage/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Mit jStorage steht eine Javascript-Bibliothek, die den lokalen Speichermechanismus von HTML5 abstrahiert. Es werden sogar ältere Browser unterstützt, jedoch muß dann mit einer Speicherplatzbeschänkung gerechnet werden.</p>
<div id="attachment_804" class="wp-caption alignnone" style="width: 741px"><a href="http://tobias-seckinger.de/wp-content/uploads/2012/03/jstorage.png"><img class="size-full wp-image-804" title="jstorage" src="http://tobias-seckinger.de/wp-content/uploads/2012/03/jstorage.png" alt="Browserunterstützung von jStorage" width="731" height="321" /></a><p class="wp-caption-text">Browserunterstützung von jStorage - Quelle: http://www.jstorage.info</p></div>
<p>Es gibt einige Vorteile die für diese Technologie sprechen:</p>
<ul>
<li>Cookies können nur eine sehr begrenzte Datenmenge aufnehmen (max. 80 kB).</li>
<li>Gespeicherten Daten werden nicht wie bei den Cookies bei einem Request mitgeschickt.</li>
<li>Lokal gespeicherte Daten laufen nicht ab (sofern kein Gültigkeitszeitraum definiert wurde).</li>
<li>Cookies können (leicht) deaktiviert werden und haben zum Teil einen schlechten Ruf.</li>
</ul>
<h2>Funktionsumfang von jStorage</h2>
<p>Die wichtigsten Funktionen sind:</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">jStorage</span>.<span style="color: #660066;">set</span><span style="color: #009900;">&#40;</span>key<span style="color: #339933;">,</span> value<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Mit der Set-Funktion können Schlüssel-Werte-Paare gespeichert werden. Der Schlüssel muß ein String sein. Der Wert kann außer einem skalaren Wert auch ein JSON-Objekt, ein Array oder ein XML-Node sein.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">jStorage</span>.<span style="color: #660066;">get</span><span style="color: #009900;">&#40;</span>key<span style="color: #009900;">&#41;</span></pre></div></div>

<p>Mit der Get-Funktion werden die Werte abgerufen.</p>

<div class="wp_syntax"><div class="code"><pre class="javascript" style="font-family:monospace;">$.<span style="color: #660066;">jStorage</span>.<span style="color: #660066;">storageAvailable</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span></pre></div></div>

<p>Mit dieser Funktion wird abgefragt, ob die Funktion im Browser überhaupt zur Verfügung steht.</p>
<p>Ich habe mir diesmal die Mühe gemacht eine kleine Demo zu erstellen:</p>
<p><a title="Demonstration des lokalen Speichers" href="http://tobias-seckinger.de/demo/localstorage/" target="_blank">Demo im neuen Fenster öffnen.</a></p>
<h2>Demo</h2>
<p><iframe src="http://tobias-seckinger.de/demo/localstorage/index.html" width="731" height="425"></iframe></p>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/03/lokale-datenbank-mit-javascript-localstorage/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Doctype unter Zend setzen</title>
		<link>http://tobias-seckinger.de/2012/03/doctype-unter-zend-setzen/</link>
		<comments>http://tobias-seckinger.de/2012/03/doctype-unter-zend-setzen/#comments</comments>
		<pubDate>Thu, 15 Mar 2012 18:00:48 +0000</pubDate>
		<dc:creator>Tobias Seckinger</dc:creator>
				<category><![CDATA[Zend]]></category>

		<guid isPermaLink="false">http://tobias-seckinger.de/?p=797</guid>
		<description><![CDATA[Über die application.ini kann dies leicht gemacht werden: resources.view&#91;&#93; = resources.view.doctype=xhtml1_strict Es gibt auch die Möglichkeit das in der Bootstrap.php zu machen, wobei ich erste Methode bevorzuge: protected function _initDoctype&#40;&#41; &#123; $this-&#62;bootstrap&#40;'view'&#41;; $view = $this-&#62;getResource&#40;'view'&#41;; $view-&#62;doctype&#40;'XHTML1_STRICT'&#41;; &#125; Es sollte natürlich &#8230; <a href="http://tobias-seckinger.de/2012/03/doctype-unter-zend-setzen/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Über die application.ini kann dies leicht gemacht werden:</p>

<div class="wp_syntax"><div class="code"><pre class="ini" style="font-family:monospace;">resources.view<span style="">&#91;</span><span style="">&#93;</span> <span style="color: #000066; font-weight:bold;">=</span>
resources.view.doctype<span style="color: #000066; font-weight:bold;">=</span><span style="color: #660066;">xhtml1_strict</span></pre></div></div>

<p>Es gibt auch die Möglichkeit das in der Bootstrap.php zu machen, wobei ich erste Methode bevorzuge:</p>

<div class="wp_syntax"><div class="code"><pre class="php-brief" style="font-family:monospace;">protected <span style="color: #000000; font-weight: bold;">function</span> _initDoctype<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> 
<span style="color: #009900;">&#123;</span> 
  <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bootstrap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #0000ff;">$view</span> <span style="color: #339933;">=</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getResource</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'view'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
  <span style="color: #0000ff;">$view</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doctype</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'XHTML1_STRICT'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span> 
<span style="color: #009900;">&#125;</span></pre></div></div>

<p>Es sollte natürlich ein Layout aktiv sein. Das macht man am besten mit der Konsole:</p>

<div class="wp_syntax"><div class="code"><pre class="bash" style="font-family:monospace;">zf <span style="color: #7a0874; font-weight: bold;">enable</span> layout</pre></div></div>

<p>In der layout.phtml kann dann die Doctype-Anweisung ausgegeben werden:</p>

<div class="wp_syntax"><div class="code"><pre class="php-brief" style="font-family:monospace;">&lt;!-- application/layouts/scripts/layout.phtml --&gt;
 
<span style="color: #000000; font-weight: bold;">&lt;?php</span> <span style="color: #990000;">echo</span> <span style="color: #0000ff;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">doctype</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span> <span style="color: #000000; font-weight: bold;">?&gt;</span>
&nbsp;
....</pre></div></div>

<p>&nbsp;</p>
]]></content:encoded>
			<wfw:commentRss>http://tobias-seckinger.de/2012/03/doctype-unter-zend-setzen/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

