{"id":27,"date":"2006-07-19T20:46:49","date_gmt":"2006-07-20T00:46:49","guid":{"rendered":"http:\/\/www.kralidis.ca\/blog\/2006\/07\/19\/php-implosion\/"},"modified":"2006-08-16T11:59:32","modified_gmt":"2006-08-16T15:59:32","slug":"php-implosion","status":"publish","type":"post","link":"https:\/\/www.kralidis.ca\/blog\/2006\/07\/19\/php-implosion\/","title":{"rendered":"PHP implosion"},"content":{"rendered":"<p>I&#8217;ve toyed with many different programming languages, development environments, application approaches and the like, and thus far I can be categorized as a <a title=\"REST\" href=\"http:\/\/en.wikipedia.org\/wiki\/REST\">REST<\/a> and <a title=\"Perl\" href=\"http:\/\/www.perl.com\/\">Perl <\/a>hack.  Perl is very dear to me.  I used Perl for the <a title=\"first major project in my career\" href=\"http:\/\/geodiscover.cgdi.ca\/gdp\/search?action=entrySummary&#038;entryType=productCollection&#038;entryId=28&#038;entryLang=en\">first major project in my career<\/a> and in a slew of other applications, including <a title=\"owsview\" href=\"http:\/\/cgdi-dev.geoconnections.org\/prototypes\/owsview\/\">owsview<\/a>.<\/p>\n<p>In the last couple of years, I&#8217;ve been moving to Java (servlets, JSP, etc.) for webapps, which has been successful for the most part, but haven&#8217;t budged from a scripting point of view from Perl when I needed something really lightweight and quick and dirty.<br \/>\nUntil now.  Enter <a title=\"PHP\" href=\"http:\/\/www.php.net\/\">PHP<\/a>. <!--more--><\/p>\n<p>I took on a (non-geospatial; well almost, I used <a title=\"geocoder.ca\" href=\"http:\/\/www.geocoder.ca\/\">geocoder.ca<\/a> to geocode addresses, and output the newsfeed as <a title=\"GeoRSS\" href=\"http:\/\/www.georss.org\/\">GeoRSS<\/a> \ud83d\ude42 ) <a title=\"web project\" href=\"http:\/\/www.paulfiorini.com\/\">web project<\/a> this year for a friend, which I initially developed as a bunch of webpages and Perl CGIs.  Worked fine.  As time went on, I wanted to abstract things much more, and get heavy into templating, and did I mention I needed to have this done yesterday?  So I looked for Perl templating systems.<\/p>\n<p>I ran into <a title=\"Template Toolkit\" href=\"http:\/\/www.template-toolkit.org\/\">Template Toolkit<\/a>, which looked like a viable solution at the time, but I found it a bit confusing as to which approach to take (tt has both offline and real-time template processing).<\/p>\n<p>I then checked out <a title=\"Mason\" href=\"http:\/\/www.masonhq.com\/\">Mason<\/a>, which I have used sparingly in the past, and got a bit farther along.  I have a slow machine, so the mod_perl include in my Apache config looked to be bogging down the server.<\/p>\n<p>Finally, I looked at PHP, which I was familiar enough with from when we initially developed cwc2 (thereafter <a title=\"chameleon\" href=\"http:\/\/chameleon.maptools.org\/index.phtml\">chameleon<\/a>) in 2002.  I already had a PHP install (to run this blog), and it seemed I needed a couple of more options built in, so a recompile\/install did the trick.<\/p>\n<p>From there, things went ridiculously fast.  All the Perl code was migrated to PHP in a matter of a day (if I didn&#8217;t use Perl strict, most of it could have went untouched).  And the templating.  In a day, I had templates of templates.  Very turnkey.  And driven by one config file.<\/p>\n<p>If you&#8217;re looking for a &#8216;but&#8217;, I&#8217;m afraid I don&#8217;t have one.  We now have an abstracted <a title=\"product\" href=\"http:\/\/www.kralidis.ca\/software\/teacherspet\/\">product <\/a>which can be deployed with minimal configuration.  All thanks to some PHP.<\/p>\n<p>I&#8217;m sure I haven&#8217;t even scratched the surface of what can be done, but for a simple, easy to maintain webapp, PHP has done the job.  It would be interesting to hear what others use when they really want to bang out a webapp.  At any rate, three cheers for PHP!<\/p>\n<link rel=\"stylesheet\" href=\"http:\/\/cdn.leafletjs.com\/leaflet-0.5\/leaflet.css\" \/>\n<!--[if lte IE 8]>\n  <link rel=\"stylesheet\" href=\"http:\/\/cdn.leafletjs.com\/leaflet-0.5\/leaflet.ie.css\" \/>\n<![endif]-->\n<script src=\"http:\/\/cdn.leafletjs.com\/leaflet-0.5\/leaflet.js\"><\/script>\n<style type=\"text\/css\">#map27 { width: 300px; height: 200px; }<\/style>\n\n<div id=\"map27\"><\/div>\n<script type=\"text\/javascript\">\n  var map27 = L.map('map27').setView([43.6666667, -79.4166667], 10);\n  L.tileLayer('http:\/\/{s}.tile.osm.org\/{z}\/{x}\/{y}.png', {\n      attribution: '&copy; <a href=\"http:\/\/osm.org\/copyright\">OpenStreetMap<\/a> contributors'\n  }).addTo(map27);\n<\/script>\n","protected":false},"excerpt":{"rendered":"<p>I&#8217;ve toyed with many different programming languages, development environments, application approaches and the like, and thus far I can be categorized as a REST and Perl hack. Perl is very dear to me. I used Perl for the first major project in my career and in a slew of other applications, including owsview. In the [&hellip;]<\/p>\n","protected":false},"author":2,"featured_media":0,"comment_status":"open","ping_status":"open","sticky":false,"template":"","format":"standard","meta":{"footnotes":""},"categories":[3,11],"tags":[],"class_list":["post-27","post","type-post","status-publish","format-standard","hentry","category-technology","category-web"],"_links":{"self":[{"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/posts\/27","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/users\/2"}],"replies":[{"embeddable":true,"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/comments?post=27"}],"version-history":[{"count":0,"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/posts\/27\/revisions"}],"wp:attachment":[{"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/media?parent=27"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/categories?post=27"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.kralidis.ca\/blog\/wp-json\/wp\/v2\/tags?post=27"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}