<?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>Evolution Systems &#187; PHP</title>
	<atom:link href="http://evolution-systems.co.uk/category/matts-blog/web-development/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://evolution-systems.co.uk</link>
	<description>Web Development, Software Development and Linux Consultancy services</description>
	<lastBuildDate>Fri, 08 Aug 2025 09:18:44 +0000</lastBuildDate>
	<language>en-US</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>https://wordpress.org/?v=4.1.42</generator>
	<item>
		<title>Codeigniter REST server with Tank auth</title>
		<link>http://evolution-systems.co.uk/2014/04/18/codeigniter-rest-server-with-tank-auth/</link>
		<comments>http://evolution-systems.co.uk/2014/04/18/codeigniter-rest-server-with-tank-auth/#comments</comments>
		<pubDate>Fri, 18 Apr 2014 10:36:07 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[codeigniter]]></category>
		<category><![CDATA[Matts Blog]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/?p=736</guid>
		<description><![CDATA[I&#8217;ve just had the need within codeigniter to integrate basic auth in Phil Sturgeons REST server with the tank auth authentication library. As it turns out it is quite a trivial task. In application/libraries/REST_Controller.php find the following function: And replace it with the following: If you are not auto loading the tank auth library, be sure [&#8230;]]]></description>
				<content:encoded><![CDATA[<p>I&#8217;ve just had the need within codeigniter to integrate basic auth in <a href="https://github.com/philsturgeon/codeigniter-restserver">Phil Sturgeons REST server</a> with the <a href="http://konyukhov.com/soft/tank_auth/">tank auth authentication library</a>. As it turns out it is quite a trivial task.</p>
<p>In application/libraries/REST_Controller.php find the following function:</p>
<pre class="brush: php; title: ; notranslate">protected function _check_login($username = '', $password = NULL)&lt;/pre&gt;
 {
 if (empty($username))
 {
 return FALSE;
 }

 $auth_source = strtolower($this-&gt;config-&gt;item('auth_source'));

if ($auth_source == 'ldap')
 {
 log_message('debug', 'performing LDAP authentication for $username');
 return $this-&gt;_perform_ldap_auth($username, $password);
 }

$valid_logins = &amp; $this-&gt;config-&gt;item('rest_valid_logins');

if ( ! array_key_exists($username, $valid_logins))
 {
 return FALSE;
 }

// If actually NULL (not empty string) then do not check it
 if ($password !== NULL AND $valid_logins[$username] != $password)
 {
 return FALSE;
 }
 return TRUE;
 }</pre>
<p>And replace it with the following:</p>
<pre class="brush: php; title: ; notranslate">protected function _check_login($username = '', $password = NULL)&lt;/pre&gt;
{
 if (empty($username))
 {
 return FALSE;
 }
 return $this-&gt;tank_auth-&gt;login($username, $password, FALSE, FALSE, TRUE);
 }</pre>
<p>If you are not auto loading the tank auth library, be sure to do that in your constructor as well.</p>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2014/04/18/codeigniter-rest-server-with-tank-auth/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Nice PHP print_r Formatted Table Function</title>
		<link>http://evolution-systems.co.uk/2012/01/16/nice-php-print_r-formatted-table-function/</link>
		<comments>http://evolution-systems.co.uk/2012/01/16/nice-php-print_r-formatted-table-function/#comments</comments>
		<pubDate>Mon, 16 Jan 2012 18:58:46 +0000</pubDate>
		<dc:creator><![CDATA[Matthew Jakeman]]></dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[PHP Functions]]></category>
		<category><![CDATA[print_r]]></category>

		<guid isPermaLink="false">http://evolution-systems.co.uk/?p=654</guid>
		<description><![CDATA[Whilst looking through php.net I stumbled across the following function that will print out an array in a nicely formatted table. When dealing with lots of nested array something like this makes it much easier to see all of the data contained within an array.]]></description>
				<content:encoded><![CDATA[<p>Whilst looking through php.net I stumbled across the following function that will print out an array in a nicely formatted table. When dealing with lots of nested array something like this makes it much easier to see all of the data contained within an array.</p>
<pre class="brush: php; title: ; notranslate">
&lt;?php
 function print_nice($elem,$max_level=10,$print_nice_stack=array()){
 if(is_array($elem) || is_object($elem)){
 if(in_array(&amp;$elem,$print_nice_stack,true)){
 echo &quot;&lt;font color=red&gt;RECURSION&lt;/font&gt;&quot;;
 return;
 }
 $print_nice_stack[]=&amp;$elem;
 if($max_level&lt;1){
 echo &quot;&lt;font color=red&gt;nivel maximo alcanzado&lt;/font&gt;&quot;;
 return;
 }
 $max_level--;
 echo &quot;&lt;table border=1 cellspacing=0 cellpadding=3 width=100%&gt;&quot;;
 if(is_array($elem)){
 echo '&lt;tr&gt;&lt;td colspan=2  style=&quot;background-color:#333333;&quot;&gt;&lt;strong&gt;&lt;font  color=white&gt;ARRAY&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;';
 }else{
 echo '&lt;tr&gt;&lt;td colspan=2 style=&quot;background-color:#333333;&quot;&gt;&lt;strong&gt;';
 echo '&lt;font color=white&gt;OBJECT Type: '.get_class($elem).'&lt;/font&gt;&lt;/strong&gt;&lt;/td&gt;&lt;/tr&gt;';
 }
 $color=0;
 foreach($elem as $k =&gt; $v){
 if($max_level%2){
 $rgb=($color++%2)?&quot;#888888&quot;:&quot;#BBBBBB&quot;;
 }else{
 $rgb=($color++%2)?&quot;#8888BB&quot;:&quot;#BBBBFF&quot;;
 }
 echo '&lt;tr&gt;&lt;td valign=&quot;top&quot; style=&quot;width:40px;background-color:'.$rgb.';&quot;&gt;';
 echo '&lt;strong&gt;'.$k.&quot;&lt;/strong&gt;&lt;/td&gt;&lt;td&gt;&quot;;
 print_nice($v,$max_level,$print_nice_stack);
 echo &quot;&lt;/td&gt;&lt;/tr&gt;&quot;;
 }
 echo &quot;&lt;/table&gt;&quot;;
 return;
 }
 if($elem === null){
 echo &quot;&lt;font color=green&gt;NULL&lt;/font&gt;&quot;;
 }elseif($elem === 0){
 echo &quot;0&quot;;
 }elseif($elem === true){
 echo &quot;&lt;font color=green&gt;TRUE&lt;/font&gt;&quot;;
 }elseif($elem === false){
 echo &quot;&lt;font color=green&gt;FALSE&lt;/font&gt;&quot;;
 }elseif($elem === &quot;&quot;){
 echo &quot;&lt;font color=green&gt;EMPTY STRING&lt;/font&gt;&quot;;
 }else{
 echo str_replace(&quot;\n&quot;,&quot;&lt;strong&gt;&lt;font color=red&gt;*&lt;/font&gt;&lt;/strong&gt;&lt;br&gt;\n&quot;,$elem);
 }
 }
 ?&gt;
</pre>
]]></content:encoded>
			<wfw:commentRss>http://evolution-systems.co.uk/2012/01/16/nice-php-print_r-formatted-table-function/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>
