<?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>strictlyPHP &#187; propel</title>
	<atom:link href="http://www.strictlyphp.com/blog/tag/propel/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.strictlyphp.com/blog</link>
	<description>web development &#38; web analytics</description>
	<lastBuildDate>Mon, 15 Mar 2010 08:21:25 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Propel version 1.4.0 released</title>
		<link>http://www.strictlyphp.com/blog/2009/11/16/propel-version-1-4-0-released/</link>
		<comments>http://www.strictlyphp.com/blog/2009/11/16/propel-version-1-4-0-released/#comments</comments>
		<pubDate>Mon, 16 Nov 2009 21:17:20 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[orm]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[propel]]></category>

		<guid isPermaLink="false">http://www.strictlyphp.com/blog/?p=1159</guid>
		<description><![CDATA[
Although I must admit I didn&#8217;t notice it, less than 2 months after it was decided to create a new version for Propel, it was actually released.
Last week, on the 8th of November, the new 1.4.0 version has been released for production use. Additionally they also set up a blog to prove Propel is still [...]]]></description>
			<content:encoded><![CDATA[<p><a href="http://www.strictlyphp.com/blog/wp-content/uploads/2009/11/propel.gif"><img class="alignleft size-full wp-image-1160" style="border: 0;" title="propel" src="http://www.strictlyphp.com/blog/wp-content/uploads/2009/11/propel.gif" alt="propel" width="200" height="73" /></a></p>
<p><em>Although I must admit I didn&#8217;t notice it, less than 2 months after it was decided to create a new version for <a href="http://propel.phpdb.org/" target="_blank">Propel</a>, it was actually released.</em></p>
<p>Last week, on the 8th of November, the <a href="http://propel.phpdb.org/trac/wiki/Users/News/Propel14StableReleasedAndNewBlog" target="_blank">new 1.4.0 version</a> has been released for production use. Additionally they also set up a <a href="http://propel.posterous.com/" target="_blank">blog</a> to prove Propel is still very much alive.</p>
<blockquote><p>Propel 1.4 is a backwards compatible evolution of Propel 1.3. It offers <strong>lots of bug fixes</strong>, some very interesting new features, <strong>speed enhancements</strong>, and <strong>a very simple upgrade path</strong>: rebuild your model after updating Propel, and your application works as always. Except it works better&#8230;</p></blockquote>
<p>It all sounds to good to be true!</p>
<p>A first migration of a project to this new version went smoothly: remember to remove the *-classmap.php file that was generated by 1.3.0 because it has been integrated in the main config file. It&#8217;s also recommendable to delete the /map sub-folder in your models folder because 1.4.0 generates newly named *TableMap.php files.</p>
<p>Also good to have: full query logging (Propel 1.3 switched to PDO and lost this feature but it&#8217;s back!).</p>
<p>I must also admit I have never actually implemented <a href="http://www.doctrine-project.org/" target="_blank">Doctrine</a>, but that&#8217;s also because I haven&#8217;t found a reason while using Propel.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strictlyphp.com/blog/2009/11/16/propel-version-1-4-0-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Propel site and Subversion repository down</title>
		<link>http://www.strictlyphp.com/blog/2009/03/01/propel-site-and-subversion-repository-down/</link>
		<comments>http://www.strictlyphp.com/blog/2009/03/01/propel-site-and-subversion-repository-down/#comments</comments>
		<pubDate>Sun, 01 Mar 2009 11:27:02 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[subversion]]></category>

		<guid isPermaLink="false">http://www.strictlyphp.com/blog/?p=791</guid>
		<description><![CDATA[The phpdb.org server seems to be unreachable since yesterday, together with the Propel and Creole Subversion repositories.
Well, I guess their host doesn&#8217;t work weekends so lets hope it will be back up on Monday.
In the meanwhile, you will probably also get a timeout error message when updating your projects which have the Propel repository linked [...]]]></description>
			<content:encoded><![CDATA[<p><em>The phpdb.org server seems to be unreachable since yesterday, together with the Propel and Creole Subversion repositories.</em></p>
<p>Well, I guess their host doesn&#8217;t work weekends so lets hope it will be back up on Monday.</p>
<p>In the meanwhile, you will probably also get a <strong>timeout error messag</strong>e when updating your projects which have the Propel repository linked with svn:externals. Here&#8217;s a list of the different options you have:</p>
<ul>
<li>The easiest: <strong>don&#8217;t update the external libraries</strong>. On Windows, select &#8220;Update to revision&#8230;&#8221; in the TortoiseSVN right-click menu and check &#8220;Omit externals&#8221; instead of performing a normal &#8220;SVN Update&#8221;. Since you&#8217;ve probably linked to a tag it doesn&#8217;t need updating anyway (unless someone linked to a new version).</li>
<li>Create your own repository with the files you still have in your working copy: inside the external libraries folder, select &#8220;Export&#8221; in the TortoiseSVN menu and export to a new folder which you can then import into a new repository. That new repository can then be used as an svn:externals link.</li>
<li>Include the Propel files from option 2 inside your project instead of linking to them. But this takes away the flexibility svn:externals provides, so it is not preferable.</li>
</ul>
<p>Luckily, most SVN servers have a good up-time record.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strictlyphp.com/blog/2009/03/01/propel-site-and-subversion-repository-down/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Pagination adapter for Propel</title>
		<link>http://www.strictlyphp.com/blog/2008/09/19/zend_pagination-adapter-for-propel/</link>
		<comments>http://www.strictlyphp.com/blog/2008/09/19/zend_pagination-adapter-for-propel/#comments</comments>
		<pubDate>Fri, 19 Sep 2008 07:50:40 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.strictlyphp.com/blog/?p=180</guid>
		<description><![CDATA[Like recently proposed by Jason Eisenmenger, I&#8217;ve written a Zend_Pagination adapter for Propel.
It uses the DbFinder symfony plugin (formerly sfPropelFinder) which mimics Doctrine&#8217;s way of performing queries. The strictlyPHP_Propel_Finder used below is just a wrapper around that plugin.
Please note: it can certainly be improved (and I&#8217;m not sure the Zend Framework coding standards are met).
class [...]]]></description>
			<content:encoded><![CDATA[<p>Like <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Paginator_Adapter_Doctrine+-+Jason+Eisenmenger?focusedCommentId=8454213#comment-8454213" target="_blank">recently proposed by Jason Eisenmenger</a>, I&#8217;ve written a Zend_Pagination adapter for Propel.</p>
<p>It uses the <a href="http://www.symfony-project.org/plugins/DbFinderPlugin" target="_blank">DbFinder symfony plugin</a> (formerly sfPropelFinder) which mimics Doctrine&#8217;s way of performing queries. The strictlyPHP_Propel_Finder used below is just a wrapper around that plugin.</p>
<p>Please note: it can certainly be improved (and I&#8217;m not sure the Zend Framework coding standards are met).</p>
<pre>class strictlyPHP_Paginator_Adapter_Propel implements
Zend_Paginator_Adapter_Interface
{
    /**
     * @var strictlyPHP_Propel_Finder
     */
    protected $_finder;

    /**
     * @var Criteria
     */
    protected $_criteria;

    /**
     * @var int
     */
    protected $_count;

    /**
     * Constructor
     * @param strictlyPHP_Propel_Finder $finder
     */
    public function __construct($finder)
    {
        $this-&gt;_finder = $finder;
        $this-&gt;_criteria = $finder-&gt;getCriteria();
    }

    /**
     * Get count
     * @return int
     */
    public function count()
    {
         if ($this-&gt;_count === null) {
             $this-&gt;_finder-&gt;setCriteria($this-&gt;_criteria);
            $this-&gt;_count = $this-&gt;_finder-&gt;count();
         }

        return $this-&gt;_count;
    }

    /**
     * Get items
     * @param int $pageNumber
     * @param int $itemCountPerPage
     * @return array
     */
    public function getItems($pageNumber, $itemCountPerPage)
    {
        $criteria = clone $this-&gt;_criteria;
        $criteria-&gt;setOffset($pageNumber);
        $criteria-&gt;setLimit($itemCountPerPage);
        return $this-&gt;_finder-&gt;setCriteria($criteria)-&gt;find();
    }
}</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.strictlyphp.com/blog/2008/09/19/zend_pagination-adapter-for-propel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Log wrapper for Propel</title>
		<link>http://www.strictlyphp.com/blog/2008/08/22/zend_log-wrapper-for-propel/</link>
		<comments>http://www.strictlyphp.com/blog/2008/08/22/zend_log-wrapper-for-propel/#comments</comments>
		<pubDate>Fri, 22 Aug 2008 14:24:14 +0000</pubDate>
		<dc:creator>Sam</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[propel]]></category>
		<category><![CDATA[zend framework]]></category>

		<guid isPermaLink="false">http://www.strictlyphp.com/blog/?p=85</guid>
		<description><![CDATA[Although Doctrine has its advantages, I still like Propel. It does its job and it does it fairly well.
If you integrate Propel with Zend Framework, you basically only need a Zend_Log wrapper that implements the BasicLogger interface Propel requires. This lets you use Zend_Log as the only log class in your application instead of creating [...]]]></description>
			<content:encoded><![CDATA[<p>Although <a href="http://codeutopia.net/blog/2008/03/02/doctrine-vs-propel/" target="_blank">Doctrine has its advantages</a>, I still like Propel. It does its job and it does it fairly well.<br />
If you integrate Propel with Zend Framework, you basically only need a Zend_Log wrapper that implements the BasicLogger interface Propel requires. This lets you use Zend_Log as the only log class in your application instead of creating one especially for Propel.</p>
<pre>/**
 * Wrapper for Zend_Log for use as Propel log
 * @author Sam Hauglustaine
 */
class strictlyPHP_Propel_Log extends Zend_Log implements BasicLogger
{
    /**
     * Log
     * @var Zend_Log
     */
    private $_log;

    /**
     * Constructor
     * @param Zend_Log $log
     */
    public function __construct(Zend_Log $log) {
        $this-&gt;_log = $log;
    }

    /**
     * Log message of specified severity
     * @param string $message
     * @param int $severity
     */
    public function log($message, $severity = null) {
        $this-&gt;_log-&gt;log($message, $severity);
    }

    public function emergency($message) {
        $this-&gt;log($message, Zend_Log::EMERG);
    }
    public function alert($message) {
        $this-&gt;log($message, Zend_Log::ALERT);
    }
    public function crit($message) {
        $this-&gt;log($message, Zend_Log::CRIT);
    }
    public function err($message) {
        $this-&gt;log($message, Zend_Log::ERR);
    }
    public function warning($message) {
        $this-&gt;log($message, Zend_Log::WARN);
    }
    public function notice($message) {
        $this-&gt;log($message, Zend_Log::NOTICE);
    }
    public function info($message) {
        $this-&gt;log($message, Zend_Log::INFO);
    }
    public function debug($message) {
        $this-&gt;log($message, Zend_Log::DEBUG);
    }
}</pre>
<p>(the Zend_Log priority constants nicely match their Propel equivalents.)<br />
You then need to extend the main Propel class to do the wrapping:</p>
<pre>/**
 * Wrapper for Propel
 * @author Sam Hauglustaine
 */
class strictlyPHP_Propel extends Propel
{
    /**
     * Set Propel log (required)
     * @param mixed $log
     * @return void
     */
    public static function setLog($log)
    {
        if($log instanceof Zend_Log)
            $log = new strictlyPHP_Propel_Log($log);

        parent::setLogger($log);
    }
}</pre>
<p>That&#8217;s all. You can then call your Propel wrapper&#8217;s static methods in your bootstrap or a front controller plugin (I implemented that last option for a brand new project, a <a href="http://www.stallionlocator.com/" target="_blank">directory for stallion owners</a>):</p>
<pre>strictlyPHP_Propel::setLog($myLog);
strictlyPHP_Propel::init($myConfig);</pre>
<p>Of course the bigger part is using the Propel class generator itself but that&#8217;s something for another post.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.strictlyphp.com/blog/2008/08/22/zend_log-wrapper-for-propel/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
