https://github.com/takuya/php-plocate-wrapper
php wrapper for plocate and plocate-build command for search files
https://github.com/takuya/php-plocate-wrapper
locate php plocate search
Last synced: 3 months ago
JSON representation
php wrapper for plocate and plocate-build command for search files
- Host: GitHub
- URL: https://github.com/takuya/php-plocate-wrapper
- Owner: takuya
- License: agpl-3.0
- Created: 2025-02-27T08:21:51.000Z (over 1 year ago)
- Default Branch: master
- Last Pushed: 2025-05-21T10:39:47.000Z (about 1 year ago)
- Last Synced: 2025-07-22T12:56:12.331Z (11 months ago)
- Topics: locate, php, plocate, search
- Language: PHP
- Homepage: https://github.com/takuya/php-plocate-wrapper
- Size: 35.2 KB
- Stars: 0
- Watchers: 1
- Forks: 0
- Open Issues: 0
-
Metadata Files:
- Readme: README.md
- License: LICENSE
Awesome Lists containing this project
README
# php-plocate-wrapper
php wrapper for plocate and plocate-build command for search files
## find files by plocate db
search files using locate.db(plocate database)
```php
search('composer.json');
foreach ($ret as $item) {
var_dump($item);
}
```
## find files from sub-directory ( not from / )
We can find files from only sub-directory by shell.
```shell
## build file database only ~/Documents
subdir=/home/takuya/Documemts
cd $subdir
find . -type f -printf '%P\n' > find-results.txt
plocate-build -p find-results.txt my-document.db
## find from using custom database
plocate -d my-document.db .docx
```
This project is aimed to build that database. sample code is below.
```php
build();
$locate = new LocateWrap('~/.Document.db');
$found = $locate->search('.docx');
```
## Installing
from GitHub.
```shell
name='php-plocate-wrapper'
composer config repositories.$name \
vcs https://github.com/takuya/$name
composer require takuya/$name:master
composer install
```
from packagist
```shell
composer require takuya/php-plocate-wrapper
```