dimitrilahaye / dodo-ini-manager
Awakens the dodo which is sleeping in you! And at least, manage your files.ini ! Create them, update their sections, etc.
Installs: 6
Dependents: 0
Suggesters: 0
Security: 0
Stars: 0
Watchers: 1
Forks: 0
Open Issues: 0
Type:project
Requires
- php: >=5.4
Requires (Dev)
- phpunit/php-code-coverage: 3.*
- phpunit/phpunit: 5.*
This package is not auto-updated.
Last update: 2024-10-26 19:43:10 UTC
README
Awakens the dodo which is sleeping in you!
And at least, manage your files.ini ! Create them, update their sections, etc.
Table of Contents
-
- __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
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.
FileIni::__construct( string $path ): void
Parameters:
See Also:
- \DodoPhpLab\DodoIniManager\Classes\FileIni::createFile() - For the creation of the file.ini.
getPath
Get the path for this FileIni object.
FileIni::getPath( ): string
Return Value:
Returns the file's path for this FileIni object.
rename
Change the file's name.
FileIni::rename( string $name ): void
Parameters:
copy
Create a copy of the file with another name, at the same location in file system.
FileIni::copy( string $name ): void
Parameters:
move
Change location for this file. The original file is deleted.
FileIni::move( string $path ): void
Parameters:
arrayTo
Update entire file with an array
FileIni::arrayTo( mixed[] $array ): void
Parameters:
toArray
Get the parsed content of this file.
FileIni::toArray( ): mixed[]
Return Value:
The parsed content of this file obtained with parse_ini_file() method.
jsonTo
Update entire file with a json array
FileIni::jsonTo( string $json ): void
Parameters:
toJson
Get the parsed content of this file in json array format.
FileIni::toJson( ): \DodoPhpLab\DodoIniManager\Classes\json
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.
FileIni::hasSection( string $section ): boolean
Parameters:
Return Value:
True if the section exists in file.ini, false if not.
get
Get a section contained into this file.
FileIni::get( string $section ): mixed[]
Parameters:
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.
FileIni::set( string $section, mixed[] $array = null ): void
Parameters:
rewrite
Modify the key of a section.
FileIni::rewrite( string $section, string $newSection ): void
Parameters:
rm
Remove the section with the key passed in argument.
FileIni::rm( string $section ): void
Parameters:
prepend
Move an entire section at the top of this file.ini
FileIni::prepend( string $section ): void
Parameters:
append
Move an entire section at the bottom of this file.ini
FileIni::append( string $section ): void
Parameters:
before
Move an entire section before another one.
FileIni::before( string $section, string $before ): void
Parameters:
after
Move an entire section after another one.
FileIni::after( string $section, string $after ): void
Parameters:
hasNext
Check if this section has another section after it.
FileIni::hasNext( string $section ): boolean
Parameters:
Return Value:
True if this section has another one after it, false if not.
hasPrevious
Check if this section has another section before it.
FileIni::hasPrevious( string $section ): boolean
Parameters:
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.
FileIni::getNext( string $section ): mixed[]
Parameters:
Return Value:
Returns the following section from parsed file.
getPrevious
Get the next section before the section'key passed in argument.
FileIni::getPrevious( string $section ): mixed[]
Parameters:
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.
FileIni::hasKey( string $section, string $element ): boolean
Parameters:
Return Value:
True if key value exists in section, false if not.
getKey
Get an element contained into a section of this file.
FileIni::getKey( string $section, string $element ): string
Parameters:
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.
FileIni::setKey( string $section, mixed[] $element ): void
Parameters:
writeInKey
Add a value into the element of a section into this file.
FileIni::writeInKey( string $section, string $element, string $content ): void
Parameters:
rewriteKey
Modify the element's key of a section into this file.
FileIni::rewriteKey( string $section, string $element, string $newElement ): void
Parameters:
rewriteInKey
Overwrite a value into the element of a section into this file.
FileIni::rewriteInKey( string $section, string $element, string $content ): void
Parameters:
rmInKey
Remove the value into a target element in a section of this file.
FileIni::rmInKey( string $section, string $element ): void
Parameters:
rmKey
Remove the entire element's key/value into a section of this file.
FileIni::rmKey( string $section, string $element ): void
Parameters:
keyHasNext
Check if this section's element has another element after it.
FileIni::keyHasNext( string $section, string $element ): boolean
Parameters:
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.
FileIni::keyHasPrevious( string $section, string $element ): boolean
Parameters:
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.
FileIni::getNextKey( string $section, string $element ): string
Parameters:
Return Value:
Returns the following element from parsed file.
getPreviousKey
Get the element before the element'key passed in argument.
FileIni::getPreviousKey( string $section, string $element ): string
Parameters:
Return Value:
Returns the previous element from parsed file.
moveKey
Move the element into another section. The original element is deleted.
FileIni::moveKey( string $section, string $element, string $newSection ): void
Parameters:
beforeKey
Move an entire element's key/value before another one.
FileIni::beforeKey( string $section, string $element, string $before ): void
Parameters:
afterKey
Move an entire element's key/value after another one.
FileIni::afterKey( string $section, string $element, string $after ): void
Parameters:
prependKey
Move an entire element at the top of its section.
FileIni::prependKey( string $section, string $element ): void
Parameters:
appendKey
Move an entire element at the bottom of its section.
FileIni::appendKey( string $section, string $element ): void
Parameters:
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