Skip to end of metadata
Go to start of metadata

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

<ac:macro ac:name="unmigrated-inline-wiki-markup"><ac:plain-text-body><![CDATA[

Zend Framework: Zend_Uuid Component Proposal

Proposed Component Name Zend_Uuid
Developer Notes
Proposers Christoph Kempen
Danny Verkade
Zend Liaison TBD
Revision 0.7 - 11 March 2010: Initial Draft. (wiki revision: 26)

Table of Contents

1. Overview

Zend_Uuid is a simple component that generates a UUID according to the RFC 4122 standard. Only support for version 1, 3, 4 and 5 UUID are built-in.

2. References

3. Component Requirements, Constraints, and Acceptance Criteria

  • This component will generate UUIDs strictly complying with RFC 4122.
  • This component will use /dev/urandom on *nix platforms.
  • This component will use CAPICOM's getRandom method on Windows platforms.
  • This component will compare UUIDs in different formats (eg. canonical string, lowercase hex string, uppercase hex string, binary, URN).
  • This component will import UUIDs and transform them to a different format.

4. Dependencies on Other Framework Components

  • Zend_Exception

5. Theory of Operation

You can use Zend_Uuid to quickly generate a UUID.

6. Milestones / Tasks

The main code is ready. Zend_Uuid class is ready. Need to generate test-cases and Zend_Validation script. The Zend Validation Script will use the Zend_Uuid class, since validation is already in there.

  • Milestone 1: [DONE] Get proposal ready for review.
  • Milestone 2: Code the Zend_Validate_Uuid class.
  • Milestone 3: Generate Unit Tests

7. Class Index

  • Zend_Uuid
  • Zend_Validate_Uuid
  • Zend_Uuid_Exception

8. Use Cases

9. Class Skeletons



uuid uuid Delete
Enter labels to add to this page:
Please wait 
Looking for a label? Just start typing.
  1. Mar 11, 2010

    <p>Hey guys,<br />
    please take a look at <a class="external-link" href=""></a><br />
    I have already proposed a UUID implementation and a validator, which is feature-complete. Maybe we can work together on this one? Feel free to contact me.</p>

  2. Aug 06, 2010

    <p>Why not wrap PHP's native uuid functions if available? They will provide significant speed improvements over a pure PHP implementation. This component will be a great way to generate UUID's on systems that don't have the uuid functions such as uuid_create available...making code more portable. We should attempt to provide a consistent wrapper for the native functions where possible, for speed considerations.</p>

  3. Aug 04, 2010

    <p>Hi all,</p>

    <p>An email from the new Community Rewview Team (CR-Team) to Christoph was undeliverable (bad email address?) so maybe this comment will make it through. ZF2 is in need of a UUID component in the near future. I would urge the proposal authors to collaborate with Stephan Wentz and bring this forward to the Ready For Recommendation section of the ZFPROP wiki at your earliest convenience. Unfortunately, it will have to be ZF 2.0 (PHP 5.3) but changes to the source code are relatively simple.</p>

    <p>Please let me know as soon as possible (I hate duplicating proposed functionality <ac:emoticon ac:name="wink" />).</p>


    1. Aug 04, 2010

      <p>This implementation here is far superiour to mine. I will delete mine, hope they'll answer soon to get this into ZF.</p>

      <p>Nevertheless I will mainting the UUID validator and move it to the ready-to-review section soon.</p>

    2. Oct 03, 2010


      <p>I will test the code against the latest ZF 2.0 code. And implement some unit tests. If that is done i will forward it to Ready For Recommendation</p>

      <p>Sorry for the late response..</p>


  4. Oct 25, 2010

    <p>Added ZendFramework 2.0 ready code. I'm now working on the unit tests...</p>

  5. Feb 05, 2011

    <p><strong>Community Review Team Recommendation</strong></p>
    <ac:macro ac:name="note"><ac:rich-text-body><p>The Community Review team recommends this proposal be accepted for inclusion in the Framework in the Zend\StdLib namespace.</p>

    <p>The team also recommends support for RFC4122 (Chapters 4.1.6 & 4.1.7)</p></ac:rich-text-body></ac:macro>

  6. May 26, 2011

    <p>In zf2, your classname should be just <strong>Uuid</strong> instead of <span style="text-decoration: line-through;">Zend_Uuid</span>, and you need to refactor Exception.</p>

    <p>You should have a subnamespace Zend\Uuid\Exception implements interface Zend\Uuid\Exception, and extends SplException like InvalidArgumentException, or RuntimeException.</p>

    <p>The coding standard for constance is uppercase with underscore : <span style="text-decoration: line-through;">nsDNS</span> should be <strong>NS_DNS</strong>.</p>

    <p>I think this is a first step towards a uuid server for webservices.</p>