<?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>Mokka mit Schlag &#187; PHP</title>
	<atom:link href="http://www.elharo.com/blog/category/software-development/web-development/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.elharo.com/blog</link>
	<description>Ranting and Raving</description>
	<lastBuildDate>Wed, 01 Feb 2012 13:01:35 +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>A New Host</title>
		<link>http://www.elharo.com/blog/software-development/web-development/php/2007/12/25/a-new-host/</link>
		<comments>http://www.elharo.com/blog/software-development/web-development/php/2007/12/25/a-new-host/#comments</comments>
		<pubDate>Tue, 25 Dec 2007 17:22:45 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2007/12/25/a-new-host/</guid>
		<description><![CDATA[I&#8217;ve decided the time has come to move several sites out of my spare bedroom and off this box and onto a shared host somewhere. I probably should have done this years ago, but there&#8217;s something nice about having a server you can personally reboot or stick a CD into when necessary. I need to [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve decided the time has come to move several sites out of my spare bedroom and off this box and onto a shared host somewhere. I probably should have done this years ago, but there&#8217;s something nice about having a server you can personally reboot or stick a CD into when necessary. I need to be able to serve three sites:</p>
<ul>
<li><a href="http://www.xom.nu/">xom.nu</a> (static HTML)</li>
<li><a href="http://cafe.elharo.com/">The Cafes</a> (WordPress)</li>
<li><a href="http://www.elharo.com/">www.elharo.com</a> (static+WordPress+custom PHP)</li>
</ul>
<p>These sites are not mission critical, but I would like them to stay up. Reliable backups that I can download periodically are a must. I would like them to respond much faster than they do currently. (Xom.nu is pretty fast, but the two blogs can be dog slow at times.) </p>
<p>Traffic is not too heavy, though I don&#8217;t track hard numbers. I would like to be able to quickly ramp up to withstand a Digg effect if necessary.</p>
<p>These sites can all live on the same IP address. (They do now.)</p>
<p>I&#8217;d like the flexibility to install my own Apache modules and custom PHP extensions and modify the various config files such as httpd.conf and php.ini. Ideally I&#8217;d like to be install other frameworks such as Ruby on Rails or eXist if I feel like playing with them. That is, root access to the box would be very helpful, even if it&#8217;s virtualized. However I can probably live without that if it raises the price too high. Alternately, I could perhaps live with 24/7 phone support from a reliable sys admin who can make changes like that for me. However the ability to install and manage my own WordPress extensions and modified code is a must.  </p>
<p>Any suggestions? So  far here&#8217;s who I&#8217;ve looked at:<br />
<span id="more-1000970"></span></p>
<ul>
<li><a href="http://www.pair.com/services/web_hosting/advanced.html">Pair</a>: $17.95 a month</li>
<li><a href="http://www.dreamhost.com/hosting.html">Dreamhost</a>: $10.95 a month</li>
<li><a href="http://www.speakeasy.net/business/ms/hosting/web.php">Speakeasy</a>: $24.95 a month</li>
</ul>
<p>Dreamhost is the cheapest, but may also be the least reliable. Anyone else I should consider?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/web-development/php/2007/12/25/a-new-host/feed/</wfw:commentRss>
		<slash:comments>7</slash:comments>
		</item>
		<item>
		<title>eAccelerator</title>
		<link>http://www.elharo.com/blog/software-development/web-development/php/2007/09/25/eaccelerator/</link>
		<comments>http://www.elharo.com/blog/software-development/web-development/php/2007/09/25/eaccelerator/#comments</comments>
		<pubDate>Tue, 25 Sep 2007 12:03:17 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2007/09/25/eaccelerator/</guid>
		<description><![CDATA[I&#8217;m still finding this site to be unmanageably slow at times. One other trick that&#8217;s been suggested is to install eAccelerator to cache the compiled PHP scripts. (WP-cache only caches the output pages.) I&#8217;ve now done that. At first glance it does feel like a dramatic speed-up, but we&#8217;ll have to see how it handles [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m still finding this site to be unmanageably slow at times. One other trick that&#8217;s been suggested is to install eAccelerator to cache the compiled PHP scripts. (WP-cache only caches the output pages.) I&#8217;ve now done that. At first glance it does feel like a dramatic speed-up, but we&#8217;ll have to see how it handles under load. Please holler if anything seems broken. </p>
<p>The install was shockingly easy for a Unix server program: took me about ten minutes total including time to write this entry. That&#8217;s less time than it took me to install PHP in the first place. </p>
<p>Things do seem to be faster, though I&#8217;m still seeing occasional timeouts requesting pages. I really wish there were some decent profiling and logging tools that could tell me exactly where the system is bottlenecking. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/web-development/php/2007/09/25/eaccelerator/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Hacking Live Preview</title>
		<link>http://www.elharo.com/blog/software-development/web-development/php/2007/05/05/hacking-live-preview/</link>
		<comments>http://www.elharo.com/blog/software-development/web-development/php/2007/05/05/hacking-live-preview/#comments</comments>
		<pubDate>Sat, 05 May 2007 10:16:01 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2007/05/05/hacking-live-preview/</guid>
		<description><![CDATA[My PHP error logs are filling up with errors like this one: [05-May-2007 06:11:56] PHP Notice: Undefined variable: livePreviewDivAdded in /var/www/thecafes/wp-content/plugins/live-comment-preview.php on line 24 so I decided to see if I could fix it. I think the problem is this line: $livePreviewDivAdded == false; I&#8217;m using this post to test that.]]></description>
			<content:encoded><![CDATA[<p>My PHP error logs are filling up with errors like this one:</p>
<p><samp>[05-May-2007 06:11:56] PHP Notice:  Undefined variable: livePreviewDivAdded in /var/www/thecafes/wp-content/plugins/live-comment-preview.php on line 24</samp></p>
<p>so I decided to see if I could fix it. I think the problem is this line:</p>
<p><code>$livePreviewDivAdded == false;</code></p>
<p>I&#8217;m using this post to test that. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/web-development/php/2007/05/05/hacking-live-preview/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>SemButtons: My First WordPress PlugIn</title>
		<link>http://www.elharo.com/blog/software-development/web-development/php/2007/04/16/sembuttons-my-first-wordpress-plugin/</link>
		<comments>http://www.elharo.com/blog/software-development/web-development/php/2007/04/16/sembuttons-my-first-wordpress-plugin/#comments</comments>
		<pubDate>Mon, 16 Apr 2007 18:50:13 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2007/04/16/sembuttons-my-first-wordpress-plugin/</guid>
		<description><![CDATA[I have written a WordPress plugin to rearrange the buttons in the post editor (the regular one, not the fancy WYSIWYG one) in a way more to my liking. It changes the names of some buttons, removes others I rarely use, and adds a few more I do use. The code involves some really awful [...]]]></description>
			<content:encoded><![CDATA[<p>I have written a WordPress plugin to rearrange the buttons in the post editor (the regular one, not the fancy WYSIWYG one) in a way more to my liking. It changes the names of some buttons, removes others I rarely use, and adds a few more I do use.</p>
<p>The code involves some really awful hacks and is a confusing mix of CSS, JavaScript, and PHP. I use CSS to hide the buttons I don&#8217;t like, and JavaScript to change the names of existing buttons and add new ones. PHP integrates this whole mess into WordPress. WordPress wasn&#8217;t really designed to support this level of customization. That&#8217;s why I have to use JavaScript to change the buttons after the page is loaded.<br />
<span id="more-1000550"></span></p>
<p>There are several features yet to be added:</p>
<ul>
<li>    Abbr and acronym need pop-ups requesting the title, like the link button has for <code>href</code>. </li>
<li>    The span button needs a pop-up requesting the class.</li>
<li>    I need to reorder the buttons. In particualr I want the more button at the end. </li>
<li>    It needs a user-accessible, non-code-level API for adjusting behavior.</li>
<li>    I need to figure out how not to load these scripts on pages that do not have the edit box? Currently these generate JavaScript errors. </li>
</ul>
<p>It may well only work in FireFox. I haven&#8217;t tested it in Internet Explorer or Opera, and it uses heavy CSS and DOM so there are likely cross-browser issues. In Safari, I can change the button names and add new buttons. However you can&#8217;t use CSS to style the buttons I&#8217;m removing. (Update: that was due to a bug in the CSS. It&#8217;s fixed now and this works in Safari too.) ) I may have to change that to use JavaScript too.</p>
<p>And I need to put this all in source code control, and use a decent IDE. Does Eclipse have a PHP plugin? Looks like there are <a href="http://www.google.com/search?btnG=Google+Search&amp;q=eclipse+php">several</a>. Which one should I use? </p>
<p>Anyway here&#8217;s iteration 0.1 of the plug-in:</p>
<pre><code>&lt;?php

/*
Plugin Name: SemButtons
Version: 0.1
Plugin URI: http://www.elharo.com/SemButtons.html
Description: This plugin makes the WordPress editor button bar more semantic.
Author: Elliotte Rusty Harold
Author URI: http://www.elharo.com/
Update:
*/

// SCRIPT INFO ///////////////////////////////////////////////////////////////////////////

/*
    SemButtons for WordPress
    © 2007 Elliotte Rusty Harold - GNU General Public License

    This has only been tested with Firefox. The JavaScript may not work on other browsers. 

    This WordPress plugin is released under the GNU General Public License.

    This WordPress plugin is released "as is". Without any warranty.

    ToDo list:

    Abbr and acronym need pop-ups requesting the title.
    span needs a popup requesting the class.
    Make buttons reorderable.
    Provide a user-accessible, non-code-level API for adjusting behavior.
    Add a Tidy button to make posts well-formed.
    Can we avoid hooking in on pages that do not have the edit box?
    Put this all in source code control, and use a decent IDE. 

*/

add_action('admin_head', 'remove_buttons');
add_action('admin_footer', 'change_names');
add_action('admin_footer', 'add_buttons');

function remove_buttons(){
    ?>
      &lt;style type="text/css">
         #ed_lookup, #ed_spell, #ed_del, #ed_ins, #ed_close { display:none;
      &lt;/style>
    &lt;?php
}

function change_names() {
  ?&gt;
    &lt;script type='text/javascript'>
        // Probably should separate ID and name into two separate arguments
        change_button('ed_em', 'em');
        change_button('ed_strong', 'strong');
        function change_button(id, name) {
            var button = document.getElementById(id)
            button.setAttribute('value', name)
        }
    &lt;/script>
  &lt;?php
}

function add_buttons(){
  ?&gt;
   &lt;script type="text/javascript">
    make_button('span', 3);
    make_button('cite', 2);
    make_button('abbr', 1);
    make_button('acronym', 0);

    // The i variable is an unbelievably ugly hack, perhaps
    // worthy of a daily WTF. The problem is one must pass
    // the distance from the end of the array because JavaScript
    // can't figure that out. PHP can't get the value from JavaScript.
    // There must be a better way to do this. Possibly it will
    // all fall out in the wash when I allow the position of individual
    // buttons to be specified.
    function make_button(name, i) {

        var toolbar = document.getElementById('ed_toolbar');

        edButtons[edButtons.length] =
        new edButton('ed_' + name,
          name,
          '&lt;' + name + '>',
          '&lt;/' + name + '>',
          's'
        );

        var button = document.createElement("input");
        button.setAttribute("value", name);
        button.setAttribute("id", "ed_" + name);
        button.setAttribute("class", "ed_button");
        button.setAttribute("type", "button");
        button.setAttribute("onClick", "edInsertTag(edCanvas, edButtons.length-1-" + i + ");");
        button.setAttribute("accesskey", name);
        toolbar.appendChild(button);
    }
  &lt;/script>
 &lt;?php
}
 ?&gt;</code></pre>
<p>Copy and paste this or <a href="http://www.elharo.com/SemButtons.txt">download it</a>. </p>
<p>Doubtless there are ways to improve this. Neither JavaScript nor PHP is my first language. Please comment if you see a simpler way to do anything. </p>
<p>Thanks to everyone on wp-hackers who helped out by answering questions and catching my mistakes. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/web-development/php/2007/04/16/sembuttons-my-first-wordpress-plugin/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>Will this &#8221; cause a problem&gt; and if so what?</title>
		<link>http://www.elharo.com/blog/software-development/web-development/php/2007/03/18/will-this-cause-a-problem-and-if-so-what/</link>
		<comments>http://www.elharo.com/blog/software-development/web-development/php/2007/03/18/will-this-cause-a-problem-and-if-so-what/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 14:54:45 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2007/03/18/will-this-cause-a-problem-and-if-so-what/</guid>
		<description><![CDATA[Testing for some plain text problems in WordPress title formatting. Hmm, looks like this one is OK. WordPress turns the double quote into a curly quote which does not terminate the attribute value. The greater than sign is escaped inside the attribute value. so the problems only arise if there&#8217;s real markup. The curly quote [...]]]></description>
			<content:encoded><![CDATA[<p>Testing for some plain text problems in WordPress title formatting. Hmm, looks like this one is OK. WordPress turns the double quote into a curly quote which does not terminate the attribute value. The greater than sign is escaped inside the attribute value. so the problems only arise if there&#8217;s real markup.</p>
<p>The curly quote may be an accidental fix. I&#8217;m not sure what would happen if I figured out how to publish a real straight double quote in a title. I wonder if there&#8217;s a preference for that somewhere?</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/web-development/php/2007/03/18/will-this-cause-a-problem-and-if-so-what/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Is This a Security Issue?</title>
		<link>http://www.elharo.com/blog/software-development/2007/03/18/is-this-a-security-issue/</link>
		<comments>http://www.elharo.com/blog/software-development/2007/03/18/is-this-a-security-issue/#comments</comments>
		<pubDate>Sun, 18 Mar 2007 11:36:46 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Software Development]]></category>
		<category><![CDATA[Web Development]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2007/03/18/is-this-a-security-issue/</guid>
		<description><![CDATA[More interesting results from yesterday&#8217;s experiments with dumping some markup in the title of a post and seeing what breaks. I noticed the markup made its way into the WordPress Admin section. Is that just because the markup I used (strong and span tags) was relatively innocuous or is there a potentially deeper problem? Let&#8217;s [...]]]></description>
			<content:encoded><![CDATA[<p>More interesting results from <a href="http://www.elharo.com/blog/software-development/web-development/2007/03/17/a-strong-test-for-markup-in-titles-summaries/">yesterday&#8217;s experiments</a> with dumping some markup in the title of a post and seeing what breaks. I noticed the markup made its way into the WordPress Admin section. Is that just because the markup I used (<code>strong</code> and <code>span</code> tags) was relatively innocuous or is there a potentially deeper problem? Let&#8217;s find out.<br />
<span id="more-1000450"></span></p>
<p>It&#8217;s not a big problem for this site, because I&#8217;m both the sole author and administrator, but it could be a problem on a site where author and administrator privileges are separated.</p>
<p>Yep, it&#8217;s a bug all right, at least in this version of WordPress. I haven&#8217;t tested it in the latest and greatest yet. (Update: several other people have now tested and verified the presence of the bug in the latest versions.) Links in titles can break the Posts box of the WordPress admin panel so it points to something other than the site it&#8217;s supposed to. I suspect this is a security hole too, though doubtless the WordPress folks will deny this. (They&#8217;re in denial about a lot of architectural flaws.) Still, I should be able to get them to fix this on non-security grounds so that doesn&#8217;t matter a great deal here. </p>
<p>However, now I start wondering if I can use this to inject JavaScript into the admin page? Hmm&#8230;</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/2007/03/18/is-this-a-security-issue/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>A Strong Test for Markup In Titles &amp; Summaries</title>
		<link>http://www.elharo.com/blog/software-development/web-development/php/2007/03/17/a-strong-test-for-markup-in-titles-summaries/</link>
		<comments>http://www.elharo.com/blog/software-development/web-development/php/2007/03/17/a-strong-test-for-markup-in-titles-summaries/#comments</comments>
		<pubDate>Sat, 17 Mar 2007 18:26:57 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2007/03/17/a-strong-test-for-markup-in-titles-summaries/</guid>
		<description><![CDATA[I&#8217;ve been hacking on Benjamin Smedberg&#8217;s Atom 1.0 plug-in for WordPress. I&#8217;ve added a preference panel for choosing between full text and summary feeds. Now I&#8217;ve fixed the double escaping of content in titles and summaries. (Escaped HTML is evil and should never have been allowed into Atom.) However I&#8217;m not sure how my hack [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve been hacking on Benjamin Smedberg&#8217;s Atom 1.0 plug-in for WordPress. I&#8217;ve added a preference panel for choosing between full text and summary feeds. Now I&#8217;ve fixed the double escaping of content in titles and summaries. (Escaped HTML is <strong>evil</strong> and should never have been allowed into Atom.) </p>
<p>However I&#8217;m not sure how my hack will react when posts contain markup in titles and summaries so I&#8217;m playing with that now. Hence this post. I may delete it once I&#8217;m convinced I&#8217;ve covered the various special cases well enough. </p>
<p>Things may look a little funny in the feed until I&#8217;m done since I&#8217;ll be deliberately breaking things to see how WordPress behaves.<br />
<span id="more-1000449"></span></p>
<p>So far it seems like WordPress&#8217;s titles are guaranteed to be plain text except for numeric character references. i.e. it strips tags. That&#8217;s good since it will make it easier to use real XHTML in the Atom titles. I need to check if the <code>the_title_rss()</code> function really promises that it will never include any tags in the string it returns.</p>
<p>Also it seems I&#8217;ve uncovered a bug in WordPress itself outside the feeds, as this title shows:</p>
<p><code>A &lt;strong style="color: green">Strong&lt;/strong> Test for Markup In Titles &amp; Summaries</code></p>
<p>The bug is in the default theme. I&#8217;m fixing it here and I&#8217;ve reported it to the WordPress folks. To reproduce it yourself, create a post with this string as the title:</p>
<p><code>A <strong style="color: green">Strong</strong> Test for Markup In Titles &amp; Summaries</code></p>
<p>Publish it and look at what WordPress puts out into the h1 header:</p>
<p><code>&lt;h1 class="single">&lt;a href="http://www.elharo.com/blog/software-development/web-development/2007/03/17/a-strong-test-for-markup-in-titles-summaries/" rel="bookmark" title="Permanent Link: A &lt;strong style="color: green">Strong&lt;/strong> Test for Markup In Titles &amp;amp; Summaries">A &lt;strong style="color: green">Strong&lt;/strong> Test for Markup In Titles &amp;amp; Summaries&lt;/a>&lt;/h1></code></p>
<p><code>the_title_rss()</code> function behaves appropriately. The bad text is probably coming from the_title and single_post_title though I haven&#8217;t verified that yet.</p>
<p>WordPress is stuffing the title text (including markup with < and > and &#8220;) into a title attribute without sanitizing it first. I suspect I could reproduce this just by using the &#8221; and > characters in a title without explicitly putting tags into my title.</p>
<p>Arguably this is a theme bug, but it is present in the WordPress default theme. Here&#8217;s the relevant code from the theme:</p>
<p><code>&lt;h2>&lt;a href="&lt;?php the_permalink() ?>" rel="bookmark" title="Permanent Link to &lt;?php the_title(); ?>">&lt;?php the_title(); ?>&lt;/a>&lt;/h2></code></p>
<p>I&#8217;ve updated my theme code so it no longer shares this bug. To do this, just change <code>Permanent Link to &lt;?php the_title(); ?></code> to <code>Permanent Link to &lt;?php the_title()_rss; ?></code>. You need to do this in three files, archive.php, single.php and index.php. </p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/web-development/php/2007/03/17/a-strong-test-for-markup-in-titles-summaries/feed/</wfw:commentRss>
		<slash:comments>4</slash:comments>
		</item>
		<item>
		<title>Notes from NY PHP Con</title>
		<link>http://www.elharo.com/blog/software-development/web-development/php/2006/06/15/notes-from-ny-php-con/</link>
		<comments>http://www.elharo.com/blog/software-development/web-development/php/2006/06/15/notes-from-ny-php-con/#comments</comments>
		<pubDate>Thu, 15 Jun 2006 15:37:49 +0000</pubDate>
		<dc:creator>Elliotte Rusty Harold</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.elharo.com/blog/software-development/web-development/2006/06/15/notes-from-ny-php-con/</guid>
		<description><![CDATA[Today I&#8217;m at the New York PHP Conference. It&#8217;s interesting. I wish I had a little more time to spend here this week, but I have to get ready for next week&#8217;s ABA conference in Bangor. I&#8217;d hoped to do some live reporting about this, but the wireless here at the Hoel New Yorker is [...]]]></description>
			<content:encoded><![CDATA[<p>Today I&#8217;m at the <a href="http://www.nyphpcon.com/">New York PHP Conference</a>. It&#8217;s interesting. I wish I had a little more time to spend here this week, but I have to get ready for next week&#8217;s ABA conference in Bangor. </p>
<p>I&#8217;d hoped to do some live reporting about this, but the wireless here at the Hoel New Yorker is quite flaky. It keeps coming in and out. This is often a problem at some of these old New York hotels that are full of iron in the walls.<br />
<span id="more-1000051"></span></p>
<h3>First Session: Getting Rich with PHP</h3>
<p>Really the second session of the day, but I didn&#8217;t get here in time for the first.</p>
<p>Yahoo&#8217;s Rasmus Lerdorf is talking about pretty much whatever he thinks is cool.</p>
<p>SimpleXML looks cool, though there are some obvious questions I have. The examples don&#8217;t consider the case where a book has no title or two titles when they write something like <code>book->title</code> to select the child title element of a book element. Hopefully this is addressed in non-toy examples. </p>
<p><a href="http://pecl.php.net/apc">APC cache</a> looks worth looking into. I could use this to do a better job with the Amazon links.</p>
<p>Yahoo&#8217;s JavaScript libraries look worth looking into. They&#8217;re BSD licensed.</p>
<p>There are major security holes in PHP when used with IE. UTF-7 decoding is a problem. Remember to always send a charset header by configuring php.ini appropriately.</p>
<p>Lerdorf won&#8217;t shop at small web stores any more because they&#8217;re too vulnerable to hackers. He&#8217;s found lots of PHP security flaws in these sites.</p>
<p>He suggests that a number of mistakes were made in the design of browsers, PHP, and the Web early on. I tend to agree. The problem is people keep hacking on top of and extending JavaScript, cookies, frames, and other misconceived kludges instead of working on improving support for things that were actually designed properly from the start like XForms and HTTP authentication. </p>
<h3>Quercus</h3>
<p>Caucho&#8217;s Quercus is cloning PHP 5/6 in Java. Interesting. Quercus can also call Java objects.</p>
<p>It enables distributed sessions which is completely the wrong answer and not very scalable. Quercus goes to great effort to work against HTTP and instead of doing much less work to work with it. </p>
<h3>XDebug</h3>
<p>The lack of a decent debugger has always been one of my problems with PHP, so I&#8217;m looking forward to Derek Rethans&#8217;s session on Xdebug. Another plus: the wireless network in this room seems to be more stable.</p>
<p>Xdebug is open source. Version 2 is almost ready.</p>
<p>So far it doesn&#8217;t seem so much a traditional stepping debugger as a way of generating more information in the error message when  a problem such as a file not found occurs. It also helps with echo printing.</p>
<pre>pear install xdebug-beta</pre>
<p>DBGp is a common debugging protocol for interactive debugging. There are other debuggers that support this, including ActiveState&#8217;s Komodo and a PHP plugin for Eclipse.</p>
<h3>Scalability</h3>
<p>Zend&#8217;s Gregory Stoltz</p>
<p>Scalability goes down as well as up! It&#8217;s fractal and self-similar. It needs to work for one guy in a garage as much as for a million customer bank. Very true. Too often I find products that are incomprehensible because they&#8217;re only designed for the Fortune 500 and big IT depts.</p>
<p>1. Distributed file systems (one giant NFS) are bad.</p>
<p>Rsync is your friend. (<a href="http://www.bombich.com/mactips/rsync.html">Learning rsync</a> has been on my TODO list for a year now.) </p>
<p>2. Blocking I/O is a problem.</p>
<p>3. Poor database design is a killer. e.g. MyISAM tables in MySQL</p>
<p>4. Failing to understand the web server and how PHP interacts with the web server. </p>
<p>5. Hanging up Apache. Big files should be sent by something else like tHttpd or Zend Download server.</p>
<p>6. Designing without scalability in mind.</p>
<p>7. Improperly dealing with database connections.</p>
<p>8. No development infrastructure. No process for going from staging to QA to production.</p>
<p>9. Failing to cache. (APC again).</p>
<p>10. Not knowing where to optimize. Know your requests per second number. Use a profiler.</p>
<h3>Random Notes</h3>
<p>I&#8217;m shocked to discover that PHP still doesn&#8217;t support Unicode. What is this, 1992?</p>
<p>I need to learn about PEAR.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.elharo.com/blog/software-development/web-development/php/2006/06/15/notes-from-ny-php-con/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
	</channel>
</rss>

