timestamp ()

Retrieves the timestamp of the cache.

Access

public

Returns

Type

Description

mixed

Either the Unix time stamp of the cache creation, or boolean false.

Source

Method defined in lib/cachecore/cachepdo.class.php | Toggle source view (25 lines) | View on GitHub

public function timestamp()
{
    if (!$this->store_read)
    {
        $this->read->bindParam(':id', $this->id);
        $this->read->execute();
        $this->store_read = $this->read->fetch(PDO::FETCH_ASSOC);
    }

    if ($this->store_read)
    {
        $value = $this->store_read['expires'];

        // If 'expires' isn't yet an integer, convert it into one.
        if (!is_numeric($value))
        {
            $value = strtotime($value);
        }

        $this->timestamp = date('U', $value);
        return $this->timestamp;
    }

    return false;
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback