<?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>dotvoid.com &#187; integration</title>
	<atom:link href="http://www.dotvoid.com/tag/integration/feed/" rel="self" type="application/rss+xml" />
	<link>http://www.dotvoid.com</link>
	<description>Experiments and thoughts in PHP and javascript</description>
	<lastBuildDate>Tue, 11 Oct 2011 12:49:15 +0000</lastBuildDate>
	<generator>http://wordpress.org/?v=2.9.2</generator>
	<language>en</language>
	<sy:updatePeriod>hourly</sy:updatePeriod>
	<sy:updateFrequency>1</sy:updateFrequency>
			<item>
		<title>Gartner report on PHP</title>
		<link>http://www.dotvoid.com/2010/01/gartner-report-on-php/</link>
		<comments>http://www.dotvoid.com/2010/01/gartner-report-on-php/#comments</comments>
		<pubDate>Wed, 13 Jan 2010 08:23:54 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[integration]]></category>

		<guid isPermaLink="false">http://www.dotvoid.com/?p=435</guid>
		<description><![CDATA[A new Gartner report about PHP &#8211; PHP: Past, present and Future is mentioned in the last Zend newsletter. Even though I remain somewhat sceptical towards similar reports it is good to see that even Gartner is catching up. What they say actually do have an impact.
"PHP has been a cornerstone technology on the Web [...]]]></description>
			<content:encoded><![CDATA[<p>A new Gartner report about PHP &#8211; <a href="http://blogs.gartner.com/mark_driver/2009/12/03/php-past-present-and-future/">PHP: Past, present and Future</a> is mentioned in the last Zend newsletter. Even though I remain somewhat sceptical towards similar reports it is good to see that even Gartner is catching up. What they say actually do have an impact.</p>
<pre>"PHP has been a cornerstone technology on the Web for more than a
decade. While its adoption among mainstream IT organizations has been
limited in the past, many corporate application development (AD)
projects are discovering the unique benefits of PHP."</pre>
<p>One particular advice is especially interesting for large companies.</p>
<pre>"Consider PHP as a supporting technology in a broader portfolio of AD
technologies, where it can provide a specialized toolset for building
Web graphical user interface (GUI) front ends to service-oriented
architecture (SOA) back-end services."</pre>
<p>PHP is a fantastic tool for building rich web applications. It&#8217;s extensibility makes it versatile and extremely easy to integrate with modern integration solutions as Web Methods, legacy systems or just about any database technology.</p>
<p>To me &#8211; this has always been where PHP really shines.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2010/01/gartner-report-on-php/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;title=Gartner+report+on+PHP" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;t=Gartner+report+on+PHP" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;title=Gartner+report+on+PHP&amp;summary=A%20new%20Gartner%20report%20about%20PHP%20-%20PHP%3A%20Past%2C%20present%20and%20Future%20is%20mentioned%20in%20the%20last%20Zend%20newsletter.%20Even%20though%20I%20remain%20somewhat%20sceptical%20towards%20similar%20reports%20it%20is%20good%20to%20see%20that%20even%20Gartner%20is%20catching%20up.%20What%20they%20say%20actually%20do%20have%20an%20impact.%0D%0A%22PHP%20has%20been%20a%20cornerstone%20technolo&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2010/01/gartner-report-on-php/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2010/01/gartner-report-on-php/&amp;title=Gartner+report+on+PHP" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Gartner+report+on+PHP+-+http://b2l.me/wt2ya&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2010/01/gartner-report-on-php/feed/</wfw:commentRss>
		<slash:comments>5</slash:comments>
		</item>
		<item>
		<title>Generating Excel files with PHP</title>
		<link>http://www.dotvoid.com/2007/07/generating-excel-files-with-php/</link>
		<comments>http://www.dotvoid.com/2007/07/generating-excel-files-with-php/#comments</comments>
		<pubDate>Tue, 10 Jul 2007 09:10:06 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[integration]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=229</guid>
		<description><![CDATA[I&#8217;m on this project at work where we need to create an excel file and send it via email or ftp to a recipient. The normal answer to this is to create a comma separated file and name it .xls and excel will work it out. However, that only works if you open it directly [...]]]></description>
			<content:encoded><![CDATA[<p>I&#8217;m on this project at work where we need to create an excel file and send it via email or ftp to a recipient. The normal answer to this is to create a comma separated file and name it .xls and excel will work it out. However, that only works if you open it directly through an http request and are able to set the http headers correctly. I&#8217;m not going to elaborate on the requirements but they want an excel file generated and sent to them. They don&#8217;t want to and can&#8217;t download the file themselves.</p>
<p>Naturally I went to the almighty Google for the answer. There are a few excel writers written out there. I found a tutorial on <a href="http://www.phphacks.com/content/view/26/33/">using PEAR Spreadsheet_Excel_Writer</a> and an <a href="http://www.phpclasses.org/browse/package/1919.html">MS-Excel Stream Handler class</a> to mention two solutions.</p>
<p>I found one piece of code floating around numerous places that I fell for. I am not sure about the original source for this code though. Extremely simple.</p>
<pre>function xlsBOF() {
    return pack("ssssss", 0x809, 0x8, 0x0, 0x10, 0x0, 0x0);
}

function xlsEOF() {
    return pack("ss", 0x0A, 0x00);
}

function xlsWriteNumber($Row, $Col, $Value) {
    return pack("sssss", 0x203, 14, $Row, $Col, 0x0)
      .pack("d", $Value);
}

function xlsWriteLabel($Row, $Col, $Value ) {
    $L = strlen($Value);
    return pack("ssssss", 0x204, 8 + $L, $Row, $Col, 0x0, $L)
      .$Value;
}</pre>
<p>I liked it because it did what I wanted with a minimum of fuss. I was happy until I realized I don&#8217;t understand it enough to be able to set the character set. Right now question marks appear in the texts instead of national Swedish characters as å, ä and ö.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2007/07/generating-excel-files-with-php/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2007/07/generating-excel-files-with-php/&amp;title=Generating+Excel+files+with+PHP" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2007/07/generating-excel-files-with-php/&amp;t=Generating+Excel+files+with+PHP" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2007/07/generating-excel-files-with-php/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2007/07/generating-excel-files-with-php/&amp;title=Generating+Excel+files+with+PHP&amp;summary=I%27m%20on%20this%20project%20at%20work%20where%20we%20need%20to%20create%20an%20excel%20file%20and%20send%20it%20via%20email%20or%20ftp%20to%20a%20recipient.%20The%20normal%20answer%20to%20this%20is%20to%20create%20a%20comma%20separated%20file%20and%20name%20it%20.xls%20and%20excel%20will%20work%20it%20out.%20However%2C%20that%20only%20works%20if%20you%20open%20it%20directly%20through%20an%20http%20request%20and%20are%20a&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2007/07/generating-excel-files-with-php/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2007/07/generating-excel-files-with-php/&amp;title=Generating+Excel+files+with+PHP" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Generating+Excel+files+with+PHP+-+File: /data/app/webapp/functions.php<br />Line: 7<br />Message: Can't connect to local MySQL server through socket '/var/run/mysqld/mysqld.sock' (11)&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2007/07/generating-excel-files-with-php/feed/</wfw:commentRss>
		<slash:comments>1</slash:comments>
		</item>
		<item>
		<title>New design and off for vacation</title>
		<link>http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/</link>
		<comments>http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/#comments</comments>
		<pubDate>Fri, 19 May 2006 14:32:09 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[Personal]]></category>
		<category><![CDATA[Web]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[vacation]]></category>
		<category><![CDATA[web design]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=186</guid>
		<description><![CDATA[I have finally pulled myself together and updated all the Smarty templates for dotvoid.com with a new design. It is not by far finished and there are lots of empty areas to fill,  and adjustments that needs to be done as well as a cleanup of faulty comment counts. But I have had these templates [...]]]></description>
			<content:encoded><![CDATA[<p>I have finally pulled myself together and updated all the Smarty templates for dotvoid.com with a new design. It is not by far finished and there are lots of empty areas to fill,  and adjustments that needs to be done as well as a cleanup of faulty comment counts. But I have had these templates waiting for more than six months now and if I&#8217;m ever to change the design I have to do it incrementally. As well as some design missing I also have to re-add the archive and search pages.</p>
<p>At work we just had a meeting discussing all the technologies and applications that we are working on at the moment. Currently, my small team of three people including myself, are integrating and developing systems using PHP, javascript, Java, C, C++, C#, ASP, Orbix  (corba), SOAP, MS CMS, MS Commerce Server, BizTalk, Oracle, MS SQL Server. We even support a Powerbuilder application on top of this. All these applications and systems run on linux, Solaris, Tru64 and windows environments. No wonder my head is spinning from time to time.</p>
<p>So it is time to let go and start focus on other things. I have decided to spend the following six months pursuing opportunities in rich web applications using technologies like PHP/C and javascript on *nix. Throw in SOAP and databases, maybe even some XSL, in the mix and I&#8217;d be more than interested&#8230;</p>
<p>Next week I will have a break from all this. I&#8217;ll spend a week in <a href="http://marbella.to/banus/">Puerto Banús</a>, Spain, with my family. We will stay in a really nice two story apartment with all the stuff and fluff you really don&#8217;t need; outdoor pool, a huge plasma TV screen as well as a broadband connection. Hopefully I won&#8217;t use the latter&#8230;</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/&amp;title=New+design+and+off+for+vacation" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/&amp;t=New+design+and+off+for+vacation" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/&amp;title=New+design+and+off+for+vacation&amp;summary=I%20have%20finally%20pulled%20myself%20together%20and%20updated%20all%20the%20Smarty%20templates%20for%20dotvoid.com%20with%20a%20new%20design.%20It%20is%20not%20by%20far%20finished%20and%20there%20are%20lots%20of%20empty%20areas%20to%20fill%2C%C2%A0%20and%20adjustments%20that%20needs%20to%20be%20done%20as%20well%20as%20a%20cleanup%20of%20faulty%20comment%20counts.%20But%20I%20have%20had%20these%20templates%20wai&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/&amp;title=New+design+and+off+for+vacation" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=New+design+and+off+for+vacation+-+File: /data/app/webapp/functions.php<br />Line: 66<br />Message: Duplicate entry 'w8trE' for key 'code'&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2006/05/new-design-and-off-for-vacation/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>PHP and (not) CORBA</title>
		<link>http://www.dotvoid.com/2005/10/php-and-not-corba/</link>
		<comments>http://www.dotvoid.com/2005/10/php-and-not-corba/#comments</comments>
		<pubDate>Wed, 05 Oct 2005 08:16:51 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[integration]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=148</guid>
		<description><![CDATA[There is a lot of talk about PHP in the enterprise nowadays &#8211; which is very good. I have been using PHP 5 for integration at Vodafone Sweden for almost a year now. The solution wraps a &#8211; rather obscure &#8211; legacy C API in a PHP 5 module and hides all this behind a [...]]]></description>
			<content:encoded><![CDATA[<p>There is a lot of talk about PHP in the enterprise nowadays &#8211; which is very good. I have been using PHP 5 for integration at Vodafone Sweden for almost a year now. The solution wraps a &#8211; rather obscure &#8211; legacy C API in a PHP 5 module and hides all this behind a generic SOAP interface implemented with the help of ext/soap. The interface automatically translates SOAP requests from other systems (for example WebMethods) into the API calls the legacy system can understand. This works great, even though I initially had some problems with .NET systems, and is now running many many transactions 24/7.</p>
<p>So even if better SOAP support and a more thought out database layer in PDO are both helping PHP in the enterprise world I still miss one extension to really help me attack java based web applications. A good CORBA extension. I just saw that Iona have started a <a href="http://www.orbzone.org/">new CORBA community</a> and a quick search there for PHP came up with nothing.</p>
<p>There have been a couple of tests in this area with the old Satellite PHP extension and then the <a href="http://universe-phpext.sourceforge.net/">Universe PHP extension</a>. These were really only good as showcases. Are there any good examples of PHP and CORBA out there? It would be really interesting to see if anyone have used for example ORBit, ORBacus or Iona Orbix for C++. Please <a href="http://www.dotvoid.com/about.php">send me an email</a> if you know something I don&#8217;t!</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2005/10/php-and-not-corba/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2005/10/php-and-not-corba/&amp;title=PHP+and+%28not%29+CORBA" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2005/10/php-and-not-corba/&amp;t=PHP+and+%28not%29+CORBA" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2005/10/php-and-not-corba/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2005/10/php-and-not-corba/&amp;title=PHP+and+%28not%29+CORBA&amp;summary=There%20is%20a%20lot%20of%20talk%20about%20PHP%20in%20the%20enterprise%20nowadays%20-%20which%20is%20very%20good.%20I%20have%20been%20using%20PHP%205%20for%20integration%20at%20Vodafone%20Sweden%20for%20almost%20a%20year%20now.%20The%20solution%20wraps%20a%20-%20rather%20obscure%20-%20legacy%20C%20API%20in%20a%20PHP%205%20module%20and%20hides%20all%20this%20behind%20a%20generic%20SOAP%20interface%20implemented%20wi&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2005/10/php-and-not-corba/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2005/10/php-and-not-corba/&amp;title=PHP+and+%28not%29+CORBA" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=PHP+and+%28not%29+CORBA+-+File: /data/app/webapp/functions.php<br />Line: 7<br />Message: Too many connections&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2005/10/php-and-not-corba/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>I hate ODBC</title>
		<link>http://www.dotvoid.com/2005/02/i-hate-odbc/</link>
		<comments>http://www.dotvoid.com/2005/02/i-hate-odbc/#comments</comments>
		<pubDate>Fri, 18 Feb 2005 10:38:35 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[odbc]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=114</guid>
		<description><![CDATA[
Many people don&#8217;t like the idea of putting binary files in a database. I on the other hand have always enjoyed having all data, textual and binary, in the same place. What better than having it all nicely tucked away in a comfy database. The site is handled by the version handling system and the [...]]]></description>
			<content:encoded><![CDATA[<div class="preamble">
<p>Many people don&#8217;t like the idea of putting binary files in a database. I on the other hand have always enjoyed having all data, textual and binary, in the same place. What better than having it all nicely tucked away in a comfy database. The site is handled by the version handling system and the data is backed up in the normal db backup routine.  But when the system is a RedHat 7.3 using ASP mixed with PHP with ODBC connections to an MS SQL Server I really start to grind my teeth.</p></div>
<p>I didn&#8217;t want to rewrite things for free. So when I took the site onboard I only had to rewrite the actual file uploading. As it is using SUN One ASP (former Chilisoft ASP) I had to use the Chili component for this. It all went smoothly until I tried to put the uploaded data into the database. For some reason I just couldn&#8217;t get the Recordset to be updatable.</p>
<pre>Set rs1 = Server.CreateObject("ADODB.Recordset")
sql = "select id, prodpic from product where id = '" &amp; ref &amp; "'"
rs1.Open sql, conn, 3, 3
rs1.Fields("bild").appendChunk picturechunk
rs1("bild").value = fblob
rs1.Update</pre>
<p>As I don&#8217;t really like, or know, ASP (I haven&#8217;t touched VB since VB4 was new and Microsoft said it was as fast as compiled C++) I decided that the quickest way out of this would be to convert the script to PHP. As the application is a horrible mix already I figured it wouldn&#8217;t make things worse. That should do it. No problem at all.</p>
<p>Well it was a problem. ODBC has this limitation on the size of an SQL statement. You can only send through SQL statements with a maximum of 4096 bytes (or something like that). I knew this and I also knew you solve it by using a combination of the methods odbc_prepare and odbc_execute. You have two different ways of sending binary data this way. Well the ODBC driver (Free TDS) puked on me again and again. Go figure.</p>
<p>Then as the genius I am I said to myself. Chunks, concatenation. Yeah. Something like below should work. I&#8217;ve done the same with MySQL queries in some circumstances.</p>
<pre>$fdata = base64_encode(get_file_contents($filepath));
$total = strlen($fdata);
$pos = 0;

while ($pos &lt; $total)
  {
      $len = ($pos + 2048 &gt; $total) ? $total - $pos : 2048;
      $substr = substr($fdata, $pos, $len);
      $sql = "update product set prodpic = prodpic + '$substr' where id='$ref'";
      db_exec($sql);
      $pos += $len;
  }</pre>
<p>After puzzling awhile over the weird results this gave I turned to the almighty web for answers. It turns out MS SQL Server only supports concatenation of datatypes <span style="font-weight: bold;">not capable</span> of storing large amounts of data. So for the datatypes image and text it is impossible. Wonderful.</p>
<p>So now I just save the files on the filesystem instead. Have to setup backup routines for the machine though. Something I thought would take about an hour to fix finally took more than two days of coding and research.</p>
<p>Hopefully I learn some valueable lesson from all of this but I&#8217;m sure I won&#8217;t.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2005/02/i-hate-odbc/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2005/02/i-hate-odbc/&amp;title=I+hate+ODBC" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2005/02/i-hate-odbc/&amp;t=I+hate+ODBC" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2005/02/i-hate-odbc/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2005/02/i-hate-odbc/&amp;title=I+hate+ODBC&amp;summary=%0D%0A%0D%0AMany%20people%20don%27t%20like%20the%20idea%20of%20putting%20binary%20files%20in%20a%20database.%20I%20on%20the%20other%20hand%20have%20always%20enjoyed%20having%20all%20data%2C%20textual%20and%20binary%2C%20in%20the%20same%20place.%20What%20better%20than%20having%20it%20all%20nicely%20tucked%20away%20in%20a%20comfy%20database.%20The%20site%20is%20handled%20by%20the%20version%20handling%20system%20and%20the&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2005/02/i-hate-odbc/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2005/02/i-hate-odbc/&amp;title=I+hate+ODBC" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=I+hate+ODBC+-+File: /data/app/webapp/functions.php<br />Line: 66<br />Message: Duplicate entry 'wyarW' for key 'code'&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2005/02/i-hate-odbc/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Web Methods course</title>
		<link>http://www.dotvoid.com/2005/01/web-methods-course/</link>
		<comments>http://www.dotvoid.com/2005/01/web-methods-course/#comments</comments>
		<pubDate>Mon, 10 Jan 2005 09:03:22 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[Personal]]></category>
		<category><![CDATA[integration]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=111</guid>
		<description><![CDATA[This week I&#8217;m off to London for a four day course on Web Methods and integration. A nice break from the normal routine. The storm made it impossible to take the train to the airport so I&#8217;ll have to drive there. So hopefully the London weather is better than the Swedish winter storm we&#8217;ve had [...]]]></description>
			<content:encoded><![CDATA[<p>This week I&#8217;m off to London for a four day course on <a href="http://www.webmethods.com/meta/default/folder/0000006494?time=6273598223707392480">Web Methods</a> and integration. A nice break from the normal routine. The storm made it impossible to take the train to the airport so I&#8217;ll have to drive there. So hopefully the London weather is better than the Swedish <a href="http://www.aftonbladet.se/vss/nyheter/story/0,2789,586530,00.html">winter storm</a> we&#8217;ve had this weekend. Almost half a million households still without electricity, seven people killed and ofcourse massive damage to peoples houses.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2005/01/web-methods-course/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2005/01/web-methods-course/&amp;title=Web+Methods+course" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2005/01/web-methods-course/&amp;t=Web+Methods+course" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2005/01/web-methods-course/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2005/01/web-methods-course/&amp;title=Web+Methods+course&amp;summary=This%20week%20I%27m%20off%20to%20London%20for%20a%20four%20day%20course%20on%20Web%20Methods%20and%20integration.%20A%20nice%20break%20from%20the%20normal%20routine.%20The%20storm%20made%20it%20impossible%20to%20take%20the%20train%20to%20the%20airport%20so%20I%27ll%20have%20to%20drive%20there.%20So%20hopefully%20the%20London%20weather%20is%20better%20than%20the%20Swedish%20winter%20storm%20we%27ve%20had%20this%20we&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2005/01/web-methods-course/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2005/01/web-methods-course/&amp;title=Web+Methods+course" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Web+Methods+course+-+http://b2l.me/wtudp&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2005/01/web-methods-course/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>ext/soap getting better</title>
		<link>http://www.dotvoid.com/2004/12/extsoap-getting-better/</link>
		<comments>http://www.dotvoid.com/2004/12/extsoap-getting-better/#comments</comments>
		<pubDate>Tue, 21 Dec 2004 17:49:23 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[integration]]></category>
		<category><![CDATA[soap]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=108</guid>
		<description><![CDATA[
I recently encountered a problem in the ext/soap extension in PHP5 (version 5.0.2). I&#8217;ve been using the extension in development only so far and it has proved to be quite stable.
The PHP soap server I&#8217;ve written run on Tru64 and exposes a weird C API that I wrapped in a custom extension. So this soap server [...]]]></description>
			<content:encoded><![CDATA[<div class="preamble">
<p>I recently encountered a problem in the ext/soap extension in PHP5 (version 5.0.2). I&#8217;ve been using the extension in development only so far and it has proved to be quite stable.</p>
<p>The PHP soap server I&#8217;ve written run on Tru64 and exposes a weird C API that I wrapped in a custom extension. So this soap server is going to be used as a wrapper for this legacy proprietary system. It all seemed to work great until a system written in a.NET environment wanted to hook up a client to the server&#8230;</p></div>
<div class="itemview">
<p>.NET sends function call parameters outside of the actual function element of the soap body using references. PHP interpreted this as being too many function calls. The extension explicitly disallowed more than one child element in the body. The below was not allowed.</p>
<pre>&lt;?xml version="1.0" encoding="utf-8"?&gt;
&lt;soap:Envelope xmlns:soap="<a href="http://schemas.xmlsoap.org/soap/envelope/">http://schemas.xmlsoap.org/soap/envelope/</a>"
 xmlns:soapenc="<a href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/encoding/</a>"
 xmlns:tns="<a href="http://spock/kunta/kunta">http://spock/kunta/kunta</a>"
 xmlns:types="<a href="http://spock/kunta/kunta/encodedTypes">http://spock/kunta/kunta/encodedTypes</a>"
 xmlns:xsi="<a href="http://www.w3.org/2001/XMLSchema-instance">http://www.w3.org/2001/XMLSchema-instance</a>"
 xmlns:xsd="<a href="http://www.w3.org/2001/XMLSchema">http://www.w3.org/2001/XMLSchema</a>"&gt;

&lt;soap:Body
soap:encodingStyle="<a href="http://schemas.xmlsoap.org/soap/encoding/">http://schemas.xmlsoap.org/soap/encoding/</a>"&gt;
 &lt;q1:bassCall xmlns:q1="<a href="http://spock/bass/types/kunta">http://spock/bass/types/kunta</a>"&gt;
  &lt;system xsi:type="xsd:string"&gt;XXX&lt;/system&gt;
  &lt;function xsi:type="xsd:string"&gt;TASKTEST&lt;/function&gt;
  &lt;parameter href="#id1" /&gt;
 &lt;/q1:bassCall&gt;

 &lt;soapenc:Array id="id1" soapenc:arrayType="tns:Item[1]"&gt;
  &lt;Item href="#id2" /&gt;
 &lt;/soapenc:Array&gt;

 &lt;tns:Item id="id2" xsi:type="tns:Item"&gt;
  &lt;key xsi:type="xsd:string"&gt;ABCabc123&lt;/key&gt;
  &lt;val xsi:type="xsd:string"&gt;123456&lt;/val&gt;
 &lt;/tns:Item&gt;

&lt;/soap:Body&gt;
&lt;/soap:Envelope&gt;</pre>
<p>It was easy to see in the source of ext/soap/soap.c that this wasn&#8217;t handled properly. Speaking to a Mirek on the PHP soap list that had the same problem led to Mirek submitting this as <a href="http://bugs.php.net/bug.php?id=30994">bug 30994</a>. Shortly after I added some more information to the bug. One week after submitting the bug it was fixed and is now included in the PHP 5.0.3 release together <a href="http://www.php.net/ChangeLog-5.php#5.0.3">with many more bug fixes</a>.</p>
<p>It is great to see open source projects usually fix bugs quicker than companies charging tens of thousands of dollars per year and license. It is just amazing how people can complain about &#8220;lack of support&#8221; in projects like PHP.</p>
<p>To be honest I haven&#8217;t had time to test it but I&#8217;m sure it&#8217;ll work. I mean &#8211; it is open source.</p></div>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2004/12/extsoap-getting-better/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2004/12/extsoap-getting-better/&amp;title=ext%2Fsoap+getting+better" rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2004/12/extsoap-getting-better/&amp;t=ext%2Fsoap+getting+better" rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2004/12/extsoap-getting-better/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2004/12/extsoap-getting-better/&amp;title=ext%2Fsoap+getting+better&amp;summary=%0D%0A%0D%0AI%20recently%20encountered%20a%20problem%20in%20the%20ext%2Fsoap%20extension%20in%20PHP5%20%28version%205.0.2%29.%C2%A0I%27ve%20been%20using%20the%20extension%20in%20development%20only%20so%20far%20and%20it%20has%20proved%20to%20be%20quite%20stable.%0D%0A%0D%0AThe%20PHP%20soap%20server%20I%27ve%20written%20run%20on%20Tru64%20and%20exposes%20a%20weird%20C%20API%20that%20I%20wrapped%20in%20a%20custom%20extension.%20So%20&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2004/12/extsoap-getting-better/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2004/12/extsoap-getting-better/&amp;title=ext%2Fsoap+getting+better" rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=ext%2Fsoap+getting+better+-+File: /data/app/webapp/functions.php<br />Line: 66<br />Message: Duplicate entry 'w8k4S' for key 'code'&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2004/12/extsoap-getting-better/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
		<item>
		<title>Springtime&#8230;</title>
		<link>http://www.dotvoid.com/2004/03/springtime/</link>
		<comments>http://www.dotvoid.com/2004/03/springtime/#comments</comments>
		<pubDate>Tue, 30 Mar 2004 11:50:46 +0000</pubDate>
		<dc:creator>Danne</dc:creator>
				<category><![CDATA[PHP]]></category>
		<category><![CDATA[c]]></category>
		<category><![CDATA[integration]]></category>

		<guid isPermaLink="false">http://www.commodi.com/?p=64</guid>
		<description><![CDATA[
The weather is absolutely wonderful today. The sun is bright and warm and the view over the bay where I work is absolutely stunning a day like this. It is hard to bring yourself to do some serious work.
My small wooden boat that I tarred this last weekend is constantly nagging my mind and I [...]]]></description>
			<content:encoded><![CDATA[<div class="preamble">
<p>The weather is absolutely wonderful today. The sun is bright and warm and the view over the bay where I work is absolutely stunning a day like this. It is hard to bring yourself to do some serious work.</p></div>
<p>My small wooden boat that I tarred this last weekend is constantly nagging my mind and I want to get into water soon. If it weren&#8217;t for all these annoying deadlines at work I would take the rest of the day off and paint the hull.</p>
<p>The project I am working on is very interesting though. I am integrating the billing system at <a href="http://www.vodafone.se/">Vodafone Sweden</a> with <a href="http://www.webmethods.com/">WebMethods</a> and other systems. The billing system is written in an obscure but rather fast <a href="http://www.proiv.com/">4GL language called ProIV</a>.  The integration solution is a heavily multithreaded C applicaton with plugins that communicate with various systems natively. It is great fun with many technical difficulties, but the wonderful spring weather and my boat not yet ready for the sea stops me from enjoying it fully.</p>


<div class="shr-bookmarks shr-bookmarks-expand shr-bookmarks-center shr-bookmarks-bg-knowledge">
<ul class="socials">
		<li class="shr-comfeed">
			<a href="http://www.dotvoid.com/2004/03/springtime/feed" rel="nofollow" class="external" title="Subscribe to the comments for this post?">Subscribe to the comments for this post?</a>
		</li>
		<li class="shr-delicious">
			<a href="http://delicious.com/post?url=http://www.dotvoid.com/2004/03/springtime/&amp;title=Springtime..." rel="nofollow" class="external" title="Share this on del.icio.us">Share this on del.icio.us</a>
		</li>
		<li class="shr-facebook">
			<a href="http://www.facebook.com/share.php?v=4&amp;src=bm&amp;u=http://www.dotvoid.com/2004/03/springtime/&amp;t=Springtime..." rel="nofollow" class="external" title="Share this on Facebook">Share this on Facebook</a>
		</li>
		<li class="shr-googlebuzz">
			<a href="http://www.google.com/buzz/post?url=http://www.dotvoid.com/2004/03/springtime/&amp;imageurl=" rel="nofollow" class="external" title="Post on Google Buzz">Post on Google Buzz</a>
		</li>
		<li class="shr-linkedin">
			<a href="http://www.linkedin.com/shareArticle?mini=true&amp;url=http://www.dotvoid.com/2004/03/springtime/&amp;title=Springtime...&amp;summary=%0D%0A%0D%0AThe%20weather%20is%20absolutely%20wonderful%20today.%20The%20sun%20is%20bright%20and%20warm%20and%20the%20view%20over%20the%20bay%20where%20I%20work%20is%20absolutely%20stunning%20a%20day%20like%20this.%20It%20is%20hard%20to%20bring%20yourself%20to%20do%20some%20serious%20work.%0D%0AMy%20small%20wooden%20boat%20that%20I%20tarred%20this%20last%20weekend%20is%20constantly%20nagging%20my%20mind%20and%20I%20wan&amp;source=dotvoid.com" rel="nofollow" class="external" title="Share this on LinkedIn">Share this on LinkedIn</a>
		</li>
		<li class="shr-plaxo">
			<a href="http://www.plaxo.com/?share_link=http://www.dotvoid.com/2004/03/springtime/" rel="nofollow" class="external" title="Share this on Plaxo">Share this on Plaxo</a>
		</li>
		<li class="shr-stumbleupon">
			<a href="http://www.stumbleupon.com/submit?url=http://www.dotvoid.com/2004/03/springtime/&amp;title=Springtime..." rel="nofollow" class="external" title="Stumble upon something good? Share it on StumbleUpon">Stumble upon something good? Share it on StumbleUpon</a>
		</li>
		<li class="shr-twitter">
			<a href="http://twitter.com/home?status=Springtime...+-+http://b2l.me/wuyzr&amp;source=shareaholic" rel="nofollow" class="external" title="Tweet This!">Tweet This!</a>
		</li>
</ul>
<div style="clear:both;"></div>
</div>

]]></content:encoded>
			<wfw:commentRss>http://www.dotvoid.com/2004/03/springtime/feed/</wfw:commentRss>
		<slash:comments>0</slash:comments>
		</item>
	</channel>
</rss>

