<?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>Technical stuff &#187; PHP</title>
	<atom:link href="http://www.tekkie.ro/tag/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.tekkie.ro</link>
	<description>Requirements are like water. They&#039;re easier to build on when they&#039;re frozen.</description>
	<lastBuildDate>Sat, 26 Nov 2011 11:35:50 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=</generator>
		<item>
		<title>PHP in the mobile ecosystem</title>
		<link>http://www.tekkie.ro/mobile-development/php-in-the-mobile-ecosystem/</link>
		<comments>http://www.tekkie.ro/mobile-development/php-in-the-mobile-ecosystem/#comments</comments>
		<pubDate>Fri, 28 Jan 2011 16:38:04 +0000</pubDate>
		<dc:creator>Georgiana</dc:creator>
				<category><![CDATA[Mobile development]]></category>
		<category><![CDATA[browser]]></category>
		<category><![CDATA[mobile]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tekkie.ro/?p=272</guid>
		<description><![CDATA[Device detection Mostly from the user agent. &#8212;&#62; http://detectmobilebrowsers.mobi/ &#8212;&#62;&#62;&#62; ugly code, good docs &#8212;&#62; http://www.deviceatlas.com/ &#8212;&#62;&#62;&#62; $99 / year for production &#8212;&#62; http://wurfl.sourceforge.net/ &#8212;&#62;&#62;&#62; open-source list of mobile devices for easy detection Don&#8217;t redirect to homepage, it&#8217;s not what the user wants. Beware: the screen sizes vary heavily, don&#8217;t make assumptions about this. Small [...]]]></description>
			<content:encoded><![CDATA[<h2>Device detection</h2>
<p>Mostly from the user agent.</p>
<p>&#8212;&gt; http://detectmobilebrowsers.mobi/</p>
<p>&#8212;&gt;&gt;&gt; ugly code, good docs</p>
<p>&#8212;&gt; http://www.deviceatlas.com/</p>
<p>&#8212;&gt;&gt;&gt; $99 / year for production</p>
<p>&#8212;&gt; http://wurfl.sourceforge.net/</p>
<p>&#8212;&gt;&gt;&gt; open-source list of mobile devices for easy detection</p>
<p>Don&#8217;t redirect to homepage, it&#8217;s not what the user wants.</p>
<p>Beware: the screen sizes vary heavily, don&#8217;t make assumptions about this.</p>
<p>Small demo code to show how easy it is in ZF-enabled apps to use a different layout, css and set of views.</p>
<p>Since ZF 1.11 one can use Zend_Http_UserAgent for easier browser detection + more info device-specific.</p>
<h2>UI Considerations</h2>
<p>- hover magic is unexpected for user</p>
<p>- HTML5, yay!</p>
<h2>Other</h2>
<p>jQTouch</p>
<h2>API improvements &amp; Security</h2>
<p>- use versioning in the URL of the API to separate users who did not upgrade their apps</p>
<p>- use signed URLs ?x=1&amp;signature=hash( secret, time limit, params)</p>
<p>- using https is difficult for the iPhone apps</p>
<h2>Deploy as native apps</h2>
<p>www.ipfaces.org : html on the server, supports php</p>
<p>www.phonegap.com</p>
<p>- not as good as the native apps</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tekkie.ro/mobile-development/php-in-the-mobile-ecosystem/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Download Curl library for CodeIgniter, ported to Kohana</title>
		<link>http://www.tekkie.ro/software/download-curl-library-for-codeigniter-ported-to-kohana/</link>
		<comments>http://www.tekkie.ro/software/download-curl-library-for-codeigniter-ported-to-kohana/#comments</comments>
		<pubDate>Wed, 22 Jul 2009 07:14:56 +0000</pubDate>
		<dc:creator>Georgiana</dc:creator>
				<category><![CDATA[Software]]></category>
		<category><![CDATA[CodeIgniter]]></category>
		<category><![CDATA[Kohana]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tekkie.ro/?p=209</guid>
		<description><![CDATA[I&#8217;ve ported the Curl library to Kohana, with kind permission of Alex Polski. You can download it here: ported to Kohana.]]></description>
			<content:encoded><![CDATA[<p>I&#8217;ve ported the Curl library to Kohana, with kind permission of <a title="Alex Polski" href="http://alexpolski.com/">Alex Polski</a>.</p>
<p>You can download it here: <a title="download Curl for Kohana" href="http://www.tekkie.ro/wp-content/uploads/2009/07/Curl.phps">ported to Kohana</a>.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.tekkie.ro/software/download-curl-library-for-codeigniter-ported-to-kohana/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>The PHP code conventions I use</title>
		<link>http://www.tekkie.ro/resources/the-php-code-conventions-i-use/</link>
		<comments>http://www.tekkie.ro/resources/the-php-code-conventions-i-use/#comments</comments>
		<pubDate>Fri, 22 May 2009 13:42:57 +0000</pubDate>
		<dc:creator>Georgiana</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[code conventions]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tekkie.ro/?p=166</guid>
		<description><![CDATA[&#60;?php // Did you notice the full-style opening PHP tags? /************************************************************** * Variable Naming conventions ************************************************************* * - Use data type as prefix inside the name * Eg: $sName instead of just $name * - Try to use as descriptive names as possible * Eg: $arProductList instead of just $arList **************************************************************/ /************************************************************** * Basic Datatypes [...]]]></description>
			<content:encoded><![CDATA[<pre class="brush: php">

&lt;?php
// Did you notice the full-style opening PHP tags?

/**************************************************************
 * Variable Naming conventions
 *************************************************************
 * - Use data type as prefix inside the name
 *          Eg: $sName instead of just $name
 * - Try to use as descriptive names as possible
 *         Eg: $arProductList instead of just $arList
 **************************************************************/

/**************************************************************
 * Basic Datatypes conventions
 **************************************************************/

// Strings
$sName = &quot;tekkie.ro&quot;;

// Integers
$iYear = 2004;

// Floats
$fAccountValue = 12.34;

// Booleans
$bCheck = true;

// Objects
$oProduct = new Product( $iProductId );

// Arrays
$aProperties = array (&#039;1&#039;, &#039;2&#039;, &#039;3&#039;);

/**************************************************************
* Spacing convention
**************************************************************/

$iSum = $iNumber1 + $iNumber2;
$sSum = $iNumber1 . $iNumber2; // space dot space before and after a variable
$sSum = &#039; Here we add a number &#039; . $iNumber1; // quote space dot space after a string
$sSum = $iNumber2 . &#039; Here we add a number &#039;; // space dot space quote before a string

/*
* Function definition convention
*
* A comment describing the function should precede its declaration.
* Begin with a slash followed by two stars.
* Give a one-line function synopsis, then a brief explanation.
*/

/**
 * bool hasPrices (obj oProduct [, bool bAlwaysTrue])
 *
 * @param Product the product we chack for prices
 * @param boolean
 * @return true if the Product has prices, false otherwise
*/

function hasPrices( $oProduct, $bAlwaysTrue = false ) {
    if ($bAlwaysTrue) return true;
    foreach ($oProduct-&gt;aProperties as $sProperty ) {
        if( &#039;price&#039; === $sProperty ) {  // use === as often as possible; put the string first for speed reasons
            return( true );
        } // .. if
    }
    return( false );
} // END func hasPrices()

/*
 * echo tag
 */

define (CR, &quot;\n&quot;);

echo 

	CR, &#039;Line1&lt;br /&gt;&#039;,

	CR, &#039;Line2&lt;br /&gt;&#039;,

	CR, &#039;Line3&lt;br /&gt;&#039;
;

/**************************************************************
 * Spacing convention
 **************************************************************/

// Code like this:

$sText = &#039;Time flies like an arrow.&#039;;
$sText .= &#039; Fruit flies like bananas.&#039;;

// Should be done in one statement instead of two:

$sText =
    &#039;Time flies like an arrow.&#039; .
    &#039; Fruit flies like bananas.&#039;
;

?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://www.tekkie.ro/resources/the-php-code-conventions-i-use/feed/</wfw:commentRss>
		<slash:comments>3</slash:comments>
		</item>
		<item>
		<title>PHP on Hormones: Rasmus Lerdorf talk</title>
		<link>http://www.tekkie.ro/resources/php-on-hormones-rasmus-lerdorf-talk/</link>
		<comments>http://www.tekkie.ro/resources/php-on-hormones-rasmus-lerdorf-talk/#comments</comments>
		<pubDate>Thu, 18 Dec 2008 10:26:09 +0000</pubDate>
		<dc:creator>Georgiana</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[tekkies]]></category>

		<guid isPermaLink="false">http://www.tekkie.ro/?p=78</guid>
		<description><![CDATA[Rasmus Lerdorf from Yahoo! talks at MySQL Conference &#38; Expo 2007. Starts with the beginning of PHP and continues to more advances stuff. Make sure you have the slides handy, too. Spaghetti code, otherwise known as Drupal.]]></description>
			<content:encoded><![CDATA[<p><a title="Rasmus Lerdorf resume" href="http://lerdorf.com/resume/">Rasmus Lerdorf</a> from Yahoo! talks at MySQL Conference &amp; Expo 2007. Starts with the beginning of PHP and continues to more advances stuff.</p>
<p>Make sure you <a title="PHP on Hormones: MySQL Conference slides" href="http://talks.php.net/show/mysql07key">have the slides handy</a>, too.</p>
<p><object width="320" height="270" data="http://blip.tv/play/AaGUe4a8EA" type="application/x-shockwave-flash"><param name="src" value="http://blip.tv/play/AaGUe4a8EA" /><param name="allowfullscreen" value="true" /></object></p>
<blockquote><p>Spaghetti code, otherwise known as Drupal.</p></blockquote>
]]></content:encoded>
			<wfw:commentRss>http://www.tekkie.ro/resources/php-on-hormones-rasmus-lerdorf-talk/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>JavaScript for PHP developers</title>
		<link>http://www.tekkie.ro/resources/javascript-for-php-developers/</link>
		<comments>http://www.tekkie.ro/resources/javascript-for-php-developers/#comments</comments>
		<pubDate>Wed, 29 Oct 2008 18:54:42 +0000</pubDate>
		<dc:creator>Georgiana</dc:creator>
				<category><![CDATA[Resources]]></category>
		<category><![CDATA[JavaScript]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.tekkie.ro/?p=44</guid>
		<description><![CDATA[If you're a PHP developer and you find it difficult to get used to all the insides of JavaScript, you might need PHP.JS, developed by Kevin van Zonneveld.]]></description>
			<content:encoded><![CDATA[<p>If you&#8217;re a PHP developer and you find it difficult to get used to all the insides of JavaScript, I think you need to take a look at <a href="http://phpjs.org/">PHP.JS</a>. It&#8217;s a brilliant tool initially developed by <a href="http://kevin.vanzonneveld.net/about/">Kevin van Zonneveld</a>, and which aims to port most of the usual PHP functions into equivalent JavaScript ones.</p>
<p>There are two ways of using this excellent codebase:</p>
<ul>
<li>grab all the <a title="one file containing all the available PHP.Js functions" href="http://kevin.vanzonneveld.net/code/php_equivalents/php.js">available PHP.JS functions</a> and use them as you need them</li>
<li>take each function you really need and put it into your JS codebase for the project</li>
</ul>
<p>The advantage of the second method is that you don&#8217;t have code you don&#8217;t need included all over the place, but it also means you will search each time the codebase to discover the code you need. Meanwhile, the first solution seems appropriate for the ones in a hurry, you just try to use one function like you&#8217;re accustomed in PHP and it&#8217;s there already included, you&#8217;re developing fast and safe, with just a small performance issue you can always address later.</p>
<p>Let&#8217;s say you&#8217;ve using the <a title="PHP long2ip function manual page" href="http://php.net/long2ip">long2ip</a> and <a title="PHP ip2long function manual page" href="http://www.php.net/ip2long">ip2long</a> PHP functions for storing IPs as numbers, and have a strong preference for using them for performance reasons, as all your IPs are stored as numbers in the database. What if you need similar functionality in JavaScript? Well, just <a title="PHP.JS long2ip function" href="http://phpjs.org/functions/long2ip:48e4b52c-c26c-4ba7-84f0-2d6486a786ee">take the code</a> <a title="PHP.JS ip2long function" href="http://phpjs.org/functions/ip2long:48e4b52b-3860-4f6c-830b-2d6486a786ee">you need</a> and use it! It&#8217;s that simple <img src='http://www.tekkie.ro/wp-includes/images/smilies/icon_smile.gif' alt=':-)' class='wp-smiley' /> </p>
]]></content:encoded>
			<wfw:commentRss>http://www.tekkie.ro/resources/javascript-for-php-developers/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

