PHP Класс Puli\Manager\Json\JsonStorage

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

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

Метод Описание
__construct ( Puli\Manager\Api\Storage\Storage $storage, JsonConverterProvider $converterProvider, JsonEncoder $jsonEncoder, JsonDecoder $jsonDecoder, Puli\Manager\Api\Factory\FactoryManager $factoryManager = null ) Creates a new storage.
loadConfigFile ( string $path, Puli\Manager\Api\Config\Config $baseConfig = null ) : Puli\Manager\Api\Config\ConfigFile Loads a configuration file from a path.
loadModuleFile ( string $path ) : ModuleFile Loads a module file from a file path.
loadRootModuleFile ( string $path, Puli\Manager\Api\Config\Config $baseConfig ) : RootModuleFile Loads a root module file from a file path.
saveConfigFile ( Puli\Manager\Api\Config\ConfigFile $configFile ) Saves a configuration file.
saveModuleFile ( ModuleFile $moduleFile ) Saves a module file.
saveRootModuleFile ( RootModuleFile $moduleFile ) Saves a root module file.

Приватные методы

Метод Описание
decode ( $json, $path )
encode ( stdClass $jsonData, $path )
loadFile ( $path, $className, array $options = [] )
saveFile ( $file, $path, array $options = [] )

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

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

Creates a new storage.
public __construct ( Puli\Manager\Api\Storage\Storage $storage, JsonConverterProvider $converterProvider, JsonEncoder $jsonEncoder, JsonDecoder $jsonDecoder, Puli\Manager\Api\Factory\FactoryManager $factoryManager = null )
$storage Puli\Manager\Api\Storage\Storage The file storage.
$converterProvider JsonConverterProvider The provider for the JSON converters.
$jsonEncoder Webmozart\Json\JsonEncoder The JSON encoder.
$jsonDecoder Webmozart\Json\JsonDecoder The JSON decoder.
$factoryManager Puli\Manager\Api\Factory\FactoryManager The manager used to regenerate the factory class after saving a file.

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

Loads a configuration file from a path.
public loadConfigFile ( string $path, Puli\Manager\Api\Config\Config $baseConfig = null ) : Puli\Manager\Api\Config\ConfigFile
$path string The path to the configuration file.
$baseConfig Puli\Manager\Api\Config\Config The configuration that the loaded configuration will inherit its values from.
Результат Puli\Manager\Api\Config\ConfigFile The loaded configuration file.

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

Loads a module file from a file path.
public loadModuleFile ( string $path ) : ModuleFile
$path string The path to the module file.
Результат Puli\Manager\Api\Module\ModuleFile The loaded module file.

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

Loads a root module file from a file path.
public loadRootModuleFile ( string $path, Puli\Manager\Api\Config\Config $baseConfig ) : RootModuleFile
$path string The path to the module configuration file.
$baseConfig Puli\Manager\Api\Config\Config The configuration that the module will inherit its configuration values from.
Результат Puli\Manager\Api\Module\RootModuleFile The loaded module file.

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

The configuration file is saved to the same path that it was read from.
public saveConfigFile ( Puli\Manager\Api\Config\ConfigFile $configFile )
$configFile Puli\Manager\Api\Config\ConfigFile The configuration file to save.

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

The module file is saved to the same path that it was read from.
public saveModuleFile ( ModuleFile $moduleFile )
$moduleFile Puli\Manager\Api\Module\ModuleFile The module file to save.

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

The module file is saved to the same path that it was read from.
public saveRootModuleFile ( RootModuleFile $moduleFile )
$moduleFile Puli\Manager\Api\Module\RootModuleFile The module file to save.