Subversion Repositories Applications.framework

Rev

Rev 253 | Rev 282 | Go to most recent revision | Show entire file | Ignore whitespace | Details | Blame | Last modification | View Log | RSS feed

Rev 253 Rev 269
Line 65... Line 65...
65
	 *
65
	 *
66
	 * @var array
66
	 * @var array
67
	 */
67
	 */
68
	protected $metadonnees = array();
68
	protected $metadonnees = array();
Line -... Line 69...
-
 
69
 
69
 
70
	private $Cache = null;
70
 
71
	
71
	/**
72
	/**
72
	 * Constructor
73
	 * Constructor
73
	 *
74
	 *
74
	 * @param  array $options associative array of options
75
	 * @param  array $options associative array of options
75
	 * @throws Zend_Cache_Exception
76
	 * @throws Zend_Cache_Exception
76
	 * @return void
77
	 * @return void
77
	 */
78
	 */
-
 
79
	public function __construct(array $options = array(), Cache $cache) {
78
	public function __construct(array $options = array()) {
80
		$this->Cache = $cache;
Line 79... Line 81...
79
		$this->setOptions($options);
81
		$this->setOptions($options);
80
 
82
 
81
		if (isset($this->options['prefixe_fichier'])) {
83
		if (isset($this->options['prefixe_fichier'])) {
Line 193... Line 195...
193
			}
195
			}
Line 194... Line 196...
194
			
196
			
195
			$metadonnees = array(
197
			$metadonnees = array(
196
				'hash' => $cle_secu,
198
				'hash' => $cle_secu,
197
				'mtime' => time(),
199
				'mtime' => time(),
198
				'expiration' => $this->getTimestampExpiration($duree_vie_specifique),
200
				'expiration' => $this->Cache->getTimestampExpiration($duree_vie_specifique),
199
				'tags' => $tags
201
				'tags' => $tags
Line 200... Line 202...
200
			);
202
			);
201
 
203
 
Line 695... Line 697...
695
		}
697
		}
696
		return array_unique($resultat);
698
		return array_unique($resultat);
697
	}
699
	}
Line 698... Line 700...
698
 
700
 
699
	/**
-
 
700
	 * Compute & return the expire time
-
 
701
	 *
-
 
702
	 * @return int expire time (unix timestamp)
-
 
703
	 */
-
 
704
	protected function getTimestampExpiration($duree_de_vie) {
-
 
705
		if ($duree_de_vie === false) {
-
 
706
			$duree_de_vie = 3600;
-
 
707
		}
-
 
708
		$timestamp = ($duree_de_vie === null) ? 9999999999 : (time() + $duree_de_vie);
-
 
709
		return $timestamp;
-
 
710
	}
-
 
711
 
-
 
712
	/**
701
	/**
713
	 * Make a control key with the string containing datas
702
	 * Make a control key with the string containing datas
714
	 *
703
	 *
715
	 * @param  string $data		Data
704
	 * @param  string $data		Data
716
	 * @param  string $controlType Type of control 'md5', 'crc32' or 'strlen'
705
	 * @param  string $controlType Type of control 'md5', 'crc32' or 'strlen'