https://github.com/takuya/php-files-search-db-builder
https://github.com/takuya/php-files-search-db-builder
Last synced: 8 months ago
JSON representation
- Host: GitHub
- URL: https://github.com/takuya/php-files-search-db-builder
- Owner: takuya
- License: agpl-3.0
- Created: 2025-04-06T19:06:36.000Z (about 1 year ago)
- Default Branch: master
- Last Pushed: 2025-10-21T10:36:30.000Z (8 months ago)
- Last Synced: 2025-10-21T12:26:34.114Z (8 months ago)
- Language: PHP
- Size: 79.1 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
## find files and save result into sqlite3
To speed up for searching files, build search indexer fts.
## FTS 5
The fts in sqlite3, can search by trigram. this package make use of it to search files.
ただ、日本語だとFTS5は3文字以上が曲者。bigram 作ればいいけど、ファイル名程度の検索なら LIKEで充分かも
## installation
```shell
name='php-files-search-db-builder'
composer config repositories.$name \
vcs https://github.com/takuya/$name
composer require takuya/$name:master
composer install
```
```shell
name='takuya/php-files-search-db-builder'
repo=git@github.com:$name.git
composer config repositories.$name vcs $repo
composer require $name
```
## sample
```shell
use Takuya\SearchFiles\FindDbBuilder;
require __DIR__.'/vendor/autoload.php';
$db = './sample.db';
file_exists($db) && unlink($db);
$dir = '/home/takuya/';
$builder = new FindDbBuilder( "sqlite:{$db}", $dir );
$builder->locates_build();
```