Skip to content

Commit

Permalink
Merge branch 'master' into danwe_custom-maps
Browse files Browse the repository at this point in the history
Conflicts:
	Maps.php
	Maps_Settings.php
	includes/criteria/CriterionMapLayer.php
	includes/layers/Maps_ImageLayer.php
	includes/layers/Maps_KMLLayer.php
	includes/services/OpenLayers/CriterionOLLayer.php
	includes/services/OpenLayers/Maps_OpenLayers.php
	includes/services/OpenLayers/Maps_ParamOLLayers.php
	includes/services/OpenLayers/jquery.openlayers.js
  • Loading branch information
DanweDE committed Jan 14, 2014
2 parents 99a02b3 + a7a5256 commit 0672cbd
Show file tree
Hide file tree
Showing 155 changed files with 7,351 additions and 5,233 deletions.
4 changes: 4 additions & 0 deletions .coveralls.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,4 @@
# for php-coveralls
service_name: travis-ci
src_dir: includes
coverage_clover: build/logs/clover.xml
8 changes: 7 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,7 +1,13 @@
.*
*~
*.kate-swp
.*.swp

!.gitignore
!.gitreview

!.travis.yml
!.travis.sh
!.coveralls.yml

composer.phar
composer.lock
34 changes: 34 additions & 0 deletions .travis.sh
Original file line number Diff line number Diff line change
@@ -0,0 +1,34 @@
#! /bin/bash

set -x

originalDirectory=$(pwd)

cd ..

git clone https://gerrit.wikimedia.org/r/p/mediawiki/core.git phase3 --depth 1

cd phase3

mysql -e 'create database its_a_mw;'
php maintenance/install.php --dbtype mysql --dbuser root --dbname its_a_mw --dbpath $(pwd) --pass nyan TravisWiki admin

cd extensions
cp -r $originalDirectory Maps

cd Maps
composer require satooshi/php-coveralls:dev-master
cd ../..

pwd
ls -lap

echo 'error_reporting(E_ALL| E_STRICT);' >> LocalSettings.php
echo 'ini_set("display_errors", 1);' >> LocalSettings.php
echo '$wgShowExceptionDetails = true;' >> LocalSettings.php
echo '$wgDevelopmentWarnings = true;' >> LocalSettings.php
echo "putenv( 'MW_INSTALL_PATH=$(pwd)' );" >> LocalSettings.php

echo 'require_once( __DIR__ . "/extensions/Maps/Maps.php" );' >> LocalSettings.php

php maintenance/update.php --quick
23 changes: 23 additions & 0 deletions .travis.yml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
language: php

php:
- 5.3
- 5.4
- 5.5

before_script:
- bash .travis.sh

script:
- cd ../phase3/extensions/Maps
- phpunit --coverage-clover ../../extensions/Maps/build/logs/clover.xml

after_script:
- php vendor/bin/coveralls -v

notifications:
email:
recipients:
- [email protected]
on_success: change
on_failure: always
76 changes: 76 additions & 0 deletions Maps.classes.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,76 @@
<?php

$classes = array();

$classes['MapsHooks'] = __DIR__ . '/Maps.hooks.php';

$classes['Maps\Element'] = __DIR__ . '/includes/Element.php';
$classes['MapsMapper'] = __DIR__ . '/includes/Maps_Mapper.php';
$classes['MapsDistanceParser'] = __DIR__ . '/includes/Maps_DistanceParser.php';
$classes['MapsGeoFunctions'] = __DIR__ . '/includes/Maps_GeoFunctions.php';
$classes['Maps\Geocoders'] = __DIR__ . '/includes/Geocoders.php';
$classes['Maps\Geocoder'] = __DIR__ . '/includes/Geocoder.php';
$classes['MapsKMLFormatter'] = __DIR__ . '/includes/Maps_KMLFormatter.php';
$classes['MapsLayer'] = __DIR__ . '/includes/Maps_Layer.php';
$classes['MapsLayerPage'] = __DIR__ . '/includes/Maps_LayerPage.php';
$classes['MapsLayerGroup'] = __DIR__ . '/includes/Maps_LayerGroup.php';
$classes['MapsLayerTypes'] = __DIR__ . '/includes/Maps_LayerTypes.php';
$classes['MapsLayers'] = __DIR__ . '/includes/Maps_Layers.php';
$classes['iMappingService'] = __DIR__ . '/includes/iMappingService.php';
$classes['MapsMappingServices'] = __DIR__ . '/includes/Maps_MappingServices.php';
$classes['MapsMappingService'] = __DIR__ . '/includes/Maps_MappingService.php';
$classes['MapsBaseFillableElement'] = __DIR__ . '/includes/Maps_BaseFillableElement.php';
$classes['MapsBaseStrokableElement'] = __DIR__ . '/includes/Maps_BaseStrokableElement.php';
$classes['MapsDisplayMapRenderer'] = __DIR__ . '/includes/Maps_DisplayMapRenderer.php';

$classes['MapEditorHtml'] = __DIR__ . '/includes/editor/MapEditorHTML.php';

$classes['Maps\BaseElement'] = __DIR__ . '/includes/elements/BaseElement.php';
$classes['Maps\Circle'] = __DIR__ . '/includes/elements/Circle.php';
$classes['Maps\ImageOverlay'] = __DIR__ . '/includes/elements/ImageOverlay.php';
$classes['Maps\Line'] = __DIR__ . '/includes/elements/Line.php';
$classes['Maps\Location'] = __DIR__ . '/includes/elements/Location.php';
$classes['Maps\Polygon'] = __DIR__ . '/includes/elements/Polygon.php';
$classes['Maps\Rectangle'] = __DIR__ . '/includes/elements/Rectangle.php';
$classes['Maps\WmsOverlay'] = __DIR__ . '/includes/elements/WmsOverlay.php';


$classes['Maps\Api\Geocode'] = __DIR__ . '/includes/api/ApiGeocode.php';

$classes['Maps\ServiceParam'] = __DIR__ . '/includes/ServiceParam.php';

$classes['MapsCoordinates'] = __DIR__ . '/includes/parserhooks/Maps_Coordinates.php';
$classes['MapsDisplayMap'] = __DIR__ . '/includes/parserhooks/Maps_DisplayMap.php';
$classes['MapsDistance'] = __DIR__ . '/includes/parserhooks/Maps_Distance.php';
$classes['MapsFinddestination'] = __DIR__ . '/includes/parserhooks/Maps_Finddestination.php';
$classes['MapsGeocode'] = __DIR__ . '/includes/parserhooks/Maps_Geocode.php';
$classes['MapsGeodistance'] = __DIR__ . '/includes/parserhooks/Maps_Geodistance.php';
$classes['MapsMapsDoc'] = __DIR__ . '/includes/parserhooks/Maps_MapsDoc.php';
$classes['MapsLayerDefinition'] = __DIR__ . '/includes/parserhooks/Maps_LayerDefinition.php';

$classes['Maps\DistanceParser'] = __DIR__ . '/includes/parsers/DistanceParser.php';
$classes['Maps\LineParser'] = __DIR__ . '/includes/parsers/LineParser.php';
$classes['Maps\LocationParser'] = __DIR__ . '/includes/parsers/LocationParser.php';
$classes['Maps\PolygonParser'] = __DIR__ . '/includes/parsers/PolygonParser.php';
$classes['Maps\WmsOverlayParser'] = __DIR__ . '/includes/parsers/WmsOverlayParser.php';

$classes['iBubbleMapElement'] = __DIR__ . '/includes/properties/iBubbleMapElement.php';
$classes['iFillableMapElement'] = __DIR__ . '/includes/properties/iFillableMapElement.php';
$classes['iHoverableMapElement'] = __DIR__ . '/includes/properties/iHoverableMapElement.php';
$classes['iLinkableMapElement'] = __DIR__ . '/includes/properties/iLinkableMapElement.php';
$classes['iStrokableMapElement'] = __DIR__ . '/includes/properties/iStrokableMapElement.php';

$classes['MapsGeonamesGeocoder'] = __DIR__ . '/includes/geocoders/Maps_GeonamesGeocoder.php';
$classes['MapsGoogleGeocoder'] = __DIR__ . '/includes/geocoders/Maps_GoogleGeocoder.php';

$classes['MapsImageLayer'] = __DIR__ . '/includes/layers/Maps_ImageLayer.php';

$classes['SpecialMapEditor'] = __DIR__ . '/includes/specials/SpecialMapEditor.php';

$classes['Maps\Test\BaseElementTest'] = __DIR__ . '/tests/phpunit/elements/BaseElementTest.php';
$classes['Maps\Test\LineTest'] = __DIR__ . '/tests/phpunit/elements/LineTest.php';
$classes['Maps\Test\RectangleTest'] = __DIR__ . '/tests/phpunit/elements/RectangleTest.php';

$classes['Maps\Test\ParserHookTest'] = __DIR__ . '/tests/phpunit/parserhooks/ParserHookTest.php';

return $classes;
35 changes: 28 additions & 7 deletions Maps.hooks.php
Original file line number Diff line number Diff line change
Expand Up @@ -13,6 +13,14 @@
* @author Daniel Werner
*/
final class MapsHooks {
/**
* Helper flag indicating whether the page has been purged.
* @var bool
*
* TODO: Figure out a better way to do this, not requiring this flag and make sure it works with
* later MW versions (purging mechanism got changed somewhat around 1.18).
*/
static $purgedBeforeStore = false;

/**
* Adds a link to Admin Links page.
Expand Down Expand Up @@ -52,6 +60,13 @@ public static function addToAdminLinks( ALTree &$admin_links_tree ) {
public static function registerUnitTests( array &$files ) {
// @codeCoverageIgnoreStart
$testFiles = array(
'elements/Circle',
'elements/ImageOverlay',
'elements/Line',
'elements/Location',
'elements/Polygon',
'elements/Rectangle',

'parserhooks/Coordinates',
'parserhooks/DisplayMap',
'parserhooks/Distance',
Expand All @@ -60,7 +75,12 @@ public static function registerUnitTests( array &$files ) {
'parserhooks/Geodistance',
'parserhooks/MapsDoc',

'MapsCoordinateParser',
'parsers/DistanceParser',
'parsers/LineParser',
'parsers/LocationParser',
'parsers/WmsOverlayParser',

'Element',
'MapsDistanceParser',
);

Expand Down Expand Up @@ -92,15 +112,16 @@ public static function onArticleFromTitle( Title &$title, /* Article */ &$articl
* Adds global JavaScript variables.
*
* @since 1.0
*
* @param array &$vars
*
* @return boolean
* @see http://www.mediawiki.org/wiki/Manual:Hooks/MakeGlobalVariablesScript
* @param array &$vars Variables to be added into the output
* @param OutputPage $outputPage OutputPage instance calling the hook
* @return boolean true in all cases
*/
public static function onMakeGlobalVariablesScript( array &$vars ) {
public static function onMakeGlobalVariablesScript( array &$vars, OutputPage $outputPage ) {
global $egMapsGlobalJSVars;

$vars['egMapsDebugJS'] = $GLOBALS['egMapsDebugJS'];
$vars[ 'egMapsAvailableServices' ] = $GLOBALS['egMapsAvailableServices'];

$vars += $egMapsGlobalJSVars;

Expand Down Expand Up @@ -181,7 +202,7 @@ public static function onParserAfterTidy( Parser &$parser, &$text ) {

self::processLayersStoreCandidate( $parser->getOutput(), $title );

// set helper to false immediately so we won't run into jop-processing weirdness:
// Set helper to false immediately so we won't run into job-processing weirdness:
self::$purgedBeforeStore = false;

return true;
Expand Down
44 changes: 42 additions & 2 deletions Maps.i18n.alias.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@
'MapEditor' => array( 'محرر_الخريطة' ),
);

/** Assamese (অসমীয়া) */
/** Assamese (অসমীয়া) */
$specialPageAliases['as'] = array(
'MapEditor' => array( 'মানচিত্ৰ_সম্পাদক' ),
);
Expand All @@ -29,14 +29,29 @@

/** Zazaki (Zazaki) */
$specialPageAliases['diq'] = array(
'MapEditor' => array( 'VurnerêXerita' ),
'MapEditor' => array( 'VırneréXerita' ),
);

/** Greek (Ελληνικά) */
$specialPageAliases['el'] = array(
'MapEditor' => array( 'ΕπεξεργαστήςΧαρτών' ),
);

/** Persian (فارسی) */
$specialPageAliases['fa'] = array(
'MapEditor' => array( 'ویرایشگر_نقشه' ),
);

/** Galician (galego) */
$specialPageAliases['gl'] = array(
'MapEditor' => array( 'Editor_do_mapa' ),
);

/** Italian (italiano) */
$specialPageAliases['it'] = array(
'MapEditor' => array( 'EditorMappa' ),
);

/** Japanese (日本語) */
$specialPageAliases['ja'] = array(
'MapEditor' => array( '地図編集', 'マップ編集' ),
Expand All @@ -47,6 +62,11 @@
'MapEditor' => array( '지도편집기' ),
);

/** Luxembourgish (Lëtzebuergesch) */
$specialPageAliases['lb'] = array(
'MapEditor' => array( 'Kaartenediteur' ),
);

/** Macedonian (македонски) */
$specialPageAliases['mk'] = array(
'MapEditor' => array( 'УредникНаКарти' ),
Expand All @@ -62,7 +82,27 @@
'MapEditor' => array( 'Kaarteditor' ),
);

/** Sicilian (sicilianu) */
$specialPageAliases['scn'] = array(
'MapEditor' => array( 'EditorMappa' ),
);

/** Turkish (Türkçe) */
$specialPageAliases['tr'] = array(
'MapEditor' => array( 'HaritaDüzenleyici', 'HaritaEditörü' ),
);

/** Vietnamese (Tiếng Việt) */
$specialPageAliases['vi'] = array(
'MapEditor' => array( 'Sửa_đổi_bản_đồ' ),
);

/** Simplified Chinese (中文(简体)‎) */
$specialPageAliases['zh-hans'] = array(
'MapEditor' => array( '地图编辑器' ),
);

/** Traditional Chinese (中文(繁體)‎) */
$specialPageAliases['zh-hant'] = array(
'MapEditor' => array( '地圖編輯器' ),
);
Loading

0 comments on commit 0672cbd

Please sign in to comment.