_log example

$data = @sqlite_escape_string($data);
        $mktime = time();
        if ($lifetime === null) {
            $expire = 0;
        } else {
            $expire = $mktime + $lifetime;
        }
        $this->_query("DELETE FROM cache WHERE id='$id'");
        $sql = "INSERT INTO cache (id, content, lastModified, expire) VALUES ('$id', '$data', $mktime, $expire)";
        $res = $this->_query($sql);
        if (!$res) {
            $this->_log("Zend_Cache_Backend_Sqlite::save() : impossible to store the cache id=$id");
            return false;
        }
        $res = true;
        foreach ($tags as $tag) {
            $res = $this->_registerTag($id$tag) && $res;
        }
        return $res;
    }

    /** * Remove a cache record * * @param string $id Cache id * @return boolean True if no problem */

    public function save($data$id$tags = array()$specificLifetime = false)
    {
        $lifetime = $this->getLifetime($specificLifetime);
        $result = apcu_store($id, array($datatime()$lifetime)$lifetime);
        if (count($tags) > 0) {
            $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APCU_BACKEND);
        }
        return $result;
    }

    /** * Remove a cache record * * @param string $id cache id * @return boolean true if no problem */
    public function remove($id)
    {
$plural    = $messageId;
                $messageId = $messageId[0];
            } else {
                $messageId = $messageId[0];
            }
        }

        if (!Zend_Locale::isLocale($locale, true, false)) {
            if (!Zend_Locale::isLocale($locale, false, false)) {
                // language does not exist, return original string                 $this->_log($messageId$locale);
                // use rerouting when enabled                 if (!empty($this->_options['route'])) {
                    if (array_key_exists($locale$this->_options['route']) &&
                        !array_key_exists($locale$this->_routed)) {
                        $this->_routed[$locale] = true;
                        return $this->translate($messageId$this->_options['route'][$locale]);
                    }
                }

                $this->_routed = array();
                if ($plural === null) {
                    

    public function save($data$id$tags = array()$specificLifetime = false)
    {
        $lifetime = $this->getLifetime($specificLifetime);
        $metadatas = array(
            'mtime' => time(),
            'expire' => $this->_expireTime($lifetime),
        );

        if (count($tags) > 0) {
            $this->_log('Zend_Cache_Backend_ZendServer::save() : tags are unsupported by the ZendServer backends');
        }

        return  $this->_store($data$id$lifetime) &&
                $this->_store($metadatas, 'internal-metadatas---' . $id$lifetime);
    }

    /** * Remove a cache record * * @param string $id cache id * @return boolean true if no problem */

    public function load($id$doNotTestCacheValidity = false)
    {
        if ($doNotTestCacheValidity) {
            $this->_log("Zend_Cache_Backend_Xcache::load() : \$doNotTestCacheValidity=true is unsupported by the Xcache backend");
        }
        $tmp = xcache_get($id);
        if (is_array($tmp)) {
            return $tmp[0];
        }
        return false;
    }

    /** * Test if a cache is available or not (for the given id) * * @param string $id cache id * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record */
// The cache is not hit !             return false;
        }
        $metadatas = $this->_getMetadatas($id);
        $file = $this->_file($id);
        $data = $this->_fileGetContents($file);
        if ($this->_options['read_control']) {
            $hashData = $this->_hash($data$this->_options['read_control_type']);
            $hashControl = $metadatas['hash'];
            if ($hashData != $hashControl) {
                // Problem detected by the read control !                 $this->_log('Zend_Cache_Backend_File::load() / read_control : stored hash and computed hash do not match');
                $this->remove($id);
                return false;
            }
        }
        return $data;
    }

    /** * Test if a cache is available or not (for the given id) * * @param string $id cache id * @return mixed false (a cache is not available) or "last modified" timestamp (int) of the available cache record */

    protected function _store($data$id$timeToLive)
    {
        if (zend_shm_cache_store($this->_options['namespace'] . '::' . $id,
                                  $data,
                                  $timeToLive) === false) {
            $this->_log('Store operation failed.');
            return false;
        }
        return true;
    }

    /** * Fetch data * * @param string $id Cache id */
    protected function _fetch($id)
    {
$lifetime = $this->getLifetime($specificLifetime);
        if ($this->_options['compression']) {
            $flag = MEMCACHE_COMPRESSED;
        } else {
            $flag = 0;
        }

        // ZF-8856: using set because add needs a second request if item already exists         $result = @$this->_memcache->set($id, array($datatime()$lifetime)$flag$lifetime);

        if (count($tags) > 0) {
            $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_MEMCACHED_BACKEND);
        }

        return $result;
    }

    /** * Remove a cache record * * @param string $id Cache id * @return boolean True if no problem */
    

    public function save($data$id$tags = array()$specificLifetime = false)
    {
        $lifetime = $this->getLifetime($specificLifetime);
        $result = apc_store($id, array($datatime()$lifetime)$lifetime);
        if (count($tags) > 0) {
            $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_APC_BACKEND);
        }
        return $result;
    }

    /** * Remove a cache record * * @param string $id cache id * @return boolean true if no problem */
    public function remove($id)
    {

    protected function _store($data$id$timeToLive)
    {
        if (zend_disk_cache_store($this->_options['namespace'] . '::' . $id,
                                  $data,
                                  $timeToLive) === false) {
            $this->_log('Store operation failed.');
            return false;
        }
        return true;
    }

    /** * Fetch data * * @param string $id Cache id */
    protected function _fetch($id)
    {

    public function load($id$doNotTestCacheValidity = false, $doNotUnserialize = false)
    {
        if (!$this->_options['caching']) {
            return false;
        }
        $id = $this->_id($id); // cache id may need prefix         $this->_lastId = $id;
        self::_validateIdOrTag($id);

        $this->_log("Zend_Cache_Core: load item '{$id}'", 7);
        $data = $this->_backend->load($id$doNotTestCacheValidity);
        if ($data === false) {
            // no cache available             return false;
        }
        if ((!$doNotUnserialize) && $this->_options['automatic_serialization']) {
            // we need to unserialize before sending the result             return unserialize($data);
        }

        return $data;
    }

    public function save($data$id$tags = array()$specificLifetime = false)
    {
        $lifetime = $this->getLifetime($specificLifetime);
        $result = wincache_ucache_set($id, array($datatime()$lifetime)$lifetime);
        if (count($tags) > 0) {
            $this->_log(self::TAGS_UNSUPPORTED_BY_SAVE_OF_WINCACHE_BACKEND);
        }
        return $result;
    }

    /** * Remove a cache record * * @param string $id cache id * @return boolean true if no problem */
    public function remove($id)
    {

    public function save($data$id$tags = array()$specificLifetime = false)
    {
        if (!($specificLifetime === false)) {
            $this->_log("Zend_Cache_Backend_ZendPlatform::save() : non false specifc lifetime is unsuported for this backend");
        }

        $lifetime = $this->_directives['lifetime'];
        $result1  = output_cache_put($id, array($datatime()));
        $result2  = (count($tags) == 0);

        foreach ($tags as $tag) {
            $tagid = self::TAGS_PREFIX.$tag;
            $old_tags = output_cache_get($tagid$lifetime);
            if ($old_tags === false) {
                $old_tags = array();
            }
// setup memcached client options         foreach ($this->_options['client'] as $name => $value) {
            $optId = null;
            if (is_int($name)) {
                $optId = $name;
            } else {
                $optConst = 'Memcached::OPT_' . strtoupper($name);
                if (defined($optConst)) {
                    $optId = constant($optConst);
                } else {
                    $this->_log("Unknown memcached client option '{$name}' ({$optConst})");
                }
            }
            if ($optId) {
                if (!$this->_memcache->setOption($optId$value)) {
                    $this->_log("Setting memcached client option '{$optId}' failed");
                }
            }
        }

        // setup memcached servers         $servers = array();
        
public function load($id$doNotTestCacheValidity = false)
    {
        if (($id = (string)$id) === '') {
            $id = $this->_detectId();
        } else {
            $id = $this->_decodeId($id);
        }
        if (!$this->_verifyPath($id)) {
            Zend_Cache::throwException('Invalid cache id: does not match expected public_dir path');
        }
        if ($doNotTestCacheValidity) {
            $this->_log("Zend_Cache_Backend_Static::load() : \$doNotTestCacheValidity=true is unsupported by the Static backend");
        }

        $fileName = basename($id);
        if ($fileName === '') {
            $fileName = $this->_options['index_filename'];
        }
        $pathName = $this->_options['public_dir'] . dirname($id);
        $file     = rtrim($pathName, '/') . '/' . $fileName . $this->_options['file_extension'];
        if (file_exists($file)) {
            $content = file_get_contents($file);
            return $content;
        }
Home | Imprint | This part of the site doesn't use cookies.