Skip to content

Commit

Permalink
update php library to accept and override timestamp as necessary
Browse files Browse the repository at this point in the history
  • Loading branch information
Daniel Bretoi committed Jan 27, 2011
1 parent 99485d3 commit 790afc3
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions km.php
Expand Up @@ -12,7 +12,7 @@ class KM
static $use_cron = false;
static $query_line = null;
static $hostname = null;
static $VERSION = '1.0.5';
static $VERSION = '1.1.0';

static function init($key, $options=array())
{
Expand Down Expand Up @@ -255,9 +255,10 @@ static protected function log($type, $msg)

static protected function generate_query($type,$data,$update = true)
{
$data = array_merge($data, array( '_k' => self::$key, '_t' => self::epoch() ));
if ($update)
$data = array_merge($data, array( '_p' => self::$id,));
$data['_k'] = self::$key;
if (array_key_exists('_t', $data)) $data['_d'] = 1;
else $data['_t'] = self::epoch();
if ($update) $data['_p'] = self::$id;

$query = '/' . $type . '?' . http_build_query($data, '', '&');

Expand Down

0 comments on commit 790afc3

Please sign in to comment.