2016-05-18 21:43:59 +02:00
|
|
|
<?php
|
2023-05-24 11:35:15 +02:00
|
|
|
|
2017-03-03 23:06:12 +01:00
|
|
|
namespace Shaarli\Config;
|
2016-05-18 21:43:59 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Interface ConfigIO
|
|
|
|
*
|
|
|
|
* This describes how Config types should store their configuration.
|
|
|
|
*/
|
|
|
|
interface ConfigIO
|
|
|
|
{
|
|
|
|
/**
|
|
|
|
* Read configuration.
|
|
|
|
*
|
|
|
|
* @param string $filepath Config file absolute path.
|
|
|
|
*
|
|
|
|
* @return array All configuration in an array.
|
|
|
|
*/
|
2017-01-05 19:33:06 +01:00
|
|
|
public function read($filepath);
|
2016-05-18 21:43:59 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Write configuration.
|
|
|
|
*
|
|
|
|
* @param string $filepath Config file absolute path.
|
|
|
|
* @param array $conf All configuration in an array.
|
|
|
|
*/
|
2017-01-05 19:33:06 +01:00
|
|
|
public function write($filepath, $conf);
|
2016-05-18 21:43:59 +02:00
|
|
|
|
|
|
|
/**
|
|
|
|
* Get config file extension according to config type.
|
|
|
|
*
|
|
|
|
* @return string Config file extension.
|
|
|
|
*/
|
2017-01-05 19:33:06 +01:00
|
|
|
public function getExtension();
|
2016-05-18 21:43:59 +02:00
|
|
|
}
|