News Feed
Sections

News Archive


Community Events






Don't see your event here?
Let us know!


feed this:

Developer Tutorials Blog:
Running background processes in PHP
0 comments :: posted Friday July 18, 2008 @ 11:18:21
voice your opinion now!

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.

tagged with: process background exec parameter mysql session track


Zend Developer Zone:
Decorators with Zend_Form
0 comments :: posted Monday May 05, 2008 @ 12:57:34
voice your opinion now!

On the Zend Developer Zone there's a new tutorial (by Matthew Weier O'Phinney) covering the use of decorators with the Zend_Form component of the Zend Framework.

One point of flexibility [Zend_Form] offers has proved to be a pain point for many developers: decorators. This tutorial aims to shed some light on decorators, as well as provide strategies for creating your own decorators and combining them in creative ways to customize the output your forms generate.

Matthew starts with a little background behind the component to help you find your way around. Building on this, he shows how to use some standard output decorators and how to create decorators of your own. His example shows how to create a set of grouped checkboxes.

tagged with: decortor zendform tutorial background example

Mikko Koppanen's Blog:
Fill patterns
0 comments :: posted Tuesday April 29, 2008 @ 15:24:50
voice your opinion now!

Mikko Koppanen has a quick post today showing how to use PHP and Imagick to create an image of text filled with another image layer behind it:

The fill pattern is used to annotate text but the named pattern could also be used to fill any shapes that allow fill to be specified (include circles, ellipses, rectangles, polygons etc etc).

His example is pretty simple (with a "Hello World!" output) that pulls in the background image, creates the composite layer over it, adds the text to it and sets the fill to the background image's layer. The whole this is wrapped up and output as a PNG file.

tagged with: fill pattern imagick tutorial example png background image

Mikko Koppanen's Blog:
Trimming an image
0 comments :: posted Friday November 02, 2007 @ 12:58:00
voice your opinion now!

Mikko Koppanen shows how, in his latest blog post, to take an image and trim it down with Imagick to get rid of extra surrounding background information.

Especially product images usually "suffer" from this issue; the product itself is composited on a white background and there are large areas of white around the object.

This is a simple example to demonstrate how to easily trim the areas off the image and only display the parts where the object lies.

His example code, a quick 16 line affair, takes in the test image, looks for a RGB value given and uses the built-in trimImage function to reduce its size.

tagged with: trim image extra background imagick example code trim image extra background imagick example code

Mikko Koppanen's Blog:
Choosing watermark color based on the background luminosity
0 comments :: posted Saturday October 13, 2007 @ 16:04:00
voice your opinion now!

Mikko Koppanen has another blog entry posted dealing with image manipulation with PHP and Imagick, this time it's a cool little script that lets you pick your watermark's color based on the image's background luminosity.

Usually images are watermarked using a predefined color (let's say for example "white"). How well does this actually work when you're doing the watermark on a light or even a white image? The answer is simple: not very well.

His example uses the ImagickPixelIterator to check the luminosity of the background and assigns the text a value between black and white according to the background. Complete code with usage and examples of the resulting images are included.

tagged with: imagick watermark color background luminosity imagick watermark color background luminosity

AlternateInterior.com:
Multi-Threading Strategies in PHP
0 comments :: posted Wednesday May 02, 2007 @ 15:29:00
voice your opinion now!

On AlternateInterior.com, there's the start of something that could be used to speed up the execution of your app - multi-threading in PHP.

PHP does not have threading anywhere in its massive core. We can, however, fake it by relying on the underlying operating system's multitasking abilities instead of PHP. This article will show you how.

PHP has no built in support for threading. But there can still be times when you've got lengthy code to run and idle CPU cycles you'd like to capitalize on. We can treat child processes as threads.

He (Brian Bosh) uses the example of executing five other PHP scripts inside of another through the use of a multi-threading class he's developed. Included is the code for both the class and the example code to use it.

tagged with: multithreading strategy class background execute multithreading strategy class background execute

Richard Davey's Blog:
Easy Reflections v2
0 comments :: posted Wednesday March 07, 2007 @ 08:32:00
voice your opinion now!

Richard Davey has updated his Easy Reflections PHP class according to a new post today:

I have updated my Easy Reflections code and released v2. Thanks to feedback and some code from Monte Ohrt (co-developer of Smarty) he added in cache support and fixed a banding issue with the alpha levels. It all works really nicely now - and the new version, with the new docs are available at http://reflection.corephp.co.uk.

The script takes any image (jpeg/png) and makes a reflection for it (he gives the album cover reflection in Apple's iTunes as an example). Configuration of the reflection is available including intensity, background, and height. Check out the galleries on motortopia.com for an example of it in action.

tagged with: easyreflections version release height intensity background cache easyreflections version release height intensity background cache

Wez Furlong's Blog:
Background/batch/workflow processing with PDOPGSQL
0 comments :: posted Friday October 27, 2006 @ 08:42:00
voice your opinion now!

Wez Furlong wants a bit more out of his PHP script, naemly the ability to be able to process things in the background without tying up or immediately using the script that's running.

In my recent talk on sending mail from php I mention that you want to avoid sending mail directly from a web page. A couple of people have asked me how to implement that, and one of the suggestions I have is to queue your mail in a database table and have some other process act on that table.

He gives a solution that's a bit more optimized for this solution than just polling the same information over and over - using PDO and LISTEN/NOTIFY processing along with transactions to make the CLI script only grab information when there's something new.

tagged with: pdo pgsql postgresql mail cli background batch processing pdo pgsql postgresql mail cli background batch processing

Ben Ramsey's Blog:
A Community of Diverse Backgrounds
0 comments :: posted Friday September 29, 2006 @ 07:41:30
voice your opinion now!

Ben Ramsey has posted "live" from the PHP Appalachia (un)conference on his blog today, and talks about the "community of diverse backgrounds" that's come up there at the conference.

To me, it's always very interesting to hear to the pre-PHP stories of other PHP programmers-the days before they programmed in PHP, what they did and how they came to call themselves PHP programmers. The stories vary greatly from programmer to programmer, and almost none begin with: "I was working toward a degree in computer science …."

In fact, the more people I talk with, the more I'm convinced that the typical PHP programmer, in fact, sort of got to where they are by an odd arrangement of life circumstances we call coincidences. Almost none elected to be where they are, but nearly all enjoy the work they do, many to a great degree of passion.

He talks about the conversation serveral attendees had, mentioning some of their backgrounds (anything from marine biology to organizational behavior).

tagged with: diverse background developer phpappalachia2006 unconference diverse background developer phpappalachia2006 unconference

Christopher Jones' Blog:
What Extending PHP Teaches
0 comments :: posted Thursday June 08, 2006 @ 05:44:54
voice your opinion now!

Christopher Jones has a quick new comment over on his Oracle blog about the release and contents of Sara Goleman's book, Extending and Embedding PHP.

Like all good books, you should read this even if you never plan to follow the title. What you will gain from the text is a better understanding of PHP and knowledge about how a large program (PHP itself) has been designed and works. I'm reminded of Lions' Commentary on Unix (though Sara's book does not reproduce all the code of PHP!) because this is a ground breaking book.

It's always good to get a better idea of what's going on behind the scenes. Too many people just use PHP and think new versions just magically appear. In truth, there are a huge number of developers working on new features and fixing bugs to help make PHP, the language, a better place. And, thanks to Sara, the work those folks do gets a bit more recognition.

tagged with: php extending embedding teaches understanding background php extending embedding teaches understanding background


code ajax example releases cakephp mysql package developer application release PHP5 conference job database zendframework zend security framework PEAR book

All content copyright, 2008 PHPDeveloper.org :: info@phpdeveloper.org - Powered by the Solar PHP Framework