1
|
|
|
<?php
|
2
|
|
|
/**
|
3
|
|
|
* Copyright (c) STMicroelectronics, 2010. All Rights Reserved.
|
4
|
|
|
*
|
5
|
|
|
* This file is a part of Codendi.
|
6
|
|
|
*
|
7
|
|
|
* Codendi is free software; you can redistribute it and/or modify
|
8
|
|
|
* it under the terms of the GNU General Public License as published by
|
9
|
|
|
* the Free Software Foundation; either version 2 of the License, or
|
10
|
|
|
* (at your option) any later version.
|
11
|
|
|
*
|
12
|
|
|
* Codendi is distributed in the hope that it will be useful,
|
13
|
|
|
* but WITHOUT ANY WARRANTY; without even the implied warranty of
|
14
|
|
|
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
15
|
|
|
* GNU General Public License for more details.
|
16
|
|
|
*
|
17
|
|
|
* You should have received a copy of the GNU General Public License
|
18
|
|
|
* along with Codendi. If not, see <http://www.gnu.org/licenses/>.
|
19
|
|
|
*/
|
20
|
|
|
|
21
|
|
|
/**
|
22
|
|
|
* This file is used only to simulate classes needed to be just declared in tests
|
23
|
|
|
*/
|
24
|
|
|
|
25
|
|
|
class Sabre_DAV_Exception extends Exception {}
|
26
|
|
|
class Sabre_DAV_Exception_RequestedRangeNotSatisfiable extends Sabre_DAV_Exception {}
|
27
|
|
|
class Sabre_DAV_Exception_FileNotFound extends Sabre_DAV_Exception {}
|
28
|
|
|
class Sabre_DAV_Exception_Conflict extends Sabre_DAV_Exception {}
|
29
|
|
|
class Sabre_DAV_Exception_Forbidden extends Sabre_DAV_Exception {}
|
30
|
|
|
class Sabre_DAV_Exception_MethodNotAllowed extends Sabre_DAV_Exception {}
|
31
|
|
|
class Sabre_DAV_Exception_BadRequest extends Sabre_DAV_Exception {}
|
32
|
|
|
class WebDAVExceptionServerError extends Sabre_DAV_Exception {}
|
|
|
|
|
33
|
|
|
|
34
|
|
|
class Sabre_DAV_File {}
|
35
|
|
|
class Sabre_DAV_Directory {}
|
36
|
|
|
|
37
|
|
|
class Sabre_DAV_ObjectTree {}
|
38
|
|
|
class Sabre_DAV_URLUtil {
|
39
|
|
|
static function splitPath($path) {
|
40
|
|
|
$matches = array();
|
41
|
|
|
if(preg_match('/^(?:(?:(.*)(?:\/+))?([^\/]+))(?:\/?)$/u',$path,$matches)) {
|
42
|
|
|
return array($matches[1],$matches[2]);
|
43
|
|
|
} else {
|
44
|
|
|
return array(null,null);
|
45
|
|
|
}
|
46
|
|
|
}
|
47
|
|
|
}
|
48
|
|
|
|
49
|
|
|
?> |
This check looks for classes that have been defined more than once.
If you can, we would recommend to use standard object-oriented programming techniques. For example, to avoid multiple types, it might make sense to create a common interface, and then multiple, different implementations for that interface.
This also has the side-effect of providing you with better IDE auto-completion, static analysis and also better OPCode caching from PHP.