Settings

$settings - an array that contains some other arrays, which are the settings for a specific MadelineProto function.
Here are the default values for the settings arrays and explanations for every setting:

$settings['authorization']

Authorization settings

$settings['authorization']['default_temp_auth_key_expires_in']

Default: 31557600
Description: Validity of temporary keys and the binding of the temporary and permanent keys

$settings['authorization']['rsa_keys'] = [...]

Default: ["-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAwVACPi9w23mF3tBkdZz+zwrzKOaaQdr01vAbU4E1pvkfj4sqDsm6\nlyDONS789sVoD/xCS9Y0hkkC3gtL1tSfTlgCMOOul9lcixlEKzwKENj1Yz/s7daS\nan9tqw3bfUV/nqgbhGX81v/+7RFAEd+RwFnK7a+XYl9sluzHRyVVaTTveB2GazTw\nEfzk2DWgkBluml8OREmvfraX3bkHZJTKX4EQSjBbbdJ2ZXIsRrYOXfaA+xayEGB+\n8hdlLmAjbCVfaigxX0CDqWeR1yFL9kwd9P0NsZRPsmoqVwMbMu7mStFai6aIhc3n\nSlv8kg9qv1m6XHVQY3PnEw+QQtqSIXklHwIDAQAB\n-----END RSA PUBLIC KEY-----", "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAxq7aeLAqJR20tkQQMfRn+ocfrtMlJsQ2Uksfs7Xcoo77jAid0bRt\nksiVmT2HEIJUlRxfABoPBV8wY9zRTUMaMA654pUX41mhyVN+XoerGxFvrs9dF1Ru\nvCHbI02dM2ppPvyytvvMoefRoL5BTcpAihFgm5xCaakgsJ/tH5oVl74CdhQw8J5L\nxI/K++KJBUyZ26Uba1632cOiq05JBUW0Z2vWIOk4BLysk7+U9z+SxynKiZR3/xdi\nXvFKk01R3BHV+GUKM2RYazpS/P8v7eyKhAbKxOdRcFpHLlVwfjyM1VlDQrEZxsMp\nNTLYXb6Sce1Uov0YtNx5wEowlREH1WOTlwIDAQAB\n-----END RSA PUBLIC KEY-----", "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAsQZnSWVZNfClk29RcDTJQ76n8zZaiTGuUsi8sUhW8AS4PSbPKDm+\nDyJgdHDWdIF3HBzl7DHeFrILuqTs0vfS7Pa2NW8nUBwiaYQmPtwEa4n7bTmBVGsB\n1700/tz8wQWOLUlL2nMv+BPlDhxq4kmJCyJfgrIrHlX8sGPcPA4Y6Rwo0MSqYn3s\ng1Pu5gOKlaT9HKmE6wn5Sut6IiBjWozrRQ6n5h2RXNtO7O2qCDqjgB2vBxhV7B+z\nhRbLbCmW0tYMDsvPpX5M8fsO05svN+lKtCAuz1leFns8piZpptpSCFn7bWxiA9/f\nx5x17D7pfah3Sy2pA+NDXyzSlGcKdaUmwQIDAQAB\n-----END RSA PUBLIC KEY-----", "-----BEGIN RSA PUBLIC KEY-----\nMIIBCgKCAQEAwqjFW0pi4reKGbkc9pK83Eunwj/k0G8ZTioMMPbZmW99GivMibwa\nxDM9RDWabEMyUtGoQC2ZcDeLWRK3W8jMP6dnEKAlvLkDLfC4fXYHzFO5KHEqF06i\nqAqBdmI1iBGdQv/OQCBcbXIWCGDY2AsiqLhlGQfPOI7/vvKc188rTriocgUtoTUc\n/n/sIUzkgwTqRyvWYynWARWzQg0I9olLBBC2q5RQJJlnYXZwyTL3y9tdb7zOHkks\nWV9IMQmZmyZh/N7sMbGWQpt4NMchGpPGeJ2e5gHBjDnlIf2p1yZOYeUYrdbwcS0t\nUiggS4UeE8TzIuXFQxw7fzEIlmhIaq3FnwIDAQAB\n-----END RSA PUBLIC KEY-----"]
Description: Array of RSA keys to use during key exchange.WARNING: be very careful while modifying the default value of this setting, the security of telegram’s MTProto protocol depends on it.

tcp_full: The basic MTProto transport protocol, supported by all clients

Overhead: medium

Pros:

All Telegram DCs support it

Initial integrity check with crc32

Transport sequence number check

Cons:

Minimum envelope length: 12 bytes (length+seqno+crc)

Maximum envelope length: 12 bytes (length+seqno+crc)

Initial integrity check with crc32 is not that useful since the TCP protocol already uses it internally

Transport sequence number check is also not that useful since transport sequence numbers are not encrypted and thus cannot be used to avoid replay attacks, and MadelineProto already uses MTProto sequence numbers and message ids for that

http: MTProto over HTTP for browsers and webhosts

Overhead: medium

Pros:

Can be used on restricted webhosts or browsers

Cons:

Very big envelope length

No Initial integrity check

No transport sequence number check

https: MTProto over HTTPS for browsers and webhosts, very secure

Overhead: high

Pros:

Can be used on restricted webhosts or browsers

Provides an additional layer of security by trasmitting data over TLS

Integrity checks with HMAC built into TLS

Sequence number checks built into TLS

Cons:

Very big envelope length

Requires an additional round of encryption

$settings['connection_settings']['all']['test_mode']

Default: false
Description: Whether to connect to the main telegram servers or to the testing servers (deep telegram)

$settings['connection_settings']['all']['ipv6']

Default: auto-detected
Description: Whether to use ipv6 while connecting to the telegram servers

$settings['peer']

$settings['peer']['full_info_cache_time']

$settings['peer']['full_fetch']

Default: false
Description: Should madeline fetch the full member list of every group it meets?

$settings['peer']['cache_all_peers_on_startup']

Default: false
Description: Should madeline fetch the full chat list on startup?

$settings['requests']

Flood timeout settings

$settings['requests']['gzip_encode_if_gt']

Default: 500
Description: Should I try using gzip encoding for requests bigger than N bytes? Set to -1 to disable.

$settings['updates']

Update handling settings

$settings['updates']['handle_updates']

Default: false
Description: Should I handle updates?

$settings['updates']['handle_old_updates']

Default: true
Description: Should I handle old updates on startup?

$settings['updates']['getdifference_interval']

Default: 10
Description: If positive and bigger than zero, no requests will be sent to the socket to request updates in N seconds, passive update listening will be used instead

$settings['updates']['callback']

Default: 'get_updates_update_handler'
Description: A callable function that will be called every time an update is received, must accept an array (for the update) as the only parameter.

$settings['serialization']

Serialization settings

$settings['serialization']['serialization_interval']

Default: 30
Description: Serialization will be made automatically every N seconds

You can provide part of any subsetting array, that way the remaining arrays will be automagically set to default and undefined values of specified subsetting arrays will be set to the default values.
Example: