Download the PHP package dimitrilahaye/dodo-ini-manager without Composer
On this page you can find all versions of the php package dimitrilahaye/dodo-ini-manager. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.
Download dimitrilahaye/dodo-ini-manager
More information about dimitrilahaye/dodo-ini-manager
Files in dimitrilahaye/dodo-ini-manager
Package dodo-ini-manager
Short Description Awakens the dodo which is sleeping in you! And at least, manage your files.ini ! Create them, update their sections, etc.
License proprietary
Homepage https://github.com/dimitrilahaye/Dodo-Ini-Manager
Informations about the package dodo-ini-manager
Dodo Ini Manager Library
Awakens the dodo which is sleeping in you!
And at least, manage your files.ini ! Create them, update their sections, etc.
Table of Contents
-
FileIni
- __construct
- getPath
- rename
- copy
- move
- arrayTo
- toArray
- jsonTo
- toJson
- hasSection
- get
- set
- rewrite
- rm
- prepend
- append
- before
- after
- hasNext
- hasPrevious
- getNext
- getPrevious
- hasKey
- getKey
- setKey
- writeInKey
- rewriteKey
- rewriteInKey
- rmInKey
- rmKey
- keyHasNext
- keyHasPrevious
- getNextKey
- getPreviousKey
- moveKey
- beforeKey
- afterKey
- prependKey
- appendKey
- Coming Soon
FileIni
General class for DodoIniManager. Provides all the methods to :
- Create and modify file.ini
- Create and modify sections
- Create and modify section's keys and their values
- Full name: \DodoPhpLab\DodoIniManager\Classes\FileIni
__construct
Method constructor. When a new FileIni object is instantiated, if file doesn't exists, we create it.
Parameters:
Parameter | Type | Description |
---|---|---|
$path |
string | File's path for this FileIni object. |
See Also:
- \DodoPhpLab\DodoIniManager\Classes\FileIni::createFile() - For the creation of the file.ini.
getPath
Get the path for this FileIni object.
Return Value:
Returns the file's path for this FileIni object.
rename
Change the file's name.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | New name for this file. |
copy
Create a copy of the file with another name, at the same location in file system.
Parameters:
Parameter | Type | Description |
---|---|---|
$name |
string | Name for the copied file. |
move
Change location for this file. The original file is deleted.
Parameters:
Parameter | Type | Description |
---|---|---|
$path |
string | The new path for this file. |
arrayTo
Update entire file with an array
Parameters:
Parameter | Type | Description |
---|---|---|
$array |
array<mixed,mixed> | The array content to update the file. |
toArray
Get the parsed content of this file.
Return Value:
The parsed content of this file obtained with parse_ini_file() method.
jsonTo
Update entire file with a json array
Parameters:
Parameter | Type | Description |
---|---|---|
$json |
string | The json array content to update the file. |
toJson
Get the parsed content of this file in json array format.
Return Value:
The parsed content of this file obtained in json array format.
hasSection
Check if this file.ini has a section specified by the name passed in argument.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The name of the searched section. |
Return Value:
True if the section exists in file.ini, false if not.
get
Get a section contained into this file.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The target section's key. |
Return Value:
Returns the section from parsed file.
set
Add a new section to this file. You are able to add an array of sub-keys for this new section.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key to add. |
$array |
array<mixed,mixed> | An array of key => value in case we want to write element to this new section |
rewrite
Modify the key of a section.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key to modify. |
$newSection |
string | The new section's key. |
rm
Remove the section with the key passed in argument.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the section to remove. |
prepend
Move an entire section at the top of this file.ini
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the section to move. |
append
Move an entire section at the bottom of this file.ini
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the section to move. |
before
Move an entire section before another one.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the section to move. |
$before |
string | The section's key of the section before wich we want to move our section. |
after
Move an entire section after another one.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the section to move. |
$after |
string | The section's key of the section after wich we want to move our section. |
hasNext
Check if this section has another section after it.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key we want to evaluate. |
Return Value:
True if this section has another one after it, false if not.
hasPrevious
Check if this section has another section before it.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key we want to evaluate. |
Return Value:
True if this section has another one before it, false if not.
getNext
Get the next section after the section'key passed in argument.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key that we want to return the following. |
Return Value:
Returns the following section from parsed file.
getPrevious
Get the next section before the section'key passed in argument.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key that we want to return the previous one. |
Return Value:
Returns the previous section from parsed file.
hasKey
Check if the target section has a key value specified by the name passed in argument.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The name of the section where to search the key value. |
$element |
string | The name of the searched key value. |
Return Value:
True if key value exists in section, false if not.
getKey
Get an element contained into a section of this file.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element. |
Return Value:
Returns the value of the target element
setKey
Add a new element into a section of this file. You are able to add an array of sub-keys in second argument in order to add many elements into the target section or just a string in order to add a simple sub-key.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
array<mixed,mixed> | The target element. |
writeInKey
Add a value into the element of a section into this file.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element. |
$content |
string | The value to write in the element. |
rewriteKey
Modify the element's key of a section into this file.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element. |
$newElement |
string | The new name for the target element. |
rewriteInKey
Overwrite a value into the element of a section into this file.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element. |
$content |
string | The value to write in the element. |
rmInKey
Remove the value into a target element in a section of this file.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element. |
rmKey
Remove the entire element's key/value into a section of this file.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element to remove. |
keyHasNext
Check if this section's element has another element after it.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element to evaluate. |
Return Value:
True if this element has another one after it, false if not.
keyHasPrevious
Check if this section's element has another element before it.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The target element to evaluate. |
Return Value:
True if this element has another one before it, false if not.
getNextKey
Get the next element after the element'key passed in argument.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The section's element's key that we want to return the following. |
Return Value:
Returns the following element from parsed file.
getPreviousKey
Get the element before the element'key passed in argument.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The section's element's key that we want to return the previous one. |
Return Value:
Returns the previous element from parsed file.
moveKey
Move the element into another section. The original element is deleted.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the target element. |
$element |
string | The element's key to move. |
$newSection |
string | The section's key where to move the element. |
beforeKey
Move an entire element's key/value before another one.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the element to move. |
$element |
string | The element's key of the element to move. |
$before |
string | The element's key before wich we want to move our element. |
afterKey
Move an entire element's key/value after another one.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the element to move. |
$element |
string | The element's key of the element to move. |
$after |
string | The element's key after wich we want to move our element. |
prependKey
Move an entire element at the top of its section.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the section's element to move. |
$element |
string | The element's key to move. |
appendKey
Move an entire element at the bottom of its section.
Parameters:
Parameter | Type | Description |
---|---|---|
$section |
string | The section's key of the section's element to move. |
$element |
string | The element's key to move. |
Coming Soon
Manage exceptions (section, element not found..)
Add sample code in README.md
- Add new cool methods : suggestions are welcome and usefull ;)
This document was automatically generated from source code comments on 2016-04-27 using phpDocumentor and cvuorinen/phpdoc-markdown-public