mirror of
https://git.friendi.ca/friendica/friendica-addons.git
synced 2025-10-08 16:02:58 +00:00
added composer.json and needed libs
This commit is contained in:
parent
4f1fb007c5
commit
1f74d409a2
42 changed files with 4413 additions and 0 deletions
69
curweather/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/AbstractCache.php
vendored
Normal file
69
curweather/vendor/cmfcmf/openweathermap-php-api/Cmfcmf/OpenWeatherMap/AbstractCache.php
vendored
Normal file
|
@ -0,0 +1,69 @@
|
|||
<?php
|
||||
/**
|
||||
* OpenWeatherMap-PHP-API — A php api to parse weather data from http://www.OpenWeatherMap.org .
|
||||
*
|
||||
* @license MIT
|
||||
*
|
||||
* Please see the LICENSE file distributed with this source code for further
|
||||
* information regarding copyright and licensing.
|
||||
*
|
||||
* Please visit the following links to read about the usage policies and the license of
|
||||
* OpenWeatherMap before using this class:
|
||||
*
|
||||
* @see http://www.OpenWeatherMap.org
|
||||
* @see http://www.OpenWeatherMap.org/terms
|
||||
* @see http://openweathermap.org/appid
|
||||
*/
|
||||
|
||||
namespace Cmfcmf\OpenWeatherMap;
|
||||
|
||||
/**
|
||||
* Abstract cache class to be overwritten by custom cache implementations.
|
||||
*/
|
||||
abstract class AbstractCache
|
||||
{
|
||||
/**
|
||||
* @var int $seconds Cache time in seconds.
|
||||
*/
|
||||
protected $seconds;
|
||||
|
||||
/**
|
||||
* Checks whether a cached weather data is available.
|
||||
*
|
||||
* @param string $url The unique url of the cached content.
|
||||
*
|
||||
* @return bool False if no cached information is available, otherwise true.
|
||||
*
|
||||
* You need to check if a cached result is outdated here. Return false in that case.
|
||||
*/
|
||||
abstract public function isCached($url);
|
||||
|
||||
/**
|
||||
* Returns cached weather data.
|
||||
*
|
||||
* @param string $url The unique url of the cached content.
|
||||
*
|
||||
* @return string|bool The cached data if it exists, false otherwise.
|
||||
*/
|
||||
abstract public function getCached($url);
|
||||
|
||||
/**
|
||||
* Saves cached weather data.
|
||||
*
|
||||
* @param string $url The unique url of the cached content.
|
||||
* @param string $content The weather data to cache.
|
||||
*
|
||||
* @return bool True on success, false on failure.
|
||||
*/
|
||||
abstract public function setCached($url, $content);
|
||||
|
||||
/**
|
||||
* Set after how much seconds the cache shall expire.
|
||||
*
|
||||
* @param int $seconds
|
||||
*/
|
||||
public function setSeconds($seconds)
|
||||
{
|
||||
$this->seconds = $seconds;
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue