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

<channel>
	<title>PHP Tips and Tricks</title>
	<atom:link href="http://devblog.asd.am/feed/" rel="self" type="application/rss+xml" />
	<link>http://devblog.asd.am</link>
	<description>Sharing experience, solving problems</description>
	<pubDate>Wed, 28 Jul 2010 18:15:36 +0000</pubDate>
	<generator>http://wordpress.org/?v=2.7.1</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zend_Form with Zend_Validate with Zend_File_Transfer</title>
		<link>http://devblog.asd.am/development/zend_form-with-zend_validate-with-zend_file_transfer/</link>
		<comments>http://devblog.asd.am/development/zend_form-with-zend_validate-with-zend_file_transfer/#comments</comments>
		<pubDate>Wed, 28 Jul 2010 18:15:36 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Development]]></category>

		<category><![CDATA[Zend Framework]]></category>

		<guid isPermaLink="false">http://devblog.asd.am/?p=58</guid>
		<description><![CDATA[How to build form using ini files.
Example includes Zend_Form elements, Zend_Validate and File uploads using Zend_File_Transfer.
Protected method to retrieve form config and fill data into selectbox.
protected function prepareProductForm()
{
$form = new Application_Form( &#8216;admin/product&#8217; );
$categories = array( &#8216;Select Category&#8217; );
foreach( Application_Category::getCategories() as $category )
{
$categories[$category-&#62;categoryId] = $category-&#62;name;
}
$form-&#62;getElement( &#8216;categoryId&#8217; )-&#62;setMultiOptions( $categories );
return $form;
}
This method will render form from and [...]]]></description>
			<content:encoded><![CDATA[<p>How to build form using ini files.<br />
Example includes Zend_Form elements, Zend_Validate and File uploads using Zend_File_Transfer.</p>
<p>Protected method to retrieve form config and fill data into selectbox.</p>
<blockquote><p>protected function prepareProductForm()<br />
{<br />
$form = new Application_Form( &#8216;admin/product&#8217; );</p>
<p>$categories = array( &#8216;Select Category&#8217; );<br />
foreach( Application_Category::getCategories() as $category )<br />
{<br />
$categories[$category-&gt;categoryId] = $category-&gt;name;<br />
}</p>
<p>$form-&gt;getElement( &#8216;categoryId&#8217; )-&gt;setMultiOptions( $categories );</p>
<p>return $form;<br />
}</p></blockquote>
<p>This method will render form from and handle submits. Will check for uploaded files.</p>
<blockquote><p>public function productAction()<br />
{<br />
$form = $this-&gt;prepareProductForm();<br />
$product = array();</p>
<p>if ( $this-&gt;getRequest()-&gt;isPost() )<br />
{<br />
$product = new Application_Product(<br />
array(<br />
&#8216;productId&#8217; =&gt; $this-&gt;getRequest()-&gt;getParam( &#8216;productId&#8217; ),<br />
&#8216;name&#8217; =&gt; $this-&gt;getRequest()-&gt;getParam( &#8216;name&#8217; ),<br />
&#8216;description&#8217; =&gt; $this-&gt;getRequest()-&gt;getParam( &#8216;description&#8217; ),<br />
&#8216;categoryId&#8217; =&gt; $this-&gt;getRequest()-&gt;getParam( &#8216;categoryId&#8217; ),<br />
&#8216;resellerPrice&#8217; =&gt; $this-&gt;getRequest()-&gt;getParam( &#8216;resellerPrice&#8217; )<br />
)<br />
);</p>
<p>if ( !$form-&gt;isValid( $this-&gt;getRequest()-&gt;getPost() ) )<br />
{<br />
$this-&gt;view-&gt;errorMessages = array( &#8220;Validation Error&#8221; );<br />
}</p>
<p>/*<br />
* Receiving files<br />
*/<br />
if ( !$form-&gt;photos-&gt;receive() || !$form-&gt;photom-&gt;receive() || !$form-&gt;photol-&gt;receive() )<br />
{<br />
$this-&gt;view-&gt;errorMessages = array( &#8220;Upload error&#8221; );<br />
}</p>
<p>if ( count( $this-&gt;view-&gt;errorMessages ) &lt;= 0 )<br />
{<br />
try {<br />
$product-&gt;save();<br />
$this-&gt;view-&gt;message = &#8220;User successfully updated&#8221;;<br />
}<br />
catch ( Application_Service_Exception $ex )<br />
{<br />
$this-&gt;view-&gt;errorMessages = array( $ex-&gt;getMessage() );<br />
}<br />
}</p>
<p>$product = $product-&gt;toArray();<br />
}<br />
elseif ( $this-&gt;getRequest()-&gt;getParam( &#8216;id&#8217; ) )<br />
{<br />
$product = Application_Service::getInstance()-&gt;getProduct( $this-&gt;getRequest()-&gt;getParam( &#8216;id&#8217; ) );<br />
}</p>
<p>$form-&gt;populate( $product );<br />
$this-&gt;view-&gt;form = $form;<br />
}</p></blockquote>
<p>Ini file defining form containing elements.</p>
<blockquote><p># Product</p>
<p>admin.product.method = post<br />
admin.product.options.description = &#8216;Create Product&#8217;</p>
<p>admin.product.elements.productId.type = hidden</p>
<p>admin.product.elements.name.type = text<br />
admin.product.elements.name.options.label = &#8220;Product Name&#8221;<br />
admin.product.elements.name.options.required = true</p>
<p>admin.product.elements.photos.type = file<br />
admin.product.elements.photos.options.label = &#8220;Photo S&#8221;<br />
admin.product.elements.photos.options.description = &#8220;( 100&#215;110 ) Shown on Front page. Only jpg,png,gif formats supported&#8221;<br />
admin.product.elements.photos.options.destination = APPLICATION_PATH &#8220;/../public/images/product&#8221;<br />
admin.product.elements.photos.options.validators.extension.validator = Extension<br />
admin.product.elements.photos.options.validators.extension.options.extension = &#8220;jpg,png,gif&#8221;<br />
admin.product.elements.photos.options.validators.imagesize.validator = ImageSize<br />
admin.product.elements.photos.options.validators.imagesize.width = 100<br />
admin.product.elements.photos.options.validators.imagesize.height = 110</p>
<p>admin.product.elements.photom.type = file<br />
admin.product.elements.photom.options.label = &#8220;Photo M&#8221;<br />
admin.product.elements.photom.options.description = &#8220;( 180&#215;250 ) Shown on Auction Info Page. Only jpg,png,gif formats supported&#8221;<br />
admin.product.elements.photom.options.destination = APPLICATION_PATH &#8220;/../public/images/product&#8221;<br />
admin.product.elements.photom.options.validators.extension.validator = Extension<br />
admin.product.elements.photom.options.validators.extension.options.extension = &#8220;jpg,png,gif&#8221;<br />
#admin.product.elements.photom.options.validators.imagesize.validator = ImageSize<br />
#admin.product.elements.photom.options.validators.imagesize.options.width = 180<br />
#admin.product.elements.photom.options.validators.imagesize.options.height = 250</p>
<p>admin.product.elements.photol.type = file<br />
admin.product.elements.photol.options.label = &#8220;Photo L&#8221;<br />
admin.product.elements.photol.options.description = &#8220;( 250&#215;450 ) Shown on &#8230; Only jpg,png,gif formats supported&#8221;<br />
admin.product.elements.photol.options.destination = APPLICATION_PATH &#8220;/../public/images/product&#8221;<br />
admin.product.elements.photol.options.validators.extension.validator = Extension<br />
admin.product.elements.photol.options.validators.extension.options.extension = &#8220;jpg,png,gif&#8221;<br />
admin.product.elements.photol.options.validators.imagesize.validator = ImageSize<br />
admin.product.elements.photol.options.validators.imagesize.width = 250<br />
admin.product.elements.photol.options.validators.imagesize.height = 450</p>
<p>admin.product.elements.description.type = textarea<br />
admin.product.elements.description.options.label = &#8220;Description&#8221;<br />
admin.product.elements.description.options.cols = 50<br />
admin.product.elements.description.options.rows = 8</p>
<p>admin.product.elements.resellerPrice.type = text<br />
admin.product.elements.resellerPrice.options.label = &#8220;Reseller Price&#8221;<br />
admin.product.elements.resellerPrice.options.required = true</p>
<p>admin.product.elements.categoryId.type = select<br />
admin.product.elements.categoryId.options.label = &#8220;Category&#8221;<br />
admin.product.elements.categoryId.options.required = true</p>
<p>admin.product.elements.submit.type = submit<br />
admin.product.elements.submit.options.label = &#8220;Save&#8221;</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/development/zend_form-with-zend_validate-with-zend_file_transfer/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Magento 1.4 upgrade - Missing Yesnocustom.php</title>
		<link>http://devblog.asd.am/development/magento-14-upgrade-missing-yesnocustomphp/</link>
		<comments>http://devblog.asd.am/development/magento-14-upgrade-missing-yesnocustomphp/#comments</comments>
		<pubDate>Fri, 21 May 2010 13:39:54 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Applications]]></category>

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

		<category><![CDATA[Magento Commerce]]></category>

		<category><![CDATA[Upgrade Issue]]></category>

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

		<guid isPermaLink="false">http://devblog.asd.am/?p=56</guid>
		<description><![CDATA[After upgrade from 1.3.2.4 to 1.4.0.1 using MagentoConnect we got exception in Admin/System page.
After checks we have figured out that the file was missing in upgrade package for Magento Core Modules.
File was used by system.xml located in Mage/Core/etc/.
In order to fix this you have to download Magento package 1.4.0.1 from website and add missing file [...]]]></description>
			<content:encoded><![CDATA[<p>After upgrade from 1.3.2.4 to 1.4.0.1 using MagentoConnect we got exception in Admin/System page.</p>
<p>After checks we have figured out that the file was missing in upgrade package for Magento Core Modules.</p>
<p>File was used by system.xml located in Mage/Core/etc/.</p>
<p>In order to fix this you have to download Magento package 1.4.0.1 from website and add missing file to your sources</p>
<blockquote><p>app/code/core/Mage/Adminhtml/Model/System/Config/Source/Yesnocustom.php</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/development/magento-14-upgrade-missing-yesnocustomphp/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Magento :: Invalid mode for clean() method</title>
		<link>http://devblog.asd.am/development/magento-invalid-mode-for-clean-method/</link>
		<comments>http://devblog.asd.am/development/magento-invalid-mode-for-clean-method/#comments</comments>
		<pubDate>Thu, 20 May 2010 12:08:49 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Applications]]></category>

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

		<category><![CDATA[Magento Commerce]]></category>

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

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

		<guid isPermaLink="false">http://devblog.asd.am/?p=53</guid>
		<description><![CDATA[After upgrade Magento to 1.4.0.1 I&#8217;ve got such an error.
The problem is that Varien did not managed to add removal deprecated code/files which overrides Zend&#8217;s code.
In order to fix this problem you have to remove folder:
app/code/core/Zend/Cache
]]></description>
			<content:encoded><![CDATA[<p>After upgrade Magento to 1.4.0.1 I&#8217;ve got such an error.</p>
<p>The problem is that Varien did not managed to add removal deprecated code/files which overrides Zend&#8217;s code.</p>
<p>In order to fix this problem you have to remove folder:</p>
<blockquote><p>app/code/core/Zend/Cache</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/development/magento-invalid-mode-for-clean-method/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Upgrading subversion client to 1.6.x for Ubuntu 8.04 hardy</title>
		<link>http://devblog.asd.am/development/upgrading-subversion-client-to-16x-for-ubuntu-804-hardy/</link>
		<comments>http://devblog.asd.am/development/upgrading-subversion-client-to-16x-for-ubuntu-804-hardy/#comments</comments>
		<pubDate>Thu, 06 May 2010 09:21:45 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Development]]></category>

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

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

		<guid isPermaLink="false">http://devblog.asd.am/?p=51</guid>
		<description><![CDATA[Tortoise SVN and other IDE integrated subversion clients was changing format of .svn/* files so that was not possible to use command line subversion client which is more secure.
Finally got upgraded subversion client for Ubuntu Hardy (8.04).
1. Copy source list from: https://launchpad.net/~anders-kaseorg/+archive/subversion-1.6
2. Add lists to /etc/apt/sources.list at bottom of file - Save file
3. apt-get install subversion
(Here [...]]]></description>
			<content:encoded><![CDATA[<p>Tortoise SVN and other IDE integrated subversion clients was changing format of .svn/* files so that was not possible to use command line subversion client which is more secure.</p>
<p>Finally got upgraded subversion client for Ubuntu Hardy (8.04).</p>
<blockquote><p>1. Copy source list from: <a href="https://launchpad.net/~anders-kaseorg/+archive/subversion-1.6">https://launchpad.net/~anders-kaseorg/+archive/subversion-1.6</a></p>
<p>2. Add lists to /etc/apt/sources.list at bottom of file - Save file</p>
<p>3. apt-get install subversion</p>
<p>(Here I had asked to confirm not authenticated installation)</p>
<p>4. svn status</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/development/upgrading-subversion-client-to-16x-for-ubuntu-804-hardy/feed/</wfw:commentRss>
		</item>
		<item>
		<title>MyDNS Starts Before Mysql</title>
		<link>http://devblog.asd.am/uncategorized/mydns-starts-before-mysql/</link>
		<comments>http://devblog.asd.am/uncategorized/mydns-starts-before-mysql/#comments</comments>
		<pubDate>Wed, 21 Apr 2010 13:14:06 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

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

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

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

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

		<guid isPermaLink="false">http://devblog.asd.am/uncategorized/mydns-starts-before-mysql/</guid>
		<description><![CDATA[In order to force mydns start after mysql execute following:
cd /etc/rc.d/rc3.d
mv S52mydns S99mydns
cd /etc/rc.d/rc4.d
mv S52mydns S99mydns
cd /etc/rc.d/rc5.d
mv S52mydns S99mydns
See: http://www.howtoforge.com/installing-mydns-mydnsconfig-centos-5.1-p2
Also: http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-boot-init-shutdown-sysv.html
]]></description>
			<content:encoded><![CDATA[<p>In order to force mydns start after mysql execute following:</p>
<p>cd /etc/rc.d/rc3.d<br />
mv S52mydns S99mydns<br />
cd /etc/rc.d/rc4.d<br />
mv S52mydns S99mydns<br />
cd /etc/rc.d/rc5.d<br />
mv S52mydns S99mydns</p>
<p>See: http://www.howtoforge.com/installing-mydns-mydnsconfig-centos-5.1-p2<br />
Also: http://www.centos.org/docs/5/html/Installation_Guide-en-US/s1-boot-init-shutdown-sysv.html</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/uncategorized/mydns-starts-before-mysql/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drupal node access</title>
		<link>http://devblog.asd.am/uncategorized/drupal-node-access/</link>
		<comments>http://devblog.asd.am/uncategorized/drupal-node-access/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 06:27:27 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://devblog.asd.am/uncategorized/drupal-node-access/</guid>
		<description><![CDATA[How to restrict editing of verified content?
node_access is not called. It&#8217;s required to define node types from modules in order to have node_access hook be called.
]]></description>
			<content:encoded><![CDATA[<p>How to restrict editing of verified content?<br />
node_access is not called. It&#8217;s required to define node types from modules in order to have node_access hook be called.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/uncategorized/drupal-node-access/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Drupal Views - Right Join issue</title>
		<link>http://devblog.asd.am/uncategorized/drupal-views-right-join-issue/</link>
		<comments>http://devblog.asd.am/uncategorized/drupal-views-right-join-issue/#comments</comments>
		<pubDate>Mon, 08 Mar 2010 06:22:57 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

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

		<guid isPermaLink="false">http://devblog.asd.am/uncategorized/drupal-views-right-join-issue/</guid>
		<description><![CDATA[Currently we are experiencing problem with drupal views.
We need to right join two entities.
]]></description>
			<content:encoded><![CDATA[<p>Currently we are experiencing problem with drupal views.<br />
We need to right join two entities.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/uncategorized/drupal-views-right-join-issue/feed/</wfw:commentRss>
		</item>
		<item>
		<title>ExtJs - Form field description and tips</title>
		<link>http://devblog.asd.am/uncategorized/extjs-form-field-description-and-tips/</link>
		<comments>http://devblog.asd.am/uncategorized/extjs-form-field-description-and-tips/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 09:23:38 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://devblog.asd.am/?p=39</guid>
		<description><![CDATA[The problem is that ExtJs is not presume field description at all.
There are Label component which can be used as field description.
Label component can be linked to particular so that formfield will be focused when label (description) clicked.

]]></description>
			<content:encoded><![CDATA[<p>The problem is that ExtJs is not presume field description at all.</p>
<p>There are Label component which can be used as field description.</p>
<p>Label component can be linked to particular so that formfield will be focused when label (description) clicked.</p>
<p><img class="alignnone size-full wp-image-41" title="extjs-form-field-description" src="http://devblog.asd.am/wp-content/uploads/2010/03/extjs-form-field-description.jpg" alt="extjs-form-field-description" width="609" height="142" /></p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/uncategorized/extjs-form-field-description-and-tips/feed/</wfw:commentRss>
		</item>
		<item>
		<title>How to use svnignore!</title>
		<link>http://devblog.asd.am/development/how-to-use-svnignore/</link>
		<comments>http://devblog.asd.am/development/how-to-use-svnignore/#comments</comments>
		<pubDate>Thu, 04 Mar 2010 09:04:52 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Development]]></category>

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

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

		<guid isPermaLink="false">http://devblog.asd.am/?p=35</guid>
		<description><![CDATA[1. Settings  svn:ignore property
svn propset  svn:ignore &#8220;*&#8221; folder1/
svn propset svn:ignore &#8220;*&#8221; folder2
2.  Commit to apply changes.
svn ci -m &#8220;Data in these folders will be ignored by svn&#8221;
Source: http://www.devcha.com/2008/02/how-to-make-svn-ignore-some-folders.html
]]></description>
			<content:encoded><![CDATA[<p>1. Settings  svn:ignore property</p>
<blockquote><p>svn propset  svn:ignore &#8220;*&#8221; folder1/<br />
svn propset svn:ignore &#8220;*&#8221; folder2</p></blockquote>
<p>2.  Commit to apply changes.</p>
<blockquote><p>svn ci -m &#8220;Data in these folders will be ignored by svn&#8221;</p></blockquote>
<p>Source: http://www.devcha.com/2008/02/how-to-make-svn-ignore-some-folders.html</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/development/how-to-use-svnignore/feed/</wfw:commentRss>
		</item>
		<item>
		<title>Magento and ExtJs</title>
		<link>http://devblog.asd.am/development/magento-and-extjs/</link>
		<comments>http://devblog.asd.am/development/magento-and-extjs/#comments</comments>
		<pubDate>Thu, 21 Jan 2010 08:00:35 +0000</pubDate>
		<dc:creator>Aram</dc:creator>
		
		<category><![CDATA[Applications]]></category>

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

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

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

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

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

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

		<guid isPermaLink="false">http://devblog.asd.am/?p=33</guid>
		<description><![CDATA[We are going to use in our huge auction project Magento Commerce Community edition.
http://www.magentocommerce.com/
Also decided to use ExtJs as user interface rendering engine.
http://www.extjs.com/
To work on server side objects without touching javascript code we decided to use PHP-Ext adapter.
http://php-ext.quimera-solutions.com/
Soon will drop about details. May be will publish Magento module as well.
]]></description>
			<content:encoded><![CDATA[<p>We are going to use in our huge auction project Magento Commerce Community edition.</p>
<p><a href="http://www.magentocommerce.com/">http://www.magentocommerce.com/</a></p>
<p>Also decided to use ExtJs as user interface rendering engine.</p>
<p><a href="http://www.extjs.com/">http://www.extjs.com/</a></p>
<p>To work on server side objects without touching javascript code we decided to use PHP-Ext adapter.</p>
<p><a href="http://php-ext.quimera-solutions.com/">http://php-ext.quimera-solutions.com/</a></p>
<p>Soon will drop about details. May be will publish Magento module as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://devblog.asd.am/development/magento-and-extjs/feed/</wfw:commentRss>
		</item>
	</channel>
</rss>
