wCMF  3.6
 All Classes Namespaces Files Functions Variables Groups Pages
function.prevent_caching.php
Go to the documentation of this file.
1 <?php
2 /**
3  * wCMF - wemove Content Management Framework
4  * Copyright (C) 2005-2014 wemove digital solutions GmbH
5  *
6  * Licensed under the terms of any of the following licenses
7  * at your choice:
8  *
9  * - GNU Lesser General Public License (LGPL)
10  * http://www.gnu.org/licenses/lgpl.html
11  * - Eclipse Public License (EPL)
12  * http://www.eclipse.org/org/documents/epl-v10.php
13  *
14  * See the license.txt file distributed with this work for
15  * additional information.
16  *
17  * $Id: function.prevent_caching.php 1462 2014-02-04 23:52:27Z iherwig $
18  */
19 
20 /*
21 * Smarty plugin
22 * -------------------------------------------------------------
23 * File: function.prevent_caching.php
24 * Type: function
25 * Name: prevent_caching
26 * Purpose: prevents caching of an url by adding a unique parameter to the url
27 * (default parameter name is chacheKiller, to change it pass a name in the
28  'name' parameter)
29 * Usage: e.g. {prevent_cache url="title.gif"} or {prevent_cache url="title.gif" name="uid"}
30 * -------------------------------------------------------------
31 */
32 function smarty_function_prevent_caching($params, &$smarty)
33 {
34  $variables = array();
35  if (isset($params['name']))
36  $params['name'] = 'cahceKiller';
37 
38  echo $params['url']."?".$params['name']."=".uniqid((double)microtime()*1000000,1);
39 }
40 ?>
smarty_function_prevent_caching($params, &$smarty)