Install files from array.

@param $files
327269
private function install($files)
    {
        foreach ($files as $fileSrc => $fileDst) {
            if (file_exists($fileDst) && !$this->force && !$this->confirmOverwrite(basename($fileDst))) {
                return;
            }
            if ($this->files->isFile($fileSrc)) {
                $this->publishFile($fileSrc, $fileDst);
            } elseif ($this->files->isDirectory($fileSrc)) {
                $this->publishDirectory($fileSrc, $fileDst);
            } else {
                $this->error("Can't locate path: <{$fileSrc}>");
            }
        }
    }
1192099
public function addFile(\Haven\CoreBundle\Entity\File\File $files)
    {
        $this->files[] = $files;

        return $this;
    }
345434
public function loadFiles(array $files, $type = 'yaml')
    {
        $set = $this->createFixtureSet();
        foreach ($files as $file) {
            $set->addFile($file, $type);
        }
        $set->setDoPersist(false);

        return $this->load($set);
    }
553050
public static function loadRoutingFiles(array $files)
    {
        $routing = new Structure();

        foreach ($files as $file) {
            if (!in_array(pathinfo($file, PATHINFO_EXTENSION), ['json', 'yml', 'yaml'])) {
                continue;
            }

            $routing = $routing->loadFile($file, pathinfo($file, PATHINFO_EXTENSION));
        }

        return $routing->toArray();
    }
246744
protected function processNewFiles(array $files)
    {
        foreach ($files as $file) {
            if (!file_exists($file)) {
                //This is bad
                throw new Exception('Cant find File: '.$file);
            }
            include $file;
            
            if (!isset($arrUpdate)) {
                throw new Exception('Array $arrUpdate does not exist in '.$file);
            }
            
            try {
                $this->processArray($arrUpdate);
                $this->addFileToProcessedList($file);
            } catch (Exception $ex) {
                echo $ex->getMessage();
            }
            
            unset($arrUpdate);
        }
    }
1129293
public static function load($files = [], $options = null)
    {
        if (! self::$configurator instanceof ConfiguratorClass) {
            self::$configurator = new ConfiguratorClass($files, $options);
        } else {
            self::$configurator->load($files, $options);
        }
    }
426180
protected function copy( $files ) {
		$failures = [];

		foreach ( $files as $source => $destination ) {
			if ( file_exists( $destination ) ) {
				$failures[ $source ] = $destination;
				continue;
			}

			$directory = dirname( $destination );
			if ( ! file_exists( $directory ) ) {
				mkdir( $directory );
			}

			copy( $source, $destination );
		}

		return $failures;
	}
1250536
public function setFiles($files = array())
    {
        if (count($files) === 0) {
            $this->_files = $_FILES;
        } else {
            $this->_files = $files;
        }
        return $this;
    }
962426
public function verifyFiles(array $files): self
    {
        $arguments = \array_merge($files, $this->getArguments());

        $this->verifyAction($arguments);

        return $this;
    }
1089630
private function removeBrokenFiles(array $files)
    {
        // Recursive logic to replace broken arrays with empty ones (which to be removed later)
        if (isset($files['error'])) {
            return $files['error'] == 4 ? array() : $files;
        }

        foreach ($files as $key => $value) {
            // Recursive call
            $files[$key] = call_user_func(array($this, __FUNCTION__), $value);
        }

        // Now remove empty arrays
        return array_filter($files);
    }
1295210
public function setFiles(array $files)
    {
        $this->files = array();
        foreach ($files as $key => $file) {
            if (!is_array($file)) {
                $file = array('content' => $file);
            }

            $file = array_merge(array(
                'content' => null,
                'mtime' => null,
            ), $file);

            $this->setFile($key, $file['content'], $file['mtime']);
        }
    }
437027
public function addPaths(array $paths)
    {
        $this->currentCollectorData = $this->filePathCollector->collect();

        foreach ($paths as $path) {
            $this->addPath($path);
        }
    }
730029
public function setMerged(array $files)
    {
        if (!empty($files)) {
            foreach ($files as $_file) {
                $this->addMerged($_file);
            }
        }
        return $this;
    }
271622
public function addFiles(array $files)
    {
        $added_files = 0;
        try {
            foreach ($files as $localName => $filename) {
                if (!is_null($filename)) {
                    $this->sevenZip->addEntry($filename);
                    $this->sevenZip->renameEntry($filename, $localName);
                    $added_files++;
                }
            }
        } catch (Exception $e) {
            throw new Exception('Could not modify archive: '.$e->getMessage(), $e->getCode(), $e);
        }
        return $added_files;
    }
1185300
public static function addCssFiles($files = array())
    {
        
		foreach($files as $file){
			self::addFile($file, tao_helpers_Scriptloader::CSS);
		}
        
    }
1144220
public function attach(array $files)
    {
        foreach ($files as $key => $file) {
            if (is_array($file)) {
                $file = new UploadedFile($file['path'], basename($file['path']), $file['mime'], $file['size']);
            } elseif (is_string($file)) {
                $finfo = finfo_open(FILEINFO_MIME_TYPE);

                $file = new UploadedFile($file, basename($file), finfo_file($finfo, $file), $this->files->size($file));
            } elseif (! $file instanceof UploadedFile) {
                continue;
            }

            $this->uploads[$key] = $file;
        }

        return $this;
    }
625534
protected function prepareUploadedFiles($files)
    {
        $fileKeys = ['error', 'name', 'size', 'tmp_name', 'type'];
        $reformatFiles = new ReformatUploadedFiles($files);

        $output = [];
        foreach ($reformatFiles as $key => $value) {
            $keys = array_keys($value);
            sort($keys);

            if ($fileKeys == $keys && is_array($value['tmp_name'])) {
                $output[$key] = $this->prepareUploadedFiles($reformatFiles[$key]);
                continue;
            }

            $output[$key] = new UploadedFile(
                $value['tmp_name'],
                $value['error'],
                $value['name'],
                $value['type'],
                $value['size']
            );
        }

        return $output;
    }