fix PHP Deprecated: Methods with the same name as their class will not be constructors in a future version of PHP

This commit is contained in:
Ralf Becker 2016-05-26 11:27:03 +02:00
parent 5f62492b9c
commit 2b2845fff7
3 changed files with 18 additions and 18 deletions

View File

@ -36,12 +36,12 @@
/** /**
* helper class for parsing LOCK request bodies * helper class for parsing LOCK request bodies
* *
* @package HTTP_WebDAV_Server * @package HTTP_WebDAV_Server
* @author Hartmut Holzgraefe <hholzgra@php.net> * @author Hartmut Holzgraefe <hholzgra@php.net>
* @version @package-version@ * @version @package-version@
*/ */
class _parse_lockinfo class _parse_lockinfo
{ {
/** /**
* success state flag * success state flag
@ -82,21 +82,21 @@ class _parse_lockinfo
* @access private * @access private
*/ */
var $collect_owner = false; var $collect_owner = false;
/** /**
* constructor * constructor
* *
* @param string path of stream to read * @param string path of stream to read
* @access public * @access public
*/ */
function _parse_lockinfo($path) function __construct($path)
{ {
// we assume success unless problems occur // we assume success unless problems occur
$this->success = true; $this->success = true;
// remember if any input was parsed // remember if any input was parsed
$had_input = false; $had_input = false;
// open stream // open stream
$f_in = fopen($path, "r"); $f_in = fopen($path, "r");
if (!$f_in) { if (!$f_in) {
@ -125,7 +125,7 @@ class _parse_lockinfo
$had_input = true; $had_input = true;
$this->success &= xml_parse($xml_parser, $line, false); $this->success &= xml_parse($xml_parser, $line, false);
} }
} }
// finish parsing // finish parsing
if ($had_input) { if ($had_input) {
@ -140,9 +140,9 @@ class _parse_lockinfo
xml_parser_free($xml_parser); xml_parser_free($xml_parser);
// close input stream // close input stream
fclose($f_in); fclose($f_in);
} }
/** /**
* tag start handler * tag start handler
@ -153,7 +153,7 @@ class _parse_lockinfo
* @return void * @return void
* @access private * @access private
*/ */
function _startElement($parser, $name, $attrs) function _startElement($parser, $name, $attrs)
{ {
// namespace handling // namespace handling
if (strstr($name, " ")) { if (strstr($name, " ")) {
@ -162,8 +162,8 @@ class _parse_lockinfo
$ns = ""; $ns = "";
$tag = $name; $tag = $name;
} }
if ($this->collect_owner) { if ($this->collect_owner) {
// everything within the <owner> tag needs to be collected // everything within the <owner> tag needs to be collected
$ns_short = ""; $ns_short = "";
@ -192,7 +192,7 @@ class _parse_lockinfo
} }
} }
} }
/** /**
* data handler * data handler
* *
@ -201,7 +201,7 @@ class _parse_lockinfo
* @return void * @return void
* @access private * @access private
*/ */
function _data($parser, $data) function _data($parser, $data)
{ {
// only the <owner> tag has data content // only the <owner> tag has data content
if ($this->collect_owner) { if ($this->collect_owner) {
@ -217,7 +217,7 @@ class _parse_lockinfo
* @return void * @return void
* @access private * @access private
*/ */
function _endElement($parser, $name) function _endElement($parser, $name)
{ {
// namespace handling // namespace handling
if (strstr($name, " ")) { if (strstr($name, " ")) {

View File

@ -109,9 +109,9 @@ class _parse_propfind
* *
* @access public * @access public
* @param string $path * @param string $path
* @param boolean $store_request=false if true whole request data will be made available in $this->request * @param boolean $store_request =false if true whole request data will be made available in $this->request
*/ */
function _parse_propfind($path, $store_request=false) function __construct($path, $store_request=false)
{ {
// success state flag // success state flag
$this->success = true; $this->success = true;

View File

@ -94,10 +94,10 @@ class _parse_proppatch
* constructor * constructor
* *
* @param string path of input stream * @param string path of input stream
* @param boolean $store_request=false if true whole request data will be made available in $this->request * @param boolean $store_request =false if true whole request data will be made available in $this->request
* @access public * @access public
*/ */
function _parse_proppatch($path, $store_request=false) function __construct($path, $store_request=false)
{ {
$this->success = true; $this->success = true;