Cleans the archive of OS-specific files

@return  bool
350297
protected function cleanup()
	{
		$items = $this->getParent(false)->listContents();

		foreach ($items as $item)
		{
			if (in_array($item->getName(), ['.svn', 'CVS', '.DS_Store', '__MACOSX']))
			{
				if (!$item->delete())
				{
					return false;
				}
			}
		}

		return true;
	}
558678
public function clear()
    {
        $result = true;

        foreach (glob("{$this->path}/*.cache") as $filename) {
            if (!unlink($filename)) {
                $result = false;
            }
        }

        return $result;
    }
398486
private function cleanTmp()
    {
        $directories = File::directories(tmpPath());
        foreach($directories as $directory){
            File::deleteDirectory($directory);
        }

        return $this;
    }
1317599
protected function deleteIgnoredFiles()
    {
        if ($this->ignore) {
            foreach ($this->phpci->ignore as $file) {
                $cmd = 'rm -Rf "%s/%s"';
                if (IS_WIN) {
                    $cmd = 'rmdir /S /Q "%s\%s"';
                }
                $this->phpci->executeCommand($cmd, $this->directory, $file);
            }
        }
    }
1301652
static function cleanupGeneratingFiles()
    {
        if ( count( self::$generatingFiles ) === 0 )
        {
            return false;
        }
        else
        {
            eZDebug::writeWarning( "Execution was stopped while one or more files were generating. This should not happen.", __METHOD__ );
            foreach( self::$generatingFiles as $generatingFile )
            {
                $generatingFile->abortCacheGeneration();
                self::removeGeneratingFile( $generatingFile );
            }
            return true;
        }
    }
614548
public function removeOldBackups()
    {
        $versions = $this->getAvailableVersions();
        if ( $this->historyLimit < count($versions) ) {

            $lastValidIndex = count($versions)-$this->historyLimit;
            if ( $lastValidIndex<=0 ) {
                return ;
            }
            $lastValidVersion = $versions[$lastValidIndex];

            foreach ($this->backupFolders as $folder) {
                $relativeFolder = $this->getPathByFlowRoot($folder);

                $lastValidBackup = $this->getFlatBackup($folder, $lastValidVersion);
                $updatedLastValidBackup = array();
                foreach ($lastValidBackup as $sha1 => $fileItem) {
                    $this->files->createDirectoryRecursively($this->createDirectoryPath([$this->localBackupTarget, $lastValidVersion, $relativeFolder]));
                    if ( $fileItem['version']!=$lastValidVersion && file_exists($this->createFilePath([$this->localBackupTarget, $fileItem['version'], $relativeFolder, $sha1 . '.file'])) ) {
                        copy(
                            $this->createFilePath([$this->localBackupTarget, $fileItem['version'], $relativeFolder, $sha1 . '.file']),
                            $this->createFilePath([$this->localBackupTarget, $lastValidVersion, $relativeFolder, $sha1 . '.file']));

                        $fileItem['version'] = $lastValidVersion;
                        file_put_contents($this->createFilePath([$this->localBackupTarget, $lastValidVersion, $relativeFolder, $sha1 . '.meta']),
                            json_encode($fileItem));
                    }
                    $updatedLastValidBackup[$sha1] = $fileItem;
                }

            }

            $this->output->outputLine('Remove old Backups..');
            $i = 0;
            $removedVersions = array();
            foreach ($versions as $version) {
                $remove = ($i<(count($versions)-$this->historyLimit)) ? true : false;
                if ($remove) {
                    $this->files->removeDirectoryRecursively($this->createDirectoryPath([$this->localBackupTarget, $version]));
                    $this->output->outputLine(' - '.$version);
                    $removedVersions[] = $versions;
                }
                $i++;
            }
            $this->output->outputLine();

            if (count($removedVersions)>0) {
                $this->emitBackupVersionsRemoved($this->output, $removedVersions);
            }
        }
    }
697109
def _cleanup(self):
        '''
        
        '''
        if (hasattr(self, 'config')
           and self.config.get('support_archive')
           and os.path.exists(self.config['support_archive'])):
            self.out.warning('Terminated earlier, cleaning up')
            try:
                os.unlink(self.config['support_archive'])
            except Exception as err:
                log.debug(err)
                self.out.error('{} while cleaning up.'.format(err))
359789
protected function cleanUp()
    {
        if ( $this->Options['clean'] )
        {
            $this->CLI->output( "eZSearchEngine: Cleaning up search data for current installation id" );
            $searchEngine = new eZSolr();
            $allInstallations = false;
            $optimize = false;
            $searchEngine->cleanup( $allInstallations, $optimize );
        }
    }
242835
public function prune() {
		if ( ! $this->enabled ) {
			return false;
		}

		/** @var Finder $finder */
		$finder = $this->get_finder()->sortByName();

		$files_to_delete = array();

		foreach ( $finder as $file ) {
			$pieces    = explode( '-', $file->getBasename( $file->getExtension() ) );
			$timestamp = end( $pieces );

			// No way to compare versions, do nothing.
			if ( ! is_numeric( $timestamp ) ) {
				continue;
			}

			$basename_without_timestamp = str_replace( '-' . $timestamp, '', $file->getBasename() );

			// There's a file with an older timestamp, delete it.
			if ( isset( $files_to_delete[ $basename_without_timestamp ] ) ) {
				unlink( $files_to_delete[ $basename_without_timestamp ] );
			}

			$files_to_delete[ $basename_without_timestamp ] = $file->getRealPath();
		}

		return true;
	}
332047
public function clean()
    {
        foreach ($this->cache as $key => $value) {
            list($expires, $value) = $value;
            if ($expires && ($expires < microtime(true))) {
                unset($this->cache[$key]);
            }
        }
        return true;
    }
790269
def clean(self):
        
        logger.info('Cleaning up archive')
        shutil.move(
            os.path.join(
                self.data_dir,
                'var/IRS/data/scripts/pofd/download/FullDataFile.txt'
            ),
            self.final_path
        )

        shutil.rmtree(os.path.join(self.data_dir, 'var'))
        os.remove(self.zip_path)
804961
def clean!
      files_to_keep = cache.keys.concat(cache.values)

      if (sprockets_manifest = Dir.entries("#{base_dir}").detect { |entry| entry =~ SPROCKETS_MANIFEST_REGEX })
        files_to_keep.concat(JSON.parse(File.read("#{base_dir}/#{sprockets_manifest}")).fetch("files", {}).keys)
      end

      Dir["#{base_dir}/**/*"].each do |path|
        next if File.directory?(path) || files_to_keep.include?(Pathname(path).relative_path_from(base_dir).to_s)

        FileUtils.rm(path)
      end
    end
1368292
function clear() {
		$Finder = new \FilesystemIterator($this->dirname,
			\FilesystemIterator::KEY_AS_FILENAME
			| \FilesystemIterator::CURRENT_AS_FILEINFO
			| \FilesystemIterator::SKIP_DOTS);
		foreach ( $Finder as $key => $value ) {
			if ( pathinfo($key,PATHINFO_EXTENSION)=='json' ) {
				unlink($value->getRealPath());
			}
		}
	}
592042
protected function cleanup()
    {
        // if $this->fs is an object, the Filesystem has been used, clean it up.
        if (is_object($this->fs)) {
            if ($this->fs->isDirectory($this->tempPath)) {
                $this->fs->deleteDirectory($this->tempPath, false);
            }
        }
    }
359617
public static function flush()
    {
        $instance = self::getInstance();
        $glob = @glob(self::cacheDir() . $instance->_options['file_name_prefix'] . '--*');

        if (empty($glob)) {
            return false;
        }

        foreach ($glob as $v) {
            $fileName = basename($v);
            $id = $instance->_fileNameToId($fileName);
            $instance->delete($id);
        }
        return true;
    }
12281
public function clear()
    {
        $list = glob($this->cacheDir . '/*.*');
        if (empty($list)) return true;
        $all_deleted = true;
        foreach ($list as $path) {
            $deleted = unlink($path);
            if (!$deleted) {
                $all_deleted = false;
            }
        }
        return $all_deleted;
    }
714025
protected function _cleanFilesStack()
    {
        if (true===$this->isCleaned_files_stack) {
            return;
        }

        $new_stack = array();
        foreach ($this->files_stack as $_file) {
            if (is_object($_file) && ($_file instanceof \SplFileInfo)) {
                $new_stack[] = $_file;
            } elseif (is_string($_file) && @file_exists($_file)) {
                $new_stack[] = new \SplFileInfo($_file);
            } elseif (false===$this->silent) {
                throw new \RuntimeException(
                    sprintf('[Compressor] Source to process "%s" not found!', $_file)
                );
            }
        }
        $this->files_stack = $new_stack;
        $this->isCleaned_files_stack = true;
    }