Useful element for building regex matching a path + depth.

This commit is contained in:
Andrew McMillan 2006-12-11 19:16:01 +13:00
parent f72d204f4e
commit 77117734e7

View File

@ -220,6 +220,16 @@ class CalDAVRequest
return $this->depth;
}
/**
* Returns the tail of a Regex appropriate for this Depth, when appended to
*
*/
function DepthRegexTail( ) {
if ( $this->IsInfiniteDepth() ) return '';
if ( $this->depth == 0 ) return '$';
return '[^/]*/?$';
}
/**
* Returns the locked row, either from the cache or from the database
*