spl_autoload_register(function($className) {
$className = ltrim($className, '\\');
if (0 != strpos($className, 'Geocoding')) {
return false;
}
$fileName = '';
$namespace = '';
if ($lastNsPos = strrpos($className, '\\')) {
$namespace = substr($className, 0, $lastNsPos);
$className = substr($className, $lastNsPos + 1);
$fileName = str_replace('\\', DIRECTORY_SEPARATOR, $namespace) . DIRECTORY_SEPARATOR;
}
$fileName = __DIR__ . DIRECTORY_SEPARATOR . $fileName . $className . '.php';
if (is_file($fileName)) {
require $fileName;
return true;
}
return false;
});
$geocoding = new \Geocoding\Geocoding(
new \Geocoding\Service\GoogleMapsService(
false
)
);
$geocodingResult = $geocoding->locate('1 Infinite Loop, Cupertino, CA');
echo $geocodingResult->getCountry();
-
Notifications
You must be signed in to change notification settings - Fork 0
anton-vakulchyk/Geocoding
Folders and files
Name | Name | Last commit message | Last commit date | |
---|---|---|---|---|
Repository files navigation
About
Geocoding
Resources
Stars
Watchers
Forks
Releases
No releases published
Packages 0
No packages published