1
- # codemasher/php-filereader
1
+ # chillerlan/php-filereader
2
+ A simple file/directory reader for all (well, most... ok. some.) of your file-reading needs.
2
3
3
4
[ ![ version] [ packagist-badge ]] [ packagist ]
4
5
[ ![ license] [ license-badge ]] [ license ]
5
6
[ ![ Travis] [ travis-badge ]] [ travis ]
6
7
[ ![ Coverage] [ coverage-badge ]] [ coverage ]
7
8
[ ![ Scrunitizer] [ scrutinizer-badge ]] [ scrutinizer ]
8
- [ ![ Code Climate] [ codeclimate-badge ]] [ codeclimate ]
9
+ [ ![ Packagist downloads] [ downloads-badge ]] [ downloads ]
10
+ [ ![ PayPal donate] [ donate-badge ]] [ donate ]
9
11
10
- [ packagist-badge ] : https://img.shields.io/packagist/v/chillerlan/php-filereader.svg
12
+ [ packagist-badge ] : https://img.shields.io/packagist/v/chillerlan/php-filereader.svg?style=flat-square
11
13
[ packagist ] : https://packagist.org/packages/chillerlan/php-filereader
12
- [ license-badge ] : https://img.shields.io/packagist/l/chillerlan/php-filereader.svg
13
- [ license ] : https://github.com/codemasher/php-filereader/blob/master/LICENSE
14
- [ travis-badge ] : https://img.shields.io/travis/codemasher/php-filereader.svg
15
- [ travis ] : https://travis-ci.org/codemasher/php-filereader
16
- [ coverage-badge ] : https://img.shields.io/codecov/c/github/codemasher/php-filereader.svg
17
- [ coverage ] : https://codecov.io/github/codemasher/php-filereader
18
- [ scrutinizer-badge ] : https://img.shields.io/scrutinizer/g/codemasher/php-filereader.svg
19
- [ scrutinizer ] : https://scrutinizer-ci.com/g/codemasher/php-filereader
20
- [ codeclimate-badge ] : https://img.shields.io/codeclimate/github/codemasher/php-filereader.svg
21
- [ codeclimate ] : https://codeclimate.com/github/codemasher/php-filereader
22
-
23
- ##Info
24
-
25
- A simple file/directory reader for all (well, most...) of your file-reading needs.
26
-
27
- ## Requirements
14
+ [ license-badge ] : https://img.shields.io/github/license/chillerlan/php-filereader.svg?style=flat-square
15
+ [ license ] : https://github.com/chillerlan/php-filereader/blob/master/LICENSE
16
+ [ travis-badge ] : https://img.shields.io/travis/chillerlan/php-filereader.svg?style=flat-square
17
+ [ travis ] : https://travis-ci.org/chillerlan/php-filereader
18
+ [ coverage-badge ] : https://img.shields.io/codecov/c/github/chillerlan/php-filereader.svg?style=flat-square
19
+ [ coverage ] : https://codecov.io/github/chillerlan/php-filereader
20
+ [ scrutinizer-badge ] : https://img.shields.io/scrutinizer/g/chillerlan/php-filereader.svg?style=flat-square
21
+ [ scrutinizer ] : https://scrutinizer-ci.com/g/chillerlan/php-filereader
22
+ [ downloads-badge ] : https://img.shields.io/packagist/dt/chillerlan/php-filereader.svg?style=flat-square
23
+ [ downloads ] : https://packagist.org/packages/chillerlan/database/stats
24
+ [ donate-badge ] : https://img.shields.io/badge/donate-paypal-ff33aa.svg?style=flat-square
25
+ [ donate ] : https://www.paypal.com/cgi-bin/webscr?cmd=_s-xclick&hosted_button_id=WLYUNAT9ZTJZ4
26
+
27
+ # Requirements
28
28
- PHP 7+
29
29
30
- ## Documentation
30
+ # Documentation
31
31
32
- ### Installation
33
- #### Using [ composer] ( https://getcomposer.org )
32
+ ## Installation
33
+ ** requires [ composer] ( https://getcomposer.org ) **
34
34
35
- * Terminal*
36
- ``` sh
37
- composer require chillerlan/php-filereader:dev-master
38
- ```
39
-
40
- * composer.json*
35
+ ### * composer.json*
36
+ (note: replace ` dev-master ` with a [ version boundary] ( https://getcomposer.org/doc/articles/versions.md#summary ) )
41
37
``` json
42
38
{
43
39
"require" : {
44
- "php" : " >=7.0.3 " ,
45
- "chillerlan/php-filereader " : " dev-master"
40
+ "php" : " >=7.2.0 " ,
41
+ "chillerlan/database " : " dev-master"
46
42
}
47
43
}
48
44
```
49
45
50
- #### Manual installation
51
- Download the desired version of the package from [ master] ( https://github.com/codemasher/php-filereader/archive/master.zip ) or
52
- [ release] ( https://github.com/codemasher/php-filereader/releases ) and extract the contents to your project folder.
53
- Point the namespace ` chillerlan\Filereader ` to the folder ` src ` of the package.
46
+ ### Manual installation
47
+ Download the desired version of the package from [ master] ( https://github.com/chillerlan/php-filereader/archive/master.zip ) or
48
+ [ release] ( https://github.com/chillerlan/php-filereader/releases ) and extract the contents to your project folder. After that:
49
+ - run ` composer install ` to install the required dependencies and generate ` /vendor/autoload.php ` .
50
+ - if you use a custom autoloader, point the namespace ` chillerlan\Filereader ` to the folder ` src ` of the package
54
51
55
52
Profit!
56
53
57
- ### Usage
58
- #### simple
54
+ ## Usage
55
+ ### simple
59
56
You can just invoke one a ` FSDriverInterface ` and use it right away:
60
57
61
58
``` php
@@ -66,7 +63,7 @@ $filereader->isDir('/some/path');
66
63
67
64
```
68
65
69
- #### advanced
66
+ ### advanced
70
67
``` php
71
68
$directory = new Directory($filereader, '/some/path');
72
69
@@ -78,8 +75,8 @@ foreach($directory->read() as $file){
78
75
79
76
```
80
77
81
- ### API
82
- #### ` FSDriverInterface ` methods
78
+ ## API
79
+ ### ` FSDriverInterface ` methods
83
80
method | return
84
81
------ | ------
85
82
` fileExists(string $path) ` | bool
@@ -93,7 +90,7 @@ method | return
93
90
` deleteDir(string $path) ` | bool
94
91
` rename(string $oldname, string $newname, bool $overwrite = true) ` | bool
95
92
96
- #### ` Directory ` public methods
93
+ ### ` Directory ` public methods
97
94
method | return
98
95
------ | ------
99
96
` __construct(FSDriverInterface $driver, string $path) ` | -
@@ -103,7 +100,7 @@ method | return
103
100
` delete(string $subdir = null) ` | bool
104
101
` rename(string $newname, bool $overwrite = true) ` | ` Directory `
105
102
106
- #### ` File ` public methods
103
+ ### ` File ` public methods
107
104
method | return
108
105
------ | ------
109
106
` __construct(FSDriverInterface $driver, Directory $directory, string $name) ` | -
@@ -123,4 +120,4 @@ property | type | description
123
120
property | type | description
124
121
-------- | ---- | -----------
125
122
` $name ` | string | the basename of the file
126
- ` $directory ` | ` Directory ` | the ` Directory ` which contains the file
123
+ ` $directory ` | ` Directory ` | the ` Directory ` which contains the file
0 commit comments