<?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"
	>

<channel>
	<title>Under the Outside &#187; symfony</title>
	<atom:link href="http://arthurkoziel.com/tag/symfony/feed/" rel="self" type="application/rss+xml" />
	<link>http://arthurkoziel.com</link>
	<description>Arthur Koziel - stuff that I find interesting.</description>
	<pubDate>Wed, 07 May 2008 18:56:58 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.5.1</generator>
	<language>en</language>
			<item>
		<title>Improved sfDateValidator for Symfony 1.0 - new download link</title>
		<link>http://arthurkoziel.com/2008/05/07/improved-sfdatevalidator-for-symfony-10-new-download-link/</link>
		<comments>http://arthurkoziel.com/2008/05/07/improved-sfdatevalidator-for-symfony-10-new-download-link/#comments</comments>
		<pubDate>Wed, 07 May 2008 18:40:53 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://arthurkoziel.com/?p=44</guid>
		<description><![CDATA[Sometime during last month, the server where my improved sfDateValidator for Symfony 1.0 was hosted went down. Although over a year passed since I wrote it, I&#8217;m quite pleased that there are still some people who are interested in it.
Of course there&#8217;s the ticket in Symfony&#8217;s Trac with the files attached to it, but the attached [...]]]></description>
			<content:encoded><![CDATA[<p>Sometime during last month, the server where my improved sfDateValidator for Symfony 1.0 was hosted went down. Although over a year passed since I wrote it, I&#8217;m quite pleased that there are still some people who are interested in it.</p>
<p>Of course there&#8217;s the <a href="http://trac.symfony-project.com/ticket/1665">ticket in Symfony&#8217;s Trac</a> with the files attached to it, but the attached php class is the wrong one. In order to use it, you had to apply the attached patch manually (which I guess caused some confusion).</p>
<p>However, I ran the unit test for the improved sfDateValidator against Symfony 1.0.14, and it still works very well. So, here&#8217;s the new download link:</p>
<p><a href="http://arthurkoziel.com/wp-content/uploads/2008/05/sfdatevalidator.zip">Download the improved sfDateValidator for Symfony 1.0</a></p>
<p>You might want to <a href="http://symfoniac.wordpress.com/2007/04/12/my-final-sfdatevalidator/">head over to the old post on Symfoniac</a> for a quick usage example.</p>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/05/07/improved-sfdatevalidator-for-symfony-10-new-download-link/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Validating Checkboxes and Radiobuttons in Symfony</title>
		<link>http://arthurkoziel.com/2008/04/02/validating-checkboxes-and-radiobuttons-in-symfony/</link>
		<comments>http://arthurkoziel.com/2008/04/02/validating-checkboxes-and-radiobuttons-in-symfony/#comments</comments>
		<pubDate>Wed, 02 Apr 2008 07:59:00 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[symfony]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[validation]]></category>

		<guid isPermaLink="false">http://arthurkoziel.wordpress.com/?p=53</guid>
		<description><![CDATA[Months ago I wrote about the validation of checkboxes in Symfony and how it could fill your database with wrong values.
I recommended downloading, or writing, a small validator which checked if the value of the checkbox is zero or one. But there&#8217;s a much simpler solution to this problem.
If you use a numerical value for [...]]]></description>
			<content:encoded><![CDATA[<p>Months ago <a href="http://symfoniac.wordpress.com/2007/06/06/do-we-need-to-validate-checkboxes/">I wrote about the validation of checkboxes in Symfony</a> and how it could fill your database with wrong values.</p>
<p>I recommended downloading, or writing, a small validator which checked if the value of the checkbox is zero or one. But there&#8217;s a much simpler solution to this problem.</p>
<p>If you use a numerical value for your radiobuttons/checkboxes, simply call the sfNumberValidator with zero as an minmum and one as an maximum.</p>
<div class="highlight">
<pre>tos:
  sfNumberValidator:
    min: 0
    max: 1</pre>
</div>
<p>If you use strings, such as &#8216;male&#8217; or &#8216;female&#8217; for a gender radiobutton, the sfStringValidator is the right choice:</p>
<div class="highlight">
<pre>sfStringValidator:
  values: ['male', 'female']
  value_error: Invalid value</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/04/02/validating-checkboxes-and-radiobuttons-in-symfony/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Symfony + MySQL to Django + PostgreSQL</title>
		<link>http://arthurkoziel.com/2008/03/26/symfony-mysql-to-django-postgresql/</link>
		<comments>http://arthurkoziel.com/2008/03/26/symfony-mysql-to-django-postgresql/#comments</comments>
		<pubDate>Wed, 26 Mar 2008 18:40:31 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[database]]></category>

		<category><![CDATA[django]]></category>

		<category><![CDATA[mysql]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[postgresql]]></category>

		<category><![CDATA[python]]></category>

		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://arthurkoziel.wordpress.com/?p=52</guid>
		<description><![CDATA[While recently migrating Tschitschereengreen.com from Symfony to Django plus changing the database backend from MySQL to PostgreSQL, there were mainly two tasks more time-consuming than I&#8217;ve had thought beforehand:
SQL dump
The old database used a latin1 encoding for the database fields and utf-8 as the server and client connection encoding. With these settings, even trying to [...]]]></description>
			<content:encoded><![CDATA[<p>While recently migrating <a href="http://www.tschitschereengreen.com/">Tschitschereengreen.com</a> from <a href="http://www.symfony-project.org/">Symfony</a> to <a href="http://www.djangoproject.com/">Django</a> plus changing the database backend from <a href="http://www.mysql.com/">MySQL</a> to <a href="http://www.postgresql.com/">PostgreSQL</a>, there were mainly two tasks more time-consuming than I&#8217;ve had thought beforehand:</p>
<h2>SQL dump</h2>
<p>The old database used a latin1 encoding for the database fields and utf-8 as the server and client connection encoding. With these settings, even trying to get a correctly encoded database dump from <a href="http://www.phpmyadmin.net/">phpMyAdmin</a> is a bad idea.</p>
<p>Using mysqldump with an explicitly specified character-set is much better:</p>
<div class="highlight">
<pre>mysqldump … –default-character-set<span class="o">=</span>latin1 –skip-set-charset dbname &gt; dump.sql</pre>
</div>
<h2>MySQL to PostgreSQL with JSON</h2>
<p>After realizing that changing a MySQL dump to a valid PostgreSQL dump might take some time, Django’s ability to import and export database fixtures in JSON was a great alternative.</p>
<p>There were, however, a few corrections needed in order to import the data in PostgreSQL:</p>
<ol>
<li><strong>Date fields</strong><br />
&#8220;0000-00-00 00:00:00&#8243; might be valid MySQL datetime value, but it ain’t so in PostgreSQL. To import the data it is needed to replace such dates with valid ones like &#8220;1970-01-01 00:00:01&#8243;.</li>
<li><strong>Boolean fields</strong><br />
MySQL doesn’t support real boolean fields and instead uses tinyint. PostgreSQL, on the other hand, supports real boolean fields and doesn’t accept &#8220;0&#8243; or &#8220;1&#8243; as valid boolean values. Replacing &#8220;0&#8243; with “&#8221;alse&#8221; and &#8220;1&#8243; with &#8220;true” will help in this case.</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/03/26/symfony-mysql-to-django-postgresql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Symfony: How Do You Keep Your Model and Database in Sync?</title>
		<link>http://arthurkoziel.com/2008/02/03/symfony-how-do-you-keep-your-model-and-database-in-sync/</link>
		<comments>http://arthurkoziel.com/2008/02/03/symfony-how-do-you-keep-your-model-and-database-in-sync/#comments</comments>
		<pubDate>Sun, 03 Feb 2008 16:12:51 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[symfony]]></category>

		<category><![CDATA[php]]></category>

		<guid isPermaLink="false">http://arthurkoziel.wordpress.com/?p=45</guid>
		<description><![CDATA[Symfony has been around for quite some time now and most developers have their prefered way of doing things -  time to ask a question that has been floating around for a very long time:
How do you keep your model and database in sync? 
A) You build your database in some other tools (e.g. [...]]]></description>
			<content:encoded><![CDATA[<p>Symfony has been around for quite some time now and most developers have their prefered way of doing things -  time to ask a question that has been floating around for a very long time:</p>
<p><strong>How do you keep your model and database in sync? </strong></p>
<p><strong>A)</strong> You build your database in some other tools (e.g. phpMyAdmin) and run <em>propel-build-schema</em> followed by <em>propel-build-model</em>.</p>
<p><strong>B)</strong> You write a schema.yml/xml file and run <em>propel-build-all</em> to generate the model, create and insert the sql.</p>
<p>Please state your opinion (or maybe a even better way) in the comments below.</p>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/02/03/symfony-how-do-you-keep-your-model-and-database-in-sync/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Manage Symfony with Git</title>
		<link>http://arthurkoziel.com/2008/02/01/manage-symfony-with-git/</link>
		<comments>http://arthurkoziel.com/2008/02/01/manage-symfony-with-git/#comments</comments>
		<pubDate>Fri, 01 Feb 2008 18:56:58 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[symfony]]></category>

		<category><![CDATA[git]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[svn]]></category>

		<guid isPermaLink="false">http://arthurkoziel.wordpress.com/?p=43</guid>
		<description><![CDATA[Using Git to manage Subversion repositories has become very popular the past days - especially in the Django community, where Brian Rosner brought this up in a nice video tutorial.
The biggest advantage of using Git is that you can switch between various branches very easily and nearly instantly - even offline. However, Git&#8217;s SVN support [...]]]></description>
			<content:encoded><![CDATA[<p>Using <a href="http://git.or.cz/">Git</a> to manage <a href="http://subversion.tigris.org/">Subversion</a> repositories has become very popular the past days - especially in the <a href="http://www.djangoproject.com/">Django</a> community, where Brian Rosner brought this up in a nice <a href="http://oebfare.com/blog/2008/jan/23/using-git-django-screencast/">video tutorial</a>.</p>
<p>The biggest advantage of using Git is that you can switch between various branches very easily and nearly instantly - even offline. However, Git&#8217;s SVN support isn&#8217;t perfect, so there&#8217;re also some drawbacks.</p>
<p>The method described here is perfect for testing your project with an older or even a newer version of <a href="http://www.symfony-project.org/">Symfony</a>.</p>
<p><span id="more-14"></span></p>
<h2>Installation</h2>
<p>If you installed Git over <a href="http://www.macports.org/">MacPorts</a>, make sure you enabled SVN support:</p>
<div class="highlight">
<pre>port -v install git-core +svn</pre>
</div>
<h2>Clone the Symfony repository</h2>
<p>The following command will clone the <strong>whole</strong> symfony SVN repository with all its revisions (over 7000), tags and branches in a folder called <em>symfony.git</em>. This takes some time, so better do something else. You can, however, always cancel and resume the checkout at a later time.</p>
<div class="highlight">
<pre>git svn clone -s http://svn.symfony-project.com/ symfony.git</pre>
</div>
<p>Since all the stuff you just downloaded is taking up quite some space on your hard drive, you might want to run <em>git gc</em> to cleanup unnecessary files and optimize the repository (also takes its time but size went from over 200MB to just 50MB for me).</p>
<div class="highlight">
<pre>git gc</pre>
</div>
<p>In Git, HEAD is always set to the branch where the last commit was made, this could lead to problems. Set it to the 1.0 branch for now:</p>
<div class="highlight">
<pre>git reset --hard 1.0</pre>
</div>
<h2>Externals</h2>
<p>Of course, the SVN implementation in Git isn&#8217;t perfect. It mostly shows when using <em>svn:externals</em> which Git doesn&#8217;t support yet and therefore repositories must be fetched manually. In Symfony&#8217;s case this is <em>pake</em> and <em>lime</em>.</p>
<div class="highlight">
<pre>git svn clone http://svn.symfony-project.com/tools/pake/tags/RELEASE_1_1_5/lib/pake lib/vendor/pake
git svn clone http://svn.symfony-project.com/tools/lime/tags/RELEASE_1_0_4/lib lib/vendor/lime</pre>
</div>
<h2>Finishing up</h2>
<p>Create a symlink that links to the Symfony command in our Git repository:</p>
<div class="highlight">
<pre>sudo ln -s /Users/arthur/Webdev/symfony.git/data/bin/symfony /usr/bin/symfony_dev</pre>
</div>
<p>and checkout the latest stable version of Symfony:</p>
<div class="highlight">
<pre>git checkout tags/RELEASE_1_0_11</pre>
</div>
<p><img src="http://arthurkoziel.files.wordpress.com/2008/02/bild-4.png" alt="bild-4.png" /><br />
A few branches, like <em>dwhittle</em>, might have a slightly different directory structure. In this case, just adjust your symlink and eventually check out pake and/or lime again - most Symfony branches and tags do have the same layout though.</p>
<p>Remember to run <em>git svn rebase</em> (similar to <em>svn update</em>) once in a while.</p>
<div class="highlight">
<pre>git svn rebase</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/02/01/manage-symfony-with-git/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How To: Build Your Schema from Multiple Database Connections</title>
		<link>http://arthurkoziel.com/2008/01/08/how-to-build-your-schema-from-multiple-database-connections/</link>
		<comments>http://arthurkoziel.com/2008/01/08/how-to-build-your-schema-from-multiple-database-connections/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 23:20:10 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[symfony]]></category>

		<category><![CDATA[creole]]></category>

		<category><![CDATA[multiple database-connection]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[propel]]></category>

		<guid isPermaLink="false">http://arthurkoziel.com/2008/01/08/how-to-build-your-schema-from-multiple-database-connections/</guid>
		<description><![CDATA[Multiple database connections are a great feature, but if you plan to generate a schema for each database, you will most certainly run into some problems caused by different  connection names. This Howto will show you how to solve the problem.

Connections
Let&#8217;s start by defining our database connections: open up the file config/databases.yml and create [...]]]></description>
			<content:encoded><![CDATA[<p>Multiple database connections are a great feature, but if you plan to generate a schema for each database, you will most certainly run into some problems caused by different  connection names. This Howto will show you how to solve the problem.</p>
<p><span id="more-13"></span></p>
<h2>Connections</h2>
<p>Let&#8217;s start by defining our database connections: open up the file <em>config/databases.yml</em> and create at least two connections with different names (like „database” and „database1”).</p>
<div class="highlight">
<pre>all:
  database:
    class:          sfPropelDatabase
    param:
      dsn:          mysql://ptest:ptest@localhost/ptest 

database1:
    class:          sfPropelDatabase
    param:
      dsn:          mysql://ptest:ptest@localhost/ptest2</pre>
</div>
<h2>Schema</h2>
<p>In the <em>config/propel.ini</em> configuration file, go to the the sixth line and edit the „propel.database.url” setting so that it matches the first database connection.</p>
<div class="highlight">
<pre>propel.database.url = mysql://ptest:ptest@localhost/ptest</pre>
</div>
<p>Now we can execute the <em>propel-build-schema</em> command.</p>
<p><img src="http://arthurkoziel.files.wordpress.com/2008/01/schema_small.png" alt="schema_small.png" /></p>
<p>The next little problem is that the schema generator always assumes that a connection is named „propel” but since we&#8217;ve named it „database”, we need to open the just generated schema file and rename the connection (second line).</p>
<p>Before we go on and generate the second schema, we first need to rename the current one or otherwise symfony would just overwrite it.</p>
<div class="highlight">
<pre>mv config/schema.yml config/1_schema.yml</pre>
</div>
<p>(<strong>Note:</strong> schema files must end with „schema.yml”)</p>
<h2>Second schema</h2>
<p>The procedure to generate the schema for the second connection is basically the same as for the first one:</p>
<ol>
<li>Edit the „propel.database.url” setting in <em>propel.ini</em>.</li>
<li>Execute <em>propel-build-schema</em>.</li>
<li>Open the schema and change the connection name from „propel&#8221; to „database1”.</li>
<li>Rename the generated <em>schema.yml</em> to <em>2_schema.yml</em>.</li>
</ol>
<p><img src="http://arthurkoziel.files.wordpress.com/2008/01/mate_schema1.png" alt="mate_schema1.png" /></p>
<p>Finally, we can execute the <em>propel-build-model</em> command and are ready to use our databases.</p>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/01/08/how-to-build-your-schema-from-multiple-database-connections/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Quick ReCaptcha Tip: Change the Theme</title>
		<link>http://arthurkoziel.com/2008/01/07/quick-recaptcha-tip-change-the-theme/</link>
		<comments>http://arthurkoziel.com/2008/01/07/quick-recaptcha-tip-change-the-theme/#comments</comments>
		<pubDate>Mon, 07 Jan 2008 13:22:02 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[symfony]]></category>

		<category><![CDATA[captcha]]></category>

		<category><![CDATA[javascript]]></category>

		<guid isPermaLink="false">http://arthurkoziel.com/2008/01/07/quick-recaptcha-tip-change-the-theme/</guid>
		<description><![CDATA[After a comment from An Vu, i checked up on how to change reCaptcha themes - turns out it&#8217;s really easy. Because many users don&#8217;t know how to change the reCaptcha options like the theme or the language, i&#8217;m posting this little tip.

To change the theme and other options, simply create a dictionary called RecaptchaOptions [...]]]></description>
			<content:encoded><![CDATA[<p>After a <a href="http://arthurkoziel.com/2008/01/02/sfrecaptchaplugin-103/#comment-5">comment from An Vu</a>, i checked up on how to change reCaptcha themes - turns out it&#8217;s really easy. Because many users don&#8217;t know how to change the reCaptcha options like the theme or the language, i&#8217;m posting this little tip.<br />
<span id="more-12"></span><br />
To change the theme and other options, simply create a dictionary called RecaptchaOptions in a script-tag:</p>
<div class="highlight">
<pre><span class="o">&lt;</span><span class="nx">script</span><span class="o">&gt;</span>
<span class="k">var</span> <span class="nx">RecaptchaOptions</span> <span class="o">=</span> <span class="p">{</span>
   <span class="nx">theme</span><span class="o">:</span> <span class="s1">&#39;clean&#39;</span>
<span class="p">};</span>
<span class="o">&lt;/</span><span class="nx">script</span><span class="o">&gt;</span>
</pre>
</div>
<p>For further reference check the <a href="http://recaptcha.net/apidocs/captcha/client.html#look-n-feel">API documentation</a>. ReCaptcha&#8217;s like the one <a href="https://www.facebook.com/r.php">Facebook uses</a> in their sign-up, can be created by using the &#8216;custom&#8217; theme setting.</p>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/01/07/quick-recaptcha-tip-change-the-theme/feed/</wfw:commentRss>
		</item>
		<item>
		<title>sfReCaptchaPlugin 1.0.3</title>
		<link>http://arthurkoziel.com/2008/01/02/sfrecaptchaplugin-103/</link>
		<comments>http://arthurkoziel.com/2008/01/02/sfrecaptchaplugin-103/#comments</comments>
		<pubDate>Wed, 02 Jan 2008 21:59:55 +0000</pubDate>
		<dc:creator>Arthur Koziel</dc:creator>
		
		<category><![CDATA[symfony]]></category>

		<category><![CDATA[captcha]]></category>

		<category><![CDATA[php]]></category>

		<category><![CDATA[plugin]]></category>

		<guid isPermaLink="false">http://arthurkoziel.wordpress.com/2008/01/02/sfrecaptchaplugin-103/</guid>
		<description><![CDATA[
Just released a new version of the sfReCaptchaPlugin. The updated version 1.0.3 includes the recaptcha-php-lib 1.10, which mainly fixes some minor XHTML bugs.
Please note that the plugin does not work with the current symfony 1.1 branch. A update will be available after the first beta release.
If you&#8217;re using a previous version of the plugin, you [...]]]></description>
			<content:encoded><![CDATA[<p><img src="http://arthurkoziel.files.wordpress.com/2008/01/recaptcha.jpg" alt="recaptcha.jpg" align="right" /></p>
<p>Just released a new version of the <a href="http://trac.symfony-project.com/wiki/sfReCaptchaPlugin">sfReCaptchaPlugin</a>. The updated version 1.0.3 includes the recaptcha-php-lib 1.10, which mainly fixes some minor XHTML bugs.</p>
<p>Please note that the plugin does not work with the current symfony 1.1 branch. A update will be available after the first beta release.</p>
<p>If you&#8217;re using a previous version of the plugin, you can update to the latest version by executing:</p>
<div class="highlight">
<pre>symfony plugin-upgrade http://plugins.symfony-project.com/sfReCaptchaPlugin</pre>
</div>
]]></content:encoded>
			<wfw:commentRss>http://arthurkoziel.com/2008/01/02/sfrecaptchaplugin-103/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.473 seconds -->
