diff --git a/src/GeoTimeZone/Calculator.php b/src/GeoTimeZone/Calculator.php index 461df03..8a069d8 100644 --- a/src/GeoTimeZone/Calculator.php +++ b/src/GeoTimeZone/Calculator.php @@ -18,6 +18,10 @@ class Calculator */ public function __construct($dataDirectory = null) { + if (!extension_loaded("geos")) { + throw new ErrorException('Required dependency geos extension not installed'); + } + if (isset($dataDirectory) && is_dir($dataDirectory)) { $this->quadrantTree = new Tree($dataDirectory); $this->quadrantTree->initializeDataTree(); diff --git a/src/GeoTimeZone/UpdaterData.php b/src/GeoTimeZone/UpdaterData.php index 61c3122..f126ca3 100755 --- a/src/GeoTimeZone/UpdaterData.php +++ b/src/GeoTimeZone/UpdaterData.php @@ -29,6 +29,10 @@ class UpdaterData */ public function __construct($dataDirectory = null) { + if (!extension_loaded("geos")) { + throw new ErrorException('Required dependency geos extension not installed'); + } + if ($dataDirectory == null) { throw new ErrorException("ERROR: Invalid data directory."); }else{