You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Make pull requests only one feature or change at the time. Make pull requests from feature branch. Pull requests should not come from your master branch.
6
+
7
+
For example you have fixed a bug. You also have optimized some code. Optimization is not related to a bug. These should be submitted as separate pull requests. This way I can easily choose what to include. It is also easier to understand the code changes.
8
+
9
+
## Write meaningful commit messages
10
+
11
+
Proper commit message is full sentence. It starts with capital letter but does not end with period. Headlines do not end with period. The GitHub default `Update filename.js` is not enough. When needed include also longer explanation what the commit does.
12
+
13
+
```
14
+
Capitalized, short (50 chars or less) summary
15
+
16
+
More detailed explanatory text, if necessary. Wrap it to about 72
17
+
characters or so. In some contexts, the first line is treated as the
18
+
subject of an email and the rest of the text as the body. The blank
19
+
line separating the summary from the body is critical (unless you omit
20
+
the body entirely); tools like rebase can get confused if you run the
21
+
two together.
22
+
```
23
+
24
+
When in doubt see Tim Pope's blogpost [A Note About Git Commit Messages](http://tbaggery.com/2008/04/19/a-note-about-git-commit-messages.html)
25
+
26
+
## Send coherent history
27
+
28
+
Make sure each individual commit in your pull request is meaningful. If you had to make multiple intermediate commits while developing, please squash them before submitting.
29
+
30
+
## Follow the existing coding standards
31
+
32
+
When contributing to open source project it is polite to follow the original authors coding standars. They might be different than yours. It is not a holy war. This project uses **[PSR-2 Coding Standard](https://github.com/php-fig/fig-standards/blob/master/accepted/PSR-2-coding-style-guide.md)**
33
+
34
+
## Running Tests
35
+
36
+
You can run individual tests either manually...
37
+
38
+
```bash
39
+
$ composer phplint
40
+
$ composer phpcs
41
+
$ composer phpunit
42
+
```
43
+
44
+
... or automatically on every code change. You will need [entr](http://entrproject.org/) for this to work.
Copy file name to clipboardExpand all lines: README.md
+45-7
Original file line number
Diff line number
Diff line change
@@ -1,6 +1,23 @@
1
-
# IniParser
1
+
<h1align="center">
2
+
PHP .ini parser
3
+
</h1>
2
4
3
-
IniParser is a simple parser for complex INI files, providing a number of extra syntactic features to the built-in INI parsing functions, including section inheritance, property nesting, and array literals.
[![Watch on GitHub][github-watch-badge]][github-watch]
15
+
[![Star on GitHub][github-star-badge]][github-star]
16
+
[![Tweet][twitter-badge]][twitter]
17
+
18
+
# \Ini\Parser
19
+
20
+
\Ini\Parser is a simple parser for complex INI files, providing a number of extra syntactic features to the built-in INI parsing functions, including section inheritance, property nesting, and array literals.
4
21
5
22
## Installing by [Composer](https://getcomposer.org)
6
23
@@ -64,9 +81,9 @@ This is great when you just want a simple configuration file, but here is a supe
64
81
database.name = production
65
82
database.username = root
66
83
67
-
And when parsed with IniParser:
84
+
And when parsed with \Ini\Parser:
68
85
69
-
$parser = new \IniParser('sample.ini');
86
+
$parser = new \Ini\Parser('sample.ini');
70
87
$config = $parser->parse();
71
88
72
89
You get the following structure:
@@ -163,7 +180,7 @@ array(
163
180
164
181
### Property Nesting
165
182
166
-
IniParser allows you to treat properties as associative arrays:
183
+
\Ini\Parser allows you to treat properties as associative arrays:
167
184
168
185
person.age = 42
169
186
person.name.first = John
@@ -185,7 +202,7 @@ array (
185
202
186
203
### Section Inheritance
187
204
188
-
Keeping to the DRY principle, IniParser allows you to "inherit" from other sections (similar to OOP inheritance), meaning you don't have to continually re-define the same properties over and over again. As you can see in the example above, "production" inherits from "staging", which in turn inherits from "testing".
205
+
Keeping to the DRY principle, \Ini\Parser allows you to "inherit" from other sections (similar to OOP inheritance), meaning you don't have to continually re-define the same properties over and over again. As you can see in the example above, "production" inherits from "staging", which in turn inherits from "testing".
189
206
190
207
You can even inherit from multiple parents, as in `[child : p1 : p2 : p3]`. The properties of each parent are merged into the child from left to right, so that the properties in `p1` are overridden by those in `p2`, then by `p3`, then by those in `child` on top of that.
191
208
@@ -235,9 +252,30 @@ array (
235
252
236
253
### ArrayObject
237
254
238
-
As an added bonus, IniParser also allows you to access the values OO-style:
255
+
As an added bonus, \Ini\Parser also allows you to access the values OO-style:
0 commit comments