find trigger.

@param   string|array    $paths
496299
public function find($paths = null)
    {
        if ($paths === null) $paths = $this->paths;

        // iterator
        $iterator = $this->getIterator();

        // search in target paths
        foreach ((array)$paths as $path) {
            $this->searchInPath($iterator, $path);
        }

        // clear
        $this->clear();

        return $iterator;
    }
1071034
protected function loadMigrationsFrom($paths): void
    {
        $options = \is_array($paths) ? $paths : ['--path' => $paths];

        if (isset($options['--realpath']) && \is_string($options['--realpath'])) {
            $options['--path'] = [$options['--realpath']];
        }

        $options['--realpath'] = true;

        $migrator = new MigrateProcessor($this, $options);
        $migrator->up();

        $this->beforeApplicationDestroyed(function () use ($migrator) {
            $migrator->rollback();
        });
    }
518777
private function parsePathsSettings(\DOMNode $paths) {

		if(is_null($this->paths)) {
			$this->paths = [];
		}

		foreach($paths->getElementsByTagName('path') as $path) {

			$id = $path->getAttribute('id');
			$subdir = $path->getAttribute('subdir') ?: '';

			if(!$id || !$subdir) {
				continue;
			}

			$subdir = '/' . trim($subdir, '/') . '/';

			// additional attributes are currently ignored

			$this->paths[$id] = ['subdir' => $subdir];

		}

	}
437027
public function addPaths(array $paths)
    {
        $this->currentCollectorData = $this->filePathCollector->collect();

        foreach ($paths as $path) {
            $this->addPath($path);
        }
    }
773633
public function run(array $paths = array())
    {
        $results = $this->container->get('behat.inspector')
            ->run($paths);

        return new ProcessEvent($this,$results);
    }
289280
protected function findInPaths($name, $paths)
    {
        foreach ((array) $paths as $path) {
            foreach ($this->getPossibleViewFiles($name) as $file) {
                if (is_file($viewPath = $path . '/' . $file)) {
                    return $viewPath;
                }
            }
        }

        throw new InvalidArgumentException("View [$name] not found.");
    }
1142657
public function rollback($paths = [], array $options = [])
    {
        $this->notes = [];
        $rolledBack  = [];

        $migrations = $this->getRanMigrations();
        $files = $this->getMigrationFiles($paths);
        $count = count($migrations);

        if ($count === 0) {
            $this->note('<info>Nothing to rollback.</info>');
        } else {
            $this->requireFiles($files);

            $steps = Arr::get($options, 'step', 0);
            if ($steps == 0) {
                $steps = 1;
            }

            $lastBatch = $this->repository->getLastBatchNumber();
            $stepDown  = false;

            foreach ($migrations as $migration) {
                $migration = (object) $migration;

                if ($lastBatch > $migration->batch && $stepDown) {
                    $steps--;

                    $stepDown  = false;
                    $lastBatch = $migration->batch;
                }

                if ($steps <= 0) {
                    break;
                }

                if (Arr::exists($files, $migration->migration)) {
                    $rolledBack[] = $files[$migration->migration];

                    $stepDown = true;

                    $this->runDown(
                        $files[$migration->migration],
                        $migration, Arr::get($options, 'pretend', false)
                    );
                }
            }
        }

        return $rolledBack;
    }
1115682
public function addPaths($paths)
    {
        $paths = is_array($paths) ? $paths : [$paths];

        foreach ($paths as $key => $path) {
            $key = is_int($key) ? null : $key;

            $this->addPath($path, $key);
        }

        return $this;
    }
930071
protected function filter($path, array $patterns)
    {
        foreach ($patterns as $pattern) {
            if ($pattern[0] == '!' ? !fnmatch(substr($pattern, 1), $path) : fnmatch($pattern, $path)) {
                return false;
            }
        }

        return true;
    }
553614
public function load(array $paths)
    {
        $finder = new Finder();
        $finder->in($paths);
        $finder->name('*Fixture.php');

        foreach ($finder as $file) {
            $declaredClasses = get_declared_classes();
            require_once $file;
            $declaredClassesDiff = array_diff(get_declared_classes(), $declaredClasses);
            $fixtureClass = array_pop($declaredClassesDiff);

            if (!$fixtureClass) {
                throw new \InvalidArgumentException(sprintf(
                    'Could not determine class from included file "%s". Class detection will only work once per request.',
                    $file
                ));
            }

            $refl = new \ReflectionClass($fixtureClass);

            if ($refl->isAbstract()) {
                continue;
            }

            if (false === $refl->isSubclassOf(DocumentFixtureInterface::class)) {
                continue;
            }

            $fixture = new $fixtureClass();

            if ($fixture instanceof ContainerAwareInterface) {
                $fixture->setContainer($this->container);
            }

            $fixtures[] = $fixture;
        }

        usort($fixtures, function(DocumentFixtureInterface $fixture1, DocumentFixtureInterface $fixture2) {
            return $fixture1->getOrder() > $fixture2->getOrder();
        });

        return $fixtures;
    }
1311988
public function setPaths(array $paths)
    {
        foreach ($paths as $value) {
            $this->ensureString(
                $value,
                'All the elements from array must be strings'
            );
        }

        $this->paths = $paths;

        return $this;
    }
828905
protected function streamlineFilePaths(array $paths): array
    {
        $paths = \array_map(function ($url) {
            if (!GeneralUtility::isValidUrl($url) && ':' !== $url[0]) {
                $url = GeneralUtility::locationHeaderUrl($url);
            }

            return $url;
        }, $paths);

        $paths = \array_filter($paths, function ($path) {
            return GeneralUtility::isOnCurrentHost($path) && ':' !== $path[0];
        });

        $paths = \array_map(function ($url) {
            return '/' . \ltrim(\str_replace(GeneralUtility::getIndpEnv('TYPO3_REQUEST_HOST'), '', $url), '/');
        }, $paths);

        return $paths;
    }
1038665
public function run($paths = [], array $options = [])
    {
        $this->notes = [];

        // Once we grab all of the migration files for the path, we will compare them
        // against the migrations that have already been run for this package then
        // run each of the outstanding migrations against a database connection.
        $files = $this->getMigrationFiles($paths);

        $this->requireFiles($migrations = $this->pendingMigrations($files, $this->executedMigrations()));

        // Once we have all these migrations that are outstanding we are ready to run
        // we will go ahead and run them "up". This will execute each migration as
        // an operation against a database. Then we'll return this list of them.
        $this->runPending($migrations, $options);

        return $migrations;
    }
1041107
public function findMapping($path) {
        if (!strEndsWith($path, '/'))
            $path .= '/';
        // $path: /
        // $path: /action/
        // $path: /controller/action/
        // $path: /controller/action/parameter/

        $pattern = $path;
        while (strlen($pattern)) {
            if (isset($this->mappings['paths'][$pattern]))          // path keys start and end with a slash "/"
                return $this->mappings['paths'][$pattern];
            $pattern = strLeftTo($pattern, '/', $count=-2, $includeLimiter=true);
            if ($pattern == '/')
                break;
        }
        return null;
    }
782076
public static function loadConfig($paths)
    {
        $apaths = explode(';', $paths);
        foreach ($apaths as $path) {
            if (is_file($p = realpath($path))) {
                $ext = strtolower(pathinfo($p, PATHINFO_EXTENSION));
                if ($ext === 'conf') {
                    return Daemon::$config->loadFile($p);
                } else {
                    Daemon::log('Config file \'' . $p . '\' has unsupported file extension.');
                    return false;
                }
            }
        }
        Daemon::log('Config file not found in \'' . $paths . '\'.');
        return false;
    }
860766
public function delete($paths)
	{
		$paths = is_array($paths) ? $paths : func_get_args();

		foreach ($paths as $path)
		{
			$this->driver->delete($path);
		}

		return true;
	}
1149121
protected function load($paths)
    {
        $paths = array_unique(is_array($paths) ? $paths : (array) $paths);

        $paths = array_filter($paths, function ($path) {
            return is_dir($path);
        });

        if (empty($paths)) {
            return;
        }

        $namespace = $this->app->getNamespace();

        foreach ((new Finder())->in($paths)->files() as $command) {
            $command = $namespace.str_replace(
                ['/', '.php'],
                ['\\', ''],
                Str::after($command->getPathname(), app_path().DIRECTORY_SEPARATOR)
            );

            if (is_subclass_of($command, Command::class) && ! (new \ReflectionClass($command))->isAbstract()) {
                Console::starting(function ($console) use ($command) {
                    $console->resolve($command);
                });
            }
        }
    }