News Feed
Sections

News Archive
feed this:

Havard Eide's Blog:
SplObjectStorage
July 23, 2008 @ 08:47:44

Havard Eide has a recent post to his blog that looks at a part of the Standard PHP Library (SPL) that can be used with objects to store them for later use - SplObjectStorage.

In this post I will look at SplObjectStorage: a container that allows to store objects uniquely without the need to compare them one by one.

He lets the code to most of the talking, showing how to do the standard operations for a data store - adding objects (both unique and the same), updating objects in the store, checking to see if an object is already added and removing an object from storage.

0 comments voice your opinion now!
splobjectstorage add unique update check data storage object remove



Tim Koschuetzki's Blog:
Composing Methods Remove Assignments to Parameters
July 06, 2007 @ 10:21:00

In another part of his "Composing Methods" series, Tim Koschuetzki posts about removing assignments to parameters today - working with a temporary variable inside a method rather than the actual passed in value.

When your code assigns to a parameter in a function/method, use a temporary variable instead. [...] It will make your code much more readable and prevents by-reference confusion and therefore big problems in the future.

His example code uses the illustration of calling a price() method in a class to modify the inputVal value based on other inputted information. His suggestion is to not work with the actual inputVal value passed in (so as to avoid issues if it happens to be passed my reference later), but to work with a temporary variable - $result - inside the method.

0 comments voice your opinion now!
method compose remove assignment parameter temporary variable method compose remove assignment parameter temporary variable


Philip Olson's Blog:
A brief unofficial history about register_globals in PHP
April 23, 2007 @ 09:23:00

Philip Olson has posted a brief history of one of the more infamous features of PHP on its fifth birthday - register_globals:

It's been a long road and exactly five years (35 releases) since the much discussed and highly controversial PHP directive register_globals has been disabled by default in PHP. After sifting through the mailing list archives, the following set of information has been compiled. Feel free to make additions, corrections, and report register_globals memories!

His list includes some recent "tidbits" about the directive (including the fact that there's still lots of code in the PHP CVS repository that requires register_globals to be on). Following that, there's his brief timeline of the directive's progression - from its infancy as gpc_globals all the way up to more recent events - like its removal from the PHP 6 HEAD CVS versions. With the release of this next major version of PHP, "the beast" can finally be laid to rest.

1 comment voice your opinion now!
registerglobals history tidbits timeline remove registerglobals history tidbits timeline remove


Zend Developer Zone:
PHP Security Tip #15 (Remove Temporary Files)
March 23, 2007 @ 09:20:00

The Zend Developer Zone has posted security tip #15 today, focusing on an easily forgotten aspect of web development (not just in PHP) - forgetting to remove temporary files.

As developers, most of us are very messy. I've worked on countless projects and at each either run across or left a trail of diagnostic files laying around. (info.php, test.php, doMe.php, etc.) These tiles, if found by someone with nefarious intent, can leak valuable information about your system.

Always remember to remove these types of files...as Cal puts it:

It would be a shame to spend all that time securing your application only to leave info.php or worse yet, a "quick piece of code" in test.php that could potentially leak dangerous information about your system. Don't help the ad guys any more than you have to.
0 comments voice your opinion now!
temporary files remove securitytip diagnostic temporary files remove securitytip diagnostic


Jonathan Diehl's Wiki:
Ajax ActiveTable
August 08, 2006 @ 06:18:46

Jonathan Diehl has submitted a new tutorial today about the creation (and demonstration) of an Ajax ActiveTable with a little help from the Sajax library.

The ActiveTable library creates an editable HTML table from a MySQL database table. The ActiveTable library consists of two classes and a few lines of JavaScript, embedded in a typical environment of a php website. The AJAX calls are realized using the Sajax Toolikit, which must be downloaded and installed separately.

The functionality allows the user to both create and remove rows of data from the database directly with a few simple calls back to a server-side handler to do the work. It can also dynamically create a table for the MySQL data it's looking at to make setup even easier.

The best part? The code for the project is ready for download to be used right away.

0 comments voice your opinion now!
ajax activetable sajax library database table add remove ajax activetable sajax library database table add remove


WeberDev.com:
User Authentication With patUser (Part 2)
June 17, 2006 @ 08:09:51

From WeberDev today, there's part two of their "User Authentication with patUser" series, this timie with a focus on managing user data with other patUser functionality.

patUser can do a lot more than just handle user authentication - the library also comes with a large number of methods designed to make the task of managing user data as simple and efficient as possible. Over the course of this second installment, I'm going to show you how these methods work, and how they can be used to quickly create scripts to view, add, edit and delete users (and user attributes) from your database. Keep reading!

They build on the previous article's foundation (and database) to insert some new user information for manipulation and output. They then give some sample code to pull all of the users from the database, pull details for each user (including additional fields created in a database update), and limiting the results based on one of the fields.

They also include another database table and the needed code to help organize the users into groups. They also include the functionality to add and remove groups and users as well as adding and removing people to/from groups directly from the patUser setup. Finally, they finish it with a few "real life" examples to help it all make sense together.

1 comment voice your opinion now!
patuser user authentication management add remove update delete patuser user authentication management add remove update delete



Community Events











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


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

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