<?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>My Beloved PHP</title>
	<atom:link href="http://www.mybelovedphp.com/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.mybelovedphp.com</link>
	<description>The Art of Quick &#38; Dirty Programming</description>
	<lastBuildDate>Wed, 07 Dec 2011 15:10:12 +0000</lastBuildDate>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
	<generator>http://wordpress.org/?v=3.3.1</generator>
		<item>
		<title>Suppressing errors in PHP with control operator @</title>
		<link>http://www.mybelovedphp.com/2011/12/07/suppressing-errors-in-php/</link>
		<comments>http://www.mybelovedphp.com/2011/12/07/suppressing-errors-in-php/#comments</comments>
		<pubDate>Wed, 07 Dec 2011 15:08:17 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=125</guid>
		<description><![CDATA[Errors give valuable information, it&#8217;s worth paying attention to. Sometimes though when parsing content from different sources you can run into errors you can prevent, or you can&#8217;t solve. Reading something into simpleXML that isn&#8217;t 100% validated XML, because it&#8217;s encoded in ISO-8859 instead of UTF-8. Then use the PHP one error control operator @. When [...]]]></description>
			<content:encoded><![CDATA[<p>Errors give valuable information, it&#8217;s worth paying attention to.</p>
<p>Sometimes though when parsing content from different sources you can run into errors you can prevent, or you can&#8217;t solve.</p>
<p>Reading something into simpleXML that isn&#8217;t 100% validated XML, because it&#8217;s encoded in ISO-8859 instead of UTF-8.</p>
<p>Then use the PHP one error control operator @.</p>
<blockquote><p>When prepended to an expression in PHP, any error messages that might be generated by that expression will be ignored.</p></blockquote>
<p>Tha comes quite in hand in the following piece of code :</p>
<pre class="brush: php; title: ; notranslate">

$xml = @simplexml_load_file('rssfeed.xml');
</pre>
<p>No more errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2011/12/07/suppressing-errors-in-php/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Creating csv content</title>
		<link>http://www.mybelovedphp.com/2011/02/25/creating-csv-content/</link>
		<comments>http://www.mybelovedphp.com/2011/02/25/creating-csv-content/#comments</comments>
		<pubDate>Fri, 25 Feb 2011 14:50:03 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[Uncategorized]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=121</guid>
		<description><![CDATA[It is tempting to simply generate CSV data with writing comma-separated  array-values. Unfortunately this obvious way of doing turns out to be a bad idea. Often it seems to be working at first, but eventually you&#8217;ll be faced with annoying bugs, wrongly escaped data. Fortunately, PHP has a native function to write CSV values to [...]]]></description>
			<content:encoded><![CDATA[<p>It is tempting to simply generate CSV data with writing comma-separated  array-values.</p>
<pre class="brush: php; title: ; notranslate">
implode(&quot;,&quot;, $data_array);
</pre>
<p>Unfortunately this obvious way of doing turns out to be a bad idea. Often it seems to be working at first, but eventually you&#8217;ll be faced with annoying bugs, wrongly escaped data.</p>
<p>Fortunately, PHP has a native function to write CSV values to a file. </p>
<pre class="brush: php; title: ; notranslate">
fputcsv()
</pre>
<p>With a little trick you can use this function to write values to the screen.<br />
Use the built-in streamwrappers:</p>
<pre class="brush: php; title: ; notranslate">
 $outstream = fopen(&quot;php://output&quot;, 'w');
 fputcsv($outstream, $data_array, ',', '&quot;');
 fclose($outstream);
</pre>
<p>This will echo the data to the screen.<br />
Most people won&#8217;t know `php://output`. A pity it&#8217;s really powerful.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2011/02/25/creating-csv-content/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Fix broken UTF8 encoded RSS feeds in php</title>
		<link>http://www.mybelovedphp.com/2009/07/03/fix-broken-utf8-encoded-rss-feeds-in-php/</link>
		<comments>http://www.mybelovedphp.com/2009/07/03/fix-broken-utf8-encoded-rss-feeds-in-php/#comments</comments>
		<pubDate>Fri, 03 Jul 2009 19:21:23 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[RSS]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=99</guid>
		<description><![CDATA[Parsing feeds with the SimpleXML object is a walk in the park. But it can turn into a pain in the ass, when the provided XML feed isn&#8217;t correctly UTF8 encoded and I can tell you, there are some ugly ones out there in the wild. Parsing RSS feeds with SimpleXML Normally you can load [...]]]></description>
			<content:encoded><![CDATA[<p>Parsing feeds with the SimpleXML object is a walk in the park. But it can turn into a pain in the ass, when the provided XML feed isn&#8217;t correctly UTF8 encoded and I can tell you, there are some ugly ones out there in the wild.</p>
<h3>Parsing RSS feeds with SimpleXML</h3>
<p>Normally you can load and parse a feed as simple as:</p>
<pre class="brush: php; title: ; notranslate">
&lt;?
$feed = simplexml_load_file(rss.xml);

foreach ($feed-&gt;channel-&gt;item as $item){ ?&gt;
  &lt;h3&gt;&lt;?= $item-&gt;title ?&gt;&lt;/h3&gt;
  &lt;p&gt;&lt;?= $item-&gt;description ?&gt;&lt;/p&gt;
&lt;? } ?&gt;
</pre>
<p>That&#8217;s a standard. Sometimes though the XML is not proper UTF8 encoded, and the following nasty error occurs loading in into the SimpleXML object.</p>
<p><strong>Warning: simplexml_load_string() [function.simplexml-load-string]: Entity: line 6: parser error : Input is not proper UTF-8, indicate encoding ! Bytes: 0xEB 0x6C 0&#215;65 0&#215;20 in index.php on line 33</strong></p>
<h3>How to fix this</h3>
<p>First I tried to filter out the bad characters with str_replace, but that&#8217;s silly. I didn&#8217;t feel right. So I looked further and I stumbled on this quite unknow function iconv.</p>
<p>What&#8217;s the iconv module</p>
<blockquote><p>This module contains an interface to iconv character set conversion facility. With this module, you can turn a string represented by a local character set into the one represented by another character set, which may be the Unicode character set. Supported character sets depend on the iconv implementation of your system. </p></blockquote>
<p>The iconv function is available since PHP 4.0.5</p>
<pre class="brush: php; title: ; notranslate">
Description

string iconv ( string $in_charset , string $out_charset , string $str )

Performs a character set conversion on the string str from in_charset to out_charset .
</pre>
<h3>A better and safer way of parsing</h3>
<p>To be on the safe side, never read in a feed directly into a SimpleXML object, but do it this way:</p>
<pre class="brush: php; title: ; notranslate">
$feed = file_get_contents($feed_url);

$feed = iconv(&quot;UTF-8&quot;,&quot;UTF-8//IGNORE&quot;,$feed);

$feed = simplexml_load_string($feed);
</pre>
<p>There is another reason to do this. Reading in a feed with file_get_contents is much faster then loading it straight into a SimpleXML object , at least in PHP < 5.2x. </p>
<p>So following above instructions you will experience a performance gain and get rid of some nasty unexpected errors.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2009/07/03/fix-broken-utf8-encoded-rss-feeds-in-php/feed/</wfw:commentRss>
		<slash:comments>8</slash:comments>
		</item>
		<item>
		<title>Dating takes time, women are difficult but PHP?</title>
		<link>http://www.mybelovedphp.com/2009/03/18/formatting-dates-in-different-languages/</link>
		<comments>http://www.mybelovedphp.com/2009/03/18/formatting-dates-in-different-languages/#comments</comments>
		<pubDate>Wed, 18 Mar 2009 12:28:11 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[Apache]]></category>
		<category><![CDATA[Linux]]></category>
		<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=81</guid>
		<description><![CDATA[One of the big annoyances is having a blog or webpage in a certain language and that all the dates appear on your website in English. Of course you can choose just numbered formats, but sometimes the month or the day of the week in words adds that needed little extra polish. Formatting a date [...]]]></description>
			<content:encoded><![CDATA[<p>One of the big annoyances is having a blog or webpage in a certain language and that all the dates appear on your website in English. Of course you can choose just numbered formats, but sometimes the month  or the day of the week in words adds that needed little extra polish.</p>
<h5>Formatting a date in PHP</h5>
<p>Normally a date is formatted like this with the <strong>date() </strong>function:</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?= date('d-m-Y') ?&gt;
</pre>
<h5>Formatting a localised date in PHP</h5>
<p>But to format a date in your preferred language you need to use the <strong>strftime</strong> function:</p>
<blockquote><p>Format the time and/or date according to locale settings. Month and weekday names and other language-dependent strings respect the current locale set with setlocale().</p></blockquote>
<p>So we also need the <strong>setlocale()</strong><strong> </strong>function. This function let you set the language to use for the formatting. Your system or server should have them installed, otherwise it&#8217;s not possible! And most of them are not installed by default, although easily available.<br />
What does the <strong>setlocale() </strong>function do:</p>
<blockquote><p>Returns the new current locale, or FALSE if the locale functionality is not implemented on your platform, the specified locale does not exist or the category name is invalid.<br />
An invalid category name also causes a warning message. Category/locale names can be found in <a href="http://www.faqs.org/rfcs/rfc1766">RFC 1766</a> and <a href="http://www.w3.org/WAI/ER/IG/ert/iso639.htm">ISO 639</a>. Different systems have different naming schemes for locales.</p></blockquote>
<p>Tough pages to consume to be honest, but let&#8217;s go on.</p>
<h5>Locales settings on your server</h5>
<p>You can find the installed localisations in this file on a Linux server:</p>
<pre class="brush: xml; title: ; notranslate">
vi var/lib/locales/supported.d/local
</pre>
<p>My server only had one line by default!<br />
Simply add the one&#8217;s you&#8217;re missing. You can find all possible localisations in this file:</p>
<pre class="brush: xml; title: ; notranslate">
/usr/share/i18n/SUPPORTED
</pre>
<p>Don&#8217;t add them all: it will decrease performance.</p>
<p>So we&#8217;re nearly done:</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?
setlocale(LC_TIME,'nl-NL.UTF-8');
echo strftime('%s-$b-%y',time())
?&gt;
</pre>
<p>You need to enter the correct encoding aswell, otherwise it won&#8217;t work. This is dependent of the server settings, so it will influence the portability of your code a bit.<br />
Above code will give you the current date in Dutch, but we need another function to create localised dates from stored timestamps of the MySQL database.</p>
<h5>Converting stored Timestamps to PHP understandable format</h5>
<p>A MySQL timestamp value won&#8217;t work as a direct input to the strftime function. We need to convert it with another function: <strong>strtotime</strong>.</p>
<p>So we end up with something like this:</p>
<pre class="brush: php; title: ; notranslate">
&lt; ?
setlocale(LC_TIME,'nl-NL.UTF-8');
echo strftime('%A %d $b %y',strtotime($row-&gt;timestamp))
?&gt;
</pre>
<p><strong>Quite a long road to take for a boring date!</strong></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2009/03/18/formatting-dates-in-different-languages/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP 5.2.9 released</title>
		<link>http://www.mybelovedphp.com/2009/02/27/php-529-released/</link>
		<comments>http://www.mybelovedphp.com/2009/02/27/php-529-released/#comments</comments>
		<pubDate>Fri, 27 Feb 2009 11:15:32 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=75</guid>
		<description><![CDATA[The PHP development team would like to announce the immediate availability of PHP 5.2.9. This release focuses on improving the stability of the PHP 5.2.x branch with over 50 bug fixes, several of which are security related. All users of PHP are encouraged to upgrade to this release. Security Enhancements and Fixes in PHP 5.2.9: [...]]]></description>
			<content:encoded><![CDATA[<p>The PHP development team would like to announce the immediate availability of PHP 5.2.9.</p>
<p>This release focuses on improving the stability of the PHP 5.2.x branch with over 50 bug fixes, several of which are security related. All users of PHP are encouraged to upgrade to this release.</p>
<p>Security Enhancements and Fixes in PHP 5.2.9:</p>
<ul>
<li>Fixed security issue in imagerotate(), background colour isn&#8217;t validated correctly with a non truecolour image. Reported by Hamid Ebadi, APA Laboratory (Fixes CVE-2008-5498). (Scott)</li>
<li>Fixed a crash on extract in zip when files or directories entry names contain a relative path. (Pierre)</li>
<li>Fixed explode() behavior with empty string to respect negative limit. (Shire)</li>
<li>Fixed a segfault when malformed string is passed to json_decode(). (Scott)</li>
</ul>
<p>Further details about the PHP 5.2.9 can be found in the release announcement for 5.2.9, the full list of changes is available in the ChangeLog for PHP 5.<br />
<a href="http://www.php.net/index.php#id2009-02-26-1">Read more here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2009/02/27/php-529-released/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Netbeans: Code Completion for the Kohana Framework</title>
		<link>http://www.mybelovedphp.com/2009/01/27/netbeans-code-completion-for-the-kohana-framework/</link>
		<comments>http://www.mybelovedphp.com/2009/01/27/netbeans-code-completion-for-the-kohana-framework/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 15:02:04 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=50</guid>
		<description><![CDATA[In some earlier posts I&#8217;ve described ways to get Netbeans code completion working for CodeIgniter. In this post I will show you how to do the same for Kohana. Kohana is originally a PHP-5 only fork of CodeIgniter, but it has developed into much more. Now all code has been rewritten, so only the framework [...]]]></description>
			<content:encoded><![CDATA[<p>In some earlier posts I&#8217;ve described ways to get Netbeans code completion working for CodeIgniter. In this post I will show you how to do the same for Kohana.</p>
<p><a href="http://kohanaphp.com/">Kohana</a> is originally a PHP-5 only fork of CodeIgniter, but it has developed into much more. Now all code has been rewritten, so only the framework in concept is based on CodeIgniter. It has nice ORM, AUTH and Cache modules.</p>
<p>It&#8217;s easy to convert and actually I prefer Kohana, it&#8217;s more intuitive and extensible. The only drawback: Kohana needs PHP 5.2+, where CI can be used with PHP 4.</p>
<p>Kohana uses the PHP class autoload feature, no need to include class files manually, PHP will lookup the file on the included path automatically at the moment the class is mentioned.<br />
So when you write.<br />
<code>$this->db = New Database</code><br />
The Database class declaration file will be loaded by PHP automatically. This way of lading classes is also understandable for the auto completion parser of Netbeans.</p>
<p>This is in contrast to CodeIgniter, because there classes are loaded like:<br />
<code>$this->load->library('validation')</code></p>
<p>To achieve code completion for CodeIgniter in Netbeans we have to manually insert comments to help the auto completion parser map properties to classes:<br />
<code>* @property CI_DB_active_record $db</code></p>
<p>That&#8217;s not the case in Kohana, but there is another problem. Kohana uses Class suffixes. The classes are declared like Database_Core, but called like Database (without the _Core).<br />
To evade that we grap to the <a href="http://www.mybelovedphp.com/2009/01/27/netbeans-revisited-code-completion-for-code-igniter-ii/">netbeans_ci_code_autocompletion helper file</a> trick. But here we don&#8217;t write the property in comments, we simple do this:<br />
<code>Class Database extends Database_Core{}<br />
etc</code><br />
You can see the discussion on which this post is based in the <a href="http://forum.kohanaphp.com/comments.php?DiscussionID=230">Kohana forum</a>. There is even a script that will generate the file automatically, so it will do extensions aswell. Works for Zend, Netbeans and Eclipse. </p>
<p>You can find the script here:</p>
<p>http://www.mapledesign.co.uk/code/kohana-zend-autocomplete/</p>
<p>There is a nasty flaw though on the website, they mixed up names. The script should be activated by:</p>
<p>http://yoursite/zend_ide</p>
<p>And it will create a zend_autocomplete.php file in the cache directory. You can move that to the nbproject folder if you want.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2009/01/27/netbeans-code-completion-for-the-kohana-framework/feed/</wfw:commentRss>
		<slash:comments>15</slash:comments>
		</item>
		<item>
		<title>Netbeans revisited: Code Completion for Code-igniter II</title>
		<link>http://www.mybelovedphp.com/2009/01/27/netbeans-revisited-code-completion-for-code-igniter-ii/</link>
		<comments>http://www.mybelovedphp.com/2009/01/27/netbeans-revisited-code-completion-for-code-igniter-ii/#comments</comments>
		<pubDate>Tue, 27 Jan 2009 12:42:14 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=42</guid>
		<description><![CDATA[In an earlier post I described a way to achieve PHP code completion in Netbeans for the CodeIgniter framework. That way consisted of inserting property comments &#8211; which functioned as a helper for Netbeans to interprete the use &#8211; in every user application controller. This post will describe an even easier way, but first some [...]]]></description>
			<content:encoded><![CDATA[<p>In an <a href="http://www.mybelovedphp.com/2009/01/27/netbeans-revis…ode-igniter">earlier post</a> I described a way to achieve PHP code completion in <a href="http://www.netbeans.org/">Netbeans</a> for the CodeIgniter framework. That way consisted of inserting property comments &#8211; which functioned as a helper for Netbeans to interprete the use &#8211; in every user application controller. This post will describe an even easier way, but first some comments about the earlier post.</p>
<p>I showed some ways to automate the inserting of the comments, although writing phpDocumentor comments in Netbeans is supported natively. Just type /** and completion will be available like explained <a href="http://codeigniter.com/forums/viewthread/94145/#522295">here</a>. </p>
<p>It&#8217;s a good custom to write comments in phpDoc style, it will help users to understand your coding, and it will offer an extremely easy way to publish documentation about your programs. Read here more about <a href="http://www.phpdoc.org/">phpDOC</a>.</p>
<p>On more remark, I wrote to include the CodeIgniter path in the  Netbeans Global Include Path, it&#8217;s definitely better to do it on a project basis, so include it in the PHP Include Path in the Project Properties. Otherwise you will have CodeIgniter completion on projects that don&#8217;t use CI. <img src='http://www.mybelovedphp.com/wp-includes/images/smilies/icon_smile.gif' alt=':)' class='wp-smiley' /> </p>
<p>Now were getting to the core of this post. Probably the easiest way to achieve code completion is to put a file in the source path of Netbeans, but out of the CodeIgniter application or systems paths, let&#8217;s say a file called `netbeans_ci_code_completion.php`, but you can give it any name you want.</p>
<p>Make a text file with this content:<br />
<code><br />
< ?<br />
/**<br />
* @property CI_Loader $load<br />
* @property CI_Form_validation $form_validation<br />
* @property CI_Input $input<br />
* @property CI_Email $email<br />
* @property CI_DB_active_record $db<br />
* @property CI_DB_forge $dbforge<br />
* @property CI_Table $table<br />
* @property CI_Session $session<br />
* @property CI_FTP $ftp<br />
* ....<br />
 */<br />
Class Controller {<br />
}<br />
?><br />
</code></p>
<p>It doens&#8217;t matter how you call it, as long it has a php extension and is seen by Netbeans but not CodeIgniter. You can save it in a folder called temp, or even in the nbproject (netbeans project folder) folder. I worked for me, and I&#8217;ve haven&#8217;t noticed any drawbacks yet.</p>
<p>For most of my projects I have this project folder structure:</p>
<p><code><br />
/application<br />
/error<br />
/images<br />
/nbproject<br />
/scripts<br />
/styles<br />
index.php<br />
.htaccess<br />
</code></p>
<p>Putting it in the nbproject folder has the advantage that the file will not by copied to the server automatically, because that folder is already marked to be excluded in the synchronization settings.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2009/01/27/netbeans-revisited-code-completion-for-code-igniter-ii/feed/</wfw:commentRss>
		<slash:comments>50</slash:comments>
		</item>
		<item>
		<title>Netbeans revisited: Code Completion for Code-igniter</title>
		<link>http://www.mybelovedphp.com/2009/01/23/netbeans-revisited-code-completion-for-code-igniter/</link>
		<comments>http://www.mybelovedphp.com/2009/01/23/netbeans-revisited-code-completion-for-code-igniter/#comments</comments>
		<pubDate>Fri, 23 Jan 2009 14:53:01 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=31</guid>
		<description><![CDATA[Some software you like, you start working with it, and you feel like it&#8217;s made for you. Everyday you discover a little bit more of all the hidden powers. That&#8217;s the good thing about open source, there is so much power that has yet to be discovered. Most commercial software claim a lot of features [...]]]></description>
			<content:encoded><![CDATA[<p>Some software you like, you start working with it, and you feel like it&#8217;s made for you. Everyday you discover a little bit more of all the hidden powers. That&#8217;s the good thing about open source, there is so much power that has yet to be discovered. Most commercial software claim a lot of features in their marketing brochures and disappoint enormously in the end when you start working.</p>
<p>Netbeans 6.5 is good software, out of the box it offers code completion and validation for php, html, css, javascript including jquery, mootools etc.</p>
<p>Code Igniter is a rapid development framework for  PHP, it&#8217;s a flexible MVC-like system. Netbeans let you easily implements CodeIgniter powers, by offering code completion for CodeIgniter&#8217;s native Active record classes, libraries and helpers functions.</p>
<p><a href="http://www.mybelovedphp.com/wp-content/uploads/2009/01/codeigniter_netbeans_code.png"><img src="http://www.mybelovedphp.com/wp-content/uploads/2009/01/codeigniter_netbeans_code-300x226.png" alt="" title="codeigniter_netbeans_code" width="300" height="226" class="alignnone size-medium wp-image-37" /></a></p>
<p>You need to set it up though, and here we will explain how:</p>
<p>The first step is only neccesary if you have moved the system folder out of the Netbeans project source folder that contains the application folder, in case of a multi site set up or something.</p>
<p>Add the CodeIgniter System folder to the Netbeans Global Include Path:</p>
<p><code>Tools>Options>PHP>Add folder to  Global Include Path</code></p>
<p>This will give code completion for the helper functions and some more, but not for the Active record or database functions in a controller.</p>
<p><code>$this->db->...</code></p>
<p>To achieve more power, add this to your controller:<br />
<code><?<br />
/**<br />
* @property CI_Loader $load<br />
* @property CI_Form_validation $form_validation<br />
* @property CI_Input $input<br />
* @property CI_Email $email<br />
* @property CI_DB_active_record $db<br />
* @property CI_DB_forge $dbforge<br />
*/</p>
<p>class Stylist extends Controller<br />
</code><br />
Now you can type<br />
<code>$this->db->...</code><br />
or<br />
<code>$this->dbforge->...</code><br />
And you will get all available functions offered. Wow!</p>
<p>To make it really easy, add this to Tools->Options->Editor->Code Templates</p>
<ol>
<li>
<ol>
<li>New -> abbreviation: <code>db</code></li>
<li>Expanded text: `<code>$this->db-></code>`</li>
</ol>
</li>
<li>
<ol>
<li>New -> abbreviation: <code>`codei`</code></li>
<li>Expanded text: `
<p><code>/**<br />
* @property CI_Loader $load<br />
* @property CI_Form_validation $form_validation<br />
* @property CI_Input $input<br />
* @property CI_Email $email<br />
* @property CI_DB_active_record $db<br />
* @property CI_DB_forge $dbforge<br />
*/<br />
</code></p>
</li>
</ol>
</li>
</ol>
<p>Now you can easily insert the Codeigniter code just above your controller, by typing  `codei` and TAB<br />
or db TAB for $this->db-></p>
<p>That rocks, doesn`t it.</p>
<p>See also <a href='http://blogs.sun.com/netbeansphp/entry/screencat_about_class_property_variables'>here</a> and <a href="http://codeigniter.com/forums/viewthread/94145/">here</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2009/01/23/netbeans-revisited-code-completion-for-code-igniter/feed/</wfw:commentRss>
		<slash:comments>22</slash:comments>
		</item>
		<item>
		<title>Netbeans IDE &#8211; a new star(t) for PHP developers</title>
		<link>http://www.mybelovedphp.com/2008/12/09/netbeans-ide-a-new-start-for-php-developers/</link>
		<comments>http://www.mybelovedphp.com/2008/12/09/netbeans-ide-a-new-start-for-php-developers/#comments</comments>
		<pubDate>Tue, 09 Dec 2008 16:00:49 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[MySQL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[ide]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/?p=25</guid>
		<description><![CDATA[Recently Sun Microsystems updated there Netbeans branch of Integrated Development Environment (IDE) software to version 6.5 and introduced native support for PHP for the first time. Historically Netbeans has been first choice for JAVA-decelopers,  but now made the move to the broad pool of PHP developers. How stiff is the competition Eclipse PDT or PHP-Eclipse, [...]]]></description>
			<content:encoded><![CDATA[<p>Recently Sun Microsystems updated there Netbeans branch of Integrated Development Environment (IDE) software to version 6.5 and introduced native support for PHP for the first time. Historically Netbeans has been first choice for JAVA-decelopers,  but now made the move to the broad pool of PHP developers. How stiff is the competition Eclipse PDT or PHP-Eclipse, the other main open-source free IDE&#8217;S,  are facing?</p>
<p>Main features of NetBeans:</p>
<ul>
<li><strong>Strong integration with PHP</strong> as realtime syntax checking, a PHPDoc implementation, code-autocompletion, which also integrates with used defined classes.</li>
<li><strong>Version subcontrol:</strong> NetBeans offers support for Subversion, Mercurial en CVS out of the box.</li>
<li><strong>Database manipulation tools</strong> NetBeans offers native access to  MySQL databasesto create tables, update records etc. No need for phpMyAdmin, although ceretain tasks are faster done with the old favorite management tool.</li>
<li><strong>CSS and Javascript integration</strong>. Offers Javascript debugging and native support for the prototype, DOJO, MOOTOOLS, and JQUERY libraries.</li>
</ul>
<p>New features as support for SFTP and frameworks like Drupal or Symfony are coming very soon.</p>
<p>First impression is good: intuitive, reasonable speed and feature rich. CSS, HTML and MYSQL support is better than in Eclipse, although Aptana plugins can help.</p>
<p>Try it out yourself:<br />
<a href="http://www.netbeans.org/features/php/index.html">Netbeans</a></p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2008/12/09/netbeans-ide-a-new-start-for-php-developers/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>The end of PHP 4</title>
		<link>http://www.mybelovedphp.com/2008/09/21/the-end-of-php-4/</link>
		<comments>http://www.mybelovedphp.com/2008/09/21/the-end-of-php-4/#comments</comments>
		<pubDate>Sun, 21 Sep 2008 09:28:08 +0000</pubDate>
		<dc:creator>programmer</dc:creator>
				<category><![CDATA[PHP]]></category>

		<guid isPermaLink="false">http://www.mybelovedphp.com/2008/09/21/the-end-of-php-4/</guid>
		<description><![CDATA[On the magical date 8-8-2008 PHP 4.4.9 was released, the absolutely last release in the PHP4 branche. PHP 4.4.9 has some important security fixes: Updated PCRE to version 7.7. Fixed overflow in memnstr(). Fixed crash in imageloadfont when an invalid font is given. Fixed open_basedir handling issue in the curl extension. Fixed mbstring.func_overload set in [...]]]></description>
			<content:encoded><![CDATA[<p>On the magical date 8-8-2008 PHP 4.4.9 was released, the absolutely last release in the  PHP4 branche. PHP 4.4.9 has some important security fixes:</p>
<ul>
<li>Updated PCRE to version 7.7.</li>
<li>Fixed overflow in memnstr().</li>
<li>Fixed crash in imageloadfont when an invalid font is given.</li>
<li>Fixed open_basedir handling issue in the curl extension.</li>
<li>Fixed mbstring.func_overload set in .htaccess becomes global.</li>
</ul>
<p>Support for PHP4 has now officially ended.</p>
]]></content:encoded>
			<wfw:commentRss>http://www.mybelovedphp.com/2008/09/21/the-end-of-php-4/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
	</channel>
</rss>

