public static function save(array $data, array $extra = null)
    {
        $data = self::saveConfigParams($data, $extra);
        $final_data = self::saveExtraParams($data);
        $saved = false;
        try {
            $final_data = array_filter($final_data, function($key, $value) {
                return in_array($key, self::$required, true) || !empty($value);
            }, ARRAY_FILTER_USE_BOTH);
            $saved = (false !== file_put_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE, json_encode($final_data, JSON_PRETTY_PRINT)));
            self::getInstance()->loadConfigData();
            $saved = true;
        } catch (ConfigException $e) {
            Logger::log($e->getMessage(), LOG_ERR);
        }
        return $saved;
    }
public static function save(array $data, array $extra = null)
    {
        $data = self::saveConfigParams($data, $extra);
        $final_data = self::saveExtraParams($data);
        $saved = false;
        try {
            $final_data = array_filter($final_data, function($key, $value) {
                return in_array($key, self::$required, true) || !empty($value);
            }, ARRAY_FILTER_USE_BOTH);
            $saved = (false !== file_put_contents(CONFIG_DIR . DIRECTORY_SEPARATOR . self::CONFIG_FILE, json_encode($final_data, JSON_PRETTY_PRINT)));
            self::getInstance()->loadConfigData();
            $saved = true;
        } catch (ConfigException $e) {
            Logger::log($e->getMessage(), LOG_ERR);
        }
        return $saved;
    }
public static function save ( array $ data , array $ extra = null ) { $ data = self :: saveConfigParams ( $ data , $ extra ) ; $ final_data = self :: saveExtraParams ( $ data ) ; $ saved = false ; try { $ final_data = array_filter ( $ final_data , function ( $ key , $ value ) { return in_array ( $ key , self :: $ required , true ) || ! empty ( $ value ) ; } , ARRAY_FILTER_USE_BOTH ) ; $ saved = ( false !== file_put_contents ( CONFIG_DIR . DIRECTORY_SEPARATOR . self :: CONFIG_FILE , json_encode ( $ final_data , JSON_PRETTY_PRINT ) ) ) ; self :: getInstance ( ) -> loadConfigData ( ) ; $ saved = true ; } catch ( ConfigException $ e ) { Logger :: log ( $ e -> getMessage ( ) , LOG_ERR ) ; } return $ saved ; }
Method that saves all the configuration in the system

@param array $data
@param array|null $extra
@return boolean
Method that saves all the configuration in the system