News Feed
Sections
News Archive


Community Events
php|tek 2008 PHP Conference



feed this:

PHP in Action:
Public constructors considered harmful
0 comments :: posted Monday May 05, 2008 @ 10:21:33
voice your opinion now!

According to the PHP in Action blog, public constructors can be hazardous to your (application's) health and should be replaced.

Everybody who writes object-oriented code knows about constructors. You need them so the program knows how to instantiate objects, right? And you especially need them when a lot of things have to be done while instantiating an object. [...] So why would I be skeptical of public constructors?

The solution, as he sees it, is to make a "constructor" that's actually called statically with parameters that returns an instance of the class it's in as well as performing the action. He argues that this can help make the code much more readable for some types of method calls.

tagged with: public constructor harmful replace private instance


Vinu Thomas' Blog:
Replace print_r and var_dump with Krumo
0 comments :: posted Wednesday April 09, 2008 @ 14:44:31
voice your opinion now!

Vinu Thomas has proposed a replacement for the usual var_dump or print_r sort of debugging developers tend to do - Krumo.

To put it simply, Krumo is a replacement for print_r() and var_dump(). By definition Krumo is a debugging tool (now for PHP5 only), which displays structured information about any PHP variable [...] it does the same job, but it presents the information beautified using CSS and DHTML.

It also supports output of other data in a "pretty format" like backtraces, included files and a listing of all constants. You can check out a demo of it in action here.

tagged with: krumo printf vardump replace sourceforge css html pretty

Hasin Hayder's Blog:
Facebook data storage api can really be the replacement of memcache
0 comments :: posted Wednesday April 09, 2008 @ 13:58:22
voice your opinion now!

Hasin Hayder has proposed an interesting replacement for the usual caching mechanism - using the Facebook data storage API to cache copies of pages/data/etc.

Why not! All you need is a fast-n-furious caching storage for your Facebook application which stores values against a key, same like a hash table. Facebook data storage API does the same for you. using the batch API in Facebook rest client you can seriously think it as an alternative of memcache.

He shows the simple process for making the object (manually in a preexisting application), inserting data into the object through the API they provide and how to pull that data back out.

tagged with: facebook storage api replace memcache object

SitePoint PHP Blog:
Tokenization using regular expression sub patterns
0 comments :: posted Friday January 18, 2008 @ 11:15:49
voice your opinion now!

On the SitePoint PHP blog there's a new post from Harry Fuecks talking about a replacement method using token that works a bit better than the typical regular expression method.

Promtped by a real world example, one often-overlooked feature of most regular expressions engines is how subpatterns can useful to whip up tokenizers relatively easily. The problem? I needed to match the word any of the words "Canton", "Region" or "Group" in a string and perform a follow up action depending on which matched.

His ultimate solution used a set of preg_match generated tokens to do the replaces a bit more reliably. It also makes it easy for other scripts (like his Python example) to use them too.

tagged with: regularexpression pattern token replace


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

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