sebastian bergmann  eZ systems employee

› Zend/PHP Conference 2006



I will present a session titled "Testing PHP Applications with PHPUnit 3" at this year's Zend/PHP Conference. The conference will be held in San Jose, CA, the heart of Silicon Valley, from October 30 to November 2, 2006.

I am planning this presentation to be different from the ones I did in the past on the topic of PHPUnit. I want to use "real world" examples from the test suites of both the eZ components and the Zend Framework.
26/08/2006 8:50 am (UTC)   Sebastian Bergmann   View entry   Digg!  digg it!   del.icio.us  del.icio.us

sebastian bergmann  eZ systems employee

› Zend/PHP Conference 2006



I will present a session titled "Testing PHP Applications with PHPUnit 3" at this year's Zend/PHP Conference. The conference will be held in San Jose, CA, the heart of Silicon Valley, from October 30 to November 2, 2006.

I am planning this presentation to be different from the ones I did in the past on the topic of PHPUnit. I want to use "real world" examples from the test suites of both the eZ components and the Zend Framework.
26/08/2006 8:50 am (UTC)   Sebastian Bergmann   View entry   Digg!  digg it!   del.icio.us  del.icio.us

sebastian bergmann  eZ systems employee

› Zend/PHP Conference 2006



I will present a session titled "Testing PHP Applications with PHPUnit 3" at this year's Zend/PHP Conference. The conference will be held in San Jose, CA, the heart of Silicon Valley, from October 30 to November 2, 2006.

I am planning this presentation to be different from the ones I did in the past on the topic of PHPUnit. I want to use "real world" examples from the test suites of both the eZ components and the Zend Framework.
26/08/2006 8:50 am (UTC)   Sebastian Bergmann   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› Peter Goodman's Blog: Observers and Dispatchers

As pointed out by Cal Evans on the Zend Developer Zone, there's a new look at Observers and Dispatchers over on Peter Goodman's blog.

Maybe you've used a framework that uses Observers and Dispatchers, or you've heard of them but don't know how they work. Well, I'm going to explain them and tell you why they're so useful.

He starts with a table defining the parts of this dynamic duo before jumping into the code examples and explainations. His first example is just a basic use of the pattern, while the second involves using a MySQL table for the notification events.

25/08/2006 3:30 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

community news (ez.no)  eZ systems employee

› eZ components 1.1.1

In this release the major change is the way properties and "struct classes" are internally used. In addition, there is an updated version of our documentation generation tool (phpDocumentor) that allows us to display properties in a much nicer way. This release also addresses some PHP 5.2 compatibility issues and includes bug fixes to the following components: ConsoleTools, ImageConversion and Mail.

25/08/2006 11:27 am (UTC)   Community news (ez.no)   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› Prism-Perfect.net: PHP Tag Cloud Tutorial

As pointed out in this post on the Zend Developer Zone, the tag cloud can be a valuable tool to any site using tags for its articles/posts. They also mention a tutorial to help you build one.

Well, it's actually so simple it's not really a tutorial at all so much as a snippet with a bit of explanation. But I've had some people ask how it's done, so here's how I do it. I tried to go through and add some comments about what's happening.

The code pulls the information from a backend database and calculates out what size each of the items needs to be based on the max and min values set in the script.

25/08/2006 2:17 am (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› Hardened-PHP.net: Zend Platform Multiple Remote Vulnerabilities

According to this new advisory on the Hardened-PHP project's site, there are some issues with the Zend Platform product that could cause a number of security issues becaue of malformed session IDs.

During the development of suhosin, which is our new PHP protection module, several compatibility tests with binary 3rd party PHP extensions like the Zend Platform and the Zend Optimizer have been made. When testing the session protection features of suhosin, we discovered that the session clustering system, which is shipping with the Zend Platform is vulnerable to several different attacks.

They mentions a few things a potential attacker could use this issue for, including crashing the session daemon, remote code execution, and being able to view and write files of their choice (like session files) to execute malicious code.

The details are listed out, but a "proof of concept" isn't published for this exploit. Thankfully, Zend has already provided a patch for the issue which can be downloaded at Zend's website (an upgrade to version 2.2.1a).

24/08/2006 2:58 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› Ben Ramsey's Blog: Zend Framework on Ning

In his latest post today, Ben Ramsey decided to be productive in the middle of the night and implemented the Zend Framework over on Ning.

I couldn't sleep tonight, so, instead of doing one of the many other things on my plate that I need to actually work on, I decided to set up the Zend Framework on Ning so that others could clone it and use it for their Ning applications.

He talks more about what Ning is and points out his sample application he's already set up on Ning using the Framework. All a user would need to do is clone it. For more details on the integration, check out this page Ben has set up to help with any confusion.

24/08/2006 2:26 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

php developer

› Adam Trachtenberg's Blog: Stupid PHP one liners: Google calc

One-liners can sometimes be quite helpful in your programming, and in hopes it will help someone out there out, Adam Trachtenberg shares one of his own in his latest blog entry today.

A long time ago, I wrote a two line hack that let you use Google as a command line calculator. It eventually ended up in the 2nd and 3rd editions of Google Hacks.

The code calls the Google Calculator page and pulls back in the contents, allowing you to pass in any sort of calulation you might want and pass back out the result all cleaned up and parsed out.

24/08/2006 2:22 pm (UTC)   PHP Developer   View entry   Digg!  digg it!   del.icio.us  del.icio.us

frederik holljen  eZ systems employee

› Things that should be fixed in PHP - Constructors

Constructors are a beautiful thing of object oriented programming. Unfortunately PHP has a serious design flaw with constructors and inheritance. Consider this class:

class Calc
{
   private $value = null;
   public function __construct( $initValue )
   {
      if( $initValue == 0 )
      {
         throw new Exception( "invalid init value" );
      }
   }

   public function compute( $someOtherValue )
   {
      return $someOtherValue / $this->value;
   }
}
 

The idea here is basically that the constructor performs its task of initializing the object making sure that the member variable $value can never be 0. This way the class is fail safe, it simply cannot go wrong. Or so you think..

So you give your nice Calc code to a friend so he can use it. However, he needs some more functionality so he extends the class


class AdvancedCalc extends Calc
{
   public function __construct()
   {
      // some init of AdvancedCalc
   }

   public function advancedCompute()
   {
      // do stuff here...
      $this->compute();
      // do more stuff...
   }
}
 

All of a sudden his code will crash, in YOUR code. Your friend will blame you, and you thought the code was fail safe! So what is going on here? In your friends code, extending your class he does not call the constructor of the parent class. Boof.. there goes your initializing code and your class will always fail. What is worse is that the error you will get is completely unrelated to any code you have written.

This case is pretty simple. Imagine however what it is like in big projects like eZ components where we write large classes that may be extended by others all the time. Without the constructors the objects of these classes will not be properly set up. Things will fail and the problem will seem to lie with eZ components.

The only way to give a proper warning about such a problem is to have a boolean in our classes that is set when the constructor is run. We can then check this boolean in all the methods. This is dirty hack however, and not a solution to the problem.

The real solution is of course to require that any existing constructors in your parent classes are run. This is common practice in other object oriented languages. Since you can't change this in PHP without breaking backwards compatibility I propose adding a keyword in front of a constructor to require it to be run. For example like this:


class RequiredConstructor
{
   public required __construct()
   {
   }
}
 
24/08/2006 9:19 am (UTC)   Frederik Holljen   View entry   Digg!  digg it!   del.icio.us  del.icio.us

eZ publish™ copyright © 1999-2005 eZ systems as