multi language support

support for small devices
This commit is contained in:
2024-03-02 15:09:07 +01:00
parent 4d479cedaf
commit b3b58ce103
14 changed files with 613 additions and 339 deletions

View File

@ -25,7 +25,14 @@ class WpConfigEditor extends \WP_Filesystem_Direct
public function writeConfig($value): bool
{
$this->put_contents(ABSPATH . self::WP_CONFIG_FILE, $value);
$value = str_replace('<?php', '', $value);
$value = str_replace('<?', '', $value);
$value = str_replace('?>', '', $value);
$value = str_replace(PHP_EOL . PHP_EOL, PHP_EOL, $value);
$value = '<?php' . PHP_EOL . $value;
$this->put_contents(ABSPATH . self::WP_CONFIG_FILE, $value);
return true;
}
@ -35,7 +42,7 @@ class WpConfigEditor extends \WP_Filesystem_Direct
$configContent = $wfs->readConfig();
if (null === self::getConfigValue($key)) {
$configContent .= "define( '$key', $value );";
$configContent .= "define( '$key', $value );" . PHP_EOL;
}
preg_match("/define\([ ]?'($key)'\,[ ]?(.*)[ ]?\);/",$configContent, $matches);