public function clear()
	{
		// Path to cache folder
		$cacheDir = PATH_APP . DS . 'cache' . DS . '*';

		// Remove recursively
		foreach (glob($cacheDir) as $cacheFileOrDir)
		{
			$readable = str_replace(PATH_APP . DS, '', $cacheFileOrDir);
			if (is_dir($cacheFileOrDir))
			{
				if (!Filesystem::deleteDirectory($cacheFileOrDir))
				{
					$this->output->addLine('Unable to delete cache directory: ' . $readable, 'error');
				}
				else
				{
					$this->output->addLine($readable . ' deleted', 'success');
				}
			}
			else
			{
				// Don't delete index.html
				if ($cacheFileOrDir != PATH_APP . DS . 'cache' . DS . 'index.html')
				{
					if (!Filesystem::delete($cacheFileOrDir))
					{
						$this->output->addLine('Unable to delete cache file: ' . $readable, 'error');
					}
					else
					{
						$this->output->addLine($readable . ' deleted', 'success');
					}
				}
			}
		}

		$this->output->addLine('Clear cache complete', 'success');
	}
public function clear()
	{
		// Path to cache folder
		$cacheDir = PATH_APP . DS . 'cache' . DS . '*';

		// Remove recursively
		foreach (glob($cacheDir) as $cacheFileOrDir)
		{
			$readable = str_replace(PATH_APP . DS, '', $cacheFileOrDir);
			if (is_dir($cacheFileOrDir))
			{
				if (!Filesystem::deleteDirectory($cacheFileOrDir))
				{
					$this->output->addLine('Unable to delete cache directory: ' . $readable, 'error');
				}
				else
				{
					$this->output->addLine($readable . ' deleted', 'success');
				}
			}
			else
			{
				// Don't delete index.html
				if ($cacheFileOrDir != PATH_APP . DS . 'cache' . DS . 'index.html')
				{
					if (!Filesystem::delete($cacheFileOrDir))
					{
						$this->output->addLine('Unable to delete cache file: ' . $readable, 'error');
					}
					else
					{
						$this->output->addLine($readable . ' deleted', 'success');
					}
				}
			}
		}

		$this->output->addLine('Clear cache complete', 'success');
	}
public function clear ( ) { // Path to cache folder $ cacheDir = PATH_APP . DS . 'cache' . DS . '*' ; // Remove recursively foreach ( glob ( $ cacheDir ) as $ cacheFileOrDir ) { $ readable = str_replace ( PATH_APP . DS , '' , $ cacheFileOrDir ) ; if ( is_dir ( $ cacheFileOrDir ) ) { if ( ! Filesystem :: deleteDirectory ( $ cacheFileOrDir ) ) { $ this -> output -> addLine ( 'Unable to delete cache directory: ' . $ readable , 'error' ) ; } else { $ this -> output -> addLine ( $ readable . ' deleted' , 'success' ) ; } } else { // Don't delete index.html if ( $ cacheFileOrDir != PATH_APP . DS . 'cache' . DS . 'index.html' ) { if ( ! Filesystem :: delete ( $ cacheFileOrDir ) ) { $ this -> output -> addLine ( 'Unable to delete cache file: ' . $ readable , 'error' ) ; } else { $ this -> output -> addLine ( $ readable . ' deleted' , 'success' ) ; } } } } $ this -> output -> addLine ( 'Clear cache complete' , 'success' ) ; }
Clear all Cache

@museDescription  Clears all cached items in document root cache directory

@return  void
Clear all Cache