 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Hasin Hayder's Blog: Using new PECL Memcached extension for storing session data
by Chris Cornutt October 19, 2009 @ 09:51:21
Hasin Hayder has a new post talking about the new memcached extension for PHP (memcached from PECL) and how it can be used to store sessions data.
Many of you already know that managing session is a critical task for web applications, specially when you want to avoid I/O hop and also a significant load over your database by writing a custom session handler. [...] This is why a central session manager is very important for your application to scale.
He walks you through the whole process - installation, setting up memcached instances and getting the extension installed and working with your PHP installation. By adding two lines to your php.ini file, the sessions can quickly and easily be stored in memcache instead of on the local server.
voice your opinion now!
session data save memcached pecl extension
Maarten Balliauw's Blog: Saving a PHPExcel spreadsheet to Google Documents
by Chris Cornutt February 03, 2009 @ 12:58:56
Maarten Balliauw has written up a guide to saving the output of your PHPExcel applications out to the Documents service that Google offers.
As you may know, PHPExcel is built using an extensible model, supporting different input and output formats. The PHPExcel core class library features a spreadsheet engine, which is supported by IReader and IWriter instances used for reading and writing a spreadsheet to/from a file. Currently, PHPExcel supports writers for Excel2007, Excel5 (Excel 97+), CSV, HTML and PDF. Wouldnt it be nice if we could use PHPExcel to store a spreadsheet on Google Documents? Let's combine some technologies.
The two technologies in question are a standard install of the PHPExcel library and the Zend Framework (with its Zend_Gdata component). Using the component, a save() method is created and hooked into the IWriter interface of PHPExcel. When this save method is called, the Zend_Gdata component connects to the Documents service and uploads the resulting information for the account you supply.
voice your opinion now!
tutorial save phpexcel extensible document google spreadsheet zendframework zendgdata
CSSGallery.info: Textmate - php syntax check
by Chris Cornutt January 27, 2009 @ 12:55:22
If you're a fan of the Textmate editor for the Mac platform, you might want to check out this new post from the cssgallery website. It shows how you can get your favorite editor to check your PHP syntax for you.
A nice "hidden" feature that Textmate has, is to check the syntax of the php files you are writing, and display a popup with the result. [...] Each time you save, a syntax check will be done, and a popup will show you the result
You'll need to edit the PHP bundle slightly to get things working, but that's as easy as going through the UI and changing a drop-down value to activate the check. You'll need to have a php binary where the editor can use it, but most OS X installs will have that in place anyway. Check out this image to see the end result.
voice your opinion now!
textmate editor bundle edit syntax check save
Ask Apache Blog: A better way to use PDF files online
by Chris Cornutt November 26, 2007 @ 11:11:00
From the Ask Apache blog, there's a quick tip that makes it simple to give your site's visitors the option to either download or view a PDF file no matter what their browser default is.
One of the most annoying things on the Internet for me is when I click on a link to an Adobe PDF file. For me this is annoying to the extreme because the PDF file is openened directly in your browser because of the Adobe PDF Plugin that almost all browsers have installed. [...] For me an ideal solution would be to offer me choices.
His solution uses mod_rewrite in an .htaccess file to push the visitor to a PHP file. This file grabs the filename they want and pulls in the content, pushing it back out the other side with the "attachment" header that forces a request box on the browser.
voice your opinion now!
pdf file modrewrite htaccess save open choice pdf file modrewrite htaccess save open choice
Felix Geisendorfer's Blog: Making error handling for Modelsave more beautiful in CakePHP
by Chris Cornutt February 06, 2007 @ 10:05:00
In a new post to his blog today, Felix Geisendorfer shares a method to make error handling in the CakePHP model functionality a bit more "beautiful".
Now I've written actions like the one above in the past as well. It's just that I've not had many MySql errors since I've switched to CakePHP. The Model class usually handles all the DB operations flawlessly and it's probably been over a year that I've written a custom MySql statement in my code somewhere. However, even CakePHP or, what's more likely, the database can fail or deny operations.
He shows some code snippets of what he sees as less beautiful versions of database insertion code, methods that either don't check the response/errors or make a messy job of it. His solution works by returning the result into a switch statement to check the results and handling it there (versus a series of ifs). There's a class you'll need to make it work (Common), but he shows how to use it and creates a simple "add" example with it and a new Controller to handle the request.
voice your opinion now!
cakephp save model controller beautiful cakephp save model controller beautiful
DevShed: Using Self-Saving Objects with Command Objects in PHP 5
by Chris Cornutt December 26, 2006 @ 16:37:00
DevShed steps into the final part of their series looking at Command objects in PHP5 with this new tutorial just posted - "Using Self-Saving Objects with Command Objects in PHP 5".
I'm going to extend the creation and use of command objects to use the pattern in a more helpful fashion. Essentially, I'm going to explain how to utilize command classes for defining and handling self-saving objects, that is objects capable of storing a copy of themselves on a database, text file, etc.
They start by defining the core modules and classes for the creation of the objects. They build the other functionality on top of that, creating the save and load mechanisms. The wrap things up and add a few more small bits of functionality before giving a real-life example of the pattern and code in action.
voice your opinion now!
command pattern object save automatic tutorial command pattern object save automatic tutorial
Syntux: eZ components
by Chris Cornutt August 14, 2006 @ 07:39:14
On his blog today, Ammar Ibrahim relays a story of how the Mail component from the eZ component frameowrk "saved the day" for a project he was working on.
A few days ago I was asked to develop a simple script for a solidarity campaign. The idea is that people send their photos as attachements to some email. The script would download all images attached and insert a record for that in the database.
I got introduced to eZ components during my last visit to Norway to attend the eZ systems conference. I decided to give it a shot, and oh boy it's just amazing, probably the cleanest and simplest API ever.
The Mail attachment provided all that he needed, and he includes the script (about 50 lines long) that he used to fetch the emails. He did have one issue with the ability to fetch a single email with the tool, but he managed to hack around it (script included as well).
voice your opinion now!
ez components save mail send photos attachments api simple clean ez components save mail send photos attachments api simple clean
|
Community Events
Don't see your event here? Let us know!
|