<?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>Design Disclosure - Portfolio &#38; Personal Blog of Alistair Stead &#187; php</title> <atom:link href="http://www.designdisclosure.com/category/php/feed/" rel="self" type="application/rss+xml" /><link>http://www.designdisclosure.com</link> <description>Software Engineer developing PHP applications for fun, profit and distraction. Magento, Zend Framework and Symfony</description> <lastBuildDate>Fri, 11 Nov 2011 23:30:10 +0000</lastBuildDate> <language>en</language> <sy:updatePeriod>hourly</sy:updatePeriod> <sy:updateFrequency>1</sy:updateFrequency> <generator>http://wordpress.org/?v=3.2.1</generator> <item><title>MageTool Update v0.3.0</title><link>http://www.designdisclosure.com/2011/02/magetool-update-v0-3-0/</link> <comments>http://www.designdisclosure.com/2011/02/magetool-update-v0-3-0/#comments</comments> <pubDate>Wed, 09 Feb 2011 02:27:25 +0000</pubDate> <dc:creator>Alistair Stead</dc:creator> <category><![CDATA[Magento]]></category> <category><![CDATA[php]]></category> <category><![CDATA[magetool]]></category><guid
isPermaLink="false">http://www.designdisclosure.com/?p=168</guid> <description><![CDATA[While at Magento Imagine I have used the time where I was awake due to jet lag to finish a couple of new features to MageTool.MageTool v0.3.0 now includes:Improved feedback when running commands for mage-core-resource
Added commands to query and run the Magento indexer
Added commands to query and run the Magento compiler
Improved mage-core-cache commands
Added functionality ...]]></description> <content:encoded><![CDATA[<p>While at Magento Imagine I have used the time where I was awake due to jet lag to finish a couple of new features to <a
title="MageTool" href="http://www.magetool.co.uk/" target="_blank">MageTool</a>.</p><p>MageTool v0.3.0 now includes:</p><ul><li>Improved feedback when running commands for mage-core-resource</li><li>Added commands to query and run the Magento indexer</li><li>Added commands to query and run the Magento compiler</li><li>Improved mage-core-cache commands</li><li>Added functionality to run individual module setup classes directly</li><li>Added functionality to dispatch Magento events to test your observers</li></ul><p>All of these commands are intended to make development of Magento extensions easier and more streamlined. If you have feature requests please let me know. Or if you wish feel free to fork the <a
title="MageTool on Github" href="https://github.com/alistairstead/MageTool">project on GitHub</a> and add the command that you need.</p><p>If you find and bugs with MageTool please raise a ticket on <a
title="MageTool bug tracker" href="https://github.com/alistairstead/MageTool/issues">GitHub</a>.</p><div
class="shr-publisher-168"></div><h3  class="related_post_title">Related Articles</h3><ul
class="related_post"><li>October 10, 2010 -- <a
href="http://www.designdisclosure.com/2010/10/magento-command-line-tools-magetool/" title="Magento command line tools MageTool">Magento command line tools MageTool</a></li><li>March 26, 2011 -- <a
href="http://www.designdisclosure.com/2011/03/package-and-install-your-latest-magento-1-5-extension/" title="Package and Install your latest Magento 1.5+ extension">Package and Install your latest Magento 1.5+ extension</a></li><li>March 15, 2011 -- <a
href="http://www.designdisclosure.com/2011/03/testing-magento-checkout/" title="Testing Magento Checkout">Testing Magento Checkout</a></li><li>July 29, 2009 -- <a
href="http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/" title="How to: Magento eCommerce help and tutorials">How to: Magento eCommerce help and tutorials</a></li></ul><p
class="wp-flattr-button"></p><p><a
href="http://www.designdisclosure.com/?flattrss_redirect&amp;id=168&amp;md5=addc77750bc4d40fa814d6c1fc1702d2" title="Flattr" target="_blank"><img
src="http://www.designdisclosure.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://www.designdisclosure.com/2011/02/magetool-update-v0-3-0/feed/</wfw:commentRss> <slash:comments>1</slash:comments> </item> <item><title>Magento command line tools MageTool</title><link>http://www.designdisclosure.com/2010/10/magento-command-line-tools-magetool/</link> <comments>http://www.designdisclosure.com/2010/10/magento-command-line-tools-magetool/#comments</comments> <pubDate>Sat, 09 Oct 2010 23:05:22 +0000</pubDate> <dc:creator>Alistair Stead</dc:creator> <category><![CDATA[Magento]]></category> <category><![CDATA[php]]></category> <category><![CDATA[command]]></category> <category><![CDATA[magetool]]></category><guid
isPermaLink="false">http://www.designdisclosure.com/?p=157</guid> <description><![CDATA[If you have spent any time developing with Magento I expect that like me you have found a number of tasks you find yourself repeating many many times. While developing new modules or themes there are many times when you need to clear the Magento cache or even disable it completely. Now of course ...]]></description> <content:encoded><![CDATA[<p>If you have spent any time developing with Magento I expect that like me you have found a number of tasks you find yourself repeating many many times. While developing new modules or themes there are many times when you need to clear the Magento cache or even disable it completely. Now of course you can log into the admin system and carry out these actions but have you every thought there must be an easier way?</p><p>Many development frameworks or other open source projects have tool that can be used by developers to issue commands quickly and easily. Magento however does not have any built in tools to improve the development workflow. This is where MageTool fits in!</p><h2 id="magetool">MageTool</h2><p>How can <a
href="http://github.com/alistairstead/MageTool">MageTool</a> help? Well hopefully in a number of ways. MageTool extends the existing Zend Framework command line tool zf, adding new commands that are specific to Magento development workflow. Rather then navigating the Magento admin system to clear cache or the enable or disable caching you can issue a simple command in your terminal window and achieve the same results. You can also modify the Magento configuration quickly or issue commands that will selectively update many configuration values.</p><p>In my standard development practices I maintain a number of Magento installs on different servers. These are used for Development, Staging and UAT each using different domains to access the stores. This means however that I often need to move databases between servers, resulting in the ‘base_url’ configuration being incorrect. This can be easily updated if you have database access and is fairly simple if you only have a couple of sites setup. However if you have more sites setup this can become very very difficult to maintain and calls into question the idea of working with many environment servers during development.</p><p>MageTool can help again in any situation where you need to move a Magento install and then update the ‘base_url’ configuration. You can construct a command that will quickly and easily update all URLs in the Magento config.</p><p><span
id="more-157"></span></p><h2 id="install">Install</h2><p>First install ZF:</p><pre><code>sudo pear channel-discover pear.zfcampus.org
sudo pear install zfcampus/zf
</code></pre><p>Then install MageTool:</p><pre><code>sudo pear channel-discover pear.magetool.co.uk
sudo pear install magetool/magetool
</code></pre><p>Once you have installed ZF and MageTool you will need to create configuration for your user by creating the following file:</p><pre><code>vim ~/.zf.ini
</code></pre><p>Add the following lines to load the additional MageTool commands making them available to zf:</p><pre><code>basicloader.classes.1 = "MageTool_Tool_MageApp_Provider_Manifest"
basicloader.classes.2 = "MageTool_Tool_MageExtension_Provider_Manifest"
</code></pre><p>After the install has completed successfully if you run zf you will see the additional commands available for Magento.</p><pre><code> MageAdminUser
    zf show mage-admin-user
    zf create mage-admin-user username email password firstname[=Admin] lastname[=User]

  MageCoreCache
    zf clear mage-core-cache
    zf enable mage-core-cache
    zf disable mage-core-cache

  MageCoreResource
    zf show mage-core-resource
    zf delete mage-core-resource path

  MageCoreConfig
    zf show mage-core-config path scope
    zf set mage-core-config path scope value
    zf replace mage-core-config match value path scope

  MageApp
    zf version mage-app

  MageExtension
    zf create mage-extension code-pool vendor-name extension-name
</code></pre><h2 id="example_usage">Example Usage</h2><h3 id="cache">Cache</h3><p>To clear the entire Magento cache simply run the following command from within the Magento project root directory:</p><pre><code>zf clear mage-core-cache
</code></pre><p>To disable the entire Magento cache:</p><pre><code>zf disable mage-core-cache
</code></pre><h3 id="core_config">Core Config</h3><p>MageTool provides commands to show existing configuration values and to set their values. It also has an additional command that can be used to perform a str_replace on the config values. This can be used if you have moved the database from another server with a different domain to update the config values in a single command:</p><pre><code>zf replace mage-core-config --match www.current-domain.com --value shop.new-domain.co.uk
</code></pre><p>This will update all the config value that include the string “www.current-domain.com” and substitute it for “shop.new-domain.co.uk”. This can also be further refined to only affect specific config paths or scopes.</p><h3 id="core_resource">Core Resource</h3><p>During the development of a new extension you sometimes need to remove the resource from the internal registry to force it to re-run the install scripts. MageTool can help you first see which versions of each extensions are installed:</p><pre><code>zf show mage-core-resource --code mage_log
</code></pre><p>You can also remove specific entries:</p><pre><code>zf delete mage-core-resource --code mage_log
</code></pre><h3 id="admin_user">Admin User</h3><p>If you inherit a Magento project you may need to create a new admin user to gain access to the system. MageTool can list existing admin users and email addresses or it can create a new user for you to use.</p><pre><code>zf create mage-admin-user --username newadmin --email newadmin@project.com --password newpassword
</code></pre><h2 id="roadmap">Roadmap</h2><p>I plan to add additional functionality to create skeleton files for new extensions or themes, removing the repetitive creation of directories and configuration files when creating new extension.</p><p>If you have additional suggestions please let me know or alternatively you can fork the <a
href="http://github.com/alistairstead/MageTool">MageTool</a> project on github and add the commands before sending me a pull request.</p><h2 id="feedback_and_bugs">Feedback and Bugs</h2><p>If you have any problems using MageTool or if you have any feedback or suggestions please <a
href="http://github.com/alistairstead/MageTool/issues">submit them here</a>.</p><div
class="shr-publisher-157"></div><h3  class="related_post_title">Related Articles</h3><ul
class="related_post"><li>February 9, 2011 -- <a
href="http://www.designdisclosure.com/2011/02/magetool-update-v0-3-0/" title="MageTool Update v0.3.0">MageTool Update v0.3.0</a></li><li>March 26, 2011 -- <a
href="http://www.designdisclosure.com/2011/03/package-and-install-your-latest-magento-1-5-extension/" title="Package and Install your latest Magento 1.5+ extension">Package and Install your latest Magento 1.5+ extension</a></li><li>March 15, 2011 -- <a
href="http://www.designdisclosure.com/2011/03/testing-magento-checkout/" title="Testing Magento Checkout">Testing Magento Checkout</a></li><li>July 29, 2009 -- <a
href="http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/" title="How to: Magento eCommerce help and tutorials">How to: Magento eCommerce help and tutorials</a></li></ul><p
class="wp-flattr-button"></p><p><a
href="http://www.designdisclosure.com/?flattrss_redirect&amp;id=157&amp;md5=a92ff529e4ec6e9cbd8b2dfcb24f5dc6" title="Flattr" target="_blank"><img
src="http://www.designdisclosure.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://www.designdisclosure.com/2010/10/magento-command-line-tools-magetool/feed/</wfw:commentRss> <slash:comments>4</slash:comments> </item> <item><title>symfony APC cache and Memcache session storage</title><link>http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/</link> <comments>http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/#comments</comments> <pubDate>Mon, 30 Nov 2009 23:22:43 +0000</pubDate> <dc:creator>Alistair Stead</dc:creator> <category><![CDATA[php]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[optimization]]></category> <category><![CDATA[scaling]]></category><guid
isPermaLink="false">http://www.designdisclosure.com/?p=138</guid> <description><![CDATA[In a previous post I described some of the reasons why you would want to store your session data in an alternate location to temporary files on your server. I explained the setup of database session storage using Doctrine and how this would allow you to take advantage of storing session data in a ...]]></description> <content:encoded><![CDATA[<p><img
class="alignnone size-full wp-image-145" title="symfony-memcache" src="http://designdisclosure.s3.amazonaws.com/wp-content/uploads/2009/12/symfony-memcache.jpg" alt="symfony-memcache" width="570" height="300" /></p><p>In a previous post I described some of the reasons why you would want to store your session data in an alternate location to temporary files on your server. I explained the<a
title="symfony Doctrine database session storage" href="http://www.designdisclosure.com/2009/11/symfony-doctri…ession-storage/"> setup of database session storage using Doctrine</a> and how this would allow you to take advantage of storing session data in a database. However depending upon your application requirements storing your session data in a database may cause excessive load on you database. You could of course use a separate dedicated database server to store your session data. However there is an alternate setup that will allow you to centralise your session storage ready for horizontal scaling of your hosting e.g. adding additional web servers.</p><p><span
id="more-138"></span></p><p>symfony provides a very easy way for you to configure your application to use a number of alternate session storage strategies. In this article I will explain the steps needed to setup your application to use first APC as your session storage and then Memcache. Both of these strategies result in the session data being stored in volatile memory on your server and a cookie is stored on the client to maintain reference to the session data. You can set the lifetime of the cookie to control your session timeout.</p><h2>Install APC and Memcached modules</h2><p>First we need to ensure that your server has the required packages installed. I am using Ubuntu 9.04 in this example but the packages are available for your preferred linux distro. To install the required packages run the following commands.</p><p>Install the required PHP modules and the correct version of apache to successfully install APC, then install the Pecl APC module.</p><pre class="textmate-source"><span class="source source_shell">sudo apt-get install php5-dev php-pear apache2-threaded-dev
sudo pecl install apc</span></pre><p>Install memcache</p><pre class="textmate-source"><span class="source source_shell">sudo apt-get install memcached</span></pre><h2>Configure APC session storage</h2><p>Once you have your server setup with the required packages you need to configure symfony to use your preferred session storage strategy. To do this you simply need to modify the factories.yml file for you application. You need to modify the section of the factories.yml that defines your application storage strategy e.g.</p><p>Amend your factories.yml to include the following settings then change the parameters to reflect you setup such as the domain and session name.</p><pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">all<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">storage<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfCacheSessionStorage
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_name<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfproject </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] name of session to use
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_path<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">/ </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie path
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_domain<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">example.com </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie domain
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_lifetime<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">+30 days </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] liftime of cookie
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_secure<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] send only if secure connection
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_http_only<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] accessible only via http protocol
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">cache<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">
</span></span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfAPCCache </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] define the cache strategy
</span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">~ </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] this empty key is required or you will get warnings</span></span></pre><p>Once you have made this change clear the symfony cache and try your application. You will not see any noticeable difference unless you check the symfony toolbar and look for the additional cookie stored on the client.</p><p>This example defines the use of sfAPCCache as the session storage strategy. APC stores the session data in memory on your web server making it quicker to access than reading a file or database record.</p><h2>Configure Memcache session storage</h2><p>To setup memcache session storage it is almost as simple. Amend your factories.yml to include the following settings then change the parameters to reflect your setup including any specific values for your memcache server if you set it up differently.</p><pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">all<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span><span class="meta meta_leading-tabs meta_leading-tabs_yaml"><span class="meta meta_odd-tab">  </span></span><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">storage<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfCacheSessionStorage
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_name<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfproject </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] name of session to use
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_path<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">/ </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie path
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_domain<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">example.com </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] cookie domain
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_lifetime<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">+30 days </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] liftime of cookie
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_secure<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">false </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] send only if secure connection
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">session_cookie_http_only<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] accessible only via http protocol
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">cache<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">
</span></span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfMemcacheCache </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span>[required] define the cache strategy
</span>        <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>          <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">servers<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Array of servers
</span>            <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">localserver<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>              <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">host<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">localhost </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> hostname or IP of mamcache server
</span>              <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">port<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">11211 </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> default memcache port</span></span></pre><p>Once you have made this change clear your symfony cache and test your application.</p><p>Memcache is a volatile storage strategy very similar to RAM in you PC or Mac. It is very quick to access as the session data is held in the server memory rather than in a file or database. Memcache can also be centralised onto a dedicated memcache server allowing your application to be scaled. The example above uses localhost as the memcache server but the host value of the configured server could be modified to be an alternate dedicated memcache server.</p><p>I will be running some performance tests using these strategies and also compare the default file based session storage and also the database session storage strategy. If you have already run these tests I would be keen to see your results.</p><p>I hope these examples prove useful. If you have any queries or questions please leave a comment.</p><div
class="shr-publisher-138"></div><h3  class="related_post_title">Related Articles</h3><ul
class="related_post"><li>November 25, 2009 -- <a
href="http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/" title="symfony Doctrine database session storage">symfony Doctrine database session storage</a></li><li>October 8, 2009 -- <a
href="http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/" title="Propel doUpdate update multiple records in a single statement">Propel doUpdate update multiple records in a single statement</a></li></ul><p
class="wp-flattr-button"></p>]]></content:encoded> <wfw:commentRss>http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/feed/</wfw:commentRss> <slash:comments>7</slash:comments> </item> <item><title>symfony Doctrine database session storage</title><link>http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/</link> <comments>http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/#comments</comments> <pubDate>Wed, 25 Nov 2009 22:23:26 +0000</pubDate> <dc:creator>Alistair Stead</dc:creator> <category><![CDATA[php]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[doctrine]]></category> <category><![CDATA[sessions]]></category><guid
isPermaLink="false">http://www.designdisclosure.com/?p=128</guid> <description><![CDATA[Sessions are normally managed by your server and depending upon how involved you get with the PHP setup you need never know how this data is stored. The default setup for PHP is to store session data in temporary files on the server. So why would we want to change how sessions are handled ...]]></description> <content:encoded><![CDATA[<p>Sessions are normally managed by your server and depending upon how involved you get with the PHP setup you need never know how this data is stored. The default setup for PHP is to store session data in temporary files on the server. So why would we want to change how sessions are handled and what advantage can we gain from any changes we make.</p><h2>Why use database session management?</h2><p>Sessions allow you maintain persistence within PHP applications. With every HTTP request a PHP application must re-assign every variable and object needed in your application. Sessions allow you to store data that is required to persist past each HTTP request allowing it to be easily retrieved and used.</p><p><span
id="more-128"></span></p><p>Sessions are commonly used when  creating a secure application, used to store the state of a user e.g. if they are logged in or credentials to control access to content.</p><p>By storing session data in a database table you are able to create an application interface that will show information about the users that are logged in. This for example could show the number of users logged into the application or show administrators who is logged in.</p><p>If you  need to scale your application by adding more than one server, saving your session data in temporary files can lead to major problems. By using database storage you can optimise and unify the session storage, ensuring that session data is always available and consistent.</p><p>Obviously there are other solutions for scalable session storage such as APC or MemCache but these solutions are for another post.</p><h2>How to setup Doctrine database session storage</h2><p>You first need to add a table to you database schema that will be used to store your session data. Although you can create this table manually, adding it to your scheme also created the model classes that you can later use to interact with the table data.</p><pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">Session<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">columns<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">id<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span>{ <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">type<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">string(32)</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">primary<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">notnull<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span>}
    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">data<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span>{ <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">type<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">string(4000)</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">notnull<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span>}
    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">time<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml"> </span></span>{ <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">type<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">integer(4)</span></span>, <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">notnull<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">true </span></span>}</span></pre><p>Once you have added the table to your schema you can build your model and database:</p><pre class="textmate-source"><span class="source source_shell">./symfony doctrine:build-all</span></pre><p>You then need to configure your symfony application to use this table to store all session data. To do this you need to modify the factories.yml file for your application. Update your file to include the following lines:</p><pre class="textmate-source"><span class="source source_yaml"><span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">all<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>  <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">storage<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">class<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">sfPDOSessionStorage
</span></span>    <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">param<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span><span class="string string_unquoted string_unquoted_yaml">
</span></span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_table<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">session </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Name of the table storing the sessions
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_id_col<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">id </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> The primary key column
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_data_col<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">data </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> The column where the session data will be stored
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">db_time_col<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">time </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> The column where the timestamp of the session will be stored
</span>      <span class="string string_unquoted string_unquoted_yaml"><span class="entity entity_name entity_name_tag entity_name_tag_yaml">database<span class="punctuation punctuation_separator punctuation_separator_key-value punctuation_separator_key-value_yaml">:</span></span> <span class="string string_unquoted string_unquoted_yaml">doctrine </span></span><span class="comment comment_line comment_line_number-sign comment_line_number-sign_yaml"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_yaml">#</span> Name of the database connection to use</span></span></pre><p>Once you have modifies your factories.yml file you will need to clear the symfony cache. After that your application should run exactly as it did before except that your users session data will be stored in the database table.</p><p>The data column stores all the session data in a serialised form this is deserialized each time a user requests the data. There are many uses for this type of session storage and I hope this brief explanation helps you.</p><p>Subscribe to my <a
title="Designdisclosure.com RSS Feed" href="feed://www.designdisclosure.com/feed/">RSS feed</a> or follow <a
title="Alistair Stead on Twitter" href="http://twitter.com/alistairstead">me on twitter</a> to find out about <a
title="setup symfony to use apc or memcache session storage" href="http://www.designdisclosure.com/2009/11/symfony-apc-ca…ession-storage/">setting up symfony to use APC or MemCache session storage.</a></p><div
class="shr-publisher-128"></div><h3  class="related_post_title">Related Articles</h3><ul
class="related_post"><li>November 30, 2009 -- <a
href="http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/" title="symfony APC cache and Memcache session storage">symfony APC cache and Memcache session storage</a></li><li>October 8, 2009 -- <a
href="http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/" title="Propel doUpdate update multiple records in a single statement">Propel doUpdate update multiple records in a single statement</a></li></ul><p
class="wp-flattr-button"></p><p><a
href="http://www.designdisclosure.com/?flattrss_redirect&amp;id=128&amp;md5=9011613925bcfdc08de4fc9fdaa38384" title="Flattr" target="_blank"><img
src="http://www.designdisclosure.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/feed/</wfw:commentRss> <slash:comments>20</slash:comments> </item> <item><title>Propel doUpdate update multiple records in a single statement</title><link>http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/</link> <comments>http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/#comments</comments> <pubDate>Thu, 08 Oct 2009 19:59:09 +0000</pubDate> <dc:creator>Alistair Stead</dc:creator> <category><![CDATA[php]]></category> <category><![CDATA[symfony]]></category> <category><![CDATA[propel]]></category> <category><![CDATA[sql]]></category><guid
isPermaLink="false">http://www.designdisclosure.com/?p=103</guid> <description><![CDATA[I've been very busy with a number of project launches lately. While working on a little problem today I re-discovered a little gem for use with Propel to update multiple rows in a single statement, rather than iterating through a collection updating and saving each object in turn.This task is simple in SQL but ...]]></description> <content:encoded><![CDATA[<p>I&#8217;ve been very busy with a number of project launches lately. While working on a little problem today I re-discovered a little gem for use with Propel to update multiple rows in a single statement, rather than iterating through a collection updating and saving each object in turn.</p><p>This task is simple in SQL but after a while using any abstraction layer you may find like me you forget about the simple solutions as you spend you day working with complex objects and trying to hydrate custom objects. Blah blah blah&#8230;</p><p>The complex solution to a simple problem:</p><pre class="textmate-source"><span class="source source_php"><span class="source source_php source_php_embedded source_php_embedded_block source_php_embedded_block_html"><span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Obtain the connection configured
</span><span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>conn</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php">=</span> <span class="support support_class support_class_php">Propel</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="meta meta_function-call meta_function-call_static meta_function-call_static_php">getConnection</span>(<span class="support support_class support_class_php">YourObjectPeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="constant constant_other constant_other_class constant_other_class_php">DATABASE_NAME</span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Create a Criteria object that will select the correct rows from the database
</span><span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>selectCriteria</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php">=</span> <span class="keyword keyword_other keyword_other_new keyword_other_new_php">new</span> <span class="support support_class support_class_php">Criteria</span>()<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>selectCriteria</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">-&gt;</span><span class="meta meta_function-call meta_function-call_object meta_function-call_object_php">add</span>(<span class="support support_class support_class_php">YourObjectPeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="constant constant_other constant_other_class constant_other_class_php">COLUMB_TO_SELECT</span>, <span class="string string_quoted string_quoted_single string_quoted_single_php"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php">'</span><span class="meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php">value_to_match</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php">'</span></span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Create a Criteria object includes the value you want to set
</span><span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>updateCriteria</span> <span class="keyword keyword_operator keyword_operator_assignment keyword_operator_assignment_php">=</span> <span class="keyword keyword_other keyword_other_new keyword_other_new_php">new</span> <span class="support support_class support_class_php">Criteria</span>()<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>updateCriteria</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">-&gt;</span><span class="meta meta_function-call meta_function-call_object meta_function-call_object_php">add</span>(<span class="support support_class support_class_php">YourObjectPeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="constant constant_other constant_other_class constant_other_class_php">COLUMB_TO_CHANGE</span>, <span class="string string_quoted string_quoted_single string_quoted_single_php"><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_begin punctuation_definition_string_begin_php">'</span><span class="meta meta_string-contents meta_string-contents_quoted meta_string-contents_quoted_single meta_string-contents_quoted_single_php">value_to_be_set</span><span class="punctuation punctuation_definition punctuation_definition_string punctuation_definition_string_end punctuation_definition_string_end_php">'</span></span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span>
<span class="comment comment_line comment_line_double-slash comment_line_double-slash_php"><span class="punctuation punctuation_definition punctuation_definition_comment punctuation_definition_comment_php">//</span> Execute the query
</span><span class="support support_class support_class_php">BasePeer</span><span class="keyword keyword_operator keyword_operator_class keyword_operator_class_php">::</span><span class="meta meta_function-call meta_function-call_static meta_function-call_static_php">doUpdate</span>(<span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>selectCriteria</span>, <span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>updateCriteria</span>, <span class="variable variable_other variable_other_php"><span class="punctuation punctuation_definition punctuation_definition_variable punctuation_definition_variable_php">$</span>conn</span>)<span class="punctuation punctuation_terminator punctuation_terminator_expression punctuation_terminator_expression_php">;</span></span></span></pre><p>Thats it! I hope it helps&#8230;</p><div
class="shr-publisher-103"></div><h3  class="related_post_title">Related Articles</h3><ul
class="related_post"><li>November 30, 2009 -- <a
href="http://www.designdisclosure.com/2009/11/symfony-apc-cache-and-memcache-session-storage/" title="symfony APC cache and Memcache session storage">symfony APC cache and Memcache session storage</a></li><li>November 25, 2009 -- <a
href="http://www.designdisclosure.com/2009/11/symfony-doctrine-database-session-storage/" title="symfony Doctrine database session storage">symfony Doctrine database session storage</a></li></ul><p
class="wp-flattr-button"></p>]]></content:encoded> <wfw:commentRss>http://www.designdisclosure.com/2009/10/propel-doupdate-update-multiple-records-in-a-single-statement/feed/</wfw:commentRss> <slash:comments>0</slash:comments> </item> <item><title>How to: Magento eCommerce help and tutorials</title><link>http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/</link> <comments>http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/#comments</comments> <pubDate>Wed, 29 Jul 2009 22:34:09 +0000</pubDate> <dc:creator>Alistair Stead</dc:creator> <category><![CDATA[Magento]]></category> <category><![CDATA[php]]></category> <category><![CDATA[tutorials]]></category><guid
isPermaLink="false">http://www.designdisclosure.com/?p=91</guid> <description><![CDATA[Magento is an Open Source eCommerce platform developed using the Zend Framework by Varien. It is a fabulously customizable and extendible platform that once mastered can allow you to develop feature rich eCommerce solutions for your clients quickly and effectively. However for some mastering the Magento platform may not be that easy.Magento uses common ...]]></description> <content:encoded><![CDATA[<p><img
class="alignnone size-full wp-image-99" title="Magento how to" src="http://designdisclosure.s3.amazonaws.com/wp-content/uploads/2009/07/Magento-How-TO1.jpg" alt="Magento how to" width="570" height="300" /></p><p><a
title="Magento - Home  - eCommerce Software for Growth" href="http://www.magentocommerce.com/">Magento</a> is an Open Source eCommerce platform developed using the Zend Framework by <a
title="Home :: Varien :: Open Source eCommerce Development and Consulting Firm" href="http://www.varien.com/">Varien</a>. It is a fabulously customizable and extendible platform that once mastered can allow you to develop feature rich eCommerce solutions for your clients quickly and effectively. However for some mastering the Magento platform may not be that easy.</p><p>Magento uses common design patterns such as <a
title="P of EAA: Model View Controller" href="http://www.martinfowler.com/eaaCatalog/modelViewController.html">MVC</a>, <a
title="P of EAA: Application Controller" href="http://www.martinfowler.com/eaaCatalog/applicationController.html">Application Controller</a> and <a
title="P of EAA: Two Step View" href="http://www.martinfowler.com/eaaCatalog/twoStepView.html">Two Step View</a> to structure the application and provide mechanisms to extend and override the functionality and presentation. The platform has a huge number of files and directories that can cause confusion for newcomers to the platform. However this extended folder structure clearly defines where the platforms core files exist and where you can place your custom code and modules. Allowing you to extend the platform without modifying the core and breaking the upgrade process.</p><p>However daunting the platform appears or skeptical you may be due to the unfamiliar concepts, invest a small amount of time with the platform and it will soon start to payoff. This list of tutorials and resources will help you get up to speed quickly.<span
id="more-91"></span></p><h2>Magento eCommerce Tutorials and Resources</h2><p>I have compiled the following list of resources that have helped me while developing for the Magento platform.</p><h3>Developing Themes</h3><ul><li><a
title="Learning to Design and Code for Magento Themes «  Mike Smullin" href="http://www.mikesmullin.com/development/learning-to-design-and-code-for-magento-themes/">Learning to Design and Code for Magento Themes</a></li><li><a
title="Magento - Designer's Guide to Magento  - eCommerce Software for Growth" href="http://www.magentocommerce.com/design_guide/articles/how-magento-builds-content">Designer&#8217;s Guide to Magento</a></li><li><a
title="Web Design Tips: Configuring Templates, Adding a Product Grid in Magento  | Practical eCommerce" href="http://www.practicalecommerce.com/articles/1037-Web-Design-Tips-Configuring-Templates-Adding-a-Product-Grid-in-Magento-">Configuring Templates, Adding a Product Grid in Magento</a></li><li><a
title="Cult-foo     » Magento Template Advices" href="http://www.cult-f.net/2008/11/17/magento-template-advices/">Magento Template Advices</a></li></ul><h3>Custom Code and Modules</h3><ul><li><a
title="Writing a custom module in Magento, detailed walktrough | ActiveCodeline" href="http://activecodeline.com/writing-a-custom-module-in-magento-detailed-walktrough/">Writing a custom module in Magento, detailed walktrough</a></li><li><a
title="How To Write Magento Custom Module: Cash On Delivery Payment Method | Elias Interactive" href="http://eliasinteractive.com/blog/magento-create-new-payment-method-cash-on-delivery/">How To Write Magento Custom Module: Cash On Delivery Payment Method</a></li><li><a
title="Magento Design and Magento Development blog" href="http://www.exploremagento.com/">Magento Design and Magento Development blog</a></li><li><a
title="snippi | MAGENTO CODE SNIPPETS" href="http://snippi.net/">snippi | MAGENTO CODE SNIPPETS</a></li><li><a
title="Magento - Wiki - Create Payment Method Module" href="http://www.magentocommerce.com/wiki/how-to/create-payment-method-module">Create Payment Method Module</a></li><li><a
title="Tips for Twits  » Blog Archive   » Howto: Repackageable custom extension development in Magento" href="http://t.wits.sg/2009/03/31/howto-repackageable-custom-extension-development-in-magento/">HOWTO: Repackageable custom extension development in magento</a></li></ul><h3>API Documentation</h3><ul><li><a
title="Magento Documentation (phpdoc)" href="http://docs.magentocommerce.com/">Magento Documentation (phpdoc)</a></li></ul><h3>Tips and Advice</h3><ul><li><a
title="MageTips - Published by Simon Young" href="http://magetips.com/">MageTips</a></li><li><a
title="Magento Beginners • Hints for Start | Inchoo" href="http://inchoo.net/ecommerce/top-3-mistakes-by-magento-beginners/">Top 3 mistakes by Magento beginners</a></li></ul><div
class="shr-publisher-91"></div><h3  class="related_post_title">Related Articles</h3><ul
class="related_post"><li>March 26, 2011 -- <a
href="http://www.designdisclosure.com/2011/03/package-and-install-your-latest-magento-1-5-extension/" title="Package and Install your latest Magento 1.5+ extension">Package and Install your latest Magento 1.5+ extension</a></li><li>March 15, 2011 -- <a
href="http://www.designdisclosure.com/2011/03/testing-magento-checkout/" title="Testing Magento Checkout">Testing Magento Checkout</a></li><li>February 9, 2011 -- <a
href="http://www.designdisclosure.com/2011/02/magetool-update-v0-3-0/" title="MageTool Update v0.3.0">MageTool Update v0.3.0</a></li><li>October 10, 2010 -- <a
href="http://www.designdisclosure.com/2010/10/magento-command-line-tools-magetool/" title="Magento command line tools MageTool">Magento command line tools MageTool</a></li></ul><p
class="wp-flattr-button"></p><p><a
href="http://www.designdisclosure.com/?flattrss_redirect&amp;id=91&amp;md5=79a1bba1e69175eea63cc18407513d3f" title="Flattr" target="_blank"><img
src="http://www.designdisclosure.com/wp-content/plugins/flattr/img/flattr-badge-large.png" alt="flattr this!"/></a></p>]]></content:encoded> <wfw:commentRss>http://www.designdisclosure.com/2009/07/how-to-magento-ecommerce-tutorials/feed/</wfw:commentRss> <slash:comments>5</slash:comments> </item> </channel> </rss>
<!-- Performance optimized by W3 Total Cache. Learn more: http://www.w3-edge.com/wordpress-plugins/

Minified using memcached
Page Caching using memcached
Database Caching 8/27 queries in 0.017 seconds using memcached
Object Caching 1178/1180 objects using apc
Content Delivery Network via Amazon Web Services: S3: designdisclosure.s3.amazonaws.com

Served from: www.designdisclosure.com @ 2012-02-06 05:03:41 -->
