Skip to content

Default cache duration #107

Closed
Closed
@michael-vostrikov

Description

@michael-vostrikov

General Information

GeocoderLaravel Version: 4.0.2
Laravel Version: 5.4.28
PHP Version: PHP 7.1.1 (ZTS MSVC14 (Visual C++ 2015) x86)

Issue Description

Default value for 999999999 for cache-duration causes that results are not cached with 32-bit PHP.
This happens because Laravel has the check (int) ($duration * 60) > 0 ? $duration : null in the method Illuminate\Cache\Repository::getMinutes(). For 999999999 on 32-bit systems it causes a truncation, and the result becomes less that zero.
https://github.com/laravel/framework/blob/5.4/src/Illuminate/Cache/Repository.php#L486

The solution can be to change the value to 9999999 or at least add a warning to config file and docs.

Steps to Replicate

Install toin0u/geocoder-laravel with 32-bit PHP.
Run php artisan vendor:publish --provider="Geocoder\Laravel\Providers\GeocoderService" --tag="config"
Check if results are cached.

Metadata

Metadata

Assignees

Type

No type

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions