<?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>Chaos Engine &#187; PHP</title>
	<atom:link href="http://dev.modmancer.com/index.php/category/php/feed/" rel="self" type="application/rss+xml" />
	<link>http://dev.modmancer.com</link>
	<description>Sometimes I drink to forget.. but then I forget to drink..</description>
	<lastBuildDate>Mon, 06 Feb 2012 16:11:00 +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>My darkish Komodo and QT Creator color schemes</title>
		<link>http://dev.modmancer.com/index.php/2010/07/17/my-darkish-komodo-and-qt-creator-color-schemes/</link>
		<comments>http://dev.modmancer.com/index.php/2010/07/17/my-darkish-komodo-and-qt-creator-color-schemes/#comments</comments>
		<pubDate>Sat, 17 Jul 2010 16:43:58 +0000</pubDate>
		<dc:creator>akiko</dc:creator>
				<category><![CDATA[C++]]></category>
		<category><![CDATA[IDE]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Qt]]></category>
		<category><![CDATA[Qt Creator]]></category>
		<category><![CDATA[color scheme]]></category>
		<category><![CDATA[dark theme]]></category>
		<category><![CDATA[Komodo]]></category>
		<category><![CDATA[theme]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=81</guid>
		<description><![CDATA[You can download my Komodo and Qt Creator &#8216;dark&#8217; themes from: http://www.modmancer.com/downloads/dev_blog/dew_dark.ksf http://www.modmancer.com/downloads/dev_blog/dew_dark.xml For Komodo: copy the Komodo theme to your ~/.komodoide/5.2/schemes folder. For Qt Creator 2.0: copy the Qt Creator theme to your ~/.config/Nokia/qtcreator/styles folder.]]></description>
			<content:encoded><![CDATA[<p>You can download my Komodo and Qt Creator &#8216;dark&#8217; themes from:</p>
<p><a title="Komodo Theme" href="http://www.modmancer.com/downloads/dev_blog/dew_dark.ksf">http://www.modmancer.com/downloads/dev_blog/dew_dark.ksf</a><br />
<a title="Qt Theme" href="http://www.modmancer.com/downloads/dev_blog/dew_dark.xml"> http://www.modmancer.com/downloads/dev_blog/dew_dark.xml</a></p>
<p>For Komodo:<br />
copy the Komodo theme to your ~/.komodoide/5.2/schemes folder.</p>
<p>For Qt Creator 2.0:<br />
copy the Qt Creator theme to your ~/.config/Nokia/qtcreator/styles folder.<span id="more-81"></span></p>
<p><img class="alignnone" title="dew's dark Qt Creator theme " src="http://www.modmancer.com/downloads/dev_blog/style_qtcreator.png" alt="" width="400" /><!--more--></p>
<p><img class="alignnone" title="dew's dark komodo style" src="http://www.modmancer.com/downloads/dev_blog/style_komodo.png" alt="" width="400" /></p>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/07/17/my-darkish-komodo-and-qt-creator-color-schemes/feed/</wfw:commentRss>
		<slash:comments>2</slash:comments>
		</item>
		<item>
		<title>PHP and OpenSSL key format (&#8220;key parameter is not a valid public key&#8221;)</title>
		<link>http://dev.modmancer.com/index.php/2010/07/07/php-and-openssl-key-format/</link>
		<comments>http://dev.modmancer.com/index.php/2010/07/07/php-and-openssl-key-format/#comments</comments>
		<pubDate>Wed, 07 Jul 2010 22:27:34 +0000</pubDate>
		<dc:creator>akiko</dc:creator>
				<category><![CDATA[OpenSSL]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[Security]]></category>
		<category><![CDATA[openssl_pkey_get_public error]]></category>
		<category><![CDATA[private key]]></category>
		<category><![CDATA[public key]]></category>
		<category><![CDATA[ssh]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=73</guid>
		<description><![CDATA[PHP Warning: openssl_public_encrypt(): key parameter is not a valid public key in /script.php on line 175 If you experienced problems with OpenSSL and PHP, especially functions like openssl_pkey_get_public and openssl_pkey_get_private not willing to initialise from the provided public and private key strings, then you just need a few tweaks to get things running, because the [...]]]></description>
			<content:encoded><![CDATA[<p><strong><span style="color: #ff0000;">PHP Warning:  openssl_public_encrypt(): key parameter is not a valid public key in /script.php on line 175</span></strong></p>
<p>If you experienced problems with OpenSSL and PHP, especially functions like openssl_pkey_get_public and openssl_pkey_get_private not willing to initialise from the provided public and private key strings, then you just need a few tweaks to get things running, because the key formats are not compatible. If you are used to using ssh-keygen command line tool to generate your key pair, you will need to manually edit the public key in order to make it php openssl compatible. <span id="more-73"></span>For example your tmp_rsa.pub key looks like this:</p>
<pre>ssh-rsa ABABB3NzaC1yc2EAAAABIwAAAQEAtO9f1rn1plAH5flOotX0NYFjfQH7xt0dukt7v
8Nt3g7GFijXsoc+/+1SNSusHbj4LfBPXgKQJJoaZaCoQIWjBIXXKlODv+z2pSMBvvCPRThSFetqeh
/0pWcdiHPsmPOYpHby7zzwNKPCDyMrVrlC7FsaGmOC+F7FvSGA1PLdYEiOiJV/OmxQ
2HELrmhYPDc0vVPHfOETygNjjqMUuu8QwLvBgk3OUbT1m5NRNHMnpgPOID6+BBumLs
M0t8jOp1/AQG3pQFtlLBNETOMe7nuBPuE5pPhr5HbyV+9FUGI2FiYlNl7G+d8VlibR2wZkGHsa
p6mmzmJi64x4gNDdil+QDa== xyz@computer
</pre>
<p>That&#8217;s good for shell but not good enough for PHP openssl_pkey_get_public() function. You will need to manually edit it, and in the end it should look like this:</p>
<pre>-----BEGIN PUBLIC KEY-----
ABABB3NzaC1yc2EAAAABIwAAAQEAtO9f1rn1plAH5flOotX0NYFjfQH7xt0dukt7v
8Nt3g7GFijXsoc+/+1SNSusHbj4LfBPXgKQJJoaZaCoQIWjBIXXKlODv+z2pSMBvvC
PRThSFetqeh/0pWcdiHPsmPOYpHby7zzwNKPCDyMrVrlC7FsaGmOC+F7FvSGA1
PLdYEiOiJV/OmxQ2HELrmhYPDc0vVPHfOETygNjjqMUuu8QwLvBgk3OUbT1m5N
RNHMnpgPOID6+BBumLsM0t8jOp1/AQG3pQFtlLBNETOMe7nuBPuE5pPhr5HbyV
+9FUGI2FiYlNl7G+d8VlibR2wZkGHsap6mmzmJi64x4gNDdil+QDa==
-----END PUBLIC KEY-----
</pre>
<p>Don&#8217;t ask me why, it simply won&#8217;t work (or at least in my case didn&#8217;t work) if you don&#8217;t do it. It will still be complaining about some start line:</p>
<pre>error:0906D06C:PEM routines:PEM_read_bio:no start line
</pre>
<p>But that is obviously a trivial error, which you can ignore. I haven&#8217;t figured out yet how to avoid it.</p>
<p><strong>Another thing -</strong><br />
make sure you check for ssl errors after each ssl function. Here is a simple fn which can be helpful in your openSSL wrapper class:</p>
<pre>//! Checks for recent OpenSSL errors, and logs them.
//! \return true if no errors found, otherwise false.
public static function check_ssl_error()
{
  $ret = true;
  while ($msg = openssl_error_string())
  {
    // --- todo : log the error in your log file
    $ret = false;
  }
  return $ret;
}
</pre>
<p>So in the end you will init your openssl wrapper like this:</p>
<pre>$public_key_str = file_get_contents("./public.key");
$private_key_str = file_get_contents("./private.key");

MY_ASSERT($public_key_str, "Public key not found.");
MY_ASSERT($private_key_str, "Private key not found.");

$this-&gt;public_key = openssl_pkey_get_public($public_key_str);
OpenSSLWrapper::check_ssl_error();
OpenSSLWrapper::check_ssl_error();
$this-&gt;private_key = openssl_pkey_get_private($private_key_str);
OpenSSLWrapper::check_ssl_error();
</pre>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/07/07/php-and-openssl-key-format/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>Joomla! 1.0.x and PHP 5.3 meltdown</title>
		<link>http://dev.modmancer.com/index.php/2010/05/23/joomla-1-0-x-and-php-5-3-meltdown/</link>
		<comments>http://dev.modmancer.com/index.php/2010/05/23/joomla-1-0-x-and-php-5-3-meltdown/#comments</comments>
		<pubDate>Sun, 23 May 2010 12:14:31 +0000</pubDate>
		<dc:creator>riddler</dc:creator>
				<category><![CDATA[Joomla!]]></category>
		<category><![CDATA[PHP]]></category>
		<category><![CDATA[bug]]></category>

		<guid isPermaLink="false">http://dev.modmancer.com/?p=49</guid>
		<description><![CDATA[Here is the story: if you happen to run Joomla! 1.0, which you should not but what the heck, you&#8217;ll run into some weird issues if there is PHP 5.3.x running on your server. Everything will work fine except for one thing &#8211; there will be no content at al on your web site. And [...]]]></description>
			<content:encoded><![CDATA[<p>Here is the story: if you happen to run Joomla! 1.0, which you should  not but what the heck, you&#8217;ll run into some weird issues if there is  PHP 5.3.x running on your server. Everything will work fine except for  one thing &#8211; there will be no content at al on your web site. And no  matter what you do content will be invisible. Since Joomla! 1.0.x is no  longer being maintained you should either upgrade to Joomla! 1.5.x/1.6.x  or apply this little hack below:</p>
<p>Replace:</p>
<pre>$arguments = func_get_args();
</pre>
<p>with</p>
<pre>$arguments = func_get_args();
$numargs = func_num_args();
for($i=1; $i &lt; $numargs; $i++){
$arguments[$i] = &amp;$arguments[$i];
}
</pre>
<p>in includes/Cache/Lite/Function.php. This should be OK till&#8230; well,  till you upgrade. It&#8217;s not like they are going to fix it in Joomla! 1.0.</p>
]]></content:encoded>
			<wfw:commentRss>http://dev.modmancer.com/index.php/2010/05/23/joomla-1-0-x-and-php-5-3-meltdown/feed/</wfw:commentRss>
		<slash:comments>43</slash:comments>
		</item>
	</channel>
</rss>

