[ Index ] |
PHP Cross Reference of MediaWiki-1.24.0 |
[Summary view] [Print] [Text view]
1 -- Add the range handling fields 2 ALTER TABLE /*$wgDBprefix*/ipblocks 3 ADD ipb_range_start tinyblob NOT NULL default '', 4 ADD ipb_range_end tinyblob NOT NULL default '', 5 ADD INDEX ipb_range (ipb_range_start(8), ipb_range_end(8)); 6 7 8 -- Initialise fields 9 -- Only range blocks match ipb_address LIKE '%/%', this fact is used in the code already 10 UPDATE /*$wgDBprefix*/ipblocks 11 SET 12 ipb_range_start = LPAD(HEX( 13 (SUBSTRING_INDEX(ipb_address, '.', 1) << 24) 14 + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 2), '.', -1) << 16) 15 + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 3), '.', -1) << 24) 16 + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '/', 1), '.', -1)) ), 8, '0' ), 17 18 ipb_range_end = LPAD(HEX( 19 (SUBSTRING_INDEX(ipb_address, '.', 1) << 24) 20 + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 2), '.', -1) << 16) 21 + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '.', 3), '.', -1) << 24) 22 + (SUBSTRING_INDEX(SUBSTRING_INDEX(ipb_address, '/', 1), '.', -1)) 23 + ((1 << (32 - SUBSTRING_INDEX(ipb_address, '/', -1))) - 1) ), 8, '0' ) 24 25 WHERE ipb_address LIKE '%/%';
title
Description
Body
title
Description
Body
title
Description
Body
title
Body
Generated: Fri Nov 28 14:03:12 2014 | Cross-referenced by PHPXref 0.7.1 |