Exemplo n.º 1
0
 /**
  *    Flush the cache
  * 	@param		$id					key to delete, nothing flush_all
  *  @return		string        		Libelle
  */
 function flush($id = '')
 {
     if (!empty($id)) {
         return dol_delcache($id);
     } else {
         return dol_flushcache();
     }
 }
Exemplo n.º 2
0
print '</div>';


if (!$error) {
	if (class_exists("Memcached"))
		$m = new Memcached();
	elseif (class_exists("Memcache"))
		$m = new Memcache();
	else
		dol_print_error('', 'Should not happen');

	// This action must be set here and not in actions to be sure all lang files are already loaded
	if ($_GET["action"] == 'clear') {
		$error = 0;
		if (!$error) {
			dol_flushcache();

			$mesg = '<div class="ok">' . $langs->trans("Flushed") . '</div>';
		}
	}

	if ($mesg)
		print '<br>' . $mesg;

	if (!empty($conf->memcached->host)) {
		$tmparray = explode(':', $conf->memcached->host);
		$server = $tmparray[0];
		$port = $tmparray[1] ? $tmparray[1] : 11211;

		//dol_syslog("Try to connect to server " . $server . " port " . $port . " with class " . get_class($m));
		$result = $m->addServer($server, $port);