<?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>Mukesh Chapagain&#039;s Blog &#187; PEAR</title>
	<atom:link href="http://blog.chapagain.com.np/tag/pear/feed/" rel="self" type="application/rss+xml" />
	<link>http://blog.chapagain.com.np</link>
	<description>PHP Magento jQuery SQL Wordpress Joomla Programming &#38; Tutorial</description>
	<lastBuildDate>Tue, 07 Feb 2012 00:54:41 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.1.3</generator>
		<item>
		<title>File Upload in PEAR and Smarty</title>
		<link>http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/</link>
		<comments>http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/#comments</comments>
		<pubDate>Mon, 21 Jul 2008 10:07:18 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PEAR]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[file upload]]></category>
		<category><![CDATA[http]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=73</guid>
		<description><![CDATA[For uploading files, you need to install a package of PEAR called ‘HTTP_Upload’ along with the installation of PEAR and Smarty. HTTP_Upload is used for easy and secure managment of files submitted via HTML forms. This package provides an advanced system for managing uploads of files via HTML fields. Features include: 1) Handling of multiple [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/using-database-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Using database in PEAR and Smarty'>Using database in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/pagination-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Pagination in PEAR and Smarty'>Pagination in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/file-upload-in-php-simplified/' rel='bookmark' title='Permanent Link: File Upload in PHP :: Simplified'>File Upload in PHP :: Simplified</a></li>
<li><a href='http://blog.chapagain.com.np/multiple-file-upload-with-jquery-and-php/' rel='bookmark' title='Permanent Link: Multiple file upload with jQuery and php'>Multiple file upload with jQuery and php</a></li>
<li><a href='http://blog.chapagain.com.np/installing-the-smarty-template-engine/' rel='bookmark' title='Permanent Link: Installing the Smarty Template Engine'>Installing the Smarty Template Engine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For uploading files, you need to install a package of PEAR called ‘HTTP_Upload’ along with the installation of PEAR and <a title="Installing Smarty" href="http://blog.chapagain.com.np/index.php/2008/07/11/installing-the-smarty-template-engine/" target="_blank">Smarty</a>.</p>
<p class="MsoNormal" style="text-align: justify;">
<p><span id="more-73"></span></p>
<p class="MsoNormal" style="text-align: justify;">HTTP_Upload is used for easy and secure managment of files submitted via <acronym>HTML</acronym> forms. This package provides an advanced system for managing uploads of files via HTML<br />
<input type="file" /> fields. Features include:</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span>1)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: "> </span></span><!--[endif]-->Handling of multiple file uploads at a time</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span>2)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: "> </span></span><!--[endif]-->Safe file copying/moving from temporary directories</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span>3)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: "> </span></span><!--[endif]-->Upload validaton mechanisms</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span>4)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: "> </span></span><!--[endif]-->Extensive information about uploaded files</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span>5)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: "> </span></span><!--[endif]-->Renaming uploaded files</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span>6)<span style="font-style: normal; font-variant: normal; font-weight: normal; font-size: 7pt; line-height: normal; font-size-adjust: none; font-stretch: normal; font-family: "> </span></span><!--[endif]-->Internationalized error messages</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">Two class files are included in index.php. One is ConnectSmarty.class.php which is used for connecting with Smarty. I have explained about it in my <a title="Installing Smarty" href="http://blog.chapagain.com.np/index.php/2008/07/11/installing-the-smarty-template-engine/" target="_blank">previous article</a>. The other is files.class.php.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">files.class.php</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">&lt;?php
require_once &quot;HTTP/Upload.php&quot;;&lt;/p&gt;
class Files
{
function upload($field_name,$dest)
{
$upload =&amp; new HTTP_Upload(&quot;en&quot;);
$file = $upload-&gt;getFiles($field_name);&lt;/p&gt;
if ($file-&gt;isValid())
{
$moved = $file-&gt;moveTo(&quot;$dest/&quot;);
if (PEAR::isError($moved))
{
require_once('ConnectSmarty.class.php');
// create an object of the class included above
$smarty = new ConnectSmarty;&lt;/p&gt;
$error =&amp; $moved-&gt;getMessage();&lt;/p&gt;
// assign error message
$smarty-&gt;assign('errmessage',$error);

// display error message and exit
$smarty-&gt;display('error.tpl');
exit();
}
}
}
}
?&gt;</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">This class file includes the upload class which becomes available after installing the HTTP_Upload package. I have created a function named ‘upload’ inside the class ‘Files’. The <em>upload()</em> function requires two parameters: <em>$field_name</em> and <em>$dest</em>.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>$field_name</em> is the name of input file.</p>
<p class="MsoNormal" style="text-align: justify;"><em>$dest</em> is the name of the destination directory where the file is to be uploaded.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">The function <em>getFiles() </em>checks if a valid file was uploaded through the form. If the file is valid then it is moved to the destination directory.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">If there is error while moving the file to the destination directory then the error message is fetched through the <em>getMessage()</em> function and displayed in a separate template file called error.tpl.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">index.php</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">&lt;?php
require_once('classes/ConnectSmarty.class.php');
require_once ('classes/files.class.php');&lt;/p&gt;
// create an object of the class included above
$smarty = new ConnectSmarty;&lt;/p&gt;
if(isset($_POST['submit']))
{
$post = $_POST;
$keys = &quot;&quot;;&lt;/p&gt;
$type = $_FILES['logo']['type'];&lt;/p&gt;
// Only allowing jpeg and gif image to be uploaded
if($type == &quot;image/jpeg&quot; || $type == &quot;image/gif&quot;)
{
/**
* file upload part
* creating an object of the class Files
* calling the upload function of the class Files
* the destination directory is to be created at first
* in this case, the destination directory is created and named 'uploads'
*/
$file =&amp; new Files;
$fieldName = &quot;logo&quot;;
$dest = &quot;uploads&quot;;
$file-&gt;upload($fieldName,$dest);

// assign success message
$smarty-&gt;assign('success','File Uploaded Successfully');
}
else
{
// assign error message
$smarty-&gt;assign('error','Only jpge and gif image are supported.');

// display error message and exit
$smarty-&gt;display('index.tpl');
exit();
}
}

// display the content
$smarty-&gt;display('index.tpl');

?&gt;</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">I have only allowed jpeg and gif image to be uploaded. If the file is successfully uploaded then a success message is assigned and displayed.</p>
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">// assign success message

$smarty-&gt;assign('success','File Uploaded Successfully');</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">If the file is not of jpeg or gif type then an error message is assigned and displayed.</p>
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">// assign error message

$smarty-&gt;assign('error','Only jpge and gif image are supported.');

// display error message and exit

$smarty-&gt;display('index.tpl');

exit();</pre>
<p>index.tpl</p>
<pre class="brush: xml; title: ; notranslate">&lt;html&gt;

&lt;head&gt;
&lt;title&gt; Homepage : File Upload&lt;/title&gt;
&lt;/head&gt;

&lt;body&gt;

&lt;font color=&quot;green&quot;&gt;{$success}&lt;/font&gt;
&lt;font color=&quot;red&quot;&gt;{$error}&lt;/font&gt;

&lt;h2&gt;Upload Logo&lt;/h2&gt;
&lt;table&gt;
&lt;form action=&quot;index.php&quot; method=&quot;post&quot; enctype=&quot;multipart/form-data&quot;&gt;
&lt;tr&gt;&lt;td&gt;Logo&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;file&quot; name=&quot;logo&quot; &gt;&lt;/td&gt;&lt;/tr&gt;
&lt;tr&gt;&lt;td&gt;&lt;/td&gt;&lt;td&gt;&lt;input type=&quot;submit&quot; name=&quot;submit&quot; value=&quot;Submit&quot; /&gt;&lt;/td&gt;&lt;/tr&gt;
&lt;/form&gt;
&lt;/table&gt;

&lt;/body&gt;

&lt;/html&gt;</pre>
<p>error.tpl</p>
<pre class="brush: xml; title: ; notranslate">&lt;div align=&quot;center&quot;&gt;
&lt;font color=&quot;red&quot;&gt;
{$errmessage}
&lt;/font&gt;
&lt;/div&gt;</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><strong><span><a title="File upload in PEAR and Smarty" href="http://chapagain.googlecode.com/files/fileupload_pear_smarty.zip">Download source code</a></span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span>Note: <em>I have not included Smarty library files in this zip file. You can download the Smarty library files from </em></span><a title="Download Smarty" href="http://smarty.php.net/download.php" target="_blank">http://smarty.php.net/download.php</a><span><em> or directly from </em></span><a href="http://chapagain.googlecode.com/files/smarty.zip">http://chapagain.googlecode.com/files/smarty.zip</a></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=73&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/using-database-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Using database in PEAR and Smarty'>Using database in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/pagination-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Pagination in PEAR and Smarty'>Pagination in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/file-upload-in-php-simplified/' rel='bookmark' title='Permanent Link: File Upload in PHP :: Simplified'>File Upload in PHP :: Simplified</a></li>
<li><a href='http://blog.chapagain.com.np/multiple-file-upload-with-jquery-and-php/' rel='bookmark' title='Permanent Link: Multiple file upload with jQuery and php'>Multiple file upload with jQuery and php</a></li>
<li><a href='http://blog.chapagain.com.np/installing-the-smarty-template-engine/' rel='bookmark' title='Permanent Link: Installing the Smarty Template Engine'>Installing the Smarty Template Engine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Pagination in PEAR and Smarty</title>
		<link>http://blog.chapagain.com.np/pagination-in-pear-and-smarty/</link>
		<comments>http://blog.chapagain.com.np/pagination-in-pear-and-smarty/#comments</comments>
		<pubDate>Sun, 20 Jul 2008 10:20:53 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PEAR]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[pager]]></category>
		<category><![CDATA[pagination]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=72</guid>
		<description><![CDATA[First of all, you need to install PEAR in your web server. Then you need to install Smarty. After that, you need to install a package in PEAR. It’s called ‘Pager’. Pager is a class to page an array of data. It is taken as input and it is paged according to various parameters. Pager [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/using-database-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Using database in PEAR and Smarty'>Using database in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/creating-selection-list-using-foreach-and-section-loop-in-smarty/' rel='bookmark' title='Permanent Link: Creating selection list, using foreach and section loop in Smarty'>Creating selection list, using foreach and section loop in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: File Upload in PEAR and Smarty'>File Upload in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/templating-in-smarty/' rel='bookmark' title='Permanent Link: Templating in Smarty'>Templating in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/an-introduction-to-smarty-template-engine/' rel='bookmark' title='Permanent Link: An Introduction to Smarty Template Engine'>An Introduction to Smarty Template Engine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>First of all, you need to install PEAR in your web server. Then you need to <a title="Installing Smarty" href="http://blog.chapagain.com.np/index.php/2008/07/11/installing-the-smarty-template-engine/" target="_blank"><span style="text-decoration: underline;">install Smarty</span></a>. After that, you need to install a package in PEAR. It’s called ‘Pager’.</p>
<p class="MsoNormal" style="text-align: justify;">
<p><span id="more-72"></span></p>
<p class="MsoNormal" style="text-align: justify;">Pager is a class to page an array of data. It is taken as input and it is paged according to various parameters. Pager also builds links within a specified range, and allows complete customization of the output.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">In the index.php file, we make a function named getPager(). This function contains four parameters &#8211; $item, $perPage, $mode, and $delta.</p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><em>$item</em> is the array of data.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>$perPage</em> is the number of data to be displayed per page.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>$mode</em> defines about the mode of pagination links. There are two types of modes – Sliding and Jumping. The Jumping mode displays ‘Back’ and ‘Next’ link.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>$delta</em> defines the width of pagination links. High value of $delta increases the width of pagination links.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">The getPager() function returns an array of data and links. The first element of the array contains array of data and the second element contains pagination links.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">index.php</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">&lt;?php
require_once('classes/ConnectSmarty.class.php');
require_once ('Pager/Pager.php');&lt;/p&gt;
// create an object of the class included above
$smarty = new ConnectSmarty;&lt;/p&gt;
function getPager($item,$perPage,$mode,$delta)
{
// setting Sliding as default mode
if($mode == &quot;&quot;)
{
$mode = 'Sliding';
}

// setting the default delta value as 2
// delta means the width of pagination
// more delta value results more width
if($delta == &quot;&quot;)
{
$delta = '2';
}

$params = array(
'mode'=&gt;$mode,
'perPage'=&gt;$perPage,
'delta'=&gt;$delta,
'itemData'=&gt;$item);
$pager =&amp; Pager::factory($params);
$data = $pager-&gt;getPageData();
$links = $pager-&gt;getLinks();
$links = $pager-&gt;links;
return array($data,$links);
}

$mode = 'Sliding'; // $mode = 'Jumping';
$perPage = '3';
$delta = '2';
$item = array(
array('country_id'=&gt;'1','country_name'=&gt;'India'),
array('country_id'=&gt;'2','country_name'=&gt;'Pakistan'),
array('country_id'=&gt;'3','country_name'=&gt;'Nepal'),
array('country_id'=&gt;'4','country_name'=&gt;'Srilanka'),
array('country_id'=&gt;'5','country_name'=&gt;'Bangladesh'),
array('country_id'=&gt;'6','country_name'=&gt;'Maldives'),
array('country_id'=&gt;'7','country_name'=&gt;'Bhutan'),
array('country_id'=&gt;'8','country_name'=&gt;'Afganistan'),
array('country_id'=&gt;'9','country_name'=&gt;'China')
);
$pagination = getPager($item,$perPage,$mode,$delta);
// print_r($pagination);

$smarty-&gt;assign('pager',$pagination[1]);
$smarty-&gt;assign('country',$pagination['0']);

// display the content
$smarty-&gt;display('index.tpl');

?&gt;</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>foreach</em> loop is used to display data. Before trying <em>foreach</em> loop, I had tried <em>section</em> loop but it didn’t work with pagination/pager. After that I tried the <em>foreach</em> loop and it worked fine and smooth. <span style="font-family: Wingdings;"><span>J</span></span></p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">A custom Smarty function ‘cycle’ is used to alternate row color of the table on which data is being displayed. Cycle is used to cycle through a set of values. This makes it easy to alternate between two or more colors in a table, or cycle through an array of values.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">index.tpl</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: xml; title: ; notranslate">&lt;html&gt;&lt;/p&gt;
&lt;head&gt;
&lt;title&gt; Homepage : Pagination&lt;/title&gt;
&lt;/head&gt;&lt;/p&gt;
&lt;body&gt;

&lt;table&gt;
&lt;tr style=&quot;background-color:#336699;color:#eeeeee&quot;&gt;
&lt;td&gt;Country ID&lt;/td&gt;&lt;td width=&quot;65%&quot;&gt;Country Name&lt;/td&gt;

{foreach from=$country item=view}
&lt;tr bgcolor=&quot;{cycle values=&quot;#ffffff,#eeeeee&quot;}&quot;&gt;
&lt;td align=&quot;center&quot;&gt;{$view.country_id}&lt;/td&gt;
&lt;td&gt;{$view.country_name}&lt;/td&gt;
&lt;/tr&gt;
{/foreach}

&lt;tr&gt;&lt;td colspan=&quot;5&quot; align=&quot;center&quot;&gt;{$pager}&lt;/td&gt;&lt;/tr&gt;
&lt;/table&gt;

&lt;/body&gt;

&lt;/html&gt;</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><strong><span><a title="Pagination in PEAR and Smarty" href="http://chapagain.googlecode.com/files/pagination_pear_smarty.zip">Download source code</a></span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span>Note: <em>I have not included Smarty library files in this zip file. You can download the Smarty library files from </em></span><a title="Download Smarty" href="http://smarty.php.net/download.php" target="_blank">http://smarty.php.net/download.php</a><span><em> or directly from </em></span><a href="http://chapagain.googlecode.com/files/smarty.zip">http://chapagain.googlecode.com/files/smarty.zip</a></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=72&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/using-database-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Using database in PEAR and Smarty'>Using database in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/creating-selection-list-using-foreach-and-section-loop-in-smarty/' rel='bookmark' title='Permanent Link: Creating selection list, using foreach and section loop in Smarty'>Creating selection list, using foreach and section loop in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: File Upload in PEAR and Smarty'>File Upload in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/templating-in-smarty/' rel='bookmark' title='Permanent Link: Templating in Smarty'>Templating in Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/an-introduction-to-smarty-template-engine/' rel='bookmark' title='Permanent Link: An Introduction to Smarty Template Engine'>An Introduction to Smarty Template Engine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/pagination-in-pear-and-smarty/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Using database in PEAR and Smarty</title>
		<link>http://blog.chapagain.com.np/using-database-in-pear-and-smarty/</link>
		<comments>http://blog.chapagain.com.np/using-database-in-pear-and-smarty/#comments</comments>
		<pubDate>Fri, 18 Jul 2008 06:00:57 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PEAR]]></category>
		<category><![CDATA[Smarty]]></category>
		<category><![CDATA[code]]></category>
		<category><![CDATA[Database]]></category>
		<category><![CDATA[mdb2]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=71</guid>
		<description><![CDATA[For using database, you need to install a package of PEAR called ‘MDB2’ along with the installation of PEAR and Smarty. MDB2 provides a common API for all support RDBMS. Connecting to database To connect to a database through PEAR::MDB2, you have to create a valid DSN &#8211; data source name. This DSN consists in [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: File Upload in PEAR and Smarty'>File Upload in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/pagination-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Pagination in PEAR and Smarty'>Pagination in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/installing-the-smarty-template-engine/' rel='bookmark' title='Permanent Link: Installing the Smarty Template Engine'>Installing the Smarty Template Engine</a></li>
<li><a href='http://blog.chapagain.com.np/an-introduction-to-pear/' rel='bookmark' title='Permanent Link: An Introduction to PEAR'>An Introduction to PEAR</a></li>
<li><a href='http://blog.chapagain.com.np/backup-and-recovery-of-mysql-database/' rel='bookmark' title='Permanent Link: Backup and Recovery of MySQL database'>Backup and Recovery of MySQL database</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p>For using database, you need to install a package of PEAR called ‘MDB2’ along with the installation of <a title="Installing PEAR" href="http://pear.php.net/manual/en/installation.php" target="_blank">PEAR</a> and <a title="Installing Smarty" href="http://blog.chapagain.com.np/index.php/2008/07/11/installing-the-smarty-template-engine/" target="_blank">Smarty</a>.</p>
<p>MDB2 provides a common API for all support RDBMS.</p>
<p><span id="more-71"></span></p>
<p><strong>Connecting to database</strong></p>
<p>To connect to a database through PEAR::MDB2, you have to create a valid <acronym>DSN &#8211; data source name</acronym>. This DSN consists in the following parts:</p>
<p class="MsoNormal" style="text-align: justify;">phptype: Database backend used in PHP (i.e. mysql , pgsql etc.)</p>
<p class="MsoNormal" style="text-align: justify;">dbsyntax: Database used with regards to SQL syntax etc.</p>
<p class="MsoNormal" style="text-align: justify;">protocol: Communication protocol to use ( i.e. tcp, unix etc.)</p>
<p class="MsoNormal" style="text-align: justify;">hostspec: Host specification (hostname[:port])</p>
<p class="MsoNormal" style="text-align: justify;">database: Database to use on the DBMS server</p>
<p class="MsoNormal" style="text-align: justify;">username: User name for login</p>
<p class="MsoNormal" style="text-align: justify;">password: Password for login</p>
<p class="MsoNormal" style="text-align: justify;">proto_opts: Maybe used with protocol</p>
<p class="MsoNormal" style="text-align: justify;">option: Additional connection options in URI query string format. options get separated by &amp;.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">The DSN can either be provided as an associative array or as a string. The string format of the supplied DSN is in its fullest form:</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>phptype(dbsyntax)://username:password@protocol+hostspec/database?option=value</em></p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">To instantiate a database object you have several methods available using MDB2.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>factory()</em> : Will instantiate a new <span>MDB2_Driver_Common</span> instance, but will not connect to the database until required. This will delay making the actual connection.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>connect()</em> : Will instantiate a new <span>MDB2_Driver_Common</span> instance, and will establish a database connection immediately. This way any connection issues will immediately raise an error.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>singleton()</em> : Returns a MDB2_Driver_Common instance.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">A new MDB2_Driver_Common object is only created once using <em>factory()</em>, subsequent calls to singleton will return a reference to the existing object. This method is preferred over declaring your database object as a global.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">To connect to a database you have to use the function <em>factory()</em>, <em>connect()</em> or <em>singleton()</em>, which require a valid DSN as the first parameter. This parameter can either be a string or an array. The second parameter is the optional $options array that can contain runtime configuration settings for this package.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">I have used the <em>connect()</em> function with the DSN as</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>phptype://username:password@hostspec/database</em></p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">$mdb2 =&amp; MDB2::connect('mysql://root:@localhost/test');</pre>
</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">In my case, the database backend is mysql, database username is root, database password is null, the hostname is localhost and the database name is test.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><strong>Querying the database</strong></p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">PEAR MDB2 provides several methods for querying databases. The most direct method is query(). It takes a SQL query string as an argument. There are two possible returns: A new MDB2_Result object for queries that return results (such as SELECT queries), or a MDB2_Error object on failure. It should not be used with statements that manipulate data (such as INSERT queries).</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">exec() should be used for manipulation queries. There are two possible returns: An integer denoting the number of affected rows for statements that manipulate data (such as INSERT queries), or a MDB2_Error object on failure. It should not be used with statements that return results (such as SELECT queries).</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">Here, I will only be dealing with the SELECT queries.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">$mdb2 = new ConnectMDB2;&lt;/p&gt;
// calling the function conMDB2 of ConnectMDB2 class
$connect = $mdb2-&gt;conMDB2();&lt;/p&gt;
$res = $connect-&gt;query(&quot;SELECT * FROM basic&quot;);
</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><strong> </strong></p>
<p class="MsoNormal" style="text-align: justify;"><strong>Fetching result</strong></p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">The MDB2_Result_Common object provides four methods for fetching data from rows of a result set: fetchOne(), fetchRow(), fetchCol() and fetchAll().</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">fetchRow() and fetchOne() read an entire row or a single field from a column respectively. The result pointer gets moved to the next row each time these methods are called. NULL is returned when the end of the result set is reached.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">fetchAll() and fetchCol() read all rows in the result set and therefore move the result pointer to the end. While fetchAll() reads the entire row data, fetchCol() only reads a single column.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">MDB2_Error is returned if an error is encountered.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">I have used the fetchRow() method. The fetchmode MDB2_FETCHMODE_ASSOC is used for fetching data. The default fetchmode is MDB2_FETCHMODE_ORDERED.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">while($row[] = $res-&gt;fetchRow(MDB2_FETCHMODE_ASSOC))
{
$result = $row;
}
</pre>
</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">If there is any error then the error message is displayed in a separate template called error.tpl. And if there is no error while fetching data then the fetched result is displayed in the template file index.tpl.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: php; title: ; notranslate">if(PEAR::isError($res))
{
// get error message
$error =&amp; $res-&gt;getMessage();&lt;/p&gt;
// assign error message
$smarty-&gt;assign('errmessage',$error);&lt;/p&gt;
// display the message and exit
$smarty-&gt;display('error.tpl');
exit();
}&lt;/p&gt;
// asign the content
$smarty-&gt;assign('result',$result);

// display the content
$smarty-&gt;display('index.tpl');
</pre>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">In the template file, <em>foreach</em> loop is used to display the result.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<pre class="brush: xml; title: ; notranslate">{foreach from=$result item=view}
&lt;tr bgcolor=&quot;{cycle values=&quot;#ffffff,#eeeeee&quot;}&quot;&gt;
&lt;td&gt;{$view.firstname}&lt;/td&gt;
&lt;td&gt;{$view.lastname}&lt;/td&gt;
&lt;/tr&gt;
{/foreach}
</pre>
</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><strong><span><a title="Download Source Code" href="http://chapagain.googlecode.com/files/database_pear_smarty.zip">Download source code</a></span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span>Note: <em>I have not included Smarty library files in this zip file. You can download the Smarty library files from </em></span><a title="Download Smarty" href="http://smarty.php.net/download.php" target="_blank">http://smarty.php.net/download.php</a><span><em> or directly from </em></span><a href="http://chapagain.googlecode.com/files/smarty.zip">http://chapagain.googlecode.com/files/smarty.zip</a></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=71&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: File Upload in PEAR and Smarty'>File Upload in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/pagination-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Pagination in PEAR and Smarty'>Pagination in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/installing-the-smarty-template-engine/' rel='bookmark' title='Permanent Link: Installing the Smarty Template Engine'>Installing the Smarty Template Engine</a></li>
<li><a href='http://blog.chapagain.com.np/an-introduction-to-pear/' rel='bookmark' title='Permanent Link: An Introduction to PEAR'>An Introduction to PEAR</a></li>
<li><a href='http://blog.chapagain.com.np/backup-and-recovery-of-mysql-database/' rel='bookmark' title='Permanent Link: Backup and Recovery of MySQL database'>Backup and Recovery of MySQL database</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/using-database-in-pear-and-smarty/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>An Introduction to PEAR</title>
		<link>http://blog.chapagain.com.np/an-introduction-to-pear/</link>
		<comments>http://blog.chapagain.com.np/an-introduction-to-pear/#comments</comments>
		<pubDate>Fri, 27 Jun 2008 12:11:31 +0000</pubDate>
		<dc:creator>Mukesh</dc:creator>
				<category><![CDATA[PEAR]]></category>
		<category><![CDATA[introduction]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://blog.chapagain.com.np/?p=62</guid>
		<description><![CDATA[PEAR is short for &#8220;PHP Extension and Application Repository&#8221; and is pronounced just like the fruit. It is a repository of PHP software code. The PEAR project was founded in 1999 by Stig S. Bakken to promote the re-use of code that performs common functions. PEAR is a code library that can reduce development time [...]


<strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: File Upload in PEAR and Smarty'>File Upload in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/using-database-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Using database in PEAR and Smarty'>Using database in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/pagination-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Pagination in PEAR and Smarty'>Pagination in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/an-introduction-to-smarty-template-engine/' rel='bookmark' title='Permanent Link: An Introduction to Smarty Template Engine'>An Introduction to Smarty Template Engine</a></li>
</ol>]]></description>
			<content:encoded><![CDATA[<p><span>PEAR is short for &#8220;PHP Extension and Application Repository&#8221; and is pronounced just like the fruit. It is a repository of PHP software code. The PEAR project was founded in 1999 by Stig S. Bakken to promote the re-use of code that performs common functions.</span></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p><span id="more-62"></span></p>
<p class="MsoNormal" style="text-align: justify;">PEAR is a code library that can reduce development time by supplying prewritten classes for standard functionality. PEAR contains functionality for a number of features, including database, mail, and error handling. PEAR provides a level of standardization that facilitates interoperability of functions.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">PEAR is broken into three classes: PEAR Core Components, PEAR Packages, and PECL Packages. The Core Components include the base classes of PEAR and PEAR_Error, along with database, HTTP, logging, and e-mailing functions. The PEAR Packages include functionality providing for authentication, networking, and file system features, as well as tools for working with XML and HTML templates. PECL Packages are extensions to PHP, written in C, that do not comply with the coding guidelines.</p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span>The purpose of PEAR is to provide: </span></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span>A structured library of open-source code for PHP users </span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span>Each PEAR code package comprises an independent project under the PEAR umbrella. It has its own development team, versioning-control and documentation. </span>Packages may relate to each other through explicit dependencies, but there is no automatic dependency relationship between packages based on the package name. For example, <span class="quote">&#8220;HTTP_Post&#8221;</span> is by default independent of <span class="quote">&#8220;HTTP&#8221;</span>.<span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span>A system for code distribution and package maintenance </span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;">All PEAR packages are registered in and downloaded from a central server at pear.php.net. All communication occurs over the HTTP protocol. Packages are distributed as a gzipped tar file with an XML description file inside. They contain source code or binaries or both. <span>Many PEAR packages can readily be used by developers as ordinary third party code via simple include statements in PHP.</span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span> </span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span>A standard style for code written in PHP </span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;">The PEAR Coding Standards apply to code that is part of the official PEAR distribution. Coding standards often abbreviated as CS among developers and they aim to keep code consistent to be easily readable and maintainable by most of PEAR folks. The PEAR Coding Standards defines about indenting and line length, control structures, function calls, function definitions, comments, including code, header comment blocks, naming conventions, etc.<span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span>The PHP Extension Community Library (PECL)</span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span>PECL (pronounced &#8220;pickle&#8221;) is a separate project that distributes PHP extensions. PECL extensions are also distributed as packages and can be installed using the PEAR installer with the pecl command. PECL contains C extensions for compiling into PHP. As C programs , PECL extensions run more efficiently than PEAR packages. PECL includes modules for XML-parsing, access to additional databases, mail-parsing, embedding Perl or Python in PHP scripts and for compiling PHP scripts. </span></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><strong><span>A web site, mailing lists and download mirrors to support the PHP/PEAR community </span></strong></p>
<p class="MsoNormal" style="text-align: justify;"><span> </span></p>
<p class="MsoNormal" style="text-align: justify;"><span>One of the jobs of the PEAR Group is to issue administrative documents about diverse topics in PEAR. If you&#8217;re interested in submitting code for inclusion in PEAR, you can do so by joining the PEAR developer&#8217;s mailing list and requesting that your code be reviewed. To be considered, be sure to pay attention to functionality that&#8217;s already included and adhere to the PEAR coding guidelines. S</span>ubmissions to PEAR are scrutinized by a panel, which provides quality assurance and reliability in the code.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;">As stated above, PEAR functionality is easy to deploy and requires no additional programming. By using quality prewritten, reusable code, you can tremendously shorten your development cycle.</p>
<p class="MsoNormal" style="text-align: justify;">
<p class="MsoNormal" style="text-align: justify;"><em>Source:</em></p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span><span>1)<span style="font-family: "> </span></span></span><!--[endif]-->PEAR Manual</p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span><span>2)<span style="font-family: "> </span></span></span><!--[endif]--><span>http://en.wikipedia.org/PHP_Extension_and_Application_Repository </span></p>
<p class="MsoNormal" style="margin-left: 0.5in; text-align: justify; text-indent: -0.25in;"><!--[if !supportLists]--><span><span>3)<span style="font-family: "> </span></span></span><!--[endif]--><span>http://articles.techrepublic.com.com/5100-10878_11-1045409.html </span></p>
<hr /><small>Copyright &copy; 2011<br /> This feed is for personal, non-commercial use only. <br /> The use of this feed on other websites breaches copyright. If this content is not in your news reader, it makes the page you are viewing an infringement of the copyright. (Digital Fingerprint:<br /> )</small><img src="http://blog.chapagain.com.np/?ak_action=api_record_view&id=62&type=feed" alt="" />

<p><strong>Related posts:</strong><ol><li><a href='http://blog.chapagain.com.np/file-upload-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: File Upload in PEAR and Smarty'>File Upload in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/using-database-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Using database in PEAR and Smarty'>Using database in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/pagination-in-pear-and-smarty/' rel='bookmark' title='Permanent Link: Pagination in PEAR and Smarty'>Pagination in PEAR and Smarty</a></li>
<li><a href='http://blog.chapagain.com.np/jquery-grey-out-background-and-preview-image-as-popup/' rel='bookmark' title='Permanent Link: jQuery: Grey out background and preview image as popup'>jQuery: Grey out background and preview image as popup</a></li>
<li><a href='http://blog.chapagain.com.np/an-introduction-to-smarty-template-engine/' rel='bookmark' title='Permanent Link: An Introduction to Smarty Template Engine'>An Introduction to Smarty Template Engine</a></li>
</ol></p>]]></content:encoded>
			<wfw:commentRss>http://blog.chapagain.com.np/an-introduction-to-pear/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>
<!-- WP Super Cache is installed but broken. The path to wp-cache-phase1.php in wp-content/advanced-cache.php must be fixed! -->
