Added first version of ConfigCacheSaver
This commit is contained in:
parent
dda26a46f5
commit
383a6715c3
14 changed files with 409 additions and 68 deletions
39
src/Util/Config/ConfigCacheManager.php
Normal file
39
src/Util/Config/ConfigCacheManager.php
Normal file
|
@ -0,0 +1,39 @@
|
|||
<?php
|
||||
|
||||
namespace Friendica\Util\Config;
|
||||
|
||||
abstract class ConfigCacheManager
|
||||
{
|
||||
/**
|
||||
* The Sub directory of the config-files
|
||||
* @var string
|
||||
*/
|
||||
const SUBDIRECTORY = 'config';
|
||||
|
||||
protected $baseDir;
|
||||
protected $configDir;
|
||||
|
||||
public function __construct($baseDir)
|
||||
{
|
||||
$this->baseDir = $baseDir;
|
||||
$this->configDir = $baseDir . DIRECTORY_SEPARATOR . self::SUBDIRECTORY;
|
||||
}
|
||||
|
||||
protected function getConfigFullName($name)
|
||||
{
|
||||
$fullName = $this->configDir . DIRECTORY_SEPARATOR . $name . '.config.php';
|
||||
return file_exists($fullName) ? $fullName : '';
|
||||
}
|
||||
|
||||
protected function getIniFullName($name)
|
||||
{
|
||||
$fullName = $this->configDir . DIRECTORY_SEPARATOR . $name . '.ini.php';
|
||||
return file_exists($fullName) ? $fullName : '';
|
||||
}
|
||||
|
||||
protected function getHtConfigFullName($name)
|
||||
{
|
||||
$fullName = $this->baseDir . DIRECTORY_SEPARATOR . '.' . $name . '.php';
|
||||
return file_exists($fullName) ? $fullName : '';
|
||||
}
|
||||
}
|
Loading…
Add table
Add a link
Reference in a new issue