News Feed
Jobs Feed
Sections

Recent Jobs

News Archive
feed this:

Sebastian Bergmann's Blog:
Freezing and Thawing PHP Objects
December 01, 2008 @ 11:12:18

Sebastian Bergmann has posted details (and a patch) for freezing and unfreezing objects via the new setAccessible method included in the SPL in PHP 5.3.

One of the many new features that have been added for PHP 5.3 is the setAccessible() method of the ReflectionProperty class that is part of PHP's Reflection API. This method makes protected and private attributes (unfortunately, the class is called ReflectionProperty instead of ReflectionAttribute) of a class or object accessible for the ReflectionProperty::getValue() and ReflectionProperty::setValue() methods, thus making protected and private attributes "open" for full read and write access from the outside.

A bit of code shows how to "freeze" and "thaw" the objects out - creating an object, calling the freeze() method on it to protect it from use, then the thaw() method to bring it back out where it can be accessed. Stefan Priebsch helped to create this class and the patch.

0 comments voice your opinion now!
freeze thaw object php5 patch spl setaccessible



PHPro.org:
Calculate Friday The 13th With Datetime Class
December 01, 2008 @ 08:46:51

As an introduction to the Datetime class functionality PHP 5 has, Kevin Waterson shows how to use it to calculate the "Friday the 13th" for any year.

This class is a request from a PHPRO.ORG regular who asked for a method to calculate Friday the 13th for the next n years. The calculation itself is easy, however, it presents a good opportunity to introduce the PHP datetime class.

He points out that timestamps, because of they way integers are handled, have a somewhat limited lifespan (2038) and dates beyond that cannot be determined by the usual date functions. Instead, he shows how to set up a DateTime object, set a timezone and loop through the days to find the Fridays that land on the 13th.

0 comments voice your opinion now!
tutorial datetime class php5 friday thirteenth


Marco Tabini's Blog:
It turns out, I was wrong
December 01, 2008 @ 07:54:29

Correcting himself from some previous comments concerning PHP 5 versus PHP 4 usage among developers, Marco Tabini has posted something new to his blog with some updated stats.

In the past, I have not been shy about sharing my opinion that the impending death of PHP 4 would have wreaked all sorts of havoc over the PHP world. I am glad to say that I've been wrong - dead wrong, in fact - and that I have never been as happy to be so far off the mark before.

According to a readers survey that the php|architect magazine ran (about a year ago even) PHP 5 is stronger than ever, taking up well over sixty percent of the usage with only a small part still hanging with PHP 4. Check out his graph for the full rankings.

0 comments voice your opinion now!
statistics php4 php5 usage correction phparchitect survey reader


DevShed:
Building a User Management Application
November 25, 2008 @ 10:24:33

On DevShed.com today they're continuing a series with part two of their look at user management - more specifically at the creation of a user management application for access control.

Any application that is security critical will have some kind of method to track and maintain user activity. In this article we will begin to build a user management system that will give us control over who has access to which part of our application.

The system's functionality will also provide authentication support (not just role management) and allows for user registration, "forgot my password" and password management. Code and database information for the ten files needed to make the system are included.

0 comments voice your opinion now!
user management application php5 tutorial password authentication


NETTUTS.com:
Create a PHP5 Framework - Part 3
November 25, 2008 @ 08:47:01

NETTUTS.com has posted the third part of their series on creating a simple PHP5 framework today:

Now that we've got a basic framework (see part 1 and part 2 of this series), we can start thinking about integrating designs with our PHP framework. For now, we'll concentrate on the front-end design, including how we can make it easy to 'skin' our new framework.

This part looks mostly at the HTML and CSS for the presentation layer (the views) to make a simple two-column layout with some basic image and text content.

0 comments voice your opinion now!
tutorial series php5 framework view layer html css output


Builder.com.au:
Quickly Install a LAMP server on Ubuntu
November 24, 2008 @ 11:14:17

This recent article from the Builder.com.au website shows exactly how simple it is to get a LAMP server up and running on your Ubuntu installation.

I can't tell you how many times I have been asked what is the fastest, easiest way to install a LAMP (Linux Apache, MySQL, PHP) server on Ubuntu. Well, I guess it's time I just post it here for everyone to enjoy.

You're just two apt-get calls and a few various commands away from pulling in an Apache 2 web server and a PHP5 module that has MySQL support already built in. Set the password for the MySQL installation and you're all set to go.

0 comments voice your opinion now!
lamp server ubuntu linux apache php5 mysql tutorial


WebReference.com:
Administering RBAC in PHP 5 CMS Framework
November 20, 2008 @ 10:28:15

WebReference.com continues their series looking at user administration in content management systems. This time they look at the importance of user roles and some code to add to help manage them.

Although the operations are simple, it is vital that they be handled correctly. It is generally a poor principle to allow access to the mechanisms of a system rather than providing an interface through class methods. The latter approach ideally allows the creation of a robust interface that changes relatively infrequently, while details of implementation can be modified without affecting the rest of the system.

Their code includes methods to get all roles for a user, check to see which they are permitted to use, add a "permit" role and remove it back out. The tutorial is an excerpt from the Packt book PHP5 CMS Framework Development (Martin Brampton).

0 comments voice your opinion now!
rbac php5 framework tutorial excerpt packt role


Sameer's Blog:
Easy way to build GET query strings in php
November 13, 2008 @ 12:47:01

Sameer has come up with an easy way to build out query strings to use in your GET requests:

Passing variables with a url is such a frequent thing programmers do that most of you may think this post is unwarranted. We call this method of passing variables as GET, the other being POST. It is one of those things which can be easily done in php. [...] The best way to pass GET variables is to use the http_build_query() function available from php version 5; which takes an array of variables and builds a nice URL encoded string which you can append to a url. And example is shown below.

He includes two code examples - one showing "the old way" of building it out by hand and the other using the http_build_query function. You pass in an array and what to connect them with and it builds out the string, no matter how many arguments there are.

0 comments voice your opinion now!
php5 httpbuildquery query string build tutorial


IBM developerWorks:
What's new in PHP V5.3, Part 1 Changes to the object interface
November 12, 2008 @ 11:13:30

John Mertic has put together a what's new list in the upcoming PHP 5.3 release:

PHP V5.3 is set to be released by the end of 2008, and many of the new features in this release have been in the planning stages for a few years. Originally touted as "PHP V6 without native Unicode support," PHP V5.3 has been developed into a feature-rich upgrade to the PHP V5 line. [...] In this "What's new in PHP V5.3" series, we'll look at these new V5.3 features, and see how they are used and how they can be used in your Web application.

In this first part of the series he talks about:

  • Improved static method and member handling
  • The _callStatic() magic method
  • Dynamic static calls
  • Late static binding
  • Standard PHP Library
  • Circular garbage collection
0 comments voice your opinion now!
object interface php5 whatsnew static lsb spl garbage collection


Pierre-Alain Joye's Blog:
PHP 5.2.7RC3 Released (Go test!)
November 10, 2008 @ 11:13:18

Pierre-Alain Joye has pointed out that the latest release candidate of the PHP 5.2.x series (5.2.7RC3) has been posted for download.

PHP 5.2.7RC3 has been released. It is likely to be the last RC and the final release is planed for Thursday next week. Please test it and report any issue you may found. The sources can be fetched here and the binaries in the windows site.

He also mentions a milestone for the PHP project - releasing the Windows builds at the same time as the normal source builds. Check out on the php.internals list for more information.

0 comments voice your opinion now!
php5 release candidate test windows build binary



Community Events







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


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

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