Source for file _parse_lockinfo.php
Documentation is available at _parse_lockinfo.php
+----------------------------------------------------------------------+
| Copyright (c) 2002-2007 Christian Stocker, Hartmut Holzgraefe |
| Redistribution and use in source and binary forms, with or without |
| modification, are permitted provided that the following conditions |
| 1. Redistributions of source code must retain the above copyright |
| notice, this list of conditions and the following disclaimer. |
| 2. Redistributions in binary form must reproduce the above copyright |
| notice, this list of conditions and the following disclaimer in |
| the documentation and/or other materials provided with the |
| 3. The names of the authors may not be used to endorse or promote |
| products derived from this software without specific prior |
| THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS |
| "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT |
| LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS |
| FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE |
| COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, |
| INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, |
| BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; |
| LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER |
| CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT |
| LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN |
| ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE |
| POSSIBILITY OF SUCH DAMAGE. |
+----------------------------------------------------------------------+
* helper class for parsing LOCK request bodies
* @package HTTP_WebDAV_Server
* @author Hartmut Holzgraefe <hholzgra@php.net>
* @version @package-version@
* lock type, currently only "write"
* lock scope, "shared" or "exclusive"
* flag that is set during lock owner read
var $collect_owner = false;
* @param string path of stream to read
// we assume success unless problems occur
// remember if any input was parsed
$f_in = fopen($path, "r");
// create namespace aware parser
// set tag and data handlers
array (&$this, "_startElement"),
array (&$this, "_endElement"));
// we want a case sensitive parser
XML_OPTION_CASE_FOLDING , false );
// check if required tags where found
* @param array tag attributes
function _startElement ($parser, $name, $attrs)
list ($ns, $tag) = explode(" ", $name);
if ($this->collect_owner) {
// everything within the <owner> tag needs to be collected
$ns_attr = " xmlns='$ns'";
$this->owner .= " <$ns_short$tag$ns_attr>";
} else if ($ns == "DAV:") {
// parse only the essential tags
$this->collect_owner = true;
function _data ($parser, $data)
// only the <owner> tag has data content
if ($this->collect_owner) {
function _endElement ($parser, $name)
list ($ns, $tag) = explode(" ", $name);
if (($ns == "DAV:") && ($tag == "owner")) {
$this->collect_owner = false;
// within <owner> we have to collect everything
if ($this->collect_owner) {
$ns_attr = " xmlns='$ns'";
$this->owner .= " </$ns_short$tag$ns_attr>";
Documentation generated on Mon, 11 Mar 2019 15:50:56 -0400 by phpDocumentor 1.4.4. PEAR Logo Copyright © PHP Group 2004.
|