From e249cff89e07a363015c48d20e22bf435a9fa808 Mon Sep 17 00:00:00 2001 From: Madhura Jayaratne Date: Tue, 3 Nov 2015 10:13:15 +1100 Subject: [PATCH] This is unnecessary with new class loading mechanism Signed-off-by: Madhura Jayaratne --- libraries/gis/GISFactory.php | 43 ++++++++++++++---------------------- 1 file changed, 16 insertions(+), 27 deletions(-) diff --git a/libraries/gis/GISFactory.php b/libraries/gis/GISFactory.php index c1f9a59634..45c89bd1f0 100644 --- a/libraries/gis/GISFactory.php +++ b/libraries/gis/GISFactory.php @@ -34,33 +34,22 @@ class GISFactory */ public static function factory($type) { - $type_lower = strtolower($type); - $file = './libraries/gis/GIS' . ucfirst($type_lower) . '.php'; - if (!PMA_isValid($type_lower, PMA\libraries\Util::getGISDatatypes()) - || !file_exists($file) - ) { - return false; - } - if (include_once $file) { - switch (strtoupper($type)) { - case 'MULTIPOLYGON' : - return GISMultipolygon::singleton(); - case 'POLYGON' : - return GISPolygon::singleton(); - case 'MULTIPOINT' : - return GISMultipoint::singleton(); - case 'POINT' : - return GISPoint::singleton(); - case 'MULTILINESTRING' : - return GISMultilinestring::singleton(); - case 'LINESTRING' : - return GISLinestring::singleton(); - case 'GEOMETRYCOLLECTION' : - return GISGeometrycollection::singleton(); - default : - return false; - } - } else { + switch (strtoupper($type)) { + case 'MULTIPOLYGON' : + return GISMultipolygon::singleton(); + case 'POLYGON' : + return GISPolygon::singleton(); + case 'MULTIPOINT' : + return GISMultipoint::singleton(); + case 'POINT' : + return GISPoint::singleton(); + case 'MULTILINESTRING' : + return GISMultilinestring::singleton(); + case 'LINESTRING' : + return GISLinestring::singleton(); + case 'GEOMETRYCOLLECTION' : + return GISGeometrycollection::singleton(); + default : return false; } }