use class constants here as well
authorMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 28 Sep 2009 20:29:17 +0000 (16:29 -0400)
committerMichael J. Rubinsky <mrubinsk@horde.org>
Mon, 28 Sep 2009 20:29:17 +0000 (16:29 -0400)
framework/Lock/lib/Horde/Lock.php
framework/Lock/lib/Horde/Lock/Sql.php

index c54f45e..c3117ac 100644 (file)
@@ -103,8 +103,8 @@ class Horde_Lock
      *                           to be in URI form.
      * @param int $lifetime      Time (in seconds) for which the lock will be
      *                           considered valid.
-     * @param string exclusive   One of HORDE_LOCK_TYPE_SHARED or
-     *                           HORDE_LOCK_TYPE_EXCLUSIVE.
+     * @param string exclusive   One of self::TYPE_SHARED or
+     *                           self::TYPE_EXCLUSIVE.
      *                           - An exclusive lock will be enforced strictly
      *                             and must be interpreted to mean that the
      *                             resource can not be modified.  Only one
@@ -123,7 +123,7 @@ class Horde_Lock
      * @throws Horde_Log_Exception
      */
     public function setLock($requestor, $scope, $principal,
-                     $lifetime = 1, $exclusive = HORDE_LOCK_TYPE_SHARED)
+                     $lifetime = 1, $exclusive = self::TYPE_SHARED)
     {
         throw new Horde_Log_Exception(_("No lock driver configured!"));
     }
index 70c7745..62d2f59 100644 (file)
@@ -240,14 +240,14 @@ class Horde_Lock_Sql extends Horde_Lock
      * @see Horde_Lock::setLock
      */
     public function setLock($requestor, $scope, $principal,
-                     $lifetime = 1, $type = HORDE_LOCK_TYPE_SHARED)
+                     $lifetime = 1, $type = self::TYPE_SHARED)
     {
        if (is_a(($result = $this->_connect()), 'PEAR_Error')) {
             Horde::logMessage($result, __FILE__, __LINE__, PEAR_LOG_ERR);
             throw new Horde_Lock_Exception(_("Internal database error.  Details have been logged for the administrator."));
         }
 
-        $oldlocks = $this->getLocks($scope, $principal,  HORDE_LOCK_TYPE_EXCLUSIVE);
+        $oldlocks = $this->getLocks($scope, $principal,  self::TYPE_EXCLUSIVE);
         if (is_a($oldlocks, 'PEAR_Error')) {
             throw new Horde_Lock_Exception($oldlocks->getMessage());
         }