create ( $data )

Creates a new cache.

Access

public

Parameters

Parameter

Type

Required

Description

$data

mixed

Required

The data to cache.

Returns

Type

Description

boolean

Whether the operation was successful.

Source

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

public function create($data)
{
    $data = serialize($data);
    $data = $this->gzip ? gzcompress($data) : $data;

    $this->create->bindParam(':id', $this->id);
    $this->create->bindParam(':data', $data);
    $this->create->bindParam(':expires', $this->generate_timestamp());

    return (bool) $this->create->execute();
}

Copyright © 2010–2013 Amazon Web Services, LLC


Feedback