2017 © Pedro Peláez
 

library dpscan

Just a directory scanner.

image

novanandriyono/dpscan

Just a directory scanner.

  • Tuesday, May 8, 2018
  • by larasati
  • Repository
  • 1 Watchers
  • 0 Stars
  • 62 Installations
  • PHP
  • 1 Dependents
  • 0 Suggesters
  • 0 Forks
  • 0 Open issues
  • 11 Versions
  • 29 % Grown

The README.md

Dpscan

Just a directory scanner., (*1)

Install via Composer

composer require novanandriyono/dpscan

List of Actions

Set base dir * setdir(string $dir);, (*2)

Results Items

  • get(); get all items inside directory
  • all(); to get recursive

Results Only Files Or Directory

  • onlyfiles(); // results only files
  • onlydir(); // result only dir

Results Contains

  • contains(array $array = []);
  • containsfiles(array $array = []);
  • containsdir(array $array = []);

Results Not Contains

  • notcontains(array $array = []);
  • notcontainsfiles(array $array = []);
  • notcontainsdir(array $array = []);

Results Except

  • except(array $array); // except full line of items

Results Regex Only

Using Regex only * regexonly(array $array); * regexonlyfiles(array $array); * regexonlydir(array $array);, (*3)

Results Regex Except

Using Regex to except * regexcept(array $array); * regexceptfiles(array $array); * regexceptdir(array $array);, (*4)

Results Items

  • items(); //get collection

Change root folder

After root change DIRECTORY_SEPARATOR will be close '/'; * rootchange(string dir);, (*5)

Change root folder

After root change DIRECTORY_SEPARATOR will be close '/'; * rootchange(string dir);, (*6)

Saving last result with Cache

option = action * cache(int $minutes,string $key,string $option);, (*7)

$dir = storage_path();
setdir($dir)->cache(10,$dir,'all')->contains(['.jpg','.png'])->rootchange(url())->items()->toJson();

or, (*8)

$userdir = public_path('/data/'.$user->id);
setdir($userdir)->cache(10,$userdir,'all')->onlyfiles()->contains(['.jpg','.png'])->rootchange(url())->items()->toJson();

or, (*9)

$username = \Auth::user()->username;
$userdir = public_path($username.'/media');
$contains = \Request::input()->all() + ['.jpg'];
setdir($userdir)->cache(10,$userdir,'all')->onlyfiles()->contains($contains)->rootchange(null)->items()->toJson();

and I never tried XD, (*10)

How to use

Results on array. both key and value are same. use array_values/array_keys to get int key or using collection, (*11)

use Dpscan;

$root = public_path();
$dir = Dpscan::setdir($root);

echo "

";
var_dump($dir->all());
echo "
"; //or echo "
";
dd($dir->onlyfiles()->contains(['js','css'])->rootchange(null)->items()->toJson());
echo "
";

Why

i made dpscan because lexroute need this XD., (*12)

License

This project is licensed under the MIT License - see the LICENSE.md file for details, (*13)

The Versions

08/05 2018

dev-master

9999999-dev https://github.com/novanandriyono/dpscan

Just a directory scanner.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel recursive directory dir scandir dpscan

08/05 2018

dev-development

dev-development https://github.com/novanandriyono/dpscan

Just a directory scanner.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel recursive directory dir scandir dpscan

08/05 2018
06/05 2018
29/04 2018

v1.0.6

1.0.6.0 https://github.com/novanandriyono/dpscan

Just a directory scanner.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel recursive directory dir scandir dpscan

29/04 2018

v1.0.5

1.0.5.0 https://github.com/novanandriyono/dpscan

Just a directory scanner.

  Sources   Download

MIT

The Requires

 

The Development Requires

laravel recursive directory dir scandir dpscan

24/04 2018

v1.0.4

1.0.4.0 https://github.com/novanandriyono/dpscan

scan it

  Sources   Download

MIT

The Requires

 

laravel dpscan

23/04 2018

v1.0.3

1.0.3.0 https://github.com/novanandriyono/dpscan

scan it

  Sources   Download

MIT

The Requires

 

laravel dpscan

19/04 2018

v1.0.2

1.0.2.0 https://github.com/novanandriyono/dpscan

scan it

  Sources   Download

MIT

The Requires

 

laravel dpscan

19/04 2018

v1.0.1

1.0.1.0 https://github.com/novanandriyono/dpscan

scan it

  Sources   Download

MIT

The Requires

 

laravel dpscan

17/04 2018

v1.0.0

1.0.0.0 https://github.com/novanandriyono/dpscan

scan it

  Sources   Download

MIT

The Requires

 

laravel dpscan