Code Duplication    Length = 6-9 lines in 4 locations

api/src/Cache/Apc.php 1 location

@@ 69-77 (lines=9) @@
66
			// ancent APC (3.1.3) in Debian 6/Squezze has size in MB without a unit
67
			if (is_numeric($size) && $size <= 1048576) $size .= 'M';
68
69
			switch(strtoupper(substr($size, -1)))
70
			{
71
				case 'G':
72
					$size *= 1024;
73
				case 'M':
74
					$size *= 1024;
75
				case 'K':
76
					$size *= 1024;
77
			}
78
			$size *= ini_get('apc.shm_segments');
79
80
			// only cache in APC, if we have at least 64M available (default is 32M)

api/src/Cache/Apcu.php 1 location

@@ 68-76 (lines=9) @@
65
		{
66
			$size = ini_get('apc.shm_size');
67
68
			switch(strtoupper(substr($size, -1)))
69
			{
70
				case 'G':
71
					$size *= 1024;
72
				case 'M':
73
					$size *= 1024;
74
				case 'K':
75
					$size *= 1024;
76
			}
77
			$size *= ini_get('apc.shm_segments');
78
79
			// only cache in APCu, if we have at least 32M available (default is 32M)

doc/rpm-build/post_install.php 1 location

@@ 798-806 (lines=9) @@
795
 */
796
function _size_with_unit($size)
797
{
798
	switch(strtoupper(substr($size, -1)))
799
	{
800
		case 'G':
801
			$size *= 1024;
802
		case 'M':
803
			$size *= 1024;
804
		case 'K':
805
			$size *= 1024;
806
	}
807
	return $size;
808
}
809

api/src/Storage/Merge.php 1 location

@@ 1244-1249 (lines=6) @@
1241
		if (!isset($memory_limit))
1242
		{
1243
			$memory_limit = ini_get('memory_limit');
1244
			switch(strtoupper(substr($memory_limit, -1)))
1245
			{
1246
				case 'G': $memory_limit *= 1024;
1247
				case 'M': $memory_limit *= 1024;
1248
				case 'K': $memory_limit *= 1024;
1249
			}
1250
		}
1251
		if ($backtrack_limit < $memory_limit/8)
1252
		{