Skip to content

Commit 0066af5

Browse files
committed
Fix class exists check
1 parent 3ace3bc commit 0066af5

2 files changed

Lines changed: 11 additions & 5 deletions

File tree

FieldtypeGeocoder.module

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -493,7 +493,7 @@ class FieldtypeGeocoder extends Fieldtype implements Module, ConfigurableModule
493493

494494
public function ___loadGeocoderPhp() {
495495
// check global geocoder class and include autoload
496-
if(!class_exists("\Geocoder\Geocoder")) {
496+
if(!class_exists("\Geocoder\StatefulGeocoder")) {
497497
if(!file_exists(__DIR__ . '/vendor/autoload.php')) throw new \Exception('Please install geocoder-php in your the module directory.');
498498
require_once(/*NoCompile*/__DIR__ . '/vendor/autoload.php');
499499
}

README.md

Lines changed: 10 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -33,10 +33,16 @@ Thanks to Ryan (FieldtypeMapMarker) and mats (FieldtypeLeafletMapMarker), from w
3333
You can change the provider with a processwire hook. [read more](#hook)
3434
5. Create a new field of type Geocoder, and name it whatever you like. In our examples we named it simply "geocoder".
3535
6. Add the field to a template and start geocoding!
36-
- For GraphQL install the moduel `GraphQLFieldtypeGeocoder`
36+
- For GraphQL install the modul `GraphQLFieldtypeGeocoder`
37+
38+
## Install via composer
39+
1. Execute the following command in your website root directory.
40+
```bash
41+
composer require nr/fieldtypegeocoder
42+
```
3743

3844
## Requirements
39-
- PHP >= 7.3
45+
- PHP >= 7.4
4046
- PHP Extensions: json, curl, intl
4147

4248

@@ -166,8 +172,8 @@ You can hook some methods to change or override the geocoding provider.
166172
[Here](https://github.com/geocoder-php/Geocoder#providers) you can find a full list of supported providers.
167173

168174
1. Download, unzip provider package.
169-
2. Move the files in your folder structure (```Provider.php``` and ```ProviderAddress.php```)*.
170-
3. Load all files with ```require_once()``` command.
175+
2. Move the files in your folder structure (`Provider.php` and `ProviderAddress.php`)*.
176+
3. Load all files with `require_once()` command.
171177

172178
<small>*Replace "Provider" with the provider name e.g. Google or Mapbox etc.</small>
173179

0 commit comments

Comments
 (0)