Code Duplication    Length = 1-5 lines in 5 locations

api/src/Vfs/StreamWrapper.php 5 locations

@@ 1248-1252 (lines=5) @@
1245
			if (self::LOG_LEVEL > 1) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') returns '.array2string(self::$fstab));
1246
			return self::$fstab;
1247
		}
1248
		if (!Vfs::$is_root)
1249
		{
1250
			if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') permission denied, you are NOT root!');
1251
			return false;	// only root can mount
1252
		}
1253
		if ($clear_fstab)
1254
		{
1255
			self::$fstab = array();
@@ 1259-1259 (lines=1) @@
1256
		}
1257
		if (isset(self::$fstab[$path]) && self::$fstab[$path] === $url)
1258
		{
1259
			if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') already mounted.');
1260
			return true;	// already mounted
1261
		}
1262
		self::load_wrapper(Vfs::parse_url($url,PHP_URL_SCHEME));
@@ 1266-1266 (lines=1) @@
1263
1264
		if ($check_url && (!file_exists($url) || opendir($url) === false))
1265
		{
1266
			if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') url does NOT exist!');
1267
			return false;	// url does not exist
1268
		}
1269
		self::$fstab[$path] = $url;
@@ 1286-1286 (lines=1) @@
1283
				$GLOBALS['egw']->invalidate_session_cache();
1284
			}
1285
		}
1286
		if (self::LOG_LEVEL > 1) error_log(__METHOD__.'('.array2string($url).','.array2string($path).') returns true (successful new mount).');
1287
		return true;
1288
	}
1289
@@ 1297-1301 (lines=5) @@
1294
	 */
1295
	static function umount($path)
1296
	{
1297
		if (!Vfs::$is_root)
1298
		{
1299
			if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($path).','.array2string($path).') permission denied, you are NOT root!');
1300
			return false;	// only root can mount
1301
		}
1302
		if (!isset(self::$fstab[$path]) && ($path = array_search($path,self::$fstab)) === false)
1303
		{
1304
			if (self::LOG_LEVEL > 0) error_log(__METHOD__.'('.array2string($path).') NOT mounted!');