Renaming GeonamesPlugin::NAMESPACE to GeonamesPlugin::LOCATION_NS to avoid parse errors; 'namespace' is a reserved keyword in PHP 5.3 and later.
This commit is contained in:
parent
e3123be350
commit
88ff0eefb4
@ -49,7 +49,7 @@ if (!defined('STATUSNET')) {
|
|||||||
|
|
||||||
class GeonamesPlugin extends Plugin
|
class GeonamesPlugin extends Plugin
|
||||||
{
|
{
|
||||||
const NAMESPACE = 1;
|
const LOCATION_NS = 1;
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* convert a name into a Location object
|
* convert a name into a Location object
|
||||||
@ -85,7 +85,7 @@ class GeonamesPlugin extends Plugin
|
|||||||
$location->lon = $n->lng;
|
$location->lon = $n->lng;
|
||||||
$location->names[$language] = $n->name;
|
$location->names[$language] = $n->name;
|
||||||
$location->location_id = $n->geonameId;
|
$location->location_id = $n->geonameId;
|
||||||
$location->location_ns = self::NAMESPACE;
|
$location->location_ns = self::LOCATION_NS;
|
||||||
|
|
||||||
// handled, don't continue processing!
|
// handled, don't continue processing!
|
||||||
return false;
|
return false;
|
||||||
@ -109,7 +109,7 @@ class GeonamesPlugin extends Plugin
|
|||||||
|
|
||||||
function onLocationFromId($id, $ns, $language, &$location)
|
function onLocationFromId($id, $ns, $language, &$location)
|
||||||
{
|
{
|
||||||
if ($ns != self::NAMESPACE) {
|
if ($ns != self::LOCATION_NS) {
|
||||||
// It's not one of our IDs... keep processing
|
// It's not one of our IDs... keep processing
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -144,7 +144,7 @@ class GeonamesPlugin extends Plugin
|
|||||||
$location = new Location();
|
$location = new Location();
|
||||||
|
|
||||||
$location->location_id = $last->geonameId;
|
$location->location_id = $last->geonameId;
|
||||||
$location->location_ns = self::NAMESPACE;
|
$location->location_ns = self::LOCATION_NS;
|
||||||
$location->lat = $last->lat;
|
$location->lat = $last->lat;
|
||||||
$location->lon = $last->lng;
|
$location->lon = $last->lng;
|
||||||
$location->names[$language] = implode(', ', array_reverse($parts));
|
$location->names[$language] = implode(', ', array_reverse($parts));
|
||||||
@ -205,7 +205,7 @@ class GeonamesPlugin extends Plugin
|
|||||||
}
|
}
|
||||||
|
|
||||||
$location->location_id = $n->geonameId;
|
$location->location_id = $n->geonameId;
|
||||||
$location->location_ns = self::NAMESPACE;
|
$location->location_ns = self::LOCATION_NS;
|
||||||
$location->lat = $lat;
|
$location->lat = $lat;
|
||||||
$location->lon = $lon;
|
$location->lon = $lon;
|
||||||
|
|
||||||
@ -237,7 +237,7 @@ class GeonamesPlugin extends Plugin
|
|||||||
|
|
||||||
function onLocationNameLanguage($location, $language, &$name)
|
function onLocationNameLanguage($location, $language, &$name)
|
||||||
{
|
{
|
||||||
if ($location->location_ns != self::NAMESPACE) {
|
if ($location->location_ns != self::LOCATION_NS) {
|
||||||
// It's not one of our IDs... keep processing
|
// It's not one of our IDs... keep processing
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
@ -292,7 +292,7 @@ class GeonamesPlugin extends Plugin
|
|||||||
|
|
||||||
function onLocationUrl($location, &$url)
|
function onLocationUrl($location, &$url)
|
||||||
{
|
{
|
||||||
if ($location->location_ns != self::NAMESPACE) {
|
if ($location->location_ns != self::LOCATION_NS) {
|
||||||
// It's not one of our IDs... keep processing
|
// It's not one of our IDs... keep processing
|
||||||
return true;
|
return true;
|
||||||
}
|
}
|
||||||
|
@ -48,8 +48,8 @@ class LocationTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
static public function locationIds()
|
static public function locationIds()
|
||||||
{
|
{
|
||||||
return array(array(6077243, GeonamesPlugin::NAMESPACE, 'en', null),
|
return array(array(6077243, GeonamesPlugin::LOCATION_NS, 'en', null),
|
||||||
array(5391959, GeonamesPlugin::NAMESPACE, 'en', null));
|
array(5391959, GeonamesPlugin::LOCATION_NS, 'en', null));
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
Loading…
Reference in New Issue
Block a user