PHP Class Puli\Manager\Json\JsonStorage

Since: 1.0
Author: Bernhard Schussek ([email protected])
Afficher le fichier Open project: puli/manager Class Usage Examples

Méthodes publiques

Méthode Description
__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.

Private Methods

Méthode Description
decode ( $json, $path )
encode ( stdClass $jsonData, $path )
loadFile ( $path, $className, array $options = [] )
saveFile ( $file, $path, array $options = [] )

Method Details

__construct() public méthode

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() public méthode

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.
Résultat Puli\Manager\Api\Config\ConfigFile The loaded configuration file.

loadModuleFile() public méthode

Loads a module file from a file path.
public loadModuleFile ( string $path ) : ModuleFile
$path string The path to the module file.
Résultat Puli\Manager\Api\Module\ModuleFile The loaded module file.

loadRootModuleFile() public méthode

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.
Résultat Puli\Manager\Api\Module\RootModuleFile The loaded module file.

saveConfigFile() public méthode

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() public méthode

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() public méthode

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.