Subversion-Projekte lars-tiefland.ci

Revision

Revision 68 | Revision 2049 | Zur aktuellen Revision | Ganze Datei anzeigen | Leerzeichen ignorieren | Details | Blame | Letzte Änderung | Log anzeigen | RSS feed

Revision 68 Revision 1257
Zeile 118... Zeile 118...
118
	 * @param	mixed	unique identifier of item in cache
118
	 * @param	mixed	unique identifier of item in cache
119
	 * @return	bool	true on success/false on failure
119
	 * @return	bool	true on success/false on failure
120
	 */
120
	 */
121
	public function delete($id)
121
	public function delete($id)
122
	{
122
	{
123
		return file_exists($this->_cache_path.$id) ? unlink($this->_cache_path.$id) : FALSE;
123
		return is_file($this->_cache_path.$id) ? unlink($this->_cache_path.$id) : FALSE;
124
	}
124
	}
Zeile 125... Zeile 125...
125
 
125
 
Zeile 126... Zeile 126...
126
	// ------------------------------------------------------------------------
126
	// ------------------------------------------------------------------------
Zeile 214... Zeile 214...
214
	 * @param	mixed	key to get cache metadata on
214
	 * @param	mixed	key to get cache metadata on
215
	 * @return	mixed	FALSE on failure, array on success.
215
	 * @return	mixed	FALSE on failure, array on success.
216
	 */
216
	 */
217
	public function get_metadata($id)
217
	public function get_metadata($id)
218
	{
218
	{
219
		if ( ! file_exists($this->_cache_path.$id))
219
		if ( ! is_file($this->_cache_path.$id))
220
		{
220
		{
221
			return FALSE;
221
			return FALSE;
222
		}
222
		}
Zeile 223... Zeile 223...
223
 
223
 
Zeile 224... Zeile 224...
224
		$data = unserialize(file_get_contents($this->_cache_path.$id));
224
		$data = unserialize(file_get_contents($this->_cache_path.$id));
225
 
225
 
226
		if (is_array($data))
226
		if (is_array($data))
Zeile 227... Zeile 227...
227
		{
227
		{
228
			$mtime = filemtime($this->_cache_path.$id);
228
			$mtime = filemtime($this->_cache_path.$id);
229
 
229
 
230
			if ( ! isset($data['ttl']))
230
			if ( ! isset($data['ttl'], $data['time']))
Zeile 231... Zeile 231...
231
			{
231
			{
232
				return FALSE;
232
				return FALSE;
233
			}
233
			}
234
 
234
 
235
			return array(
235
			return array(
Zeile 236... Zeile 236...
236
				'expire' => $mtime + $data['ttl'],
236
				'expire' => $data['time'] + $data['ttl'],