<?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>(function() { &#187; php</title>
	<atom:link href="http://maxb.net/blog/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://maxb.net/blog</link>
	<description>// MAXB.NET LABS</description>
	<lastBuildDate>Mon, 16 May 2011 19:12:58 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.2.1</generator>
		<item>
		<title>WsCrud – esempio di webservice con nusoap/php</title>
		<link>http://maxb.net/blog/2009/05/08/wscrud-esempio-di-webservice-con-nusoapphp/</link>
		<comments>http://maxb.net/blog/2009/05/08/wscrud-esempio-di-webservice-con-nusoapphp/#comments</comments>
		<pubDate>Fri, 08 May 2009 14:58:22 +0000</pubDate>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[nusoap]]></category>
		<category><![CDATA[soap]]></category>
		<category><![CDATA[webservice]]></category>
		<category><![CDATA[ws]]></category>

		<guid isPermaLink="false">http://maxb.net/blog/?p=356</guid>
		<description><![CDATA[LINK DEMO: wsdl nusoap docs client test DOWNLOAD ISTRUZIONI: Estrarre il pacchetto (htdocs del vostro webserver) configurare il file config/config.php creare il database e importare il dump presente in config/db.sql LIBRERIE DA SCARICARE A PARTE: adodb_lite simpletest nusoap Una volta &#8230; <a href="http://maxb.net/blog/2009/05/08/wscrud-esempio-di-webservice-con-nusoapphp/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<h2>LINK DEMO:</h2>
<ul>
<li><a href="http://maxb.net/scripts/wscrud/?wsdl" target="_blank">wsdl</a></li>
<li><a href="http://maxb.net/scripts/wscrud/" target="_blank">nusoap docs</a></li>
<li> <a href="http://maxb.net/scripts/wscrud/client/client.php" target="_blank">client</a></li>
<li><a href="http://maxb.net/scripts/wscrud/test/test.php" target="_blank">test</a></li>
</ul>
<p><a href="http://maxb.net/scripts/wscrud/wscrud.tar.gz">DOWNLOAD</a></p>
<h2>ISTRUZIONI:</h2>
<ul>
<li>Estrarre il pacchetto (htdocs del vostro webserver)</li>
<li>configurare il file config/config.php</li>
</ul>
<pre class="brush: php; title: ; notranslate">
	define('DB_HOST', '');//esempio localhost
	define('DB_USER', '');//esempio wscrud
	define('DB_NAME', '');//esempio wscrud
	define('DB_PWD', '');//esempio wscrud
	define('WSDL', '');//esempio http://maxb.net/scripts/wscrud/?wsdl
</pre>
<ul>
<li>creare il database e importare il dump presente in config/db.sql</li>
</ul>
<h2>LIBRERIE DA SCARICARE A PARTE:</h2>
<ol>
<li><a href="http://garr.dl.sourceforge.net/sourceforge/adodblite/adodb_lite1.42.tar.gz">adodb_lite</a></li>
<li><a href="http://garr.dl.sourceforge.net/sourceforge/simpletest/simpletest_1.0.1.tar.gz">simpletest</a></li>
<li><a href="http://garr.dl.sourceforge.net/sourceforge/nusoap/nusoap-0.7.3.zip">nusoap</a></li>
</ol>
<p style="text-align: left;"><a href="http://maxb.net/blog/wp-content/uploads/2009/05/wscrud.png"><img class="size-full wp-image-358" title="wscrud" src="http://maxb.net/blog/wp-content/uploads/2009/05/wscrud.png" alt="wscrud" width="173" height="261" /></a></p>
<p style="text-align: left;">Una volta scaricate ed estratte le librerie dovranno essere inserite nella directory libs come nell&#8217;immagine.</p>
<p style="text-align: left;">Non sono un grande esperto di servizi. Mi è capitato di farne e di usufruirne.</p>
<p style="text-align: left;">Questa volta ho deciso di estrapolare dall&#8217;ultimo lavoro una sorta di scheletro.</p>
<h2>Il servizio spiegato:</h2>
<h3>Inclusioni di librerie:</h3>
<pre class="brush: php; title: ; notranslate">
require_once(dirname(__FILE__) . '/libs/adodb_lite/adodb.inc.php');
require_once(dirname(__FILE__) . '/libs/nusoap-0.7.3/lib/nusoap.php');

require_once(dirname(__FILE__) . '/config/config.php');

require_once(dirname(__FILE__) . '/includes/exception.php');
require_once(dirname(__FILE__) . '/includes/application.php');
require_once(dirname(__FILE__) . '/includes/conn.php');
require_once(dirname(__FILE__) . '/includes/db.php');
</pre>
<h3>Inizializzazione server (vedere il config per capire le costanti):</h3>
<pre class="brush: php; title: ; notranslate">
$server = new nusoap_server();
$server-&gt;configureWSDL(APP_NAME_SPACE,APP_TARGET_NAME_SPACE);
$server-&gt;wsdl-&gt;schemaTargetNamespace = APP_TARGET_NAME_SPACE;
</pre>
<h3>Tipi complessi registrati:</h3>
<pre class="brush: php; title: ; notranslate">

$server-&gt;wsdl-&gt;addComplexType(
	'record',
	'complexType',
	'struct',
	'all',
	'',
	array(
		'id' =&gt; array('name'=&gt;'id','type'=&gt;'xsd:int'),
		'text' =&gt; array('name'=&gt;'text','type'=&gt;'xsd:string'),
	)
);

$server-&gt;wsdl-&gt;addComplexType(
	'array_of_record',
	'complexType',
	'array',
	'',
	'SOAP-ENC:Array',
	array(),
	array(array('ref'=&gt;'SOAP-ENC:arrayType','wsdl:arrayType'=&gt;'tns:record[]')),
	'tns:record'
);
</pre>
<h3>I metodi esposti:</h3>
<pre class="brush: php; title: ; notranslate">

$server-&gt;register(
	'put_record',
	array('text'=&gt;'xsd:string'),
	array('id'=&gt;'xsd:int'),
	APP_URN,
       APP_URN . '#put_record',
       'rpc',
       'encoded',
	''
);

function put_record($text){
	try{
		$app = new MyApplication();
		return $app-&gt;dao-&gt;put_record($text);
	}catch(Exception $e){
		return new soap_fault($e-&gt;getCode(), 'server', $e-&gt;getMessage());
	}
}

$server-&gt;register(
	'search_record',
	array(
		'id'=&gt;'xsd:int',
		'text'=&gt;'xsd:string',
	),
	array('return'=&gt;'tns:array_of_record'),
	APP_URN,
    APP_URN . '#search_record',
    'rpc',
    'encoded',
	''
);

function search_record($id, $text){
	try{
		$app = new MyApplication();
		return $app-&gt;dao-&gt;search_record($id, $text);
	}catch(Exception $e){
		return new soap_fault($e-&gt;getCode(), 'server', $e-&gt;getMessage());
	}
}

$server-&gt;register(
	'get_record',
	array('id'=&gt;'xsd:int'),
	array('return'=&gt;'tns:record'),
	APP_URN,
    APP_URN . '#get_record',
    'rpc',
    'encoded',
	''
);

function get_record($id){
	try{
		$app = new MyApplication();
		return $app-&gt;dao-&gt;get_record($id);
	}catch(Exception $e){
		return new soap_fault($e-&gt;getCode(), 'server', $e-&gt;getMessage());
	}
}

$server-&gt;register(
	'delete_record',
	array('id'=&gt;'xsd:int'),
	array('return'=&gt;'xsd:boolean'),
	APP_URN,
    APP_URN . '#delete_record',
    'rpc',
    'encoded',
	''
);

function delete_record($id){
	try{
		$app = new MyApplication();
		return $app-&gt;dao-&gt;delete_record($id);
	}catch(Exception $e){
		return new soap_fault($e-&gt;getCode(), 'server', $e-&gt;getMessage());
	}
}

$server-&gt;register(
	'update_record',
	array('id'=&gt;'xsd:int', 'text' =&gt; 'xsd:string'),
	array('return'=&gt;'xsd:boolean'),
	APP_URN,
    APP_URN . '#update_record',
    'rpc',
    'encoded',
	''
);

function update_record($id, $text){
	try{
		$app = new MyApplication();
		return $app-&gt;dao-&gt;update_record($id, $text);
	}catch(Exception $e){
		return new soap_fault($e-&gt;getCode(), 'server', $e-&gt;getMessage());
	}
}
</pre>
<h3>L&#8217;output del &#8220;server&#8221;:</h3>
<pre class="brush: php; title: ; notranslate">
$HTTP_RAW_POST_DATA = isset($HTTP_RAW_POST_DATA) ? $HTTP_RAW_POST_DATA : file_get_contents(&quot;php://input&quot;);
$server-&gt;service($HTTP_RAW_POST_DATA);
</pre>
<p><strong>Attenzione a quel file_get_contents(&#8220;php://input&#8221;);<br />
Ho <em>sclerato</em> parecchio per far girare questo servizio sul mio hosting.<br />
</strong></p>
<h3>IL CLIENT</h3>
<p>L&#8217;esempio del client VERAMENTE basico senza librerie senza divisioni.<br />
<strong>GREZZO</strong>. Anche l&#8217;html. Giusto il form e il meta per la codifica di invio dei dati.</p>
<pre class="brush: php; title: ; notranslate">
require_once(dirname(__FILE__) . '/../config/config.php');
error_reporting(E_ALL);
function get_client(){
	require_once(dirname(__FILE__) . '/../libs/nusoap-0.7.3/lib/nusoap.php');
	$url = WSDL;
	$client = new nusoap_client( $url, true );
	return $client;
}

$client = get_client();
$args = array();
$records = $client-&gt;call( 'search_record', $args );

if(isset($_POST['save'])){
	$_POST['text'] = stripslashes($_POST['text']);
	$client = get_client();
	if($_POST['id'] == 0){
		$args = array( 'text' =&gt; $_POST['text']);
		$result = $client-&gt;call( 'put_record', $args );
	}else{
		$args = array( 'id' =&gt; $_POST['id'], 'text' =&gt; $_POST['text']);
		$result = $client-&gt;call( 'update_record', $args );
	}
	header('Location:?do=index');
}
$do = isset($_GET['do']) ? $_GET['do'] : false;
$data = array('id' =&gt; 0, 'text' =&gt; '');
switch($do){
	case 'edit':
		$client = get_client();
		$args = array( 'id' =&gt; $_GET['id']);
		$data = $client-&gt;call( 'get_record', $args );
	break;
	case 'delete':
		$client = get_client();
		$args = array(  'id' =&gt; $_GET['id']);
		$result = $client-&gt;call( 'delete_record', $args );
		header('Location:?do=index');
	break;
}
</pre>
<pre class="brush: xml; title: ; notranslate">

&lt;meta http-equiv=&quot;Content-Type&quot; content=&quot;text/html;charset=utf-8&quot; /&gt;
&lt;form method=&quot;post&quot; action=&quot;#&quot;&gt;
&lt;p&gt;&lt;textarea name=&quot;text&quot; id=&quot;text&quot;&gt;&lt;?php echo $data['text']?&gt;&lt;/textarea&gt;&lt;/p&gt;
&lt;p&gt;
&lt;input type=&quot;hidden&quot; name=&quot;id&quot; id=&quot;id&quot; value=&quot;&lt;?php echo $data['id'] ?&gt;&quot; /&gt;
&lt;input type=&quot;submit&quot; name=&quot;save&quot; id=&quot;save&quot; value=&quot;save&quot; /&gt;
&lt;/p&gt;
&lt;/form&gt;
&lt;table&gt;
&lt;thead&gt;
&lt;tr&gt;
	&lt;th&gt;ID&lt;/th&gt;
	&lt;th&gt;TEXT&lt;/th&gt;
	&lt;th&gt;ACTIONS&lt;/th&gt;
&lt;tr&gt;
&lt;/thead&gt;
&lt;?php if(isset($records[0])){ ?&gt;
&lt;tbody&gt;
&lt;?php foreach($records as $k =&gt; $v){ ?&gt;
&lt;tr&gt;
	&lt;td&gt;&lt;?php echo $v['id']?&gt;&lt;/td&gt;
	&lt;td&gt;&lt;?php echo $v['text']?&gt;&lt;/td&gt;
	&lt;td&gt;
		&lt;a href=&quot;?do=edit&amp;amp;amp;id=&lt;?php echo $v['id']?&gt;&quot;&gt;edit&lt;/a&gt;
		&lt;a href=&quot;?do=delete&amp;amp;amp;id=&lt;?php echo $v['id']?&gt;&quot;&gt;del&lt;/a&gt;
	&lt;/td&gt;
&lt;tr&gt;
&lt;?php } ?&gt;
&lt;/tbody&gt;
&lt;?php } ?&gt;
&lt;table&gt;
</pre>
<p>All&#8217;interno della directory client troverete due client nativi (estensione soap del php5) :  client2.php e client3.php.<br />
Su questo hosting non girano.<br />
Provateli se volete. client3.php usa il metodo &#8220;ufficiale&#8221; per chiamare i metodi remoti. NON FUNZIONA!</p>
]]></content:encoded>
			<wfw:commentRss>http://maxb.net/blog/2009/05/08/wscrud-esempio-di-webservice-con-nusoapphp/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>MyPearLogComposite</title>
		<link>http://maxb.net/blog/2009/04/24/mypearlogcomposite/</link>
		<comments>http://maxb.net/blog/2009/04/24/mypearlogcomposite/#comments</comments>
		<pubDate>Fri, 24 Apr 2009 10:53:32 +0000</pubDate>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[snippets]]></category>
		<category><![CDATA[log]]></category>
		<category><![CDATA[pear]]></category>

		<guid isPermaLink="false">http://maxb.net/blog/?p=324</guid>
		<description><![CDATA[Pubblico una classe per effettuare il log composito con PEAR::Log. In sviluppo il log potrà essere usato in maniera abbondante (entrata/uscita dei metodi ad esempio). Questo causerà frequenti accessi al file di log. In produzione la maschera impostata nello switch &#8230; <a href="http://maxb.net/blog/2009/04/24/mypearlogcomposite/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Pubblico una classe per effettuare il log composito con PEAR::Log.<br />
In sviluppo il log potrà essere usato in maniera abbondante (entrata/uscita dei metodi ad esempio). Questo causerà frequenti accessi al file di log.<br />
In produzione la maschera impostata nello switch eviterà l&#8217;accesso al file per i log di tipo  PEAR_LOG_DEBUG (valore di default) ma manterrà i log di tipo ERROR e i log di tipo EMERG.<br />
In più per il log di tipo EMERG verrà inviata una mail. Il metodo _rotate della classe garantirà una rotazione del file al raggiungimento di N bytes (vedi costante LOG_SIZE_ROTATION).</p>
<pre class="brush: php; title: ; notranslate">
set_include_path(dirname(__FILE__) .'/lib/PEAR-1.7.2/:'.get_include_path());

require_once(dirname(__FILE__) . '/lib/PEAR-1.7.2/PEAR.php');
require_once(dirname(__FILE__) . '/lib/Log-1.11.3/Log.php');
require_once(dirname(__FILE__) . '/lib/Mail-1.2.0b1/Mail.php');

$env = 1;
switch($env){
	case 0://development
		define('MASK_ERROR', PEAR_LOG_DEBUG);
	break;
	case 1://production
		define('MASK_ERROR', PEAR_LOG_ERR);
	break;
}
define('APPLICATION_NAME', 'mylog');
define('MAIL_MASK_ERROR', PEAR_LOG_EMERG);
define('MAIL_WEBMASTER', 'MAILTO');
define('MAIL_FROM', 'MAILFROM');
define('LOG_FILE', dirname(__FILE__) . '/logs/'.APPLICATION_NAME.'.txt');
define('LOG_SIZE_ROTATION',1000000);

class MyPearLogComposite{

	public $logger;

	public function __construct(){
		$this-&gt;_check_rotate();
		$conf = array('mode' =&gt; 0600, 'timeFormat' =&gt; '%X %x');
		$file = &amp;Log::singleton('file', LOG_FILE, APPLICATION_NAME , $conf);
		$mask = Log::MAX(MASK_ERROR);
		$file-&gt;setMask($mask);
		$conf = array('from' =&gt; MAIL_FROM,'subject' =&gt; APPLICATION_NAME . ' Important log events');
		$mail = &amp;Log::singleton('mail', MAIL_WEBMASTER, APPLICATION_NAME, $conf);
		$mask = Log::MAX(MAIL_MASK_ERROR);
		$mail-&gt;setMask($mask);
		$this-&gt;logger = &amp;Log::singleton('composite');
		$this-&gt;logger-&gt;addChild($file);
		$this-&gt;logger-&gt;addChild($mail);
	}
	private function _check_rotate(){
		$size = @filesize(LOG_FILE);
		if($size &gt; LOG_SIZE_ROTATION)
        	$this-&gt;_rotate();

	}
	private function _rotate(){
		$file = LOG_FILE . '.' . date('Y-m-d');
        rename(LOG_FILE, $file);
	}
}

$log = new MyPearLogComposite();

$log-&gt;logger-&gt;log('log something');
$log-&gt;logger-&gt;log('log log');
$log-&gt;logger-&gt;log('log error', PEAR_LOG_ERR);
$log-&gt;logger-&gt;log('emergency', PEAR_LOG_EMERG);

//in development
//log file:
/*
12:32:30 24/04/2009 mylog [info] log something
12:32:30 24/04/2009 mylog [info] log log
12:32:30 24/04/2009 mylog [error] log error
12:32:30 24/04/2009 mylog [emergency] emergency
*/
//mail:
/*
To: MAILTO
Subject: mylog Important log events
From: MAILFROM
User-Agent: PEAR Log Package
Apr 24 12:40:25 mylog [emergency] emergency
*/

//in production
//log file:
/*
12:42:25 04/24/09 mylog [error] log error
12:42:25 04/24/09 mylog [emergency] emergency
*/
//mail:
/*
To: MAILTO
Subject: mylog Important log events
From: MAILFROM
User-Agent: PEAR Log Package
Apr 24 12:42:25 mylog [emergency] emergency
*/
</pre>
]]></content:encoded>
			<wfw:commentRss>http://maxb.net/blog/2009/04/24/mypearlogcomposite/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Proxy php vs Websense</title>
		<link>http://maxb.net/blog/2008/06/10/proxy-php-vs-websense/</link>
		<comments>http://maxb.net/blog/2008/06/10/proxy-php-vs-websense/#comments</comments>
		<pubDate>Tue, 10 Jun 2008 15:09:32 +0000</pubDate>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
				<category><![CDATA[hack]]></category>
		<category><![CDATA[php]]></category>
		<category><![CDATA[dilbert]]></category>
		<category><![CDATA[proxy]]></category>
		<category><![CDATA[websense]]></category>

		<guid isPermaLink="false">http://maxb.net/blog/?p=65</guid>
		<description><![CDATA[Se siete in una intranet e avete un proxy aziendale malefico tipo websense potreste avere problemi di cache oltre che di contenuto proibito! Ecco come nel mio wiki aziendale riesco a prendere il feed di dilbert (la mia vignetta quotidiana &#8230; <a href="http://maxb.net/blog/2008/06/10/proxy-php-vs-websense/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Se siete in una intranet e avete un proxy aziendale malefico tipo websense potreste avere problemi di cache oltre che di contenuto proibito!</p>
<p>Ecco come nel mio wiki aziendale riesco a prendere il feed di dilbert (la mia vignetta quotidiana di dilbert era ferma al 10 Maggio!):</p>
<p>* chiaramente questo proxy è implementato per trasmettere feed xml. non altro.</p>
<pre class="brush: php; title: ; notranslate">
header('Pragma: public');
header("Expires: Mon, 26 Jul 1997 05:00:00 GMT");                  // Date in the past
header('Last-Modified: '.gmdate('D, d M Y H:i:s') . ' GMT');
header('Cache-Control: no-store, no-cache, must-revalidate');     // HTTP/1.1
header('Cache-Control: pre-check=0, post-check=0, max-age=0');    // HTTP/1.1

header ("content-type: text/xml");

$params = array (
    'http' =&gt; array (
        'proxy' =&gt; 'tcp://proxy.azienda.it:80', // This needs to be the server and the port of the NTLM Authentication Proxy Server.
        'request_fulluri' =&gt; true,
        'header' =&gt; 'Cache-Control: no-store, no-cache, must-revalidate',
    )
);

$ctx = stream_context_create($params);
if(isset($_REQUEST['url'])){
    $url = $_REQUEST['url'];
    echo file_get_contents($url, false, $ctx);
}else{
    echo '&lt;?xml version="1.0" encoding="UTF-8"?&gt;&lt;nodata&gt;1&lt;/nodata&gt;';
}

exit ();
</pre>
<p><a href="http://maxb.net/blog/wp-content/uploads/2008/06/8713stripprint.gif"><img class="size-full wp-image-66" title="8713stripprint" src="http://maxb.net/blog/wp-content/uploads/2008/06/8713stripprint.gif" alt="" /></a></p>
]]></content:encoded>
			<wfw:commentRss>http://maxb.net/blog/2008/06/10/proxy-php-vs-websense/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Php Pattern</title>
		<link>http://maxb.net/blog/2008/06/07/php-pattern/</link>
		<comments>http://maxb.net/blog/2008/06/07/php-pattern/#comments</comments>
		<pubDate>Sat, 07 Jun 2008 19:04:42 +0000</pubDate>
		<dc:creator>Massimiliano Balestrieri</dc:creator>
				<category><![CDATA[php]]></category>
		<category><![CDATA[php pattern]]></category>

		<guid isPermaLink="false">http://maxb.net/blog/?p=59</guid>
		<description><![CDATA[Quanta saggezza. http://www.codinghorror.com/blog/archives/001119.html The TIOBE community index I linked above? It&#8217;s written in PHP. Wikipedia, which is likely to be on the first page of anything you search for these days? Written in PHP. Digg, the social bookmarking service so &#8230; <a href="http://maxb.net/blog/2008/06/07/php-pattern/">Continue reading <span class="meta-nav">&#8594;</span></a>]]></description>
			<content:encoded><![CDATA[<p>Quanta saggezza.</p>
<p><a href="http://www.codinghorror.com/blog/archives/001119.html" target="_blank">http://www.codinghorror.com/blog/archives/001119.html</a></p>
<blockquote><p>The <a href="http://www.tiobe.com/index.php/content/paperinfo/tpci/index.html" target="_blank">TIOBE community index</a> I linked above? It&#8217;s written in PHP. Wikipedia, which is likely to be on the first page of anything you search for these days? <a href="http://en.wikipedia.org/wiki/MediaWiki" target="_blank">Written in PHP</a>. Digg, the social bookmarking service so wildly popular that a front page link can crush the beefiest of webservers? <a href="http://www.oreillynet.com/onlamp/blog/2006/04/digg_phps_scalability_and_perf.html" target="_blank">Written in PHP</a>. WordPress, arguably the most popular blogging solution available at the moment? <a href="http://en.wikipedia.org/wiki/WordPress" target="_blank">Written in PHP</a>. YouTube, the most widely known video sharing site on the internet? <a href="http://www.procata.com/blog/archives/2006/11/09/why-is-php-code-considered-hard-to-maintain/" target="_blank">Written in PHP</a>. Facebook, the current billion-dollar zombie-poking social networking darling of venture capitalists everywhere? <a href="http://blog.facebook.com/blog.php?post=2356432130" target="_blank">Written in PHP</a>. (<span style="color: red;">Update:</span> While YouTube was originally written in PHP, it migrated to Python fairly early on, per Matt Cutts and Guido van Rossum.)<br />
<strong><br />
Notice a pattern here?</strong></p>
<p>Some of the largest sites on the internet &#8212; sites you probably interact with on a daily basis &#8212; are written in PHP. If PHP sucks so profoundly, <em>why is it powering so much of the internet?</em></p>
<p>The only conclusion I can draw is that <strong>building a compelling application is far more important than choice of language.</strong> While PHP wouldn&#8217;t be my choice, and if pressed, I might argue that it should <em>never</em> be the choice for any rational human being sitting in front of a computer, I can&#8217;t argue with the results.
</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://maxb.net/blog/2008/06/07/php-pattern/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

