Issue/327 versioning (#345)

* Switch to semver format

* Rewrite new version check to use Github Releases and cron

* Styling

* Remove v from in front of version

* New version check test fix

* Uncomment test case
This commit is contained in:
Nabeel S
2019-08-06 17:48:00 -04:00
committed by GitHub
parent 092b9fc9dc
commit e12188b7d3
16 changed files with 1195 additions and 298 deletions

View File

@@ -0,0 +1,69 @@
<?php
namespace App\Repositories;
use Spatie\Valuestore\Valuestore;
class KvpRepository
{
private $valueStore;
public function __construct()
{
$this->valueStore = Valuestore::make(config('phpvms.kvp_storage_path'));
}
/**
* @param $key
* @param null $default
*
* @return array|string|null
*/
public function retrieve($key, $default = null)
{
return $this->get($key, $default);
}
/**
* Get a value from the KVP store
*
* @param string $key
* @param mixed $default default value to return
*
* @return array|string|null
*/
public function get($key, $default = null)
{
if (!$this->valueStore->has($key)) {
return $default;
}
return $this->valueStore->get($key);
}
/**
* @alias store($key,$value)
*
* @param string $key
* @param mixed $value
*
* @return null
*/
public function save($key, $value)
{
return $this->store($key, $value);
}
/**
* Save a value to the KVP store
*
* @param $key
* @param $value
*
* @return null
*/
public function store($key, $value)
{
return $this->valueStore->put($key, $value);
}
}