Merge pull request #13504 from mauriciofauth/classes
Move GIS classes to PhpMyAdmin namespace
This commit is contained in:
commit
c83c82f3b5
@ -7,8 +7,8 @@
|
||||
*/
|
||||
|
||||
use PhpMyAdmin\Core;
|
||||
use PMA\libraries\gis\GISFactory;
|
||||
use PMA\libraries\gis\GISVisualization;
|
||||
use PhpMyAdmin\Gis\GisFactory;
|
||||
use PhpMyAdmin\Gis\GisVisualization;
|
||||
use PhpMyAdmin\Response;
|
||||
use PhpMyAdmin\Url;
|
||||
|
||||
@ -70,7 +70,7 @@ if (! isset($gis_data['gis_type'])) {
|
||||
$geom_type = htmlspecialchars($gis_data['gis_type']);
|
||||
|
||||
// Generate parameters from value passed.
|
||||
$gis_obj = GISFactory::factory($geom_type);
|
||||
$gis_obj = GisFactory::factory($geom_type);
|
||||
if (isset($_REQUEST['value'])) {
|
||||
$gis_data = array_merge(
|
||||
$gis_data, $gis_obj->generateParams($_REQUEST['value'])
|
||||
@ -91,10 +91,10 @@ $visualizationSettings = array(
|
||||
'spatialColumn' => 'wkt'
|
||||
);
|
||||
$data = array(array('wkt' => $wkt_with_zero, 'srid' => $srid));
|
||||
$visualization = GISVisualization::getByData($data, $visualizationSettings)
|
||||
$visualization = GisVisualization::getByData($data, $visualizationSettings)
|
||||
->toImage('svg');
|
||||
|
||||
$open_layers = GISVisualization::getByData($data, $visualizationSettings)
|
||||
$open_layers = GisVisualization::getByData($data, $visualizationSettings)
|
||||
->asOl();
|
||||
|
||||
// If the call is to update the WKT and visualization make an AJAX response
|
||||
|
||||
@ -9,7 +9,7 @@ namespace PhpMyAdmin\Controllers\Table;
|
||||
|
||||
use PhpMyAdmin\Controllers\TableController;
|
||||
use PhpMyAdmin\Core;
|
||||
use PMA\libraries\gis\GISVisualization;
|
||||
use PhpMyAdmin\Gis\GisVisualization;
|
||||
use PhpMyAdmin\Message;
|
||||
use PhpMyAdmin\Template;
|
||||
use PhpMyAdmin\Url;
|
||||
@ -41,7 +41,7 @@ class TableGisVisualizationController extends TableController
|
||||
protected $visualizationSettings;
|
||||
|
||||
/**
|
||||
* @var \PMA\libraries\gis\GISVisualization $visualization
|
||||
* @var \PhpMyAdmin\Gis\GisVisualization $visualization
|
||||
*/
|
||||
protected $visualization;
|
||||
|
||||
@ -143,7 +143,7 @@ class TableGisVisualizationController extends TableController
|
||||
$rows = $GLOBALS['cfg']['MaxRows'];
|
||||
}
|
||||
}
|
||||
$this->visualization = GISVisualization::get(
|
||||
$this->visualization = GisVisualization::get(
|
||||
$this->sql_query,
|
||||
$this->visualizationSettings,
|
||||
$rows,
|
||||
|
||||
@ -5,21 +5,21 @@
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
/**
|
||||
* Factory class that handles the creation of geometric objects.
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISFactory
|
||||
class GisFactory
|
||||
{
|
||||
/**
|
||||
* Returns the singleton instance of geometric class of the given type.
|
||||
*
|
||||
* @param string $type type of the geometric object
|
||||
*
|
||||
* @return GISGeometry the singleton instance of geometric class
|
||||
* @return GisGeometry the singleton instance of geometric class
|
||||
* of the given type
|
||||
*
|
||||
* @access public
|
||||
@ -29,19 +29,19 @@ class GISFactory
|
||||
{
|
||||
switch (strtoupper($type)) {
|
||||
case 'MULTIPOLYGON' :
|
||||
return GISMultipolygon::singleton();
|
||||
return GisMultiPolygon::singleton();
|
||||
case 'POLYGON' :
|
||||
return GISPolygon::singleton();
|
||||
return GisPolygon::singleton();
|
||||
case 'MULTIPOINT' :
|
||||
return GISMultipoint::singleton();
|
||||
return GisMultiPoint::singleton();
|
||||
case 'POINT' :
|
||||
return GISPoint::singleton();
|
||||
return GisPoint::singleton();
|
||||
case 'MULTILINESTRING' :
|
||||
return GISMultilinestring::singleton();
|
||||
return GisMultiLineString::singleton();
|
||||
case 'LINESTRING' :
|
||||
return GISLinestring::singleton();
|
||||
return GisLineString::singleton();
|
||||
case 'GEOMETRYCOLLECTION' :
|
||||
return GISGeometrycollection::singleton();
|
||||
return GisGeometryCollection::singleton();
|
||||
default :
|
||||
return false;
|
||||
}
|
||||
@ -6,16 +6,16 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Base class for all GIS data type classes.
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
abstract class GISGeometry
|
||||
abstract class GisGeometry
|
||||
{
|
||||
/**
|
||||
* Prepares and returns the code related to a row in the GIS dataset as SVG.
|
||||
@ -6,16 +6,16 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles actions related to GIS GEOMETRYCOLLECTION objects
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISGeometrycollection extends GISGeometry
|
||||
class GisGeometryCollection extends GisGeometry
|
||||
{
|
||||
// Hold the singleton instance of the class
|
||||
private static $_instance;
|
||||
@ -32,7 +32,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
/**
|
||||
* Returns the singleton.
|
||||
*
|
||||
* @return GISGeometrycollection the singleton
|
||||
* @return GisGeometryCollection the singleton
|
||||
* @access public
|
||||
*/
|
||||
public static function singleton()
|
||||
@ -75,7 +75,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
}
|
||||
$type = mb_substr($sub_part, 0, $type_pos);
|
||||
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -137,7 +137,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
}
|
||||
$type = mb_substr($sub_part, 0, $type_pos);
|
||||
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -184,7 +184,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
}
|
||||
$type = mb_substr($sub_part, 0, $type_pos);
|
||||
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -232,7 +232,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
}
|
||||
$type = mb_substr($sub_part, 0, $type_pos);
|
||||
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -281,7 +281,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
}
|
||||
$type = mb_substr($sub_part, 0, $type_pos);
|
||||
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -350,7 +350,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
for ($i = 0; $i < $geom_count; $i++) {
|
||||
if (isset($gis_data[$i]['gis_type'])) {
|
||||
$type = $gis_data[$i]['gis_type'];
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -381,7 +381,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
public function generateParams($value)
|
||||
{
|
||||
$params = array();
|
||||
$data = GISGeometry::generateParams($value);
|
||||
$data = GisGeometry::generateParams($value);
|
||||
$params['srid'] = $data['srid'];
|
||||
$wkt = $data['wkt'];
|
||||
|
||||
@ -403,7 +403,7 @@ class GISGeometrycollection extends GISGeometry
|
||||
continue;
|
||||
}
|
||||
$type = mb_substr($sub_part, 0, $type_pos);
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -6,16 +6,16 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles actions related to GIS LINESTRING objects
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISLinestring extends GISGeometry
|
||||
class GisLineString extends GisGeometry
|
||||
{
|
||||
// Hold the singleton instance of the class
|
||||
private static $_instance;
|
||||
@ -32,7 +32,7 @@ class GISLinestring extends GISGeometry
|
||||
/**
|
||||
* Returns the singleton.
|
||||
*
|
||||
* @return GISLinestring the singleton
|
||||
* @return GisLineString the singleton
|
||||
* @access public
|
||||
*/
|
||||
public static function singleton()
|
||||
@ -324,7 +324,7 @@ class GISLinestring extends GISGeometry
|
||||
$params = array();
|
||||
if ($index == -1) {
|
||||
$index = 0;
|
||||
$data = GISGeometry::generateParams($value);
|
||||
$data = GisGeometry::generateParams($value);
|
||||
$params['srid'] = $data['srid'];
|
||||
$wkt = $data['wkt'];
|
||||
} else {
|
||||
@ -6,16 +6,16 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles actions related to GIS MULTILINESTRING objects
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISMultilinestring extends GISGeometry
|
||||
class GisMultiLineString extends GisGeometry
|
||||
{
|
||||
// Hold the singleton instance of the class
|
||||
private static $_instance;
|
||||
@ -32,7 +32,7 @@ class GISMultilinestring extends GISGeometry
|
||||
/**
|
||||
* Returns the singleton.
|
||||
*
|
||||
* @return GISMultilinestring the singleton
|
||||
* @return GisMultiLineString the singleton
|
||||
* @access public
|
||||
*/
|
||||
public static function singleton()
|
||||
@ -405,7 +405,7 @@ class GISMultilinestring extends GISGeometry
|
||||
$params = array();
|
||||
if ($index == -1) {
|
||||
$index = 0;
|
||||
$data = GISGeometry::generateParams($value);
|
||||
$data = GisGeometry::generateParams($value);
|
||||
$params['srid'] = $data['srid'];
|
||||
$wkt = $data['wkt'];
|
||||
} else {
|
||||
@ -6,16 +6,16 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles actions related to GIS MULTIPOINT objects
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISMultipoint extends GISGeometry
|
||||
class GisMultiPoint extends GisGeometry
|
||||
{
|
||||
// Hold the singleton instance of the class
|
||||
private static $_instance;
|
||||
@ -32,7 +32,7 @@ class GISMultipoint extends GISGeometry
|
||||
/**
|
||||
* Returns the singleton.
|
||||
*
|
||||
* @return GISMultipoint the singleton
|
||||
* @return GisMultiPoint the singleton
|
||||
* @access public
|
||||
*/
|
||||
public static function singleton()
|
||||
@ -352,7 +352,7 @@ class GISMultipoint extends GISGeometry
|
||||
$params = array();
|
||||
if ($index == -1) {
|
||||
$index = 0;
|
||||
$data = GISGeometry::generateParams($value);
|
||||
$data = GisGeometry::generateParams($value);
|
||||
$params['srid'] = $data['srid'];
|
||||
$wkt = $data['wkt'];
|
||||
} else {
|
||||
@ -6,16 +6,16 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles actions related to GIS MULTIPOLYGON objects
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISMultipolygon extends GISGeometry
|
||||
class GisMultiPolygon extends GisGeometry
|
||||
{
|
||||
// Hold the singleton instance of the class
|
||||
private static $_instance;
|
||||
@ -32,7 +32,7 @@ class GISMultipolygon extends GISGeometry
|
||||
/**
|
||||
* Returns the singleton.
|
||||
*
|
||||
* @return GISMultipolygon the singleton
|
||||
* @return GisMultiPolygon the singleton
|
||||
* @access public
|
||||
*/
|
||||
public static function singleton()
|
||||
@ -448,14 +448,14 @@ class GISMultipolygon extends GISGeometry
|
||||
// correctly classify inner rings to their respective outer rings.
|
||||
foreach ($row_data['parts'] as $i => $ring) {
|
||||
$row_data['parts'][$i]['isOuter']
|
||||
= GISPolygon::isOuterRing($ring['points']);
|
||||
= GisPolygon::isOuterRing($ring['points']);
|
||||
}
|
||||
|
||||
// Find points on surface for inner rings
|
||||
foreach ($row_data['parts'] as $i => $ring) {
|
||||
if (!$ring['isOuter']) {
|
||||
$row_data['parts'][$i]['pointOnSurface']
|
||||
= GISPolygon::getPointOnSurface($ring['points']);
|
||||
= GisPolygon::getPointOnSurface($ring['points']);
|
||||
}
|
||||
}
|
||||
|
||||
@ -471,7 +471,7 @@ class GISMultipolygon extends GISGeometry
|
||||
|
||||
// If the pointOnSurface of the inner ring
|
||||
// is also inside the outer ring
|
||||
if (GISPolygon::isPointInsidePolygon(
|
||||
if (GisPolygon::isPointInsidePolygon(
|
||||
$ring1['pointOnSurface'],
|
||||
$ring2['points']
|
||||
)
|
||||
@ -549,7 +549,7 @@ class GISMultipolygon extends GISGeometry
|
||||
$params = array();
|
||||
if ($index == -1) {
|
||||
$index = 0;
|
||||
$data = GISGeometry::generateParams($value);
|
||||
$data = GisGeometry::generateParams($value);
|
||||
$params['srid'] = $data['srid'];
|
||||
$wkt = $data['wkt'];
|
||||
} else {
|
||||
@ -6,16 +6,16 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles actions related to GIS POINT objects
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISPoint extends GISGeometry
|
||||
class GisPoint extends GisGeometry
|
||||
{
|
||||
// Hold the singleton instance of the class
|
||||
private static $_instance;
|
||||
@ -32,7 +32,7 @@ class GISPoint extends GISGeometry
|
||||
/**
|
||||
* Returns the singleton.
|
||||
*
|
||||
* @return GISPoint the singleton
|
||||
* @return GisPoint the singleton
|
||||
* @access public
|
||||
*/
|
||||
public static function singleton()
|
||||
@ -331,7 +331,7 @@ class GISPoint extends GISGeometry
|
||||
$params = array();
|
||||
if ($index == -1) {
|
||||
$index = 0;
|
||||
$data = GISGeometry::generateParams($value);
|
||||
$data = GisGeometry::generateParams($value);
|
||||
$params['srid'] = $data['srid'];
|
||||
$wkt = $data['wkt'];
|
||||
} else {
|
||||
@ -5,17 +5,17 @@
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use PhpMyAdmin\Util;
|
||||
use \TCPDF;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles actions related to GIS POLYGON objects
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISPolygon extends GISGeometry
|
||||
class GisPolygon extends GisGeometry
|
||||
{
|
||||
// Hold the singleton instance of the class
|
||||
private static $_instance;
|
||||
@ -32,7 +32,7 @@ class GISPolygon extends GISGeometry
|
||||
/**
|
||||
* Returns the singleton.
|
||||
*
|
||||
* @return GISPolygon the singleton
|
||||
* @return GisPolygon the singleton
|
||||
* @access public
|
||||
*/
|
||||
public static function singleton()
|
||||
@ -437,7 +437,7 @@ class GISPolygon extends GISGeometry
|
||||
{
|
||||
// If area is negative then it's in clockwise orientation,
|
||||
// i.e. it's an outer ring
|
||||
if (GISPolygon::area($ring) < 0) {
|
||||
if (GisPolygon::area($ring) < 0) {
|
||||
return true;
|
||||
}
|
||||
|
||||
@ -553,11 +553,11 @@ class GISPolygon extends GISGeometry
|
||||
|
||||
// One of the points should be inside the polygon,
|
||||
// unless epsilon chosen is too large
|
||||
if (GISPolygon::isPointInsidePolygon($pointA, $ring)) {
|
||||
if (GisPolygon::isPointInsidePolygon($pointA, $ring)) {
|
||||
return $pointA;
|
||||
}
|
||||
|
||||
if (GISPolygon::isPointInsidePolygon($pointB, $ring)) {
|
||||
if (GisPolygon::isPointInsidePolygon($pointB, $ring)) {
|
||||
return $pointB;
|
||||
}
|
||||
|
||||
@ -583,7 +583,7 @@ class GISPolygon extends GISGeometry
|
||||
$params = array();
|
||||
if ($index == -1) {
|
||||
$index = 0;
|
||||
$data = GISGeometry::generateParams($value);
|
||||
$data = GisGeometry::generateParams($value);
|
||||
$params['srid'] = $data['srid'];
|
||||
$wkt = $data['wkt'];
|
||||
} else {
|
||||
@ -6,19 +6,19 @@
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
|
||||
namespace PMA\libraries\gis;
|
||||
namespace PhpMyAdmin\Gis;
|
||||
|
||||
use PhpMyAdmin\Core;
|
||||
use PhpMyAdmin\Util;
|
||||
use \TCPDF;
|
||||
use PhpMyAdmin\Sanitize;
|
||||
use PhpMyAdmin\Util;
|
||||
use TCPDF;
|
||||
|
||||
/**
|
||||
* Handles visualization of GIS data
|
||||
*
|
||||
* @package PhpMyAdmin-GIS
|
||||
*/
|
||||
class GISVisualization
|
||||
class GisVisualization
|
||||
{
|
||||
/**
|
||||
* @var array Raw data for the visualization
|
||||
@ -78,13 +78,13 @@ class GISVisualization
|
||||
* @param integer $row number of rows
|
||||
* @param integer $pos start position
|
||||
*
|
||||
* @return GISVisualization
|
||||
* @return GisVisualization
|
||||
*
|
||||
* @access public
|
||||
*/
|
||||
public static function get($sql_query, $options, $row, $pos)
|
||||
{
|
||||
return new GISVisualization($sql_query, $options, $row, $pos);
|
||||
return new GisVisualization($sql_query, $options, $row, $pos);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -94,11 +94,11 @@ class GISVisualization
|
||||
* ignored
|
||||
* @param array $options Users specified options
|
||||
*
|
||||
* @return GISVisualization
|
||||
* @return GisVisualization
|
||||
*/
|
||||
public static function getByData($data, $options)
|
||||
{
|
||||
return new GISVisualization(null, $options, null, null, $data);
|
||||
return new GisVisualization(null, $options, null, null, $data);
|
||||
}
|
||||
|
||||
/**
|
||||
@ -558,7 +558,7 @@ class GISVisualization
|
||||
}
|
||||
$type = mb_substr($ref_data, 0, $type_pos);
|
||||
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -647,7 +647,7 @@ class GISVisualization
|
||||
}
|
||||
$type = mb_substr($ref_data, 0, $type_pos);
|
||||
|
||||
$gis_obj = GISFactory::factory($type);
|
||||
$gis_obj = GisFactory::factory($type);
|
||||
if (!$gis_obj) {
|
||||
continue;
|
||||
}
|
||||
@ -8,11 +8,11 @@
|
||||
*/
|
||||
namespace PMA\libraries\plugins\import;
|
||||
|
||||
use PMA\libraries\gis\GISFactory;
|
||||
use PMA\libraries\gis\GISMultilinestring;
|
||||
use PMA\libraries\gis\GISMultipoint;
|
||||
use PMA\libraries\gis\GISPoint;
|
||||
use PMA\libraries\gis\GISPolygon;
|
||||
use PhpMyAdmin\Gis\GisFactory;
|
||||
use PhpMyAdmin\Gis\GisMultiLineString;
|
||||
use PhpMyAdmin\Gis\GisMultiPoint;
|
||||
use PhpMyAdmin\Gis\GisPoint;
|
||||
use PhpMyAdmin\Gis\GisPolygon;
|
||||
use PhpMyAdmin\Message;
|
||||
use PMA\libraries\plugins\ImportPlugin;
|
||||
use PMA\libraries\properties\plugins\ImportPluginProperties;
|
||||
@ -186,8 +186,8 @@ class ImportShp extends ImportPlugin
|
||||
}
|
||||
|
||||
if (isset($gis_type)) {
|
||||
/** @var GISMultilinestring|\PMA\libraries\gis\GISMultipoint|\PMA\libraries\gis\GISPoint|GISPolygon $gis_obj */
|
||||
$gis_obj = GISFactory::factory($gis_type);
|
||||
/** @var GisMultiLineString|\PhpMyAdmin\Gis\GisMultiPoint|\PhpMyAdmin\Gis\GisPoint|GisPolygon $gis_obj */
|
||||
$gis_obj = GisFactory::factory($gis_type);
|
||||
} else {
|
||||
$gis_obj = null;
|
||||
}
|
||||
|
||||
@ -1,18 +1,18 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISFactory
|
||||
* Test for PhpMyAdmin\Gis\GisFactory
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
use PMA\libraries\gis\GISFactory;
|
||||
use PhpMyAdmin\Gis\GisFactory;
|
||||
|
||||
/**
|
||||
* Test class for PMA\libraries\gis\GISFactory
|
||||
* Test class for PhpMyAdmin\Gis\GisFactory
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISFactoryTest extends PHPUnit_Framework_TestCase
|
||||
class GisFactoryTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
@ -26,7 +26,7 @@ class GISFactoryTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
public function testFactory($type, $geom)
|
||||
{
|
||||
$this->assertInstanceOf($geom, GISFactory::factory($type));
|
||||
$this->assertInstanceOf($geom, GisFactory::factory($type));
|
||||
}
|
||||
|
||||
/**
|
||||
@ -39,31 +39,31 @@ class GISFactoryTest extends PHPUnit_Framework_TestCase
|
||||
return array(
|
||||
array(
|
||||
'MULTIPOLYGON',
|
||||
'PMA\libraries\gis\GISMultipolygon'
|
||||
'PhpMyAdmin\Gis\GisMultiPolygon'
|
||||
),
|
||||
array(
|
||||
'POLYGON',
|
||||
'PMA\libraries\gis\GISPolygon'
|
||||
'PhpMyAdmin\Gis\GisPolygon'
|
||||
),
|
||||
array(
|
||||
'MULTILINESTRING',
|
||||
'PMA\libraries\gis\GISMultilinestring'
|
||||
'PhpMyAdmin\Gis\GisMultiLineString'
|
||||
),
|
||||
array(
|
||||
'LINESTRING',
|
||||
'PMA\libraries\gis\GISLinestring'
|
||||
'PhpMyAdmin\Gis\GisLineString'
|
||||
),
|
||||
array(
|
||||
'MULTIPOINT',
|
||||
'PMA\libraries\gis\GISMultipoint'
|
||||
'PhpMyAdmin\Gis\GisMultiPoint'
|
||||
),
|
||||
array(
|
||||
'POINT',
|
||||
'PMA\libraries\gis\GISPoint'
|
||||
'PhpMyAdmin\Gis\GisPoint'
|
||||
),
|
||||
array(
|
||||
'GEOMETRYCOLLECTION',
|
||||
'PMA\libraries\gis\GISGeometrycollection'
|
||||
'PhpMyAdmin\Gis\GisGeometryCollection'
|
||||
),
|
||||
);
|
||||
}
|
||||
@ -11,7 +11,7 @@
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
abstract class GISGeomTest extends PHPUnit_Framework_TestCase
|
||||
abstract class GisGeomTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
@ -2,19 +2,19 @@
|
||||
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISGeometry
|
||||
* Test for PhpMyAdmin\Gis\GisGeometry
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
use PMA\libraries\gis\GISGeometrycollection;
|
||||
use PhpMyAdmin\Gis\GisGeometryCollection;
|
||||
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISGeometrycollection class
|
||||
* Tests for PhpMyAdmin\Gis\GisGeometryCollection class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISGeometryCollectionTest extends PHPUnit_Framework_TestCase
|
||||
class GisGeometryCollectionTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
|
||||
/**
|
||||
@ -31,7 +31,7 @@ class GISGeometryCollectionTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = GISGeometrycollection::singleton();
|
||||
$this->object = GisGeometryCollection::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1,17 +1,17 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISGeometry
|
||||
* Test for PhpMyAdmin\Gis\GisGeometry
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISGeometry class
|
||||
* Tests for PhpMyAdmin\Gis\GisGeometry class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISGeometryTest extends PHPUnit_Framework_TestCase
|
||||
class GisGeometryTest extends PHPUnit_Framework_TestCase
|
||||
{
|
||||
/**
|
||||
* @access protected
|
||||
@ -27,7 +27,7 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = $this->getMockForAbstractClass('PMA\libraries\gis\GISGeometry');
|
||||
$this->object = $this->getMockForAbstractClass('PhpMyAdmin\Gis\GisGeometry');
|
||||
}
|
||||
|
||||
/**
|
||||
@ -52,7 +52,7 @@ class GISGeometryTest extends PHPUnit_Framework_TestCase
|
||||
*/
|
||||
private function _callProtectedFunction($name, $params)
|
||||
{
|
||||
$class = new ReflectionClass('PMA\libraries\gis\GISGeometry');
|
||||
$class = new ReflectionClass('PhpMyAdmin\Gis\GisGeometry');
|
||||
$method = $class->getMethod($name);
|
||||
$method->setAccessible(true);
|
||||
return $method->invokeArgs($this->object, $params);
|
||||
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISLinestring
|
||||
* Test for PhpMyAdmin\Gis\GisLineString
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
use PMA\libraries\gis\GISLinestring;
|
||||
use PhpMyAdmin\Gis\GisLineString;
|
||||
|
||||
require_once 'GISGeomTest.php';
|
||||
require_once 'GisGeomTest.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISLinestring class
|
||||
* Tests for PhpMyAdmin\Gis\GisLineString class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISLinestringTest extends GISGeomTest
|
||||
class GisLineStringTest extends GisGeomTest
|
||||
{
|
||||
/**
|
||||
* @var GISLinestring
|
||||
* @var GisLineString
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
@ -32,7 +32,7 @@ class GISLinestringTest extends GISGeomTest
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = GISLinestring::singleton();
|
||||
$this->object = GisLineString::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISMultilinestring
|
||||
* Test for PhpMyAdmin\Gis\GisMultiLineString
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
use PMA\libraries\gis\GISMultilinestring;
|
||||
use PhpMyAdmin\Gis\GisMultiLineString;
|
||||
|
||||
require_once 'GISGeomTest.php';
|
||||
require_once 'GisGeomTest.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISMultilinestring class
|
||||
* Tests for PhpMyAdmin\Gis\GisMultiLineString class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISMultilinestringTest extends GISGeomTest
|
||||
class GisMultiLineStringTest extends GisGeomTest
|
||||
{
|
||||
/**
|
||||
* @var GISMultilinestring
|
||||
* @var GisMultiLineString
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
@ -32,7 +32,7 @@ class GISMultilinestringTest extends GISGeomTest
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = GISMultilinestring::singleton();
|
||||
$this->object = GisMultiLineString::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISMultipoint
|
||||
* Test for PhpMyAdmin\Gis\GisMultiPoint
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
use PMA\libraries\gis\GISMultipoint;
|
||||
use PhpMyAdmin\Gis\GisMultiPoint;
|
||||
|
||||
require_once 'GISGeomTest.php';
|
||||
require_once 'GisGeomTest.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISMultipoint class
|
||||
* Tests for PhpMyAdmin\Gis\GisMultiPoint class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISMultipointTest extends GISGeomTest
|
||||
class GisMultiPointTest extends GisGeomTest
|
||||
{
|
||||
/**
|
||||
* @var GISMultipoint
|
||||
* @var GisMultiPoint
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
@ -32,7 +32,7 @@ class GISMultipointTest extends GISGeomTest
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = GISMultipoint::singleton();
|
||||
$this->object = GisMultiPoint::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISMultipolygon
|
||||
* Test for PhpMyAdmin\Gis\GisMultiPolygon
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
use PMA\libraries\gis\GISMultipolygon;
|
||||
use PhpMyAdmin\Gis\GisMultiPolygon;
|
||||
|
||||
require_once 'GISGeomTest.php';
|
||||
require_once 'GisGeomTest.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISMultipolygon class
|
||||
* Tests for PhpMyAdmin\Gis\GisMultiPolygon class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISMultipolygonTest extends GISGeomTest
|
||||
class GisMultiPolygonTest extends GisGeomTest
|
||||
{
|
||||
/**
|
||||
* @var GISMultipolygon
|
||||
* @var GisMultiPolygon
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
@ -32,7 +32,7 @@ class GISMultipolygonTest extends GISGeomTest
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = GISMultipolygon::singleton();
|
||||
$this->object = GisMultiPolygon::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISPoint
|
||||
* Test for PhpMyAdmin\Gis\GisPoint
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
use PMA\libraries\gis\GISPoint;
|
||||
use PhpMyAdmin\Gis\GisPoint;
|
||||
|
||||
require_once 'GISGeomTest.php';
|
||||
require_once 'GisGeomTest.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISPoint class.
|
||||
* Tests for PhpMyAdmin\Gis\GisPoint class.
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISPointTest extends GISGeomTest
|
||||
class GisPointTest extends GisGeomTest
|
||||
{
|
||||
/**
|
||||
* @var GISPoint
|
||||
* @var GisPoint
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
@ -32,7 +32,7 @@ class GISPointTest extends GISGeomTest
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = GISPoint::singleton();
|
||||
$this->object = GisPoint::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
@ -1,24 +1,24 @@
|
||||
<?php
|
||||
/* vim: set expandtab sw=4 ts=4 sts=4: */
|
||||
/**
|
||||
* Test for PMA\libraries\gis\GISPolygon
|
||||
* Test for PhpMyAdmin\Gis\GisPolygon
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
|
||||
use PMA\libraries\gis\GISPolygon;
|
||||
use PhpMyAdmin\Gis\GisPolygon;
|
||||
|
||||
require_once 'GISGeomTest.php';
|
||||
require_once 'GisGeomTest.php';
|
||||
|
||||
/**
|
||||
* Tests for PMA\libraries\gis\GISPolygon class
|
||||
* Tests for PhpMyAdmin\Gis\GisPolygon class
|
||||
*
|
||||
* @package PhpMyAdmin-test
|
||||
*/
|
||||
class GISPolygonTest extends GISGeomTest
|
||||
class GisPolygonTest extends GisGeomTest
|
||||
{
|
||||
/**
|
||||
* @var GISPolygon
|
||||
* @var GisPolygon
|
||||
* @access protected
|
||||
*/
|
||||
protected $object;
|
||||
@ -32,7 +32,7 @@ class GISPolygonTest extends GISGeomTest
|
||||
*/
|
||||
protected function setUp()
|
||||
{
|
||||
$this->object = GISPolygon::singleton();
|
||||
$this->object = GisPolygon::singleton();
|
||||
}
|
||||
|
||||
/**
|
||||
Loading…
Reference in New Issue
Block a user