PHPackages                             rusakov92/simple-file-search - PHPackages - PHPackages  [Skip to content](#main-content)[PHPackages](/)[Directory](/)[Categories](/categories)[Trending](/trending)[Leaderboard](/leaderboard)[Changelog](/changelog)[Analyze](/analyze)[Collections](/collections)[Log in](/login)[Sign up](/register)

1. [Directory](/)
2. /
3. [Search &amp; Filtering](/categories/search)
4. /
5. rusakov92/simple-file-search

AbandonedArchivedLibrary[Search &amp; Filtering](/categories/search)

rusakov92/simple-file-search
============================

This package gives you the ability to search for files by their content.

0.0.3(7y ago)05MITPHPPHP ^7.3

Since Apr 1Pushed 7y ago1 watchersCompare

[ Source](https://github.com/rusakov92/simple-file-search)[ Packagist](https://packagist.org/packages/rusakov92/simple-file-search)[ RSS](/packages/rusakov92-simple-file-search/feed)WikiDiscussions master Synced 1mo ago

READMEChangelogDependencies (4)Versions (4)Used By (0)

Simple File Search
==================

[](#simple-file-search)

This app simply finds files by searching their content.

Instalation
===========

[](#instalation)

Install via composer.

```
composer require rusakov92/simple-file-search
```

Usage
=====

[](#usage)

You have to first create a new instance of the class and specify the base directory path of the folder you want to scan files for.

```
$simpleFileSearch = new SimpleFileSearch('/path/to/base/directory');
```

You can use the class to find a files the contain a specific string. To do that you can use regular expresion with *\#* delimiter and call the `SimpleFileSearch::find()` method in the end. The returned result will be an `\Iterator` that you can iterate over.

```
/** @var \Iterator $result */
$result = $simpleFileSearch
    ->contain('#sentence I am looking for#')
    ->contain('#^[a-z]+$#')
    ->contain(['#[A-Z]+#', '#some text I know#'])
    ->find();

/** @var \SplFileInfo $item */
foreach ($result as $item) {
    var_dump($item->getRealPath());
}
```

Restrict the search to some extensions with `SimpleFileSearch::extension()`.

```
$result = $simpleFileSearch->contain('#[a-z]+#')->extension('txt')->find();
```

Restrict the recursion depth of the search.

```
$result = $simpleFileSearch->contain('#[a-z]+#')->depth(3, 10)->find();
```

Specify directories, part of the base directory, for the search to be performed on or skipped.

```
$result = $simpleFileSearch
    ->contain('#[a-z]+#')
    ->in('path/to/specific/dir')
    ->skip('path/to/specific/dir/skip')
    ->find();
```

Demo
====

[](#demo)

To see the demo please first install [docker](https://www.docker.com/) on your machine, once you are done please follow the guide below:

Clone this repository in a preferred location, now we need to build our docker image by changing the directory into the cloned repository and then running the docker build command to build an image.

```
cd /path/to/simple-file-search
docker build -t simple-file-search .
```

Now we need to start our container using docker-compose. Note that the container port is set to be `127.0.0.1:8080` in `docker-compose.yaml` file. If that port is already in use please change the port to something else that it's free.

```
docker-compose up
```

SSH into the container and run the `composer install` command in the `symfony_demo` folder.

```
docker exec -it simple-file-search-web bash
cd symfony_demo
composer install
# When asked enter the default values for the parameters.yml file
```

Now you can try out the demo. The test files are located in `public/demo_files` and you can use regular expresion or simple string to find files.

#### Console Demo

[](#console-demo)

Run the console application.

```
# Run console
bin/console search "your sentence"
# Run the console with a regular expresion
bin/console search "#[a-z]#"
# See the help for more options and usages
bin/console search -h
```

#### UI Demo

[](#ui-demo)

See the demo here [127.0.0.1:8080](http://127.0.0.1:8080/). The UI form accepts one or multiple string and they can be separated by comma.

#### Tests

[](#tests)

You can run the PHPUnit tests by simple going back to the root dir and then run the composer script.

```
cd ..
composer run phpunit
```

To run Codeception tests:

```
composer run codecept
```

###  Health Score

21

—

LowBetter than 19% of packages

Maintenance20

Infrequent updates — may be unmaintained

Popularity4

Limited adoption so far

Community7

Small or concentrated contributor base

Maturity46

Maturing project, gaining track record

 Bus Factor1

Top contributor holds 100% of commits — single point of failure

How is this calculated?**Maintenance (25%)** — Last commit recency, latest release date, and issue-to-star ratio. Uses a 2-year decay window.

**Popularity (30%)** — Total and monthly downloads, GitHub stars, and forks. Logarithmic scaling prevents top-heavy scores.

**Community (15%)** — Contributors, dependents, forks, watchers, and maintainers. Measures real ecosystem engagement.

**Maturity (30%)** — Project age, version count, PHP version support, and release stability.

###  Release Activity

Cadence

Every ~0 days

Total

3

Last Release

2594d ago

### Community

Maintainers

![](https://www.gravatar.com/avatar/89a8a4b1d32e5a9b449f8bcd2bc1278af31feb48b2d052d222e510a54edbca70?d=identicon)[rusakov92](/maintainers/rusakov92)

---

Top Contributors

[![rusakov92](https://avatars.githubusercontent.com/u/7600983?v=4)](https://github.com/rusakov92 "rusakov92 (1 commits)")

###  Code Quality

TestsPHPUnit

### Embed Badge

![Health badge](/badges/rusakov92-simple-file-search/health.svg)

```
[![Health](https://phpackages.com/badges/rusakov92-simple-file-search/health.svg)](https://phpackages.com/packages/rusakov92-simple-file-search)
```

###  Alternatives

[ruflin/elastica

Elasticsearch Client

2.3k50.4M202](/packages/ruflin-elastica)[opensearch-project/opensearch-php

PHP Client for OpenSearch

15024.3M64](/packages/opensearch-project-opensearch-php)[mailerlite/laravel-elasticsearch

An easy way to use the official PHP ElasticSearch client in your Laravel applications.

934529.3k2](/packages/mailerlite-laravel-elasticsearch)[massive/search-bundle

Massive Search Bundle

721.4M13](/packages/massive-search-bundle)[shyim/opensearch-php-dsl

OpenSearch/Elasticsearch DSL library

175.9M9](/packages/shyim-opensearch-php-dsl)[outl1ne/nova-multiselect-filter

Multiselect filter for Laravel Nova.

45802.7k3](/packages/outl1ne-nova-multiselect-filter)

PHPackages © 2026

[Directory](/)[Categories](/categories)[Trending](/trending)[Changelog](/changelog)[Analyze](/analyze)
