 | News Feed |
 | Jobs Feed |
Sections
|
| feed this: |  |
Developer Tutorials Blog: Running background processes in PHP
by Chris Cornutt July 18, 2008 @ 11:18:21
New on the Developer Tutorials blog today is this look at handling background processes from your PHP script:
You've checked and double checked the integrity of user input, and you're doing some serious processing. There's only one problem: it's too slow. There's a simple solution: forking your processing script, and running the code as a background process asynchronously. It can email your user when it's done: they'll wait. In this tutorial, I'll show you how to get started with background processes in PHP.
Akash gives examples of the three keys to background processes - starting the script via an exec, talking to the process by passing additional parameters and including code to monitor the state of the background process via something like a MySQL "sessions" table that the script writes to.
voice your opinion now!
process background exec parameter mysql session track
Sebastian Bergmann's Blog: emPHPower @ OSCON
by Chris Cornutt July 10, 2008 @ 11:18:20
Sebastian Bergmann has poted about a new something that he'll also be doing at this year's OSCON - leading a discussion about the emPHPower initiative.
As the PHP community grows however, it becomes harder and harder for people to come together from the various corners of the community. [...] That being said, maybe there is still something we could change for the better? PHP contributor Lukas Smith has formulated his vision for such an effort in the form of an organization that would serve as a mediator and catalyst between all the members of the PHP community under the code name emPHPower.
The session will be happening on Monday the 21st from 7-8pm.
voice your opinion now!
emphpower oscon2008 birdsofafeather session present
PHPFreaks.com: Sessions and cookies Adding state to a stateless protocol
by Chris Cornutt June 05, 2008 @ 12:05:11
On the PHPFreaks website, there's a new tutorial talking about sessions and cookies in PHP:
HTTP is a stateless protocol. This means that each request is handled independently of all the other requests and it means that a server or a script cannot remember if a user has been there before. However, knowing if a user has been there before is often required and therefore something known as cookies and sessions have been implemented in order to cope with that problem.
The tutorial is pretty introductory, so if you're not new to the PHP world, you won't learn much. New developers, though, will learn how to set cookies, use sessions and learn a bit about the security of both.
voice your opinion now!
session tutorial introduction cookie state stateless protocol http
PHP in Action Blog: Flash Messages
by Chris Cornutt June 02, 2008 @ 13:44:50
On the PHP in Action blog Dagfinn Reiersol shares a method to send messages across a POST request that's followed by a redirect (versus a simple GET where it can be in the URL).
When processing a GET request, you can display whatever messages you want. The most simplistic way is to echo them directly; or if just slightly more sophisticated, set it in the template that's about to become the web page. When processing a POST request that is to be followed by a redirect, you can't do that. The response (redirect) sent back to the browser does not have any text or HTML content.
He points out two different ways to handle the problem - either manually append the message to the URL you're redirecting to or (a bit better method) store it in a session variable and remove it once its done. Several frameworks call this a "flash message". He gives examples of how to set this in two popular frameworks - Zend Framework and CakePHP.
voice your opinion now!
framework zendframework cakephp message post get redirect session
Dave Marshall's Blog: Log memory usage using declare and ticks in PHP
by Chris Cornutt May 16, 2008 @ 12:05:37
Posted to his blog, Dave Marshall has a tip that uses declare and a trick or two to check out the memory usage of your scripts.
As far as I know, there isn't any memory footprint profiling in Xdebug, I think there was at some point but they removed it because it was a little flaky. I like to monitor the memory usage within my scripts, and I've found this simple snippet can help.
The script defines a log_memory function that pushes the memory and time information into a session value. The register_tick_function method is used to add log_memory to the handler and its called over and over from inside his for loop.
voice your opinion now!
log memory usage ticks registertickfunction method session
Brian Moon's Blog: PHP session cookie refresh
by Chris Cornutt May 14, 2008 @ 12:51:02
Brian Moon has posted a tip (and a bit of code) he's worked up to help make a users cookies last a bit longer than they were originally designed to:
When you start a session, if the user had no cookie, they get a new session id and they get a cookie. You can configure that cookie to last for n seconds via php.ini or session_cookie_set_params(). But, and this is a HUGE but for me, that cookie will expire in n seconds no matter what.
His method provides a way to extend the life of the cookies currently set for the domain by changing the time to live through a series of ini_get calls wrapped in a setcookie() call.
voice your opinion now!
cookie session refesh timetolive setcookie iniset
Zend Developer Zone: Zend Framework - The Big Q&A
by Chris Cornutt April 29, 2008 @ 07:54:05
Since the first stable version of the Zend Framework has been out for a while now (version 1.0), the Zend Developer Zone is starting up their own way to give back to the project - the The Big Q&A session about all things Zend Framework:
On April 30, 2008, Zend's very own Zend Framework team will make themselves available for a 2-hour Q&A session. You can submit your questions in advance here to give us an opportunity to think them over a bit, or you can surprise us with them during the webinar.
The webinar will be happening On April 30th at 9am PDT and will last about two hours, during which any and all (hopefully) questions about the framework will be answered.
Matthew Weier O'Phinney has also posted about it over on his blog.
voice your opinion now!
zendframework webinar qa question answer session
|
Community Events
Don't see your event here? Let us know!
|