~ubuntu-branches/ubuntu/trusty/zendframework/trusty

« back to all changes in this revision

Viewing changes to library/Zend/Cache/Frontend/Capture.php

  • Committer: Bazaar Package Importer
  • Author(s): Frank Habermann
  • Date: 2010-04-28 20:10:00 UTC
  • mfrom: (1.3.1 upstream) (9.1.4 sid)
  • Revision ID: james.westby@ubuntu.com-20100428201000-o347bj5qb5i3tpot
Tags: 1.10.4-1
new upstream release

Show diffs side-by-side

added added

removed removed

Lines of Context:
45
45
     * @var array
46
46
     */
47
47
    protected $_tags = array();
 
48
    
 
49
    protected $_extension = null;
48
50
 
49
51
    /**
50
52
     * Start the cache
52
54
     * @param  string  $id Cache id
53
55
     * @return mixed True if the cache is hit (false else) with $echoData=true (default) ; string else (datas)
54
56
     */
55
 
    public function start($id, array $tags)
 
57
    public function start($id, array $tags, $extension = null)
56
58
    {
57
59
        $this->_tags = $tags;
 
60
        $this->_extension = $extension;
58
61
        ob_start(array($this, '_flush'));
59
62
        ob_implicit_flush(false);
60
63
        $this->_idStack[] = $id;
74
77
        if (is_null($id)) {
75
78
            Zend_Cache::throwException('use of _flush() without a start()');
76
79
        }
77
 
        file_put_contents('/var/www/data.dump', $data);
78
 
        $this->save($data, $id, $this->_tags);
 
80
        if ($this->_extension) {
 
81
            $this->save(serialize(array($data, $this->_extension)), $id, $this->_tags);
 
82
        } else {
 
83
            $this->save($data, $id, $this->_tags);
 
84
        }
79
85
        return $data;
80
86
    }
81
87
}