This updates the data in the manifest from the files passed in.

@param array $fileList A list of files to include in the manifest.

@return array The new hash mapping from those files.
960725
public function update($fileList)
    {
        $csums = array();

        foreach ($fileList as $file) {
            if (file_exists($file)) {
                $hash = $this->calculateHash($file);
                $csums[$this->_makeRelative($file)] = $hash;
            }
        }

        $this->data = $csums;

        $this->write();

        return $csums;
    }
929914
private function preloadDependencies(array $nodeList)
    {
        $userIdList = [];
        $siteIdList = [];

        foreach ($nodeList as $node) {
            $userIdList[$node->uid] = $node->uid;
            foreach ($node->ucms_sites as $siteId) {
                $siteIdList[$siteId] = $siteId;
            }
        }

        if ($userIdList) {
            $this->entityManager->getStorage('user')->loadMultiple($userIdList);
        }
        if ($siteIdList) {
            $this->manager->getStorage()->loadAll($siteIdList);
        }
    }
1295672
public function updateCMSFields(FieldList $fields)
    {
        $owner = $this->owner;
        $fields->addFieldToTab(
            'Root.Main',
            TextField::create(
                'IDCustomValue',
                _t(__CLASS__ . '.ID', 'ID')
            )
            ->setDescription(_t(__CLASS__ . '.IDCUSTOMVALUE', 'Define an ID for the link.  This is particularly useful for google tracking.'))
        );
        return $fields;
    }
746571
protected function prepareUrls($filePath, array $urls = [], $forceRefresh = false, $cacheOnly = false, $shuffle = true)
    {
        $fileExists = file_exists($filePath);

        if ($cacheOnly) {
            if (!$fileExists) {
                $this->log->debug("Cache only mode enabled, but $filePath does not exist !");

                return [];
            }
            $this->log->debug("Cache only mode enabled, only loading content from $filePath");

            return [$filePath];
        } else {
            if ($shuffle) {
                shuffle($urls);
            }

            if ($forceRefresh) {
                $this->log->debug("Refresh forced, skipping cached content from $filePath");

                return $urls;
            }
            if ($fileExists) {
                array_unshift($urls, $filePath);
            }

            return $urls;
        }
    }
1316791
public function updateFiles(string $commit, array $files)
    {
        $path = $this->buildFilesPath($commit);

        $builder = new MultipartStreamBuilder();

        foreach ($files as $file) {
            $builder->addResource($file->getName(), $file->getResource(), $file->getOptions());
        }

        $headers = ['Content-Type' => sprintf('multipart/form-data; boundary="%s"', $builder->getBoundary())];

        return $this->postRaw($path, $builder->build(), $headers);
    }
395903
public function updateCMSFields(FieldList $fields)
    {
        $fieldEditor = $this->getFieldEditorGrid();

        $fields->insertAfter(new Tab('FormFields', _t(__CLASS__.'.FORMFIELDS', 'Form Fields')), 'Main');
        $fields->addFieldToTab('Root.FormFields', $fieldEditor);

        return $fields;
    }
297916
public function addCachedField($arFieldList)
    {
        if (empty($arFieldList)) {
            return;
        }

        if (empty($this->cached) || !is_array($this->cached)) {
            $this->cached = [];
        }

        if (is_string($arFieldList)) {
            $arFieldList = [$arFieldList];
        }

        $this->cached = array_merge($this->cached, $arFieldList);
        $this->cached = array_unique($this->cached);
    }
529252
public function _buildFileList($files, $dir)
    {
        $list = array();

        $dir = realpath($dir);
        if (!$dir) {
            return $list;
        }
        $dir = $this->fixPath($dir);

        foreach ($files as $filename) {
            $filename = $this->makeAbsolutePath(trim($filename), $dir);
            $globResults = glob($filename); // switch slashes since old versions of glob need forward slashes
            if ($globResults) {
                foreach ($globResults as $filepath) {
                    $okay = TRUE;
                    foreach ($this->_ignore as $ignore) {
                        if (strstr($filepath, trim($ignore))) {
                            $okay = FALSE;
                        }
                    }
                    if ($okay) {
                        $list[] = realpath($filepath);
                    }
                }
            } elseif (!$this->_subdirs) {
                $this->error('Could not find file "'.$filename.'"');
            }
        }

        if ($this->_subdirs) { // recurse into subdir
            $globResults = glob($dir.'*', GLOB_ONLYDIR); // get subdirs
            if ($globResults) {
                foreach ($globResults as $dirName) {
                    $okay = TRUE;
                    foreach ($this->_ignore as $ignore) {
                        if (strstr($dirName, trim($ignore))) {
                            $okay = FALSE;
                        }
                    }
                    if ($okay && (GLOB_ONLYDIR || is_dir($dirName))) { // handle missing only dir support
                        $list = array_merge($list, $this->_buildFileList($files, $this->makeAbsolutePath($dirName, $this->_path)));
                    }
                }
            }
        }

        return $list;
    }
24309
protected function addFileModificationCallbacks(&$fileList)
	{
		$fileList['index.php']['callback']=array($this,'generateIndex');
		$fileList['index-test.php']['callback']=array($this,'generateIndex');
		$fileList['protected/tests/bootstrap.php']['callback']=array($this,'generateTestBoostrap');
		$fileList['protected/yiic.php']['callback']=array($this,'generateYiic');
	}
701269
private function hashFile(File $file)
    {
        $arr = [];

        foreach ($this->layouts as $layout) {
            if (strpos($layout, '_templates') === false) {
                $layout = '_templates'.DIRECTORY_SEPARATOR.$layout;
            }

            $layoutPathName = $this->sourceDirectory.DIRECTORY_SEPARATOR.$layout.'.phtml';
            if (file_exists($layoutPathName)) {
                array_push($arr, sha1_file($layoutPathName));
            }
        }

        array_push($arr, $file->getLastModified());

        return sha1(implode('.', $arr));
    }
18441
public function copyAssetFiles(&$replacementList){
        $object = $this->object;
        $portableAssetsToExport = [];
        $service = new PortableElementService();
        $service->setServiceLocator(ServiceManager::getServiceManager());
        $files = $object->getModel()->getValidator()->getAssets($object, 'runtime');
        $baseUrl = $this->qtiItemExporter->buildBasePath() . DIRECTORY_SEPARATOR . $object->getTypeIdentifier();
        foreach ($files as $url) {
            // Skip shared libraries into portable element
            if (strpos($url, './') !== 0) {
                \common_Logger::i('Shared libraries skipped : ' . $url);
                $portableAssetsToExport[$url] = $url;
                continue;
            }
            $stream = $service->getFileStream($object, $url);
            $replacement = $this->qtiItemExporter->copyAssetFile($stream, $baseUrl, $url, $replacementList);
            $portableAssetToExport = preg_replace('/^(.\/)(.*)/', $object->getTypeIdentifier() . "/$2", $replacement);
            $portableAssetsToExport[$url] = $portableAssetToExport;
            \common_Logger::i('File copied: "' . $url . '" for portable element ' . $object->getTypeIdentifier());
        }
        return $this->portableAssetsToExport = $portableAssetsToExport;
    }
1178363
private function addFilesList($data)
    {
        foreach ($this->_FILES['data']['name'] as $key => $filenames) {
            if (!array_key_exists($key, $data)) {
                $data[$key] = array();
            }

            foreach ($filenames as $file => $filedata) {
                $data[$key][$file] = $this->file("$key.$file");
            }
        }

        return $data;
    }
1083722
public function getPackageInfo($packageList)
    {
        $formatInfo = function ($package) {
            // Convert object to array, with Capitalised keys
            $package = get_object_vars($package);
            return array_combine(
                array_map('ucfirst', array_keys($package)),
                $package
            );
        };

        $packageList = array_map($formatInfo, $packageList);
        $this->extend('updatePackageInfo', $packageList);
        return $packageList;
    }
180507
protected function updateAndGetCacheFileName($classFile)
    {
        $className = $this->className($classFile);

        if($this->hasChanged($classFile)){
            $content = $this->processClass($classFile);
            $this->writeCache($className, $content);
            $this->setDateFromClassFile($classFile);
        }

        return $this->cacheFile($className);
    }
683962
private function neglectVendorFiles($filesByFile)
    {
        $return = [];

        foreach ($filesByFile->toArray() as $key => $value) {
            if (! Str::contains($key, ':')) {
                $return[$key] = $value;
            }
        }

        return $return;
    }
348601
public function updateCMSFields(FieldList $fields)
    {
        $fields->addFieldsToTab(
            'Root.Main',
            array(
                TextField::create(
                    'GoogleTagManager',
                    _t(__CLASS__ . '.ID', 'Tag manager ID')
                )
                ->setAttribute(
                    "placeholder",
                    "GTM-******"
                ),
            )
        );
        return $fields;
    }
358691
public function addAll(ArrayList $arrayList): bool {
        $added = false;
        foreach ($arrayList as $value) {
            $added |= $this->add($value);
        }
        return $added;
    }