$modified = HttpIfModifiedSince::fileChanged($file, @$_SERVER['HTTP_IF_NONE_MATCH'], @$_SERVER['HTTP_IF_MODIFIED_SINCE']);
502215
public static function fileChanged($file, $etag = null, $lastmodifiedheader = null) {

        if ($etag) {
            return HttpIfModifiedSince::eTagChanged($file, $etag);
        }

        if ($lastmodifiedheader) {
            return HttpIfModifiedSince::isModified($file, $lastmodifiedheader);
        }

        return true;
    }
173260
public function updateFileFormAction(File $file)
    {
        $collection = new ResourceCollection(array($file->getResourceNode()));
        $this->checkAccess('EDIT', $collection);
        $form = $this->get('form.factory')->create(new UpdateFileType(), new File());

        return array(
            'form' => $form->createView(),
            'resourceType' => 'file',
            'file' => $file,
            '_resource' => $file
        );
    }
697091
function filesChanged(fileList) {
        if (FindUtils.isNodeSearchDisabled() || !fileList || fileList.length === 0) {
            return;
        }
        var updateObject = {
            "fileList": fileList
        };
        if (searchModel.filter) {
            updateObject.filesInSearchScope = FileFilters.getPathsMatchingFilter(searchModel.filter, fileList);
            _searchScopeChanged();
        }
        searchDomain.exec("filesChanged", updateObject);
    }
912860
public function detectChanges()
    {
        $this->signalDispatcher->connect(FlowFileMonitor::class, 'filesHaveChanged', function (string $fileMonitorIdentifier, array $changedFiles) {
            if ($fileMonitorIdentifier === static::FILE_MONITOR_IDENTIFIER) {
                foreach ($changedFiles as $changedFile => $status) {
                    if ($status === ChangeDetectionStrategyInterface::STATUS_DELETED) {
                        $this->unmonitorFile($changedFile);
                        $this->emitFileHasChanged($changedFile);
                    }

                    if ($status === ChangeDetectionStrategyInterface::STATUS_CHANGED) {
                        $this->emitFileHasChanged($changedFile);
                    }
                }
            }
        });

        $fileMonitor = new FlowFileMonitor(static::FILE_MONITOR_IDENTIFIER);
        $files = $this->cache->getByTag('file');

        foreach ($files as $file) {
            $fileMonitor->monitorFile($file);
        }

        $fileMonitor->detectChanges();
        $fileMonitor->shutdownObject();
    }
1039174
public function update(FileRequest $request, File $file)
    {
        $file->update($request->all());
        
        return $this->makeRedirect(true, 'admin.files.index', __('msg.update'));
    }
581993
public function getModificationTime() {

		if(false !== $this -> file -> getExists()) {

			$this -> refresh();
			
			return $this -> file -> getModificationTime();
		}
	}
82329
function updateSubmission($submission, $files) {
        $this->_flagSubmitted = false;

        if (empty($submission)) {
            $this->_submitValues = array();
        } else {
            foreach ($submission as $key => $s) {
                $type = $this->getCleanType($key, $s);
                $submission[$key] = $this->getCleanedValue($s, $type);
            }
            $this->_submitValues = $submission;
            $this->_flagSubmitted = true;
        }

        if (empty($files)) {
            $this->_submitFiles = array();
        } else {
            $this->_submitFiles = $files;
            $this->_flagSubmitted = true;
        }

        // need to tell all elements that they need to update their value attribute.
         foreach (array_keys($this->_elements) as $key) {
             $this->_elements[$key]->onQuickFormEvent('updateValue', null, $this);
         }
    }
1269245
public function modified($file, $rev=NULL, $type='sandbox')
	{
		$result = $this->metadata($file, false, false, true, $rev, $type);
		return strtotime($result['modified']);
	}
240043
protected function updateFile($filename)
    {
        $current = Context::getParam('current-version');
        $next = Context::getParam('new-version');

        $content = file_get_contents($filename);
        if (false === strpos($content, $current)) {
            throw new Exception('The version class ' . $filename . " does not contain the current version $current");
        }
        if (isset($this->options['pattern'])) {
            $current = str_replace('%version%', $current, $this->options['pattern']);
            $next = str_replace('%version%', $next, $this->options['pattern']);
        }
        $content = str_replace($current, $next, $content);
        if (false === strpos($content, $next)) {
            throw new Exception('The version class ' . $filename . " could not be updated with version $next");
        }
        file_put_contents($filename, $content);
    }
910437
function save(string $file = null)
    {
        if ($file == null) {
            $file = static::$configFile;
        }

        $a = null;
        foreach ($this as $k => $v) {
            $a[$k] = $v;
        }
        return file_put_contents($file, json_encode($a, JSON_PRETTY_PRINT));
    }
88517
public function modify(FileNodeInterface $file, array $options = [])
    {
        if (!$this->canModify($file) || !($file instanceof LocalFileNodeInterface)) {
            throw new InvalidArgumentException(
                "The specified file: '$file' does not implement LocalFileNodeInterface'"
            );
        }

        $file->setEncoding($this->getEncoding($file));

        return $file;
    }
733793
protected function serveNotModified($file)
    {
        $oInput = Factory::service('Input');
        if (function_exists('apache_request_headers')) {

            $headers = apache_request_headers();

        } elseif ($oInput->server('HTTP_IF_NONE_MATCH')) {

            $headers                  = [];
            $headers['If-None-Match'] = $oInput->server('HTTP_IF_NONE_MATCH');

        } elseif (isset($_SERVER)) {

            /**
             * Can we work the headers out for ourself?
             * Credit: http://www.php.net/manual/en/function.apache-request-headers.php#70810
             **/

            $headers = [];
            $rxHttp  = '/\AHTTP_/';
            foreach ($_SERVER as $key => $val) {

                if (preg_match($rxHttp, $key)) {

                    $arhKey    = preg_replace($rxHttp, '', $key);
                    $rxMatches = explode('_', $arhKey);

                    /**
                     * Do some nasty string manipulations to restore the original letter case
                     * this should work in most cases
                     **/

                    if (count($rxMatches) > 0 && strlen($arhKey) > 2) {
                        foreach ($rxMatches as $ak_key => $akVal) {
                            $rxMatches[$ak_key] = ucfirst($akVal);
                        }
                        $arhKey = implode('-', $rxMatches);
                    }

                    $headers[$arhKey] = $val;
                }
            }

        } else {

            //  Give up.
            return false;
        }

        if (isset($headers['If-None-Match']) && $headers['If-None-Match'] == '"' . md5($file) . '"') {
            header($oInput->server('SERVER_PROTOCOL') . ' 304 Not Modified', true, 304);
            return true;
        }

        // --------------------------------------------------------------------------

        return false;
    }
407369
public function getAssetFileLastModified()
    {
        if ($this->isAssetFilePathUrl()) {
            if (
            //Retrieve headers
                    ($aHeaders = get_headers($sAssetFilePath = $this->getAssetFilePath(), 1))
                    //Assert return is OK
                    && strstr($aHeaders[0], '200') !== false
                    //Retrieve last modified as DateTime
                    && !empty($aHeaders['Last-Modified']) && $oLastModified = new \DateTime($aHeaders['Last-Modified'])
            ) {
                return $oLastModified->getTimestamp();
            } else {
                $oCurlHandle = curl_init($sAssetFilePath);
                curl_setopt($oCurlHandle, CURLOPT_NOBODY, true);
                curl_setopt($oCurlHandle, CURLOPT_RETURNTRANSFER, true);
                curl_setopt($oCurlHandle, CURLOPT_FILETIME, true);
                if (curl_exec($oCurlHandle) === false) {
                    return null;
                }
                return curl_getinfo($oCurlHandle, CURLINFO_FILETIME) ? : null;
            }
        } else {
            \Zend\Stdlib\ErrorHandler::start();
            $iAssetFileFilemtime = filemtime($this->getAssetFilePath());
            \Zend\Stdlib\ErrorHandler::stop(true);
            return $iAssetFileFilemtime ? : null;
        }
    }
854788
def has_changed (filename):
    """"""
    key = os.path.abspath(filename)
    mtime = get_mtime(key)
    if key not in _mtime_cache:
        _mtime_cache[key] = mtime
        return True
    return mtime > _mtime_cache[key]
1076122
protected function validateEditFile()
    {
        $this->setSubmitted('file');
        $this->setSubmitted('update', $this->data_file);

        $this->validateComponent('file');

        return !$this->hasErrors();
    }
630656
public function setChanged($changed)
    {
        if (is_string($changed)) {
            $changed = new \DateTime($changed);
        }
        $this->getFileVersion()->setChanged($changed);

        return $this;
    }
1273098
public function preCommitHook($changed_files) {
    $collection = $this->collectionBuilder();
    $collection->setProgressIndicator(NULL);
    $collection->addCode(
      function () use ($changed_files) {
        return $this->invokeCommands([
          'tests:phpcs:sniff:files' => ['file_list' => $changed_files],
          'tests:twig:lint:files' => ['file_list' => $changed_files],
          'tests:yaml:lint:files' => ['file_list' => $changed_files],
        ]);
      }
    );

    $changed_files_list = explode("\n", $changed_files);
    if (in_array('composer.json', $changed_files_list)
      || in_array('composer.lock', $changed_files_list)) {
      $collection->addCode(
        function () use ($changed_files) {
          return $this->invokeCommand('tests:composer:validate');
        }
      );
    }

    $result = $collection
      ->setVerbosityThreshold(VerbosityThresholdInterface::VERBOSITY_VERBOSE)
      ->run();

    if ($result->wasSuccessful()) {
      $this->say("<info>Your local code has passed git pre-commit validation.</info>");
    }

    return $result;
  }