<?php
/*-----------------------------------------------------------------------------*\
#################################################################################
#	Script name: admin/includes/seo_cache_reset.php
#	Contribution: Ultimate SEO URLs
#	Version: 1.0
#
#	Copyright (C) 2005 Bobby Easland
#	Internet moniker: Chemo
#	Contact: chemo@mesoimpact.com
#
#	This script is free software; you can redistribute it and/or
#	modify it under the terms of the GNU General Public License
#	as published by the Free Software Foundation; either version 2
#	of the License, or (at your option) any later version.
#
#	This program is distributed in the hope that it will be useful,
#	but WITHOUT ANY WARRANTY; without even the implied warranty of
#	MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
#	GNU General Public License for more details.
#
#	Script is intended to be used with:
#	osCommerce, Open Source E-Commerce Solutions
#	http://www.oscommerce.com
#	Copyright (c) 2003 osCommerce
################################################################################
\*-----------------------------------------------------------------------------*/

$cache_dir = SEO_URLS_CACHE_DIR;

if ( function_exists('glob') ){
	foreach (glob($cache_dir."{*.cache}", GLOB_BRACE) as $filename) {
   		@unlink($filename);
	}
} else {
	$dir = $cache_dir;
	if (is_dir($dir)) {
	   if ($dh = opendir($dir)) {
		   while (($file = readdir($dh)) !== false) {
				@unlink($file);
		   }
		   closedir($dh);
	   }
	}
}
?>