Compare commits
2 commits
| Author | SHA1 | Date | |
|---|---|---|---|
| 75abcfb731 | |||
| d7ab4d30e0 |
2 changed files with 6 additions and 3 deletions
|
|
@ -1,7 +1,7 @@
|
||||||
{
|
{
|
||||||
"name": "yusurko/useragent",
|
"name": "yusurko/useragent",
|
||||||
"type": "library",
|
"type": "library",
|
||||||
"version": "0.1.1",
|
"version": "0.1.2",
|
||||||
"license": "Apache-2.0",
|
"license": "Apache-2.0",
|
||||||
"autoload": {
|
"autoload": {
|
||||||
"psr-4": {
|
"psr-4": {
|
||||||
|
|
|
||||||
|
|
@ -194,8 +194,11 @@ a:link, a:visited {color: #39f}
|
||||||
public function getCountry() {
|
public function getCountry() {
|
||||||
if ($this->country === null) {
|
if ($this->country === null) {
|
||||||
if ($this->locator === null) $this->locator = $this->probeLocator();
|
if ($this->locator === null) $this->locator = $this->probeLocator();
|
||||||
if ($this->locator === false) $this->country = Country::outerSpace();
|
if ($this->locator === false) {
|
||||||
$this->country = $this->locator->locate($this->getAddr());
|
$this->country = Country::outerSpace();
|
||||||
|
} else {
|
||||||
|
$this->country = $this->locator->locate($this->getAddr());
|
||||||
|
}
|
||||||
}
|
}
|
||||||
return $this->country;
|
return $this->country;
|
||||||
}
|
}
|
||||||
|
|
|
||||||
Loading…
Add table
Add a link
Reference in a new issue