<?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>Doggetto.com &#187; symfony Framework</title>
	<atom:link href="http://blog.doggetto.com/category/tech/symfony-tech/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.doggetto.com</link>
	<description>Just another WordPress weblog</description>
	<lastBuildDate>Fri, 22 Apr 2011 05:30:15 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>Faux-WordPress Plugin Note II</title>
		<link>http://blog.doggetto.com/2010/03/faux-wordpress-note-ii/</link>
		<comments>http://blog.doggetto.com/2010/03/faux-wordpress-note-ii/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 19:02:10 +0000</pubDate>
		<dc:creator>NoCoolName_Tom</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[symfony Framework]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.doggetto.com/?p=593</guid>
		<description><![CDATA[Okay, I think I&#8217;ve got the repository nonsense worked out. Feel free to checkout or browse the code at: https://svn.xp-dev.com/svn/tpdFauxWPPlugin/trunk/ As I said, I&#8217;m still working on this, so be careful: the code might not actually be working all the time. Feel free to read the logs for more info, I try to at least [...]]]></description>
			<content:encoded><![CDATA[<p>Okay, I think I&#8217;ve got the repository nonsense worked out.</p>
<p>Feel free to checkout or browse the code at:<br />
<a href="https://svn.xp-dev.com/svn/tpdFauxWPPlugin/trunk/">https://svn.xp-dev.com/svn/tpdFauxWPPlugin/trunk/</a><span id="more-593"></span></p>
<p>As I said, I&#8217;m still working on this, so be careful: the code might not actually be working all the time.  Feel free to read the logs for more info, I try to at least type something when I commit.</p>
<p>For those who are interested in how to convert your project into a plugin, it&#8217;s actually quite simple.  A plugin is like a little mini-application: it holds a lib directory for filters, forms, and models; it holds a modules directory for modules (these have to be explicitly activated in each application); and it can hold other directories like web and config.  Each of these directories functions the same as in a full application.  One nice thing a lot of plugin developers will do is to add a third layer of inheritance above the plugin model classes so that future developers can extend the plugin without having to muck about inside of the plugin code  (You might have seen this if you&#8217;ve played around with sfGuard:  the normal model classes are all empty and extend the Plugin classes which extend the base classes).</p>
<p>Anyways, gather all of that together, and you have the directory structure of a plugin, ready to be used in Symfony.  As for the actually business of packaging I&#8217;ll have to leave that for later.  It can be very simple, but to pull off some really cool things requires a bit of work.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.doggetto.com/2010/03/faux-wordpress-note-ii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Producing a Faux-WordPress Plugin for Symfony, Part IV</title>
		<link>http://blog.doggetto.com/2010/03/producing-a-faux-wordpress-plugin-for-symfony-part-iv/</link>
		<comments>http://blog.doggetto.com/2010/03/producing-a-faux-wordpress-plugin-for-symfony-part-iv/#comments</comments>
		<pubDate>Fri, 05 Mar 2010 17:27:04 +0000</pubDate>
		<dc:creator>NoCoolName_Tom</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[symfony Framework]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.doggetto.com/?p=589</guid>
		<description><![CDATA[I really want to finish this plugin.  I'm getting a little tired of using two solutions for my website and I want to get back to working on other things I've planned.  So instead of giving everyone the play-by-play for the application (which has been taking FOREVER), I'm going to give status updates on the project, open up a subversion repository, and just start building the applicaiton]]></description>
			<content:encoded><![CDATA[<p class="intro>For this fourth part of my post on my FauxWordPress plugin I am changing tack.  Previously I&#8217;ve actually been developing at the exact same time as writing.  This meant that, in essense, I was writing everything twice, then testing, then writing everything twice again, then testing, and finally writing everything twice again.  I guess this was really fun for people who were trying to follow along from scratch, but there&#8217;s already plenty of good tutorials that help in the development of a full application (Askeet, Jobeet).  Besides, while there are aspects of plugin development that I had to somewhat struggle with, it was better for me to struggle because I think I&#8217;ve learned more that way (still learning).<span id="more-589"></span></p>
<p class="intro">I really want to finish this plugin.  I&#8217;m getting a little tired of using two solutions for my website and I want to get back to working on other things I&#8217;ve planned.  So instead of giving everyone the play-by-play for the application (which has been taking FOREVER), I&#8217;m going to give status updates on the project, open up a subversion repository, and just start building the applicaiton.  At certain points along the way I&#8217;ll give posts about certain aspects of the development process that you should keep in mind for application development.</p>
<p>I&#8217;ve been swaped the past month with work and school so development on this plugin was somewhat slow.  I have finished up my plans for spam checking, however.  Considering that this is, basically, version 1 I&#8217;ve not written it very well in terms of adding additional spam solutions, but for now there is a Spam class that contains some abstracted functions for spam checking.  These functions basically run other functions within the class based upon config variables.  Currently there are functions to handle either Akismet or TypePad AntiSPam; I cheated because technically TypePad uses the same API calls as Akismet.  Two for the price of one!  If no spam solution is specified in the app.yml config file, then all comments are automatically approved.  I have still not added Mollum spam checking because it doesn&#8217;t return a straight-up boolean response but will, if unsure of the comment&#8217;s status after an initial check, present the user with a CAPTCHA field.  This sort of two-step process will be a little more involved and I&#8217;ll need to see about implementing it later.  For now, however, spam collection with two different checking solutions is finished.</p>
<p>Next to work on is the Show View for posts.  I want, as stated before, to allow the displaying and listing of posts (basically the entire post module for the frontend) to use any sort of WordPress theme.  I will be continuing to push for this goal after cleaning up the subversion repository.</p>
<p class="intro">Which brings me to my final bit of news.  I suck at subversion; I may use the CLI for it, but it you were to ask me to merge two branches to the trunk or something standard like that, I&#8217;d say get someone else.  I&#8217;m good at checking code out and checking code in.  Producing branches and trunks?  Not so good at that, but I need to learn.  To do so, I&#8217;ll be spending a bit of time today cleaning up my project repository and working copy in case anybody wants to check anything out.  Currently I&#8217;m still developing a full-blown application and not a plugin; converting from a project to a plugin isn&#8217;t that hard, so I&#8217;ll probably spend some time converting it and continue development as a plugin.  The benefit is that if anyone wants to try out this unfinished plugin, or offer any suggestions, they&#8217;ll be able to checkout code themselves.  I&#8217;ll post the URL of the repository as soon as I get it all figured out.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.doggetto.com/2010/03/producing-a-faux-wordpress-plugin-for-symfony-part-iv/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Producing a Faux-WordPress Plugin for Symfony, Part III</title>
		<link>http://blog.doggetto.com/2010/02/producing-a-faux-wordpress-plugin-for-symfony-part-iii/</link>
		<comments>http://blog.doggetto.com/2010/02/producing-a-faux-wordpress-plugin-for-symfony-part-iii/#comments</comments>
		<pubDate>Sat, 06 Feb 2010 19:30:24 +0000</pubDate>
		<dc:creator>NoCoolName_Tom</dc:creator>
				<category><![CDATA[symfony Framework]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.doggetto.com/?p=555</guid>
		<description><![CDATA[To build this plugin I&#8217;m going to start with a new project, entirely from scratch. This means that I will be initially developing a normal application. Once we&#8217;re nearing the end, we&#8217;ll package the project up into a plugin. This post will cover the development of basic CRUD functionality so we can actually do something [...]]]></description>
			<content:encoded><![CDATA[<p>To build this plugin I&#8217;m going to start with a new project, entirely from scratch.  This means that I will be initially developing a normal application.  Once we&#8217;re nearing the end, we&#8217;ll package the project up into a plugin.  This post will cover the development of basic CRUD functionality so we can actually <em>do</em> something if we want.<span id="more-555"></span></p>
<p>To start off, we&#8217;ll need our database and web server set up and ready to go.  I won&#8217;t go into that now and will just assume that you have config/databases.yml and config/propel.ini both set up and ready to go.  I also enjoy setting a VirtualHost in apache to handle the application, but that sort of choice is up to you.  It won&#8217;t matter to the packaged plugin in the end what you name the development database or how to configure your server.</p>
<p>We&#8217;ll need to have sfGuardUserPlugin installed because there are a few references to it in the schema of the previous post.  Let&#8217;s install it now before we set up the database tables.</p>
<div class="box"><code>symfony plugin:install sfGuardPlugin;</code></div>
<p>Now that we have sfGuard installed, we should be ready to build the application.</p>
<div class="box"><code>symfony propel:build-all --no-confirmation;</code></div>
<p>The schema is established in the database and we&#8217;re ready to go.</p>
<p>Let&#8217;s establish a few generators to take care of data entry.  For now, let&#8217;s establish one for managing posts and managing comments.</p>
<div class="box"><code>symfony propel:generate-admin --module="post" frontend sfFauxWPPost;<br />
symfony propel:generate-admin --module="comment" frontend sfFauxWPComment;</code></div>
<p>Next let&#8217;s set up the post module as the default module (for now) for the frontend, and set up links to the two modules in the template.</p>
<div class="box"><strong>/apps/frontend/config/routing.yml:</strong><br />
<code>...<br />
# default rules<br />
homepage:<br />
&nbsp;&nbsp;url:   /<br />
&nbsp;&nbsp;param: { module: post, action: index }<br />
...</code></div>
<div class="box"><strong>/apps/frontend/templates/layout.php:</strong><br />
<code>...<br />
&nbsp;&nbsp;&lt;body&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;ul&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;?php echo link_to('Posts', '@sf_faux_wp_post') ?&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;li&gt;&lt;?php echo link_to('Comments', '@sf_faux_wp_comment')?&gt;&lt;/li&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/ul&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php echo $sf_content ?&gt;<br />
&nbsp;&nbsp;&lt;/body&gt;<br />
...</code></div>
<p>Now, after cleaing the cache (<code>symfony cc;</code>) we should be able to load the application and see the Post module.  It&#8217;s rather messy, however, since there is a <em>large</em> fitler box on the side and no default data to look at.  Also, if we try to click on the &#8220;Comments&#8221; link we&#8217;ll get a failure because there is no &#8220;__toString&#8221; function for Posts.  Let&#8217;s fix this first of all since we&#8217;ll be needing to echo objects a lot in this project.</p>
<p>The following are the objects that we&#8217;d expect to produce a string when echoed.  As for the others, feel free to add a __toString if you want.  We&#8217;ll probably address these objects later.  I am including phpDoc documentation in the functions because I want to have a correctly defined tooltip in NetBeans whne I reference this function.</p>
<div class="box"><strong>/lib/model/sfFauxWPCategory.php:</strong><br />
<code>&lt;?php</p>
<p>class sfFauxWPCategory extends BasesfFauxWPCategory<br />
{<br />
&nbsp;&nbsp;/**<br />
&nbsp;&nbsp;&nbsp;* Echos the name of the category.<br />
&nbsp;&nbsp;&nbsp;*<br />
&nbsp;&nbsp;&nbsp;* @return     string<br />
&nbsp;&nbsp;&nbsp;*/<br />
&nbsp;&nbsp;public function __toString()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;getName();<br />
&nbsp;&nbsp;}<br />
}</code></div>
<div class="box"><strong>/lib/model/sfFauxWPComment.php:</strong><br />
<code>class sfFauxWPComment extends BasesfFauxWPComment<br />
{<br />
&nbsp;&nbsp;/**<br />
&nbsp;&nbsp;&nbsp;* Echos the content of the comment.<br />
&nbsp;&nbsp;&nbsp;*<br />
&nbsp;&nbsp;&nbsp;* @return     string<br />
&nbsp;&nbsp;&nbsp;*/<br />
&nbsp;&nbsp;public function __toString()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;getContent();<br />
&nbsp;&nbsp;}<br />
}<br />
</code></div>
<div class="box"><strong>/lib/model/sfFauxWPPost.php:</strong><br />
<code>&lt;?php</p>
<p>class sfFauxWPPost extends BasesfFauxWPPost<br />
{<br />
&nbsp;&nbsp;/**<br />
&nbsp;&nbsp;&nbsp;* Echos the title of the post.<br />
&nbsp;&nbsp;&nbsp;*<br />
&nbsp;&nbsp;&nbsp;* @return     string<br />
&nbsp;&nbsp;&nbsp;*/<br />
&nbsp;&nbsp;public function __toString()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;getTitle();<br />
&nbsp;&nbsp;}<br />
}</code></div>
<div class="box"><strong>/lib/model/sfFauxWPTag.php:</strong><br />
<code>&lt;?php</p>
<p>class sfFauxWPTag extends BasesfFauxWPTag<br />
{<br />
&nbsp;&nbsp;/**<br />
&nbsp;&nbsp;&nbsp;* Echos the name of the tag.<br />
&nbsp;&nbsp;&nbsp;*<br />
&nbsp;&nbsp;&nbsp;* @return     string<br />
&nbsp;&nbsp;&nbsp;*/<br />
&nbsp;&nbsp;public function __toString()<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;return $this-&gt;getName();<br />
&nbsp;&nbsp;}<br />
}</code></div>
<p>Now the basic CRUD functions for both Posts and Comments should be working.  Finally, before we end for now, let&#8217;s establish a &#8220;show&#8221; view for posts.</p>
<div class="box"><strong>/apps/frontend/modules/post/actions/actions.class.php:</strong><br />
<code>&lt;?php</p>
<p>/**<br />
&nbsp;* post actions.<br />
&nbsp;*<br />
&nbsp;* @package    PhpProject1<br />
&nbsp;* @subpackage post<br />
&nbsp;* @author     Your name here<br />
&nbsp;* @version    SVN: $Id: actions.class.php 12474 2008-10-31 10:41:27Z fabien $<br />
&nbsp;*/<br />
class postActions extends autoPostActions<br />
{<br />
&nbsp;&nbsp;public function executeShow(sfWebRequest $request)<br />
&nbsp;&nbsp;{<br />
&nbsp;&nbsp;&nbsp;&nbsp;$this-&gt;sf_faux_wp_post = $this-&gt;getRoute()-&gt;getObject();<br />
&nbsp;&nbsp;}<br />
}</code></div>
<div class="box"><strong>/apps/frontend/modules/post/templates/showSuccess.php:</strong><br />
<code>&lt;?php use_helper('I18N', 'Date') ?&gt;<br />
&lt;?php include_partial('post/assets') ?&gt;</p>
<p>&lt;div id="sf_admin_container"&gt;<br />
&nbsp;&nbsp;&lt;h1&gt;&lt;?php echo __($sf_faux_wp_post->getTitle(), array(), 'messages') ?&gt;&lt;/h1&gt;</p>
<p>&nbsp;&nbsp;&lt;div id="sf_admin_content"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="sf_faux_wp_published_at"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php echo $sf_faux_wp_post-&gt;getPublishedAt(); ?&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="sf_faux_wp_content"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php echo __(nl2br($sf_faux_wp_post-&gt;getContent())); ?&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;hr/&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="comments"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="comment_count"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php echo ($sf_faux_wp_post-&gt;countsfFauxWPComments() ? $sf_faux_wp_post-&gt;countsfFauxWPComments() : "No") ?&gt; Comment&lt;?php echo ($sf_faux_wp_post-&gt;countsfFauxWPComments() != 1 ? 's' : '')  ?&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php foreach($sf_faux_wp_post-&gt;getsfFauxWPComments() as $id =&gt; $comment):?&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="comment_&lt;?php echo $id ?&gt;"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="comment_name_&lt;?php echo $id ?&gt;"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php echo __($comment-&gt;getWebsite() ? link_to($comment-&gt;getAuthor(), $comment-&gt;getWebsite()) : $comment->getAuthor()) ?&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;div id="comment_content_&lt;?php echo $id ?&gt;"&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php echo __($comment-&gt;getContent()) ?&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&lt;?php endforeach; ?&gt;<br />
&nbsp;&nbsp;&nbsp;&nbsp;&lt;/div&gt;<br />
&nbsp;&nbsp;&lt;/div&gt;<br />
&lt;/div&gt;</code></div>
<p>That&#8217;s enough for today.  Dang, I never expected that writing these posts would slow down the development so much.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.doggetto.com/2010/02/producing-a-faux-wordpress-plugin-for-symfony-part-iii/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Producing a Faux-WordPress Plugin for Symfony, Part II</title>
		<link>http://blog.doggetto.com/2010/02/producing-a-faux-wordpress-plugin-for-symfony-part-ii/</link>
		<comments>http://blog.doggetto.com/2010/02/producing-a-faux-wordpress-plugin-for-symfony-part-ii/#comments</comments>
		<pubDate>Tue, 02 Feb 2010 00:00:06 +0000</pubDate>
		<dc:creator>NoCoolName_Tom</dc:creator>
				<category><![CDATA[symfony Framework]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.doggetto.com/?p=524</guid>
		<description><![CDATA[The Symfony framework is awesome (and well-suited, I'd argue, for such an endeavor whenever someone wishes to attempt it), but it is meant for PHP developers, not for somebody who just wants to host a blog to talk about ecclesiology(!).  So, my plugin will approach the issue from this point of view: the PHP developer.  Wordpress plugins extend Wordpress to act however the developer wants; with a real Wordpress install all needs for the website are meant to really be handled by Wordpress.  With my plugin, it is really just a plugin to handle and emulate the <em>blogging</em> aspects of Wordpress; for the other features that a user or developer might want you'll need to address those through the framework itself.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.caerdelyn.co.uk/photos.html"><img alt="Working on the Foundations" title="Working on the Foundations" class="content-img-right" src="/wp-content/uploads/w_foundation.jpg" height="200" width="240"></a>
<p class="intro">WordPress is, by far, the most popular blogging framework on the Internet today and that popularity is not undeserved.  It has an easy installation and is set up to cater to non-technical people.  After installation, it simply works and people are up and running quickly.  It has an active plugin community to extend it in any direction a user might need.  In short, it&#8217;s a great solution to use pretty much anywhere.</p>
<p>However, it&#8217;s also not very nice to play with as a developer.  The code is mostly based around PHP 4 (although that will probably change when 3.0 is released) and writing plugins and themes can occasionally be a nightmare.  Security is, unfortunately, a constant problem since the ease-of-use is occasionally in tension with secure practices.  Finally, while the self-contained aspect of WordPress is great for a typical user who pretty much runs their entire site through WordPress, integrating a WordPress installation with an existing applicaiton &#8212; especially an application that has its own extensive user-management solution &#8212; is a daunting task.<span id="more-524"></span>  WordPress is a streamlined applicaiton, but trying to bend it in ways it wasn&#8217;t meant to bend (fiddling with database schemas, login and session management, etc) often breaks either WordPress or the developer.</p>
<p>The symfony plugin I am trying to write is NOT to somehow <em>replace</em> WordPress.  That is a large project that would be nearly impossible for myself.  I have no idea how I&#8217;d ever compete against the easiness of a WordPress installation.  The Symfony framework is awesome (and well-suited, I&#8217;d argue, for such an endeavor whenever someone wishes to attempt it), but it is meant for PHP developers, not for somebody who just wants to host a blog.  So, my plugin will approach the issue from the PHP developer&#8217;s point of view.  WordPress plugins extend WordPress to act however the developer wants; with a WordPress installation all functions of the website are meant to be handled by WordPress.  With my plugin, it is just a plugin to handle and emulate the <em>blogging</em> aspects of WordPress; for the other features that a user or developer might want you&#8217;ll need to address those through the framework itself.  Anything that isn&#8217;t the job of a blogging solution (e.g., a contact page) isn&#8217;t done by the blogging solution.</p>
<p>So, with that out of the way, on to building the plugin (which, until I think of a better name, is called sfFauxWP).</p>
<p class="intro">The foundation of any blogging solution revolves around the basic idea of posts and comments.  The following schema (adapted from the already excellent <a href="http://www.symfony-project.org/plugins/sfSimpleBlogPlugin">sfSimpleBlogPlugin</a>) allows for posts, comments, tags (non-self-referential post attributes), categories (self-referential post attributes), and user ratings.  There are a number of booleans which hold post-specific settings regarding user interaction.  While allowing some room for possible modification in the future, this schema is probably more than enough for our needs.</p>
<h3>schema.yml</h3>
<p><code style="line-height: 1em; font-size: medium;"><strong>propel</strong>:<br />
&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>package</strong>: lib.model<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>defaultIdMethod</strong>: native<br/><br />
<em>## Posts ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_posts</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPPost<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>author_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_guard_user<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>title</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: varchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>size</strong>: 255<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>short_title</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: varchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>size</strong>: 255<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>summary</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: longvarchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>content</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: longvarchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>is_published</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>default</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>restrict_comments</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>default</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>rate_comments</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>default</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>rate_posts</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>default</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>published_at</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: date<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_uniques</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>short_title_published_at</strong>: [short_title, published_at]<br/><br />
<em>## Comments ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_comments</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPComment<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>sf_faux_wp_post_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_posts<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>sf_guard_user_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_guard_user<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>author</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: varchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>size</strong>: 255<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>email</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: varchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>size</strong>: 255<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>website</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: varchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>size</strong>: 255<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>content</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: longvarchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>is_moderated</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: boolean<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>default</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## Tags ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_tags</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPTag<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>name</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: varchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>size</strong>: 255<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>index</strong>: unique<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## Categories ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_categories</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPCategory<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>parent_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_posts<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: set null<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>name</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: varchar<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>size</strong>: 255<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>index</strong>: unique<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## The Post<=>Tag Relationship ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_post_tags</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPPostTag<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>post_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_posts<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>tag_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_tags<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_uniques</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>post_tag</strong>: [post_id, tag_id]<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## The Post<=>Category Relationship ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_post_categories</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPPostCategory<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>post_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_posts<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>category_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;required</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_tags<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: set null<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_uniques</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>post_category</strong>: [post_id, category_id]<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## The Post Group Controls - Who Can Comment? ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_post_groups</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPPostGroup<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>post_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_posts<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>group_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_guard_group<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## The Category Group Controls - Who Can Create? ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_category_groups</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPCategoryGroup<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>category_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: false<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_tags<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>group_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_guard_group<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## The User Ratings for Comments ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_comment_user_ratings</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPCommentUserRating<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>comment_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_comments<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>user_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_guard_user<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>rating</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: tinyint<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>default</strong>: 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~<br/><br />
<em>## The User Ratings for Posts ##</em><br />
&nbsp;&nbsp;<strong>sf_faux_wp_post_user_ratings</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>_attributes</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>phpName</strong>: sfFauxWPPostUserRating<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>primaryKey</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>autoIncrement</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>post_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_faux_wp_posts<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>user_id</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: integer<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>required</strong>: true<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignTable</strong>: sf_guard_user<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>foreignReference</strong>: id<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>onDelete</strong>: cascade<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>rating</strong>:<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>type</strong>: tinyint<br />
&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;<strong>default</strong>: 1<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>created_at</strong>: ~<br />
&nbsp;&nbsp;&nbsp;&nbsp;<strong>updated_at</strong>: ~</code></p>
]]></content:encoded>
			<wfw:commentRss>http://blog.doggetto.com/2010/02/producing-a-faux-wordpress-plugin-for-symfony-part-ii/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Producing a Faux-WordPress Plugin for Symfony, Part I</title>
		<link>http://blog.doggetto.com/2010/01/producing-a-faux-wordpress-plugin-for-symfony-pat-i/</link>
		<comments>http://blog.doggetto.com/2010/01/producing-a-faux-wordpress-plugin-for-symfony-pat-i/#comments</comments>
		<pubDate>Sun, 31 Jan 2010 01:30:01 +0000</pubDate>
		<dc:creator>NoCoolName_Tom</dc:creator>
				<category><![CDATA[symfony Framework]]></category>
		<category><![CDATA[Technology]]></category>

		<guid isPermaLink="false">http://blog.doggetto.com/?p=485</guid>
		<description><![CDATA[So, for the past year or so I have struggled in trying to figure out how best to incorporate Wordpress into a Symfony application.  The conclusion I have come to?  I'm really starting to wonder if it's worth any of the trouble.  So, I'm trying to figure out, for myself at least, what aspects of Wordpress I really appreciate; of those features, I really wonder whether or not building a new plugin (or extending sfSimpleBlogPlugin/sfBlogsPlugin) would not be a better idea.]]></description>
			<content:encoded><![CDATA[<p><img src="/wp-content/uploads/printing_press.jpg" alt="Printing Press" title="Printing Press" width="250" height="150" class="content-img" />
<p class="intro">So, for the past year or so I have struggled in trying to figure out how best to incorporate WordPress into a Symfony application.  The conclusion I have come to?  I&#8217;m really starting to wonder if it&#8217;s worth any of the trouble.  So, I&#8217;m trying to figure out, for myself at least, what aspects of WordPress I really appreciate; of those features, I really wonder whether or not building a new plugin (or extending sfSimpleBlogPlugin/sfBlogsPlugin) would not be a better idea.<span id="more-485"></span></p>
<p>I have not yet started on this project, so to decide whether it&#8217;s worthwhile, what are the aspects of WordPress (or just blog administration in general) that I really enjoy and would like to see in any other solution?</p>
<ol>
<li>
<p><strong>Themes</strong><br/>The multiplicity of WordPress themes is a great example of how extendible the blogging framework is.  Just download it, select it, and you&#8217;re good to go.  I would love, with a Symfony solution, to be able to define a theme in a config file (or even in the admin backend, as is done with WordPress) and have it display.  Or choose to use the application template default instead.  Whatever solution I come up with, I would love for it to be able to accomodate existing WordPress themes <em>without</em> any extensive reworkings (plug and play would be ideal).</p>
</li>
<li>
<p><strong>Spam Collection/Akismet</strong><br/>WordPress makes good use of the Akismet spam prevention filters.  My solution would have to make use of these prevention techniques as well.  It&#8217;d be great to figure out how to make use of ReCAPTCHA, but your avergae blog nowadays usually depends upon active filtering and I want my solution to seem like any other typical blog.</p>
</li>
<li>
<p><strong>Scheduling and Drafting of Posts</strong><br/>I <em>love</em> the ability in WordPress of drafting and publishing against a future date.  The ability to view these drafts or, if logged in, to see to-be-published posts is needed.</p>
</li>
<li>
<p><strong>Pingbacks</strong><br/>It&#8217;s just good blogging ettiquete to pingback to other blogs.  My pingback solution should work correctly with existing blogging frameworks.</p>
</li>
<li>
<p><strong>RSS Feeds</strong><br/>I&#8217;d like to deliver post/comment feeds for the entire blog as well as individual posts.</p>
</li>
<li>
<p><strong>Media Library</strong><br/>Having pictures and audio (and YouTube code) available for blog posts is made much easier when you&#8217;re confident that they are on the server and available for use.  An effective Media Library would be nice.  On the frontend, it might even be cool to put together some sort of slide-show option (although that might be more work than I need right now).</p>
</li>
<li>
<p><strong>Twitter Integration</strong><br/>I haven&#8217;t yet figured out the best way to use Twitter, but it&#8217;d be nice to be able to simul-publish a post along with a custom/default Twitter announcement and link.  Perhaps it&#8217;d also be cool to pull in Twitter posts as a sort of specialized blogroll.</p>
</li>
<li>
<p><strong>Categories/Tags</strong><br/>Having a branching tree of categories is a very nice aspect of modern blog frameworks.  I would love to be able to filter the posts based on multiple categories (not that I actually plan on writing so many posts to make that particular feature needful, but it&#8217;d be nice to have).  Deleting a category should, in my mind, simply move all of the posts up to belong to the category parent (if it exists).</p>
</li>
<li>
<p><strong>Wysiwyg Editor</strong><br/>The user should be able to set whether they wish to have the Wysiwyg editor or the source editor as their default &#8211; I use source almost all of the time and to have that be default for myself would be great.  The Wysiwyg Editor should be fast and user-friendly.</p>
</li>
<li>
<p><strong>Gravatars</strong><br/>If allowed by the theme, the use of gravatars would be very nice indeed.  I always enjoy having my avatar at a blog be personalized without me having to do anything.</p>
</li>
<li>
<p><strong>Word Count</strong><br/>I like knowing how many words are on a post, or a post summary.</p>
</li>
<li>
<p><strong>Reddit-style Like/Dislike</strong><br/>I absolutely hate having trolls on some of the blogs I go to, but it&#8217;s too easy to feed to trolls when all you want to do is get rid of them.  Being able to both like and dislike posts and comments would be a great way to users to be involved both with the blog and with each other (obviously, this should be restricted on a post-by-post basis to view-by-all, by-specified-groups, or by-none; or you could just turn the feature off on some posts).</p>
</li>
<li>
<p><strong>Protected Posts and Access Control</strong><br/>Yeah, this starts to blur the line between forum and blog, but to be honest, there are some blog posts where I&#8217;d love to prevent the entire Internet from looking at them.  I&#8217;d love to protect posts either by a defined password or even by user levels (sfGuard would work great for this).  Perhaps even apply these permissions to the categories/tags to automatically assign protection to posts.</p>
</li>
<li>
<p><strong>Ajax</strong><br/>In another word: bling.  I want the backend and the frontend to be a little easier to use by default and look nice.  Symfony includes support for a number of good Javascript libraries.</p>
</li>
<li>
<p><strong>Configuration</strong><br/>There are two levels of configuration that would be available to this solution: there would be the administrative options like themes, spam control, and others.  However there are application options that are also important:  use ajax or not?  use feeds or not?  These are things that are likely just set once and never set again.  As such, who cares if they are removed from the user and are placed into a symfony configuration file?  Simplifying the backend by not placing EVERYTHING in it would go a long way in my opinion, so I will need to define what I feel should be configurable by the user and I will also need to define WHERE they can configure it.</p>
</li>
</ol>
<p>Things I do not need:</p>
<ol>
<li>
<p><strong>Pages</strong><br/>Since we&#8217;re NOT using WordPress to handle everything, any other pages could be handled by adding a module to the application.</p>
</li>
<li>
<p><strong>Cache</strong><br/>I know that symfony caching could be a lot better, but it&#8217;s still pretty good and it&#8217;s standard in the framework.  I don&#8217;t see a need to add it.</p>
</li>
<li>
<p><strong>Contact Forms</strong><br/>We&#8217;re working with an entire framework here, complete with the idea that we&#8217;ll be delivering other content besides a blog.  If I were going to provide a complete blogging solution simply based on symfony (instead of a plugin), then this would make sense.  But in regards to this plugin, if you want a contact page, build it yourself!</p>
</li>
</ol>
<p>Things I think would be plain awesome but have no clue how:</p>
<ol>
<li>
<p><strong>Gears or HTML5</strong><br/>Using Google Gears is an awesome way of interacting with a web application.  WordPress has the ability to interact with Gears for the backend area &#8211; this speeds things up IMMENSELY.  However, Google has publicly announced with the advent of Google Wave that they really don&#8217;t see a future for Gears when all of their needs can be handled with tools in HTML5.  It would be awesome to beat WordPress to the gate by somehow implementing HTML5 tools to help speed up the backend (or possibly even the frontend).</p>
</li>
<li>
<p><strong>Alternate Login Options for Admin and Comments</strong><br/>  This is more of an issue regarding sfGuardUser, but it would be fantastic to allow a user to log into the site using FacebookConnect or OpenId.  If anything, it would allow for specific user preferences regarding comments.  This may be a bit of overkill for my own needs, but if I ever planned on opening a multi-user (or even, perhaps, a multi-blog) plugin I think this would be a great selling point.</p>
</li>
<li>
<p><strong>Mobile Solution</strong><br/>  Again, this may not be a strictly blogging feature, but it&#8217;d be nice to figure out how to deliver the application in a mobile format for Androids and iPhones.</p>
</li>
<li>
<p><strong>PHP Code within the Post</strong><br/>  This maye be the worst idea in the history of the world &#8211; to be honest it&#8217;s a security nightmare.  However, it&#8217;d be pretty awesome sometimes to not just dynamically serve posts, but to have the post content be dynamic.  It&#8217;d be fun to look further into this.</p>
</li>
<li>
<p><strong>Detailed Stats</strong><br/>  Keeping track of detailed visitor statistics would help in building some fun features (most/least popular posts, most/least popular comments, etc).</p>
</li>
<li>
<p><strong>iTunes/Podcasting Help</strong><br/>  It&#8217;d be great to ensure that you can deliver an accurate iTunes podcasting feed from the app without devoting every post to the podcast.</p>
</li>
</ol>
<p>In looking at this closely, almost all of it could be handled VERY easily by existing symfony plugins or could be created very easily.  There are a few difficulties, however, the largest of which is obviously the theme integration.  However, if I could get it to work (and I have a few ideas) then the largest reason for me to use WordPress goes away and I can be happy in having a tightly integrated blogging solution available for my projects.</p>
<p>Over the next few weeks I will be working on trying to create this solution using the symfony framework.  I&#8217;ll try to document my progress and, hopefully, my success.</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.doggetto.com/2010/01/producing-a-faux-wordpress-plugin-for-symfony-pat-i/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>How I Use Netbeans 6.8 and Symfony 1.2</title>
		<link>http://blog.doggetto.com/2010/01/how-i-use-netbeans-6-8-and-symfony-1-2/</link>
		<comments>http://blog.doggetto.com/2010/01/how-i-use-netbeans-6-8-and-symfony-1-2/#comments</comments>
		<pubDate>Mon, 04 Jan 2010 19:02:08 +0000</pubDate>
		<dc:creator>NoCoolName_Tom</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[symfony Framework]]></category>
		<category><![CDATA[Technology]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[symfony]]></category>

		<guid isPermaLink="false">http://blog.doggetto.com/?p=473</guid>
		<description><![CDATA[Recently, I found that Sun's Java-based IDE, NetBeans, had added symfony support and I wondered how useful that might be.  I tried it and loved it.  Using NetBeans is not without issues, however it's worked out quite well and I'd recommend giving it a try.]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.stockvault.net/Food_Drink_g16-Coffee_beans_very_close_p13373.html"><img alt="Beans" title="Beans" class="content-img-right" src="/wp-content/uploads/coffee_beans.jpg" height="250" width="334"></a>
<p class="intro">I am expirementing with using a full-fledged IDE for web development at work.  Until recently I used gEdit; most people don&#8217;t know that gEdit can be extended via plugins to become a fantastic development environment.  However, one thing I could never get to work was auto-completion based upon functions and classes in PHP.  However, the speed of using gEdit, as opposed to Eclipse, was amazing and I never could quite get the hang of editors like Aptana and Eclipse.  Recently, I found that Sun&#8217;s Java-based IDE, NetBeans, had added symfony support and I wondered how useful that might be.  I tried it and loved it.  Using NetBeans is not without issues, however.  It&#8217;s still a bit buggy (that might be because I&#8217;m using the development code) and memory usage is about what you&#8217;d expect from a Java-based editor (ie, sometimes really, really high).  Still, it&#8217;s worked out quite well and I&#8217;d recommend giving it a try.<span id="more-473"></span></p>
<p>Here&#8217;s how I set up my installation of NetBeans.  I am running Ubuntu Karmic Koala (9.10).</p>
<blockquote><p><strong>1. Download Netbeans 6.8 for PHP from <a href="http://netbeans.org/">netbeans.org</a></strong><br />
<strong>2. Install to /opt/NetBeans</strong><br />
Run the following code to prep the installation directory:</p>
<blockquote style="color: black; font-size: larger;"><p><code>sudo mkdir /opt/NetBeans;<br />
sudo chmod 777 /opt/NetBeans;</code></p></blockquote>
<p>Then run the following from a terminal wherever you saved the NetBeans installation file:</p>
<blockquote style="color: black; font-size: larger;"><p><code>chmod +x &lt;netbeans_file&gt;.download;<br />
./&lt;netbeans_file&gt;.download;</code></p></blockquote>
<p>This will begin the installation.</p>
<p>Be certain to change the installation from your home directory to /opt/NetBeans!</p>
<p>NetBeans should install itself to the desktop as an icon and to the menu under &#8220;Programming&#8221;.  To uninstall it at any later time simply run:</p>
<blockquote style="color: black; font-size: larger;"><p><code>sh /opt/NetBeans/uninstall.sh;</code></p></blockquote>
<p>This will remove the program.  To fully remove it, also remove the configuration directories at: ~/.netbeans,  ~/.netbeans-registration, and ~/NetBeansProjects.</p>
<p><strong>3.Configure NetBeans.</strong><br />
symfony functionality was included in NetBeans 6.8 so it doesn&#8217;t require a plugin in this or later versions.  However, it does require some setup to work correctly.  Run Netbeans, and go to the Options dialogue (Tools &gt; Options).  In the PHP section, go to the Symfony tab.  In the Symfony script field, find or enter the path for the symfony script in your local framework installation; don&#8217;t refrence the batch file, but rather the one without an extension.  Mine is installed at: /usr/share/php/symfony/symfony12/data/bin/symfony</p>
<p>Since we&#8217;re likely to be in the middle of a project we&#8217;ll set up NetBeans to use this project.  In the future, you can set up a symfony project from NetBeans (which will run commands such as &#8220;symfony generate:project&#8221; and &#8220;symfony generate:app&#8221; for you).</p>
<p>Start a new project (File &gt; New Project).  Choose to create a &#8220;PHP Application with Existing Sources&#8221;.  Click &#8220;Next&#8221;.  Set the source folder to the project&#8217;s root folder.  It&#8217;s best to place the NetBeans metadata in a seperate folder outside of the project.  The default for this is within your home directory and will work fine.  Click &#8220;Next&#8221;.  If you wish you can set up the accesible URL for your project here (or you can do so as part of the full project configuration later).</p>
<p>NetBeans will, upon analyzing the project, determine that it is a symfony project.  However, to have full symfony help, you&#8217;ll need to add the framework to the Project Include Path for the project and the project cache.  (Yes, this is kinda stupid at first, but it will be a lifesaver!)  To add to the Include Path, right-click on the Include Path in the Project Display Pane (should be, by default, the pane in the upper-left; the Include Path should be at the bottom of the list.)  I add the cache directory of the project and the lib directory of the framework (for me, this is: /usr/share/php/symfony/symfony12/lib).  Once these are added and scanned, their functions should be available in the on-screen tooltips as you type.  The reason to add these directories (especially the framework) are because it is expected that we might be editing non-Symfony files with the editor and we don&#8217;t want functions and classes that are not accessible to the script to be displayed.</p>
<p>Once you have the project up, to finish your configuration, right click on the project name in the Project Display Pane and select &#8220;Properties&#8221;.  On &#8220;Sources&#8221; make sure that the Source Folder is the root of the symfony project.  You can change the &#8220;Test Folder&#8221; to the test folder within the project.  Set the web root to the web folder within the project.  Go to the &#8220;Run Configuration&#8221; bullet point.  Ensure that the Project URL is correct for accessing the application.  Once the URL path is set, choose one of the application_dev.php files within the web directory of the project for the &#8220;Index File&#8221;.</p></blockquote>
<p>Some of the fun aspects of the new IDE:  besides having accurate tooltips about variables and functions, you have the ability to jump (via a right-click) between actions and views.  This can be very useful at times when you are trying to track down a particular bug.  Another fun trick is to Ctrl-click on a function or a class name: you will jump to that item&#8217;s declaration.</p>
<p>That should do it for you!  If you have xdebug installed, you should also be able to use the build-in debugger (I haven&#8217;t really used it yet, but can already tell just how useful it will be).</p>
]]></content:encoded>
			<wfw:commentRss>http://blog.doggetto.com/2010/01/how-i-use-netbeans-6-8-and-symfony-1-2/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
		<item>
		<title>Symfony sfConfig Variables</title>
		<link>http://blog.doggetto.com/2009/06/symfony-sfconfig-variables/</link>
		<comments>http://blog.doggetto.com/2009/06/symfony-sfconfig-variables/#comments</comments>
		<pubDate>Tue, 02 Jun 2009 23:37:37 +0000</pubDate>
		<dc:creator>NoCoolName_Tom</dc:creator>
				<category><![CDATA[symfony Framework]]></category>
		<category><![CDATA[symfony]]></category>
		<category><![CDATA[web development]]></category>

		<guid isPermaLink="false">http://blog.doggetto.com/?p=3</guid>
		<description><![CDATA[I keep trying to figure out how to reference the sfConfig variables.  I also often forget what variables are available to me through the symfony framework.  So, for my own benefit and anyone else's who might be looking for that as well, here it is.]]></description>
			<content:encoded><![CDATA[<p><img class="content-img-right" title="Variables" src="/wp-content/uploads/variables.jpg" alt="Variables" width="226" height="153" /></p>
<p class="intro">I keep trying to figure out how to reference the sfConfig variables.  I also often forget what variables are available to me through the symfony framework.  So, for my own benefit and anyone else&#8217;s who might be looking for that as well, here it is: as many of the sfConfig variables as I could find.<span id="more-3"></span> In grabbing all of these I found a few that I never knew existed.  Most of these are to aid symfony in finding all of those extra classes you&#8217;ve made in your application but they&#8217;re still available to you in your application to use however you wish.</p>
<h3>Reference to Config Variables</h3>
<ul>
<li>Be careful in referencing any app-specific variables in the model in a multi-app project.  If they are not available in the app you are using the model function in you will have problems.</li>
</ul>
<blockquote>
<pre><strong>sfConfig::get('sf_config_variable', 'The default value'); // The default is optional.</strong></pre>
</blockquote>
<h3>Symfony Framework</h3>
<pre><strong>sf_symfony_lib_dir</strong></pre>
<blockquote><p>The real path to the framework&#8217;s lib directory<br />
(/usr/share/php/symfony/symfony12/lib)</p></blockquote>
<h3>Project Structure and Layout</h3>
<pre><strong>sf_root_dir</strong></pre>
<blockquote><p>The path to the project root<br />
(/var/www/project_name)</p></blockquote>
<pre><strong>sf_apps_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s apps folder<br />
(/var/www/project_name/apps)</p></blockquote>
<pre><strong>sf_lib_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s lib folder<br />
(/var/www/project_name/lib)</p></blockquote>
<pre><strong>sf_log_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s log folder<br />
(/var/www/project_name/log)</p></blockquote>
<pre><strong>sf_data_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s data folder<br />
(/var/www/project_name/data)</p></blockquote>
<pre><strong>sf_config_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s config folder<br />
(/var/www/project_name/config)</p></blockquote>
<pre><strong>sf_test_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s test folder<br />
(/var/www/project_name/test)</p></blockquote>
<pre><strong>sf_doc_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s doc folder<br />
(/var/www/project_name/doc)</p></blockquote>
<pre><strong>sf_plugins_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s plugins folder<br />
(/var/www/project_name/plugins)</p></blockquote>
<pre><strong>sf_cache_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s plugins folder<br />
(/var/www/project_name/cache)</p></blockquote>
<pre><strong>sf_web_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s plugins folder<br />
(/var/www/project_name/web)</p></blockquote>
<pre><strong>sf_upload_dir</strong></pre>
<blockquote><p>The path to the project&#8217;s upload folder<br />
(/var/www/project_name/web/uploads)</p></blockquote>
<h3>Application Information</h3>
<pre><strong>sf_app</strong></pre>
<blockquote><p>The current application<br />
(backend)</p></blockquote>
<pre><strong>sf_environment</strong></pre>
<blockquote><p>The current environment<br />
(dev)</p></blockquote>
<pre><strong>sf_debug</strong></pre>
<blockquote><p>Whether debugging is enabled<br />
(1)</p></blockquote>
<h3>Application Structure and Layout</h3>
<pre><strong>sf_app_dir</strong></pre>
<blockquote><p>The path to the current application<br />
(/var/www/project_name/apps/backend)</p></blockquote>
<pre><strong>sf_app_config_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s config directory<br />
(/var/www/project_name/apps/backend/config)</p></blockquote>
<pre><strong>sf_app_lib_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s lib directory<br />
(/var/www/project_name/apps/backend/lib)</p></blockquote>
<pre><strong>sf_app_module_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s module directory<br />
(/var/www/project_name/apps/backend/modules)</p></blockquote>
<pre><strong>sf_app_template_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s template directory<br />
(/var/www/project_name/apps/backend/templates)</p></blockquote>
<pre><strong>sf_app_i18n_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s i18n directory<br />
(/var/www/project_name/apps/backend/i18n)</p></blockquote>
<h3>Cache Structure and Layout</h3>
<pre><strong>sf_app_base_cache_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s directory in the cache<br />
(/var/www/project_name/cache/backend)</p></blockquote>
<pre><strong>sf_app_cache_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s directory in the cache by current environment<br />
(/var/www/project_name/cache/backend/dev)</p></blockquote>
<pre><strong>sf_template_cache_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s templates directory in the cache by current environment<br />
(/var/www/project_name/cache/backend/dev/template)</p></blockquote>
<pre><strong>sf_i18n_cache_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s i18n directory in the cache by current environment<br />
(/var/www/project_name/cache/backend/dev/i18n)</p></blockquote>
<pre><strong>sf_config_cache_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s config directory in the cache by current environment<br />
(/var/www/project_name/cache/backend/dev/config)</p></blockquote>
<pre><strong>sf_test_cache_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s test directory in the cache by current environment<br />
(/var/www/project_name/cache/backend/dev/test)</p></blockquote>
<pre><strong>sf_module_cache_dir</strong></pre>
<blockquote><p>The path to the current application&#8217;s modules directory in the cache by current environment<br />
(/var/www/project_name/cache/backend/dev/modules)</p></blockquote>
<h3>Application Settings</h3>
<p>You can access any value in settings.yml by prepending &#8220;sf_&#8221; to the value.</p>
<pre><strong>sf_error_404_module</strong></pre>
<p style="padding-left: 30px;">The module that contains the 404 action (default)</p>
<pre><strong>sf_error_404_action</strong></pre>
<p style="padding-left: 30px;">The action that displays the 404 error (error404)</p>
<pre><strong>sf_logging_enabled</strong></pre>
<p style="padding-left: 30px;">Boolean for whether logging is currently enabled (1)</p>
<pre><strong>sf_escaping_strategy</strong></pre>
<p style="padding-left: 30px;">Whether the sfView class is using the Escaping Strategy (1)</p>
<pre><strong>sf_no_script_name</strong></pre>
<p style="padding-left: 30px;">Whether the application is requiring the script name. (1)</p>
<pre><strong>sf_csrf_secret</strong></pre>
<p style="padding-left: 30px;">The CSRF secret (UniqueSecret)</p>
<h3>Also:</h3>
<p>You can grab some information from the current context (usually in templates, but should work well enough in actions &#8211; I&#8217;d be very cautious about using these in models):</p>
<pre><strong>sfContext::getInstance()-&gt;getActionName();</strong></pre>
<blockquote><p>The name of the current action.  Can also be called by $this-&gt;getActionName() in templates.<br />
(my_awesome_action)</p></blockquote>
<pre><strong>sfContext::getInstance()-&gt;getModuleName();</strong></pre>
<blockquote><p>The name of the current module.  Can also be called by $this-&gt;getModuleName() in templates.<br />
(my_awesome_module)</p></blockquote>
<pre><strong>sfContext::getInstance()-&gt;getModuleDirectory();</strong></pre>
<blockquote><p>The path to the current module&#8217;s directory<br />
(/var/www/project_name/apps/backend/modules/my_awesome_module)</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://blog.doggetto.com/2009/06/symfony-sfconfig-variables/feed/</wfw:commentRss>
		<slash:comments>6</slash:comments>
		</item>
	</channel>
</rss>

