Finds all the changes in the filesystem according to the finder criteria.

@return ResourceWatcherResult
175736
public function findChanges()
    {
        $this->reset();

        if ($this->cache->isInitialized() == false) {
            $this->warmUpCache();
        } else {
            $this->findChangesAgainstCache();
        }

        $this->cache->save();

        return new ResourceWatcherResult($this->newFiles, $this->deletedFiles, $this->updatedFiles);
    }
961090
public function current()
    {
        if ($this->cacheFilesIterator === null) {
            $this->rewind();
        }

        $pathAndFilename = $this->cacheFilesIterator->getPathname();
        return $this->readCacheFile($pathAndFilename);
    }
1026542
protected function getYamlFilesetFinder() {
    $finder = new Finder();
    $finder
      ->files()
      ->name("*.yml")
      ->name("*.yaml")
      ->notPath('bower_components')
      ->notPath('node_modules')
      ->notPath('vendor');

    return $finder;
  }
136967
public function getFinder()
    {
        if (null === $this->finder) {
            $this->finder = new Finder();
            $this->finder->files();
        }

        return $this->finder;
    }
194399
public function find_all() {
        $this->ensure_path_exists();
        $files = glob($this->glob_keys_pattern(), GLOB_MARK | GLOB_NOSORT);
        $return = array();
        if ($files === false) {
            return $return;
        }
        foreach ($files as $file) {
            $return[] = substr(basename($file), 0, -6);
        }
        return $return;
    }
281861
public function getFileSystem() {
    if (empty($this->fileSystem)) {
      $this->fileSystem = \Drupal::service('file_system');
    }
    return $this->fileSystem;
  }
1185774
public function getDirectoriesIterator()
    {
        if (array() !== ($directories = $this->getDirectories())) {
            return Finder::create()
                    ->files()
                    ->filter($this->getBlacklistFilter())
                    ->ignoreVCS(true)
                    ->in($directories);
        }

        return null;
    }
554240
protected function findSource()
    {
        $stack = debug_backtrace(DEBUG_BACKTRACE_IGNORE_ARGS | DEBUG_BACKTRACE_PROVIDE_OBJECT);

        $sources = [];

        foreach ($stack as $index => $trace) {
            $sources[] = $this->parseTrace($index, $trace);
        }

        return array_filter($sources);
    }
1364845
protected function hasGitTrackedFilesChanged()
    {
        $task = $this->getGitBuildStack()
            ->exec("status --untracked-files=no --porcelain");

        /** @var Result $result */
        $result = $this->runSilentCommand($task);

        $changes = array_filter(
            explode("\n", $result->getMessage())
        );

        return (bool) count($changes) != 0;
    }
1049237
public function findAll()
    {
        if (empty($this->context) || empty($this->siteDomain) || empty($this->deviceView) || empty($this->design))
            return;

        if ($this->isSiteDeployment) {
            $design = $this->design;
            $deviceView = $this->deviceView;
        } else {
            $design = '';
            $deviceView = '';
        }

        $aggregatePath = $this->getAggregatePath();

        $files = null;
        $md5   = null;

        $this->Logger->debug("Aggregate Path: {$aggregatePath}");


        if ($this->isDevelopmentMode || $this->isOneOffRedeploy || !file_exists($aggregatePath))
            list($files,$md5) = $this->getFiles();

        if (file_exists($aggregatePath)) {

            //$contents = JSONUtils::decode(file_get_contents($aggregatePath),true);
            include $aggregatePath;

            //if this IS development mode, a refresh is performed everytime the md5's dont' match
            //if this is NOT development mode, the only way to force a refresh is to delete the .php file
            if (( $this->isDevelopmentMode === false && $this->isOneOffRedeploy === false)
             || ( ($this->isDevelopmentMode === true || $this->isOneOffRedeploy === true) && $md5 === $contents['md5']))
                if(isset(${$this->subject}))
                    return ${$this->subject}; // files haven't changed, return previously aggregated contents
                else
                    return array();
        }

        //rebuild file
        return $this->aggregateFiles($md5, $files, $aggregatePath);
    }
373938
protected function getListItems()
    {
        $changesets = ChangeSet::get();
        // Filter out published items if disabled
        if (!$this->config()->get('show_published')) {
            $changesets = $changesets->filter('State', ChangeSet::STATE_OPEN);
        }
        // Filter out automatically created changesets
        if (!$this->config()->get('show_inferred')) {
            $changesets = $changesets->filter('IsInferred', 0);
        }
        return $changesets
            ->filterByCallback(function ($item) {
                /** @var ChangeSet $item */
                return ($item->canView());
            });
    }
1055714
public function getDiffReplacements()
    {
        $data = array();
        foreach ($this->getSafeAttributes() as $attribute) {
            if ($attribute->isReplaced()) {
                $data[$attribute->getName()] = $attribute->getValues();
            }
        }
        foreach ($this->tracker->getReplacements() as $name) {
            $data[$name] = $this->get($name)->getValues();
        }
        return $data;
    }
573465
public function getAllFiles()
    {
        $finder = new Finder();
        return $finder->files()->name($this->filter)->in($this->mdPath);
    }
168239
protected function getListResource()
    {
        $items = $this->getListItems();
        $count = $items->count();
        /** @var string $treeClass */
        $treeClass = $this->config()->get('tree_class');
        $hal = [
            'count' => $count,
            'total' => $count,
            '_links' => [
                'self' => [
                    'href' => $this->Link('items')
                ]
            ],
            '_embedded' => [$treeClass => []]
        ];
        /** @var ChangeSet $item */
        foreach ($items as $item) {
            $sync = $this->shouldCampaignSync($item);
            $resource = $this->getChangeSetResource($item, $sync);
            $hal['_embedded'][$treeClass][] = $resource;
        }
        return $hal;
    }
169928
public function watch()
    {
        if ($this->inotify) {
            $events = inotify_read($this->inotify);
            if (!$events) {
                return;
            }
            foreach ($events as $ev) {
                $path = $this->descriptors[$ev['wd']];
                if (!isset($this->files[$path])) {
                    continue;
                }
                $this->onFileChanged($path);
            }
        } else {
            static $hash = [];

            foreach ($this->files as $path => $v) {
                if (!file_exists($path)) {
                    // file can be deleted
                    unset($this->files[$path]);
                    continue;
                }

                $mt = filemtime($path);

                if (isset($hash[$path]) && ($mt > $hash[$path])) {
                    $this->onFileChanged($path);
                }

                $hash[$path] = $mt;
            }
        }
    }
417820
public function onCheckForUpdates()
    {
        try {
            $manager = UpdateManager::instance();
            $result = $manager->requestUpdateList();

            $result = $this->processUpdateLists($result);
            $result = $this->processImportantUpdates($result);

            $this->vars['core'] = array_get($result, 'core', false);
            $this->vars['hasUpdates'] = array_get($result, 'hasUpdates', false);
            $this->vars['hasImportantUpdates'] = array_get($result, 'hasImportantUpdates', false);
            $this->vars['pluginList'] = array_get($result, 'plugins', []);
            $this->vars['themeList'] = array_get($result, 'themes', []);
        }
        catch (Exception $ex) {
            $this->handleError($ex);
        }

        return ['#updateContainer' => $this->makePartial('update_list')];
    }
705245
protected function findFiles()
    {
        $ds = new DirectoryScanner();
        $ds->setBasedir($this->dir);
        $ds->setIncludes(array('**/composer.json'));
        $ds->scan();
        return $ds->getIncludedFiles();
    }