<?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>Sand2Silicon &#187; PEAR</title>
	<atom:link href="http://guardiansrealm.net/sand2silicon/tag/pear/feed/" rel="self" type="application/rss+xml" />
	<link>http://guardiansrealm.net/sand2silicon</link>
	<description>Hacking the world, one line at a time!</description>
	<lastBuildDate>Wed, 02 Mar 2011 18:02:13 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1</generator>
		<item>
		<title>Magento Components and PEAR</title>
		<link>http://guardiansrealm.net/sand2silicon/2009/06/magento-components-and-pear/</link>
		<comments>http://guardiansrealm.net/sand2silicon/2009/06/magento-components-and-pear/#comments</comments>
		<pubDate>Mon, 29 Jun 2009 08:03:20 +0000</pubDate>
		<dc:creator>RavenSlay3r</dc:creator>
				<category><![CDATA[Magento]]></category>
		<category><![CDATA[extensions]]></category>
		<category><![CDATA[PEAR]]></category>

		<guid isPermaLink="false">http://guardiansrealm.net/sand2silicon/?p=130</guid>
		<description><![CDATA[Magento is a newish shopping cart platform with a built in package-manager built on PEAR for auto-install extension components. This article takes you through the steps.]]></description>
			<content:encoded><![CDATA[<h2>Magento</h2>
<p><a href="http://www.magentocommerce.com/" target="_blank">Magento</a> is a newish shopping cart platform that is pretty slick, engineered, and rather complex to pickup.You can auto-install extension components for your Magento store from <a href="http://www.magentocommerce.com/magento-connect" target="_blank">MagentoConnect</a> which it turns out is built on top of the <a href="http://pear.php.net/" target="_blank">PEAR</a> package-managing system. From the website you can browse for an extension, get an &#8220;activation key&#8221;, and use your store&#8217;s admin-gui to install a module.</p>
<hr /><em>Danger, Will Robinson, Danger:</em></p>
<ul>
<li>Make sure you&#8217;ve got a full backup or proper version-control of your stores source-code and mods.</li>
<li>Make SURE you BACKUP YOUR DATABASE &#8230;</li>
</ul>
<p>(I recently did a &#8220;live upgrade&#8221; of the &#8216;core&#8217; platform, on a test-site and it corrupted my DB &#8230; )</p>
<hr />
<h2>PHP</h2>
<p>You will need the <em>&#8220;php&#8221;</em> command in your <em>$PATH</em>.</p>
<ul>
<li> On a linux system you can usually discover it by calling:<code>$ whereis php</code></li>
<li>On OpenSolaris-2009.06 I found the webstack PHP in: <em>/usr/php/5.2/bin/php</em></li>
</ul>
<p>In either case we want to make this generically-accessible to our users, by adding a simple symbolic link from <em>/usr/bin</em> which IS in your $PATH to the actual php binary. If you can find the PEAR and want to add a similar link, do so as shown, but this is optional.:<br />
<code> $ cd /usr/bin<br />
$ ln -s /usr/php/5.2/bin/php php<br />
$ ln -s /usr/php/5.2/bin/pear pear</code></p>
<h2>PEAR</h2>
<p>Magento has a very broad file-structure, and modules put files in several locations. As a developer I wanted to <em>look</em>at an existing extension similar to one I&#8217;m developing, without hunting for bits and pieces or blowing up my dev-environment on a failed install. While the MagentoConnect webpage fails to offer us a simple &#8220;Download&#8221; button, hope is not lost, as we can simply use PEAR from the command line.</p>
<p>If your machine has PHP installed (required in your $PATH for this exercise) it probably also has  PEAR, however we will want to use the PEAR installation provided WITH Magento.</p>
<p><code><br />
// Setup Magento PEAR<br />
$ cd ~/public_html/magento/<br />
$ ./pear mage-setup<br />
$ ./pear -V<br />
$ ./pear list-channels</code></p>
<p>// Download a Package<br />
$ ./pear download connect.magentocommerce.com/community/ModuleFooBar</p>
<p>// Install a Package<br />
$ ./pear install connect.magentocommerce.com/community/ModuleFooBar</p>
<h3>Download a Package</h3>
<p>The PEAR &#8220;download&#8221; command does what it says and simply downloads a *.tar to your current directory. This is exactly what I required, now I have the files to move where I wish and examine at my leisure, if I had leisure&#8230;</p>
<h3>Install a Package</h3>
<p>The PEAR &#8220;install&#8221; command also does what it says, and goes stright to work attempting to install the package. This is (appears to be) essentially the same as grabbing the key-code from the web, and installing from your Magento AdminPanel GUI.</p>
<p>Note: You do not need to &#8220;download&#8221; a package before installing it as the PEAR &#8220;install&#8221; command is smart enough to do all the work for you.</p>
<h3>ModuleFooBar</h3>
<p>When you find a component ont he MagentoConnect site and click &#8220;Get Extension Key&#8221;, it gives you a string like <em>&#8220;magento-community/ModuleFooBarr&#8221;</em> to supply to the AdminPanel GUI. If your using PEAR, you still need to click this link and the final part &#8220;ModuleFooBar&#8221; is your package name. The first part of the path-name, you must discard in favor of PEAR channel-syntax.</p>
<p>Good Luck</p>
]]></content:encoded>
			<wfw:commentRss>http://guardiansrealm.net/sand2silicon/2009/06/magento-components-and-pear/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

