--- /dev/null
+<?php
+/**
+ * @category Horde
+ * @package Support
+ * @copyright 2009 The Horde Project (http://www.horde.org/)
+ * @license http://opensource.org/licenses/bsd-license.php
+ */
+
+/**
+ * Class for generating GUIDs. Usage:
+ *
+ * <code>
+ * <?php
+ *
+ * $uid = (string)new Horde_Support_Guid;
+ *
+ * ?>
+ * </code>
+ *
+ * @category Horde
+ * @package Support
+ * @copyright 2009 The Horde Project (http://www.horde.org/)
+ * @license http://opensource.org/licenses/bsd-license.php
+ */
+class Horde_Support_Guid
+{
+ /**
+ * Generated GUID
+ * @var string
+ */
+ private $_guid;
+
+ /**
+ * New GUID
+ */
+ public function __construct()
+ {
+ $this->generate();
+ }
+
+ /**
+ * Generates a GUID.
+ *
+ * @return string
+ */
+ public function generate()
+ {
+ $this->_guid = date('YmdHis')
+ . '.'
+ . substr(str_pad(base_convert(microtime(), 10, 36), 16, uniqid(mt_rand()), STR_PAD_LEFT), -16)
+ . '@'
+ . (isset($_SERVER['SERVER_NAME']) ? $_SERVER['SERVER_NAME'] : 'localhost');
+ }
+
+ /**
+ * Cooerce to string
+ *
+ * @return string
+ */
+ public function __toString()
+ {
+ return $this->_guid;
+ }
+
+}
<file name="Array.php" role="php" />
<file name="Backtrace.php" role="php" />
<file name="ConsistentHash.php" role="php" />
+ <file name="Guid.php" role="php" />
<file name="Inflector.php" role="php" />
<file name="Numerizer.php" role="php" />
<file name="Stack.php" role="php" />
<install name="lib/Horde/Support/Array.php" as="Horde/Support/Array.php" />
<install name="lib/Horde/Support/Backtrace.php" as="Horde/Support/Backtrace.php" />
<install name="lib/Horde/Support/ConsistentHash.php" as="Horde/Support/ConsistentHash.php" />
+ <install name="lib/Horde/Support/Guid.php" as="Horde/Support/Guid.php" />
<install name="lib/Horde/Support/Inflector.php" as="Horde/Support/Inflector.php" />
<install name="lib/Horde/Support/Numerizer/Locale/Base.php" as="Horde/Support/Numerizer/Locale/Base.php" />
<install name="lib/Horde/Support/Numerizer/Locale/De.php" as="Horde/Support/Numerizer/Locale/De.php" />