Welcome Guest, Not a member yet? Register   Sign In
Encryption problem?
#1

This "problem" might be documentation or it might be how the class is implemented.

The docs for Configuring the Library state that

documentation Wrote:You can over-ride any of these settings by passing your own Config object to the Services:

Which is not true because the class constructor looks like this.

PHP Code:
public function __construct(BaseConfig $config null

Note that $config needs to be a BaseConfig object. So, attempting a config override as the docs suggest will result in a TypeError.

The question is: Is the config override to be allowed or not?

I will submit PR(s) either way but need to know what the desired functionality should be.
Reply
#2

No error - grab an instance of any config class, update the properties as needed, and pass it in.

PHP Code:
$config = new Config\Cache();
$config->backupHandler 'file';

$cache Services::cache($configfalse); 
Reply
#3

(11-18-2019, 12:48 PM)kilishan Wrote: No error - grab an instance of any config class, update the properties as needed, and pass it in.

PHP Code:
$config = new Config\Cache();
$config->backupHandler 'file';

$cache Services::cache($configfalse); 

So, the answer to my question is config overriding is allowed, but it has to be done using the right stuff. The docs should be explicit about that. (I'll submit a PR with updated documentation.)
Reply




Theme © iAndrew 2016 - Forum software by © MyBB