loader.soap.php ➔ ldMkDir()   A
last analyzed

Complexity

Conditions 2
Paths 2

Size

Total Lines 13

Duplication

Lines 13
Ratio 100 %

Code Coverage

Tests 0
CRAP Score 6

Importance

Changes 0
Metric Value
cc 2
nc 2
nop 1
dl 13
loc 13
rs 9.8333
c 0
b 0
f 0
ccs 0
cts 11
cp 0
crap 6
1
<?php
2
    /******************************************************************
3
     loader.soap.php                                       Muze Ariadne
4
     ------------------------------------------------------------------
5
     Author: Muze ([email protected])
6
     Date: 11 december 2002
7
8
     Copyright 2002 Muze
9
10
     This file is part of Ariadne.
11
12
     Ariadne is free software; you can redistribute it and/or modify
13
     it under the terms of the GNU General Public License as published
14
     by the Free Software Foundation; either version 2 of the License,
15
     or (at your option) any later version.
16
17
     Ariadne is distributed in the hope that it will be useful,
18
     but WITHOUT ANY WARRANTY; without even the implied warranty of
19
     MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
20
     GNU General Public License for more details.
21
22
     You should have received a copy of the GNU General Public License
23
     along with Ariadne; if not, write to the Free Software
24
     Foundation, Inc., 59 Temple Place, Suite 330, Boston, MA
25
     02111-1307  USA
26
27
    -------------------------------------------------------------------
28
29
     Description:
30
31
	Contains all loader functions for the Ariadne Soap interface.
32
33
    ******************************************************************/
34
35
	$ERRMODE="htmljs"; // alternative: "text"/"html"/"js"
36
37
	require_once($store_config['code']."include/loader.soap.server.php");
38
39
	$DB["method"]["loader"] = false;
40
	$DB["method"]["file"] = true;
41
	$DB["file"] = "/tmp/soap.log";
42
43
	function error($text, $code="Client.Unkown") {
0 ignored issues
show
Best Practice introduced by
The function error() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L48-50) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
44
		global $SOAP_Fault;
45
			debug("soap::ldObjectNotFound($requestedpath, $requestedtemplate)", "loader");
0 ignored issues
show
Bug introduced by
The variable $requestedpath does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
Bug introduced by
The variable $requestedtemplate does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
46
			$SOAP_Fault = new soap_fault(
47
							$code,
48
							$text,
49
							"Server could not find $requestedpath::$requestedtemplate");
50
51
		debug("error: '$text'");
52
	}
53
54
55
	function ldCheckLogin($login, $password) {
56
	global $ARLogin, $ARPassword, $store, $AR;
57
		debug("soap::ldCheckLogin($login, [password])");
58
		$criteria = array();
59
		$criteria["object"]["implements"]["="]="puser";
60
		$criteria["login"]["value"]["="]=$login;
61
		$result = $store->call(
62
						"system.authenticate.phtml",
63
						Array(
64
							"ARPassword" => $password
65
						),
66
						$store->find("/system/users/", $criteria)
67
					);
68
69
		if (!count($result)) {
70
			//echo "<script> alert('1'); </script>\n";
71
			$user = current(
72
					$store->call(
73
						"system.authenticate.phtml",
74
						Array(
75
							"ARLogin" => $login,
76
							"ARPassword" => $password
77
						),
78
						$store->get("/system/users/extern/")
79
					));
80
		} else {
81
			$user = current($result);
82
		}
83
84
		if ($user) {
85
//			if ($login !== "public") {
86
//				/* welcome to Ariadne :) */
87
//				ldSetCredentials($login, $password);
88
//			}
89
			$ARLogin = $login;
90
			$ARPassword = 0;
91
			$AR->user = $user;
92
			$result = true;
93
		} else {
94
			debug("ldAuthUser: user('$user') could not authenticate", "all");
95
		}
96
		return $result;
97
	}
98
99
100
	function ldRegisterFile($field = "file", &$error) {
0 ignored issues
show
Best Practice introduced by
The function ldRegisterFile() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L52-81) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
101
	global $ARnls, $store, $arguments;
102
		debug("ldRegisterFile([$field], [error])");
103
104
		require_once($store->code."modules/mod_mimemagic.php");
105
106
		$result = Array();
107
		$file_data = $arguments[$field];
108
		if ($file_data) {
109
			$file_data = base64_decode($file_data);
110
			if (!$file_data) {
111
				$error = "could not base64_decode file '$field'";
112
			} else {
113
				$file_temp = tempnam($store->get_config("files")."temp", "upload");
114
				$fp = fopen($file_temp, "wb+");
115 View Code Duplication
				if (!$fp) {
116
					$error = "could not write file '$field'";
117
				} else {
118
					debug("	file_data (".$file_data.")");
119
					fwrite($fp, $file_data, strlen($file_data));
120
					fclose($fp);
121
122
					$file_type = get_mime_type($file_temp);
123
124
					$result[$field] = $field;
125
					$result[$field."_temp"] = substr($file_temp, strlen($store->get_config("files")."temp/"));
126
					$result[$field."_size"] = filesize($file_temp);
127
					$result[$field."_type"] = $file_type;
128
					debug(" http_post_vars (".serialize($result).")");
129
				}
130
			}
131
		}
132
		debug("ldRegisterFile[end] ($result)");
133
		return $result;
134
	}
135
136
137
138
	function ldObjectNotFound($requestedpath, $requestedtemplate) {
0 ignored issues
show
Best Practice introduced by
The function ldObjectNotFound() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L157-159) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
139
	global $SOAP_Fault;
140
		debug("soap::ldObjectNotFound($requestedpath, $requestedtemplate)", "loader");
141
		$SOAP_Fault = new soap_fault(
142
						"Client.ObjectNotFound",
143
						"",
144
						"Server could not find $requestedpath::$requestedtemplate");
145
	}
146
147
	function ldAccessDenied($path, $message) {
0 ignored issues
show
Unused Code introduced by
The parameter $path is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
The function ldAccessDenied() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L83-88) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
148
	global $SOAP_Fault, $store;
149
150
		$SOAP_Fault = new soap_fault(
151
						"Client.AccessDenied",
152
						"",
153
						$message);
154
	}
155
156 View Code Duplication
	function ldSetRoot($session='', $nls='') {
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Best Practice introduced by
The function ldSetRoot() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L90-92) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
157
	global $store, $AR, $ARCurrent, $root, $rootoptions;
158
159
		$root=$AR->root;
160
		$rootoptions="";
161
		if ($session) {
162
			$rootoptions.="/-".$session."-";
163
			$ARCurrent->session->id=$session;
164
		}
165
		if ($nls) {
166
			$rootoptions.="/$nls";
167
			$ARCurrent->nls=$nls;
168
		}
169
		$root.=$rootoptions;
170
		if ($store) { // loader.php uses this function before the store is initialized.
171
			$store->root=$root;
172
			$store->rootoptions=$rootoptions;
173
		}
174
	}
175
176
	function ldSetNls($nls) {
0 ignored issues
show
Best Practice introduced by
The function ldSetNls() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L94-96) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
177
	global $ARCurrent;
178
179
		$session=$ARCurrent->session->id;
180
		ldSetRoot($session, $nls);
181
	}
182
183
	function ldSetSession($session='') {
0 ignored issues
show
Best Practice introduced by
The function ldSetSession() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L98-100) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
184
	global $ARCurrent, $ARLogin, $ARPassword;
185
186
		$nls=$ARCurrent->nls;
187
		ldSetRoot($session, $nls);
188
	}
189
190 View Code Duplication
	function ldStartSession($sessionid='') {
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Best Practice introduced by
The function ldStartSession() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L102-104) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
191
	global $ARCurrent, $AR, $ariadne;
192
193
		require($ariadne."/configs/sessions.phtml");
194
		$ARCurrent->session=new session($session_config,$sessionid);
0 ignored issues
show
Bug introduced by
The variable $session_config does not exist. Did you forget to declare it?

This check marks access to variables or properties that have not been declared yet. While PHP has no explicit notion of declaring a variable, accessing it before a value is assigned to it is most likely a bug.

Loading history...
195
		ldSetSession($ARCurrent->session->id);
196
	}
197
198
	function ldSetCache($file, $time, $image, $headers) {
0 ignored issues
show
Unused Code introduced by
The parameter $image is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $headers is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
The function ldSetCache() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L106-108) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
199
	global $store;
200
201
		debug("ldSetCache($file, $time, [image], [headers])","object");
202
		debug("ldSetCache::not implemented\n");
203
	}
204
205 View Code Duplication
	function ldMkDir($dir) {
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
206
	global $store;
207
208
		debug("ldMkDir($dir)","object");
209
		$dir=strtok($dir, "/");
210
		$curr=$store->get_config("files");
211
		while ($dir) {
212
			$curr.=$dir."/";
213
			debug("ldMkDir: $curr","all");
214
			@mkdir($curr, 0755);
215
			$dir=strtok("/");
216
		}
217
	}
218
219
	function ldGetCredentials() {
0 ignored issues
show
Best Practice introduced by
The function ldGetCredentials() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L124-125) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
220
		return false;
221
	}
222
223
	function ldSetCredentials($login, $password) {
0 ignored issues
show
Best Practice introduced by
The function ldSetCredentials() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L127-128) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
224
	global $ARCurrent, $SOAP_SessionID;
225
226
		// Make sure the login is lower case. Because of the
227
		// numerous checks on "admin".
228
		$login = strtolower( $login );
229
230
		debug("ldSetCredentials($login, [password])","object");
231
		$ARCurrent->session->put("ARLogin", $login);
232
		$ARCurrent->session->put("ARPassword", $password, 1);
233
		$SOAP_SessionID = $ARCurrent->session->id.
234
							md5($ARCurrent->session->id.
235
									$login.$password);
236
237
		return $SOAP_SessionID;
238
	}
239
240
	function ldCheckCredentials($login, $password) {
0 ignored issues
show
Unused Code introduced by
The parameter $login is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $password is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
The function ldCheckCredentials() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L130-131) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
241
	global $ARCurrent, $SOAP_SessionID;
242
		debug("ldCheckCredentials()","object");
243
		$result = false;
244
		if ($ARCurrent->session && $SOAP_SessionID) {
245
			$sessionid = $ARCurrent->session->id;
246
			$md5_hash = $sessionid.md5($sessionid.
247
						$ARCurrent->session->get("ARLogin").
248
						$ARCurrent->session->get("ARPassword",1));
249
			debug("soap:: checking ($md5_hash) against $SOAP_SessionID", "loader");
250
			if ($md5_hash == $SOAP_SessionID) {
251
				$result = true;
252
			}
253
		}
254
		return $result;
255
	}
256
257
	function ldRedirect($uri) {
0 ignored issues
show
Best Practice introduced by
The function ldRedirect() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L133-134) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
258
		return ldHeader("Location: $uri");
259
	}
260
261
	function ldHeader($header) {
0 ignored issues
show
Best Practice introduced by
The function ldHeader() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L136-137) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
262
	global $ARCurrent;
263
264
		$result=false;
265
		if (!Headers_sent()) {
266
			$result=true;
267
			Header($header);
268
			$ARCurrent->ldHeaders[strtolower($header)]=$header;
269
		} else {
270
			debug("Headers already sent, couldn't send $header","all");
271
		}
272
		return $result;
273
	}
274
275
	function ldSetClientCache($cache_on, $expires=0, $modified=0) {
0 ignored issues
show
Unused Code introduced by
The parameter $cache_on is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $expires is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Unused Code introduced by
The parameter $modified is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
The function ldSetClientCache() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L139-141) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
276
		global $ARCurrent;
277
		$now=time();
0 ignored issues
show
Unused Code introduced by
$now is not used, you could remove the assignment.

This check looks for variable assignements that are either overwritten by other assignments or where the variable is not used subsequently.

$myVar = 'Value';
$higher = false;

if (rand(1, 6) > 3) {
    $higher = true;
} else {
    $higher = false;
}

Both the $myVar assignment in line 1 and the $higher assignment in line 2 are dead. The first because $myVar is never used and the second because $higher is always overwritten for every possible time line.

Loading history...
278
		$result = true;
279
		return $result;
280
	}
281
282 View Code Duplication
	function ldSetContent($mimetype, $size=0) {
0 ignored issues
show
Duplication introduced by
This function seems to be duplicated in your project.

Duplicated code is one of the most pungent code smells. If you need to duplicate the same code in three or more different places, we strongly encourage you to look into extracting the code into a single class or operation.

You can also find more detailed suggestions in the “Code” section of your repository.

Loading history...
Best Practice introduced by
The function ldSetContent() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L143-145) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
283
		$result=ldHeader("Content-type: ".$mimetype);
284
		if ($size) {
285
			$result=ldHeader("Content-Length: ".$size);
286
		}
287
		return $result;
288
	}
289
290
	function ldGetServerVar($server_var) {
0 ignored issues
show
Coding Style introduced by
ldGetServerVar uses the super-global variable $_SERVER which is generally not recommended.

Instead of super-globals, we recommend to explicitly inject the dependencies of your class. This makes your code less dependent on global state and it becomes generally more testable:

// Bad
class Router
{
    public function generate($path)
    {
        return $_SERVER['HOST'].$path;
    }
}

// Better
class Router
{
    private $host;

    public function __construct($host)
    {
        $this->host = $host;
    }

    public function generate($path)
    {
        return $this->host.$path;
    }
}

class Controller
{
    public function myAction(Request $request)
    {
        // Instead of
        $page = isset($_GET['page']) ? intval($_GET['page']) : 1;

        // Better (assuming you use the Symfony2 request)
        $page = $request->query->get('page', 1);
    }
}
Loading history...
Best Practice introduced by
The function ldGetServerVar() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L147-150) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
291
		return $_SERVER[$server_var];
292
	}
293
294
	function ldGetClientVar($client_var) {
0 ignored issues
show
Unused Code introduced by
The parameter $client_var is not used and could be removed.

This check looks from parameters that have been defined for a function or method, but which are not used in the method body.

Loading history...
Best Practice introduced by
The function ldGetClientVar() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L152-155) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
295
		// dummy function
296
		return false;
297
	}
298
299
	function ldDisablePostProcessing() {
0 ignored issues
show
Best Practice introduced by
The function ldDisablePostProcessing() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L181-184) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
300
		// dummy function
301
		return false;
302
	}
303
304
	function ldGetRequestedHost() {
0 ignored issues
show
Best Practice introduced by
The function ldGetRequestedHost() has been defined more than once; this definition is ignored, only the first definition in lib/includes/loader.cmd.php (L110-112) is considered.

This check looks for functions that have already been defined in other files.

Some Codebases, like WordPress, make a practice of defining functions multiple times. This may lead to problems with the detection of function parameters and types. If you really need to do this, you can mark the duplicate definition with the @ignore annotation.

/**
 * @ignore
 */
function getUser() {

}

function getUser($id, $realm) {

}

See also the PhpDoc documentation for @ignore.

Loading history...
305
		// dummy function
306
	}
307