About a week ago, I was doing some upgrades on my development machine and came across a rather nasty issue when it comes to how .php(s) files are associated with PHP in Apache. It seems that a number of distros including Gentoo (which is what I was using) are using the following configuration directive to make the PHP module parse PHP files:
AddHandler application/x-httpd-php .php
AddHandler application/x-httpd-php-source .phps
The non-obvious problem with the above is that it will allow not only "file.php" to be treated as PHP scripts, but also "file.php.txt", which means that any file containing ".php" in its name, no matter where in the filename, would be treated as a PHP script. This of course creates a rather nasty security hole, since many upload file validation tools, only check the final extension. Consequently allowing the user to by-pass the validation, by simply prefixing another "harmless" extension like .txt, .pdf, etc... to the filename, but still get...
PHP Excel Extension 0.8.6
The 0.8.6 version of the Excel extension was released and is now available for download. This version was updated to contain LibXL 3.0 support which introduces Excel 2007/2010 read/write support, which means that this extension can now read and generate any Excel file. Support for XSLX (2007/2010) format can be enabled by passing "true" as the 3rd parameter to the ExcelBook() construtor.
GitHub: http://github.com/iliaal/php_excel/
Source: http://github.com/downloads/iliaal/php_excel/php-excel-0.8.6.tar.bz2
The 0.8.5 version of the Excel extension was released and is now available for download, it contains a number of small build fixes, which makes it possible to compile it against all versions of PHP (5.2,5.3,trunk). The Win32 compilation was also fixed and thanks to Kalle, PHP 5.3 win32 binaries are now available for download as well.
GitHub: http://github.com/iliaal/php_excel/
Source: http://github.com/downloads/iliaal/php_excel/php-excel-0.8.5.tar.bz2
Win32 Binaries: http://github.com/downloads/iliaal/php_excel/php-excel-5.3.zip
Since I broke my right hand 3 weeks ago while biking, I found myself with a lot of spare time :/. It is amazing just how limited your ability to do things becomes when you can only use one hand. So, to stave off the boredom, I've been slowly toiling away on a PHP Excel extension that I intend to use at work, which I've finally gotten ready for release today.
You can find it on github at: http://github.com/iliaal/php_excel.
First of all, why? Our business requirements at work require us to frequently to generate Excel versions of the reports from the system and occasionally import data from Excel. For last few years we've done this via php classes; Spreadsheet Excel Writer and Reader. They do the job, but have severe limitations, one them being speed, and the other the output that supports only BIFF5. Unfortunately quite a few things don't grok BIFF5, such as Blackerries, Numbers from Apple's iWork, iPhones, etc… In instances when this poses an issue we've mitigated the problem by up-converting to B...
We are starting to use Google Docs quite a bit more at work and unsurprisingly the question of backup and offline availability comes into play. As part of the backup strategy we also wanted to capture incremental versions of the documents (on a daily basis) in the event we needed to go back to the prior versions.
To this affect I whipped up a small (120 lines) PHP script that will retrieve all your Google documents and save them to a local directory, in the event the document was created/updated in the last 24 hours, thus ensuring snapshot support. Each file name is prefixed with Ymd (Year,month,day) prefix to ensure name uniqueness and provides an easy way to spot similar files or files that were created/updated on the same day. The script has just two dependancies, cURL and Simplexml extensions, which most PHP 5.0+ installs should have.
I am publish the script for anyone with similar needs to use/improve under the BSD license...
Enjoy.
Update
I've made a few improvements to the script, some of wh...