<?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>Logan Buesching &#187; PHP</title>
	<atom:link href="http://agoln.net/archives/category/php/feed" rel="self" type="application/rss+xml" />
	<link>http://agoln.net</link>
	<description>Development and personal site</description>
	<lastBuildDate>Sun, 03 Jan 2010 23:05:38 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Zend Studio for Eclipse on Windows Debugger Issues</title>
		<link>http://agoln.net/archives/102</link>
		<comments>http://agoln.net/archives/102#comments</comments>
		<pubDate>Wed, 26 Mar 2008 10:08:44 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[Howto]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/102</guid>
		<description><![CDATA[When attempting to debug my program, zend studio for eclipse wasn&#8217;t recognizing that I had my mysql extension installed.  I found a small work around.
Go to
[install_path]\plugins\org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\resources\php5
In there, you will see your php.exe&#8217;s and your php.ini that the debugger uses.  I just copied my php.ini there for it to work.
]]></description>
			<content:encoded><![CDATA[<p>When attempting to debug my program, zend studio for eclipse wasn&#8217;t recognizing that I had my mysql extension installed.  I found a small work around.</p>
<p>Go to<br />
<code>[install_path]\plugins\org.zend.php.debug.debugger.win32.x86_5.2.12.v20071210\resources\php5</code></p>
<p>In there, you will see your php.exe&#8217;s and your php.ini that the debugger uses.  I just copied my php.ini there for it to work.</p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/102/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Zend_Pdf_Cell Proposal</title>
		<link>http://agoln.net/archives/99</link>
		<comments>http://agoln.net/archives/99#comments</comments>
		<pubDate>Thu, 20 Mar 2008 03:00:15 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/99</guid>
		<description><![CDATA[After a few weeks of downtime, and helpful input and comments from my readers, I have finally submitted my Zend_Framework CLA and authored a Zend_Pdf_Cell proposal!  Please feel free to read it and comment on any of the functionality!  I really hope that this can get integrated within the Zend Framework, as I [...]]]></description>
			<content:encoded><![CDATA[<p>After a few weeks of downtime, and helpful input and comments from my readers, I have finally submitted my Zend_Framework CLA and authored <a href="http://framework.zend.com/wiki/display/ZFPROP/Zend_Pdf_Cell+-+Logan+Buesching" title="Proposal">a Zend_Pdf_Cell proposal</a>!  Please feel free to read it and comment on any of the functionality!  I really hope that this can get integrated within the Zend Framework, as I have put a lot of time into this and hope that the community can gain as much as possible from it.</p>
<p>I want to give everyone a great big thanks for the valuable feedback and excellent encouragement!</p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/99/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Zend Pdf Cell</title>
		<link>http://agoln.net/archives/81</link>
		<comments>http://agoln.net/archives/81#comments</comments>
		<pubDate>Wed, 28 Nov 2007 22:49:59 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/81</guid>
		<description><![CDATA[Update! (3/31/2008): Now works with Zend Framework 1.5!
Update! (3/19/2008): I have submitted an official proposal for this to be included into the Zend Framework.
Update! (1/12/09): Dominik Deobald was kind enough to supply a UTF character encoding patch and bug fix.  I have attached his fix as a .patch file at the end of the [...]]]></description>
			<content:encoded><![CDATA[<p><strong>Update! (3/31/2008)</strong>: Now works with Zend Framework 1.5!<br />
<strong>Update! (3/19/2008)</strong>: I have submitted <a href="http://agoln.net/archives/99">an official proposal</a> for this to be included into the Zend Framework.<br />
<strong>Update! (1/12/09)</strong>: <a href="http://blogs.interdose.com/dominik/">Dominik Deobald</a> was kind enough to supply a UTF character encoding patch and bug fix.  I have attached his fix as a <a href="http://bund.com.au/~foo/linux/patch.html">.patch</a> file at the end of the post.</p>
<p>I have recently been working with <a href="http://framework.zend.com/manual/en/zend.pdf.html">Zend_PDF</a> to create PDF documents.  One of the basic requirements for my project is the ability to center text within a screen.  Needless to say, I was quite disappointed when I came to find out that Zend_Pdf doesn&#8217;t currently have any type of text layout support except for the exact position to place it.</p>
<p>I created a small extension to Zend_Pdf, and building off of an idea from <a href="http://www.fpdf.org/">FPDF</a>, I created Zend_Pdf_Cell.  <strong>Zend_Pdf_Cell is not currently supported by Zend, and is <em>not</em> officially in the Zend Framework</strong>, although I have <a href="http://framework.zend.com/issues/browse/ZF-1254">posted my code</a> for them to view it and give feedback (and hopefully have it incorporated into Zend Pdf).  <a href="http://agoln.net/archives/64">My first try</a> I misunderstood parts of Zend_Pdf, but I have gone back and fixed it.</p>
<h2>Features</h2>
<p>These features have been most used by myself and mostly work.<br />
* The ability to create a cell and place text in it.<br />
* Specify the width and height of a cell<br />
* Position a cell (one or more of these combined)<br />
** To the left<br />
** To the right<br />
** At the bottom<br />
** At the top<br />
** Centered horizontally<br />
** Centered vertically<br />
* Align text within a cell<br />
** Left<br />
** Right<br />
** Centered<br />
** (To be done later) Justify<br />
* Format different parts of the text in different fonts</p>
<h2>Experimental</h2>
<p>I just recently put these abilities in, so they may not fully work or even work properly.<br />
* Create a border around the cell<br />
* Word wrap text around the cell</p>
<h2>Installation</h2>
<p>To install this, just place the <a href="http://loganbuesching.com/Cell.phps">Cell.php</a> file in Zend/Pdf/, then in <em>your</em> php file, just add:</p>
<pre>
include_once('Zend/Pdf/Cell.php');
</pre>
<h2>Examples</h2>
<p>The following is an example of how to use the Zend Pdf Cell:</p>
<pre>
<?php
 $pdf=new Zend_Pdf();
 $pdf->pages[] =new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);
 $font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_ITALIC);
 $pdf->pages[0]->setFont($font,12);
 //Creates a cell in the specified page
 $cell=new Zend_Pdf_Cell($pdf->pages[0]);

 //adds a cell in the upper left with "Hello World"
 $cell->addText("Hello World");
 $cell->write();

 //creates a cell in the center of the page
 //To do top and right, then you would
 //or together POSITION_RIGHT and
 //POSITION_TOP.
 $cell=new Zend_Pdf_Cell($pdf->pages[0],
                                    Zend_Pdf_Cell::POSITION_CENTER_X |
                                    Zend_Pdf_Cell::POSITION_CENTER_Y);
 //add a 1 pixel border
 $cell->setBorder(1);
 //align to the right
 $cell->addText("The quick brown fox jumped over the lazy dog",
                        Zend_Pdf_Cell::ALIGN_RIGHT);
 $cell->write();
?>
</pre>
<p>If you have any questions or wish to report problems, please use the comment box below.  I would also like to hear if you have successfully implemented this!</p>
<h2>Files</h2>
<p><a href="http://loganbuesching.com/1.0/Cell.phps">Cell.php &#8211; Zend Framework 1.0.*</a><br />
<a href="http://loganbuesching.com/1.5/Cell.phps">Cell.php &#8211; Zend Framework 1.5.*</a><br />
(Updated 1/12/08)<br />
UTF character <a href="http://loganbuesching.com/1.5/UTF.patch">patch</a> by <a href="http://blogs.interdose.com/dominik/">Dominik</a></p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/81/feed</wfw:commentRss>
		<slash:comments>41</slash:comments>
		</item>
		<item>
		<title>Zend_Pdf Extension</title>
		<link>http://agoln.net/archives/64</link>
		<comments>http://agoln.net/archives/64#comments</comments>
		<pubDate>Tue, 25 Sep 2007 17:00:52 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/64</guid>
		<description><![CDATA[**I HAVE UPDATED THIS, PLEASE READ THE UPDATE**
I have recently been working with Zend_Pdf and it appears that their ability to put text on a screen is very lacking compared to FPDF.  I have recently been diving into expanding the functionality and have provided the following class: Zend_Pdf_Cell.  This will allow a developer [...]]]></description>
			<content:encoded><![CDATA[<p><strong>**I HAVE UPDATED THIS, PLEASE <a href="http://agoln.net/archives/81">READ THE UPDATE</a>**</strong><br />
I have recently been working with Zend_Pdf and it appears that their ability to put text on a screen is very lacking compared to FPDF.  I have recently been diving into expanding the functionality and have provided the following class: Zend_Pdf_Cell.  This will allow a developer to create a &#8220;cell&#8221; within a page, center the cell and align the text within the cell.</p>
<p>The following is a small sample code of how to use the cell:</p>
<pre>

	$pdf=new Zend_Pdf();
	$pdf->pages[] =new Zend_Pdf_Page(Zend_Pdf_Page::SIZE_A4);

        $font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_ITALIC);
        $pdf->pages[0]->setFont($font,12);  

	//create and attach the cell to the first page, and center in the X and Y direction
        $cell=new Zend_Pdf_Cell($pdf->pages[0],Zend_Pdf_Cell::POSITION_CENTER_X | Zend_Pdf_Cell::POSITION_CENTER_Y);
	//align the text in the center
        $cell->addText("The quick brown fox jumped over the lazy dog.",Zend_Pdf_Cell::ALIGN_CENTER);
        $cell->newLine();
	//change the font
        $cell->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_BOLD),28);
	//align this to the right
        $cell->addText("The quick brown fox jumped over the lazy dog.",Zend_Pdf_Cell::ALIGN_RIGHT);
        $cell->newLine();
        $cell->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES),10);
	//align this to the left
        $cell->addText("The quick brown fox jumped over the lazy dog.",Zend_Pdf_Cell::ALIGN_LEFT);
        $cell->newLine();
        $cell->setFont(Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_TIMES_ITALIC),28);
        $cell->addText("The quick brown fox jumped over the lazy dog.",Zend_Pdf_Cell::ALIGN_CENTER);
	//finally write the cell to the page.  Text will not show up unless you write to the page.
        $cell->write();
        //create a new cell and center on just the X coordinate
        $cell=new Zend_Pdf_Cell($pdf->pages[0],Zend_Pdf_Cell::POSITION_CENTER_X);
        $font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_HELVETICA);
        $cell->setPosition(Zend_Pdf_Cell::POSITION_TOP);
        $cell->addText("The quick brown fox jumped over the lazy dog.");
        $cell->write();

        $cell=new Zend_Pdf_Cell($pdf->pages[0],Zend_Pdf_Cell::POSITION_RIGHT,$pdf->pages[0]->getWidth());
        $font=Zend_Pdf_Font::fontWithName(Zend_Pdf_Font::FONT_COURIER);
        $cell->setPosition(Zend_Pdf_Cell::POSITION_BOTTOM);
        $cell->addText("The quick brown fox jumped over the lazy dog.",Zend_Pdf_Cell::ALIGN_RIGHT);
        $cell->write();

	$pdf->save($this->uploadDir.'/TEST-CELL2.pdf');
</pre>
<p>I have attached not only the Cell patch, but also the diff of font resource files separately.</p>
<p>In the origional source for the font&#8217;s, we can see that they didn&#8217;t use the correct widths:</p>
<pre>
/* The glyph numbers assigned here are synthetic; they do not match the
*  actual glyph numbers used by the font. This is not a big deal though
*  since this data never makes it to the PDF file. It is only used
* internally for layout calculations.
*/
</pre>
<p>So when attempting to calculate things like a string width, you would get the wrong numbers.  I looked up the numbers on <a title="Font Reference" href="http://www.adobe.com/devnet/font/">Adobe&#8217;s Font and Type Technology Center</a> particularly the <a href="http://www.adobe.com/devnet/font/pdfs/Core14_AFMs.tar">Unix fonts</a>.  From there I generated a small PHP script that would output the ASCII value and the corresponding glyph width.  Using these numbers, I updated the Zend font resource files which gives you the diff below.  Because these fonts only contain width values for the ASCII numbers 32 &#8211; 251ish, those are all that were updated.</p>
<p><a href='http://agoln.net/wp-content/uploads/2007/09/zendfontwidthpatch.txt' title='Zend Font Width Patch'>Zend Font Width Patch</a></p>
<p><a href='http://agoln.net/wp-content/uploads/2007/09/cell.txt' title='Cell Patch'>Cell Patch</a></p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/64/feed</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Facebook Source Code Leaked</title>
		<link>http://agoln.net/archives/56</link>
		<comments>http://agoln.net/archives/56#comments</comments>
		<pubDate>Mon, 13 Aug 2007 13:04:08 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/56</guid>
		<description><![CDATA[I recently read about how some of the source code behind Facebook was leaked.  I read through some of it and as a PHP developer, it surprised me at some of the things that they have done.  
Here is a small list of the features of their code:

There is no object oriented code.
There [...]]]></description>
			<content:encoded><![CDATA[<p>I recently <a href="http://www.techcrunch.com/2007/08/11/facebook-source-code-leaked/" title="TechCrunch Article on Code Release">read</a> about how some of the <a href="http://facebooksecrets.blogspot.com/">source code</a> behind Facebook was leaked.  I read through some of it and as a PHP developer, it surprised me at some of the things that they have done.  </p>
<p>Here is a small list of the features of their code:</p>
<ol>
<li>There is no object oriented code.</li>
<li>There are a _lot_ of includes</li>
<li>They use <a href="http://smarty.php.net/" title="Smarty Homepage">Smarty</a> (or something built to feel like Smarty)</li>
<li>They don&#8217;t use <a href="http://en.wikipedia.org/wiki/CamelCase" title="whatIsCamelCase?">camelCase</a></li>
<li>Many
<ul>
<li>Many
<ul>
<li>Many
<ul>
<li>Nested if&#8217;s</li>
</ul>
</li>
</ul>
</li>
</ul>
</li>
</ol>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/56/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>Why do people contribute documentation?</title>
		<link>http://agoln.net/archives/55</link>
		<comments>http://agoln.net/archives/55#comments</comments>
		<pubDate>Fri, 10 Aug 2007 20:18:52 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[Opinion]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/55</guid>
		<description><![CDATA[I recently read an article at ONLamp.com about why people write free documentation.  As being part of the PHP documentation team, I thought that the article would be an interesting read.
The author goes to show that most people tend to write the documentation because they want a thriving community and personal growth, but they [...]]]></description>
			<content:encoded><![CDATA[<p>I recently <a href="http://www.onlamp.com/pub/a/onlamp/2007/06/14/why-do-people-write-free-documentation-results-of-a-survey.html?page=1" title="Why Do People Write Free Documentation?">read an article</a> at ONLamp.com about why people write free documentation.  As being part of the <a href="http://docs.php.net/manual/en/" title="PHP manual">PHP documentation</a> team, I thought that the article would be an interesting read.</p>
<p>The author goes to show that most people tend to write the documentation because they want a thriving community and personal growth, but they don&#8217;t write for thrills or because they enjoy writing.  Let me reemphisize that last point: <em>People do not write the documentation because they enjoy writing</em>.  I have often been asked why I started to join the PHP team, and I can honestly say that it&#8217;s not because I enjoy writing.  My father often asks why I contribute to something where I get no monetary reward.  It is hard for him to understand how this is like community service, but on a different level.  I joined the PHP documentation team to help out and give back to the community, to learn PHP on a more intimate level, and to hopefully be able to study the source and contribute to PHP 6 and beyond.</p>
<p>I enjoy working with the PHP team and have been slacking off in my contributions, but I hope to find some time to help out during the school year.</p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/55/feed</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>BARcamp Chicago</title>
		<link>http://agoln.net/archives/32</link>
		<comments>http://agoln.net/archives/32#comments</comments>
		<pubDate>Fri, 08 Jun 2007 03:39:49 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/32</guid>
		<description><![CDATA[I&#8217;ve been thinking about attending BARcamp Chicago.  It would be about a two hour train ride but I think it would be a fun experience.  It takes place near the end of June and they have around 50 or so people signed up.
Anyone else interested?
]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been thinking about attending <a href="http://barcampchicago.com/" title="UnConference in Chicago">BARcamp Chicago</a>.  It would be about a two hour train ride but I think it would be a fun experience.  It takes place near the end of June and they have around 50 or so people signed up.</p>
<p>Anyone else interested?</p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/32/feed</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP Function Naming</title>
		<link>http://agoln.net/archives/31</link>
		<comments>http://agoln.net/archives/31#comments</comments>
		<pubDate>Thu, 07 Jun 2007 04:03:01 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/31</guid>
		<description><![CDATA[Philip Olsen has a short article on PHP [lack of] naming conventions.
Maybe ogo is the solution?
]]></description>
			<content:encoded><![CDATA[<p><a href="http://blog.roshambo.org/" title="PHP Documentation Editor">Philip Olsen</a> has a short article on <a href="http://blog.roshambo.org/archives/20-possible-reasons-why-PHP-function-names-and-parameters-are-weird.html" title="PHP.net+Ads=$$$">PHP [lack of] naming conventions</a>.</p>
<p>Maybe <a href="http://www.ogoproject.com/" title="Fork of PHP for naming conventions">ogo</a> is the solution?</p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/31/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First PHP bug report closed</title>
		<link>http://agoln.net/archives/29</link>
		<comments>http://agoln.net/archives/29#comments</comments>
		<pubDate>Wed, 16 May 2007 21:55:01 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[Development]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/29</guid>
		<description><![CDATA[So for the two-five people that read my blog know, I have joined the PHP documentation team and I have full CVS karma.  My original involvement was looking at bug#41108 in PHP&#8217;s documentation.  I just closed the bug report on it today as I felt that the solution was correct.
Yay me, first bug [...]]]></description>
			<content:encoded><![CDATA[<p>So for the two-five people that read my blog know, I have <a href="http://agoln.net/archives/23" title="My CVS account">joined the PHP documentation team</a> and I have full CVS karma.  My original involvement was looking at <a href="http://bugs.php.net/bug.php?id=41108" title="pow() and negative exponents">bug#41108</a> in PHP&#8217;s documentation.  I just closed the bug report on it today as I felt that the solution was correct.</p>
<p>Yay me, first bug report fixed.  More to come <img src='http://agoln.net/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/29/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>First PHP patch</title>
		<link>http://agoln.net/archives/24</link>
		<comments>http://agoln.net/archives/24#comments</comments>
		<pubDate>Thu, 03 May 2007 18:30:45 +0000</pubDate>
		<dc:creator>Logan</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://agoln.net/archives/24</guid>
		<description><![CDATA[So after getting my CVS account, I have posted my first patch to the documentation!  You should be able to browse to the PHP posix documentation and view many of the new functions I have documented!
]]></description>
			<content:encoded><![CDATA[<p>So after getting my CVS account, I have posted my first patch to the documentation!  You should be able to browse to the <a href="http://us.php.net/manual/en/ref.posix.php" title="PHP posix documentation">PHP posix documentation</a> and view many of the new functions I have documented!</p>
]]></content:encoded>
			<wfw:commentRss>http://agoln.net/archives/24/feed</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

<!-- Dynamic Page Served (once) in 0.340 seconds -->
