Warning: session_start(): Session cannot be started after headers have already been sent in /home/tvrreohg/public_html/manga.php on line 13
0) {
self::$defaultFontSize = $value;
return true;
}
return false;
}
/**
* Load setting from phpword.yml or phpword.yml.dist.
*/
public static function loadConfig(?string $filename = null): array
{
// Get config file
$configFile = null;
$configPath = __DIR__ . '/../../';
if ($filename !== null) {
$files = [$filename];
} else {
$files = ["{$configPath}phpword.ini", "{$configPath}phpword.ini.dist"];
}
foreach ($files as $file) {
if (file_exists($file)) {
$configFile = realpath($file);
break;
}
}
// Parse config file
$config = [];
if ($configFile !== null) {
$config = @parse_ini_file($configFile);
if ($config === false) {
return [];
}
}
// Set config value
$appliedConfig = [];
foreach ($config as $key => $value) {
$method = "set{$key}";
if (method_exists(__CLASS__, $method)) {
self::$method($value);
$appliedConfig[$key] = $value;
}
}
return $appliedConfig;
}
/**
* Get default paper.
*/
public static function getDefaultPaper(): string
{
return self::$defaultPaper;
}
/**
* Set default paper.
*/
public static function setDefaultPaper(string $value): bool
{
if (trim($value) !== '') {
self::$defaultPaper = $value;
return true;
}
return false;
}
}