multi language support
support for small devices
This commit is contained in:
		@@ -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);
 | 
			
		||||
 
 | 
			
		||||
		Reference in New Issue
	
	Block a user