PHP Класс Bolt\Configuration\YamlUpdater

Автор: Bob den Otter ([email protected])
Показать файл Открыть проект Примеры использования класса

Открытые методы

Метод Описание
__construct ( Silex\Application $app, string $filename = '' ) Creates an updater for the given file.
change ( string $key, string $value, boolean $makeBackup = true ) : boolean Updates a single value with replacement for given key in yml file.
get ( string $key ) : boolean | array Return a value for a key from the yml file.
prepareValue ( string $value ) : string Make sure the value is escaped as a yaml value.

Защищенные методы

Метод Описание
backup ( ) Backup the YAML file.
save ( boolean $makebackup ) : boolean Save our modified .yml file.
verify ( ) : boolean Verify if the modified YAML is still a valid .yml file, and if we are actually allowed to write and update the current file.

Описание методов

__construct() публичный Метод

Creates an updater for the given file.
public __construct ( Silex\Application $app, string $filename = '' )
$app Silex\Application
$filename string The file to modify

backup() защищенный Метод

Backup the YAML file.
protected backup ( )

change() публичный Метод

Updates a single value with replacement for given key in yml file.
public change ( string $key, string $value, boolean $makeBackup = true ) : boolean
$key string
$value string
$makeBackup boolean
Результат boolean

get() публичный Метод

Return a value for a key from the yml file.
public get ( string $key ) : boolean | array
$key string
Результат boolean | array

prepareValue() публичный Метод

array('one', 'two', 'three') => [ one, two, three ] "usin' quotes" => 'usin'' quotes
public prepareValue ( string $value ) : string
$value string
Результат string

save() защищенный Метод

Save our modified .yml file.
protected save ( boolean $makebackup ) : boolean
$makebackup boolean Back up the file before commiting changes to it
Результат boolean true if save was successful

verify() защищенный Метод

Verify if the modified YAML is still a valid .yml file, and if we are actually allowed to write and update the current file.
protected verify ( ) : boolean
Результат boolean