Skip to content
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 4 additions & 0 deletions src/GeoTimeZone/Calculator.php
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down
4 changes: 4 additions & 0 deletions src/GeoTimeZone/UpdaterData.php
Original file line number Diff line number Diff line change
Expand Up @@ -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{
Expand Down