<?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>coffeecoders.de &#187; zend</title>
	<atom:link href="http://coffeecoders.de/tag/zend/feed/" rel="self" type="application/rss+xml" />
	<link>http://coffeecoders.de</link>
	<description>professional devs at work</description>
	<lastBuildDate>Tue, 13 Sep 2011 16:34:02 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Bootstrapping Doctrine 1.2 and Zend 1.10/1.11 the easy way</title>
		<link>http://coffeecoders.de/2010/10/bootstrapping-doctrine-1-2-and-zend-1-10-and-1-11-the-easy-way/</link>
		<comments>http://coffeecoders.de/2010/10/bootstrapping-doctrine-1-2-and-zend-1-10-and-1-11-the-easy-way/#comments</comments>
		<pubDate>Sun, 17 Oct 2010 17:12:13 +0000</pubDate>
		<dc:creator>Daff</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[doctrine]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=262</guid>
		<description><![CDATA[So there seem to be many different ways to get the 1.2 version of Doctrine running with the Zend Framework (currently 1.11) but the easiest way that worked for me, after using the Zend framework command line tool to create &#8230; <a href="http://coffeecoders.de/2010/10/bootstrapping-doctrine-1-2-and-zend-1-10-and-1-11-the-easy-way/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>So there seem to be many different ways to get the <a href="http://www.doctrine-project.org/projects/orm/1.2/docs/en">1.2 version of Doctrine</a> running with the <a href="http://framework.zend.com/">Zend Framework (currently 1.11)</a> but the easiest way that worked for me, after using the Zend framework command line tool to create a new standard project, made my application bootstrap file look like this:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p262code4'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2624"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
</pre></td><td class="code" id="p262code4"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">&lt;</span> ?php
&nbsp;
<span style="color: #000000; font-weight: bold;">class</span> Bootstrap <span style="color: #000000; font-weight: bold;">extends</span> Zend_Application_Bootstrap_Bootstrap
<span style="color: #009900;">&#123;</span>
	<span style="color: #000000; font-weight: bold;">protected</span> <span style="color: #000000; font-weight: bold;">function</span> _initDoctrine<span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span>
	<span style="color: #009900;">&#123;</span>
		<span style="color: #000088;">$manager</span> <span style="color: #339933;">=</span> Doctrine_Manager<span style="color: #339933;">::</span><span style="color: #004000;">getInstance</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #000088;">$options</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$this</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;doctrine&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'models_path'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'models_path'</span><span style="color: #009900;">&#93;</span> <span style="color: #339933;">=</span>  APPLICATION_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/models'</span><span style="color: #339933;">;</span>
&nbsp;
		<span style="color: #b1b100;">foreach</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span> <span style="color: #b1b100;">as</span> <span style="color: #000088;">$key</span> <span style="color: #339933;">=&gt;</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span>
		<span style="color: #009900;">&#123;</span>
			<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span> <span style="color: #339933;">!=</span> <span style="color: #0000ff;">'connection'</span><span style="color: #009900;">&#41;</span>
				<span style="color: #000088;">$manager</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">setAttribute</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$key</span><span style="color: #339933;">,</span> <span style="color: #000088;">$value</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #009900;">&#125;</span>
&nbsp;
		<span style="color: #b1b100;">if</span><span style="color: #009900;">&#40;</span><a href="http://www.php.net/empty"><span style="color: #990000;">empty</span></a><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'connection'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span>
			<span style="color: #b1b100;">throw</span> <span style="color: #000000; font-weight: bold;">new</span> Exception<span style="color: #009900;">&#40;</span><span style="color: #0000ff;">&quot;No database connection string provided!&quot;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
		Doctrine_Manager<span style="color: #339933;">::</span><span style="color: #004000;">connection</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'connection'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		Doctrine<span style="color: #339933;">::</span><span style="color: #004000;">loadModels</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$options</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'models_path'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
		<span style="color: #b1b100;">return</span> <span style="color: #000088;">$manager</span><span style="color: #339933;">;</span>
	<span style="color: #009900;">&#125;</span>
<span style="color: #009900;">&#125;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>The application.ini configuration file then needs some of these information:</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p262code5'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2625"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
</pre></td><td class="code" id="p262code5"><pre class="php" style="font-family:monospace;"><span style="color: #339933;">;</span> Database configuration
doctrine<span style="color: #339933;">.</span>connection <span style="color: #339933;">=</span> <span style="color: #0000ff;">&quot;mysql://user:pass@localhost/database&quot;</span>
doctrine<span style="color: #339933;">.</span>models_path <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #0000ff;">&quot;/models&quot;</span>
doctrine<span style="color: #339933;">.</span>data_fixtures_path <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/data/fixtures&quot;</span>  
doctrine<span style="color: #339933;">.</span>migrations_path <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/data/migrations&quot;</span>  
doctrine<span style="color: #339933;">.</span>sql_path <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/data/sql&quot;</span>
doctrine<span style="color: #339933;">.</span>yaml_schema_path <span style="color: #339933;">=</span> APPLICATION_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">&quot;/data/schema
; Options for generating models from YAML
doctrine.generate_models_options.phpDocPackage = &quot;</span>Your PHP doc package<span style="color: #0000ff;">&quot;
doctrine.generate_models_options.phpDocSubpackage = &quot;</span>Subpackage<span style="color: #0000ff;">&quot;  
doctrine.generate_models_options.baseClassName = &quot;</span>Model_<span style="color: #0000ff;">&quot;  
doctrine.generate_models_options.phpDocName = &quot;</span>Your name<span style="color: #0000ff;">&quot;  
doctrine.generate_models_options.phpDocEmail = &quot;</span>email<span style="color: #339933;">@</span>address<span style="color: #339933;">.</span>com<span style="color: #0000ff;">&quot;  
; Set this to true to generate base classes. Set to false to make autoloading easier
doctrine.generate_models_options.generateBaseClasses = false</span></pre></td></tr></table></div>

<p>The command line interface is a good way of dealing with model and database generation, this is how the PHP CLI script for Doctrin + Zend looks like (inspired by <a href="http://blog.kartaca.com/?p=344">this post</a>):</p>

<div class="wp_codebox_msgheader"><span class="right"><sup><a href="http://www.ericbess.com/ericblog/2008/03/03/wp-codebox/#examples" target="_blank" title="WP-CodeBox HowTo?"><span style="color: #99cc00">?</span></a></sup></span><span class="left"><a href="javascript:;" onclick="javascript:showCodeTxt('p262code6'); return false;">View Code</a> PHP</span><div class="codebox_clear"></div></div><div class="wp_codebox"><table><tr id="p2626"><td class="line_numbers"><pre>1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
</pre></td><td class="code" id="p262code6"><pre class="php" style="font-family:monospace;"><span style="color: #666666; font-style: italic;">#!/usr/bin/php
</span><span style="color: #339933;">&lt;</span> ?php
<span style="color: #009933; font-style: italic;">/**
 * Doctrine CLI script
 */</span>
&nbsp;
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'APPLICATION_ENV'</span><span style="color: #339933;">,</span> <span style="color: #0000ff;">'development'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/define"><span style="color: #990000;">define</span></a><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'APPLICATION_PATH'</span><span style="color: #339933;">,</span> <a href="http://www.php.net/realpath"><span style="color: #990000;">realpath</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/dirname"><span style="color: #990000;">dirname</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900; font-weight: bold;">__FILE__</span><span style="color: #009900;">&#41;</span> <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/../application'</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<a href="http://www.php.net/set_include_path"><span style="color: #990000;">set_include_path</span></a><span style="color: #009900;">&#40;</span><a href="http://www.php.net/implode"><span style="color: #990000;">implode</span></a><span style="color: #009900;">&#40;</span>PATH_SEPARATOR<span style="color: #339933;">,</span> <a href="http://www.php.net/array"><span style="color: #990000;">array</span></a><span style="color: #009900;">&#40;</span>
    <a href="http://www.php.net/realpath"><span style="color: #990000;">realpath</span></a><span style="color: #009900;">&#40;</span>APPLICATION_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/../library'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
    <a href="http://www.php.net/get_include_path"><span style="color: #990000;">get_include_path</span></a><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">,</span>
<span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #b1b100;">require_once</span> <span style="color: #0000ff;">'Zend/Application.php'</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #666666; font-style: italic;">// Create application, bootstrap, and run</span>
<span style="color: #000088;">$application</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Zend_Application<span style="color: #009900;">&#40;</span>
    APPLICATION_ENV<span style="color: #339933;">,</span>
    APPLICATION_PATH <span style="color: #339933;">.</span> <span style="color: #0000ff;">'/configs/application.ini'</span>
<span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$application</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getBootstrap</span><span style="color: #009900;">&#40;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">bootstrap</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'doctrine'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$config</span> <span style="color: #339933;">=</span> <span style="color: #000088;">$application</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">getOption</span><span style="color: #009900;">&#40;</span><span style="color: #0000ff;">'doctrine'</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
&nbsp;
<span style="color: #000088;">$cli</span> <span style="color: #339933;">=</span> <span style="color: #000000; font-weight: bold;">new</span> Doctrine_Cli<span style="color: #009900;">&#40;</span><span style="color: #000088;">$config</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000088;">$cli</span><span style="color: #339933;">-&gt;</span><span style="color: #004000;">run</span><span style="color: #009900;">&#40;</span><span style="color: #000088;">$_SERVER</span><span style="color: #009900;">&#91;</span><span style="color: #0000ff;">'argv'</span><span style="color: #009900;">&#93;</span><span style="color: #009900;">&#41;</span><span style="color: #339933;">;</span>
<span style="color: #000000; font-weight: bold;">?&gt;</span></pre></td></tr></table></div>

<p>With this you can get started to use Doctrine + Zend Framework.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2010/10/bootstrapping-doctrine-1-2-and-zend-1-10-and-1-11-the-easy-way/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Using the Zend Framework 1.8 Bootstrapper and Doctrine 1.1.0</title>
		<link>http://coffeecoders.de/2009/06/using-the-zend-framework-18-bootstrapper-and-doctrine-110/</link>
		<comments>http://coffeecoders.de/2009/06/using-the-zend-framework-18-bootstrapper-and-doctrine-110/#comments</comments>
		<pubDate>Wed, 10 Jun 2009 12:59:19 +0000</pubDate>
		<dc:creator>Daff</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=221</guid>
		<description><![CDATA[I think that by now, the Zend Framework is one of the most sophisticated PHP frameworks available. Additionally I really like the idea of Object Relational Mapper tools. Unfortunately the Zend Frameworks DB and ORM capabilities didn&#8217;t convince me yet. &#8230; <a href="http://coffeecoders.de/2009/06/using-the-zend-framework-18-bootstrapper-and-doctrine-110/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>I think that by now, the <a href="http://framework.zend.com/">Zend Framework</a> is one of the most sophisticated PHP frameworks available.<br />
Additionally I really like the idea of <a href="http://en.wikipedia.org/wiki/Object-relational_mapping">Object Relational Mapper</a> tools. Unfortunately the Zend Frameworks DB and ORM capabilities didn&#8217;t convince me yet. That&#8217;s where the powerful ORM tool for PHP named <a href="http://www.doctrine-project.org/">Doctrine</a> comes into play.<br />
It is fairly easy to get Doctrine and the Zend Framework (here I&#8217;m usually referring to the MVC part) working together,<br />
but in my opinion that might not use the full potential of these two Frameworks put together.<br />
So I started developing a wrapper Framework which I named &#8211; in the lack of a better name <img src='http://coffeecoders.de/wp-includes/images/smilies/icon_wink.gif' alt=';)' class='wp-smiley' />  &#8211; Cuckoo.<br />
At this point in developmnent it only offers ZF 1.8 bootstrap classes for Doctrine and an application wrapper which makes using Doctrine and ZF together easier. A sample application is included as well, I hope it works more or less out of the box.</p>
<p>The next steps will be a Zend Form derivate that can generate forms by using the meta information from your doctrine<br />
model but stays fully customizable as well as cool Ajax/ExtJs support.</p>
<p><a href="http://coffeecoders.de/wp-content/uploads/2009/06/cuckoo_prealpha.zip">Download 0.001 PreAlpha</a></p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/06/using-the-zend-framework-18-bootstrapper-and-doctrine-110/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend Framework Book: Surviving The Deep End</title>
		<link>http://coffeecoders.de/2009/01/zend-framework-book-surviving-the-deep-end/</link>
		<comments>http://coffeecoders.de/2009/01/zend-framework-book-surviving-the-deep-end/#comments</comments>
		<pubDate>Thu, 15 Jan 2009 19:17:39 +0000</pubDate>
		<dc:creator>stevie</dc:creator>
				<category><![CDATA[common]]></category>
		<category><![CDATA[coding]]></category>
		<category><![CDATA[frameworks]]></category>
		<category><![CDATA[link]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[zend]]></category>

		<guid isPermaLink="false">http://coffeecoders.de/?p=86</guid>
		<description><![CDATA[For all those who always wanted to try out Zend&#8217;s Framework for PHP or just struggle with the usage of it, Pádraic Brady published an Open Book about that topic named &#8220;Surviving The Deep End&#8220;. Maybe it&#8217;ll help you through &#8230; <a href="http://coffeecoders.de/2009/01/zend-framework-book-surviving-the-deep-end/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>For all those who always wanted to try out <a title="Homepage of the Zend Framework" href="http://framework.zend.com/">Zend&#8217;s Framework for PHP</a> or just struggle with the usage of it, Pádraic Brady published an Open Book about that topic named &#8220;<em>Surviving The Deep End</em>&#8220;.</p>
<p>Maybe it&#8217;ll help you through the hard time figuring out the basics or solving specific issues.</p>
<p>Link: <a href="http://www.survivethedeepend.com/">Zend Framework Book: Surviving The Deep End</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://coffeecoders.de/2009/01/zend-framework-book-surviving-the-deep-end/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

