ifsnop / mysqldump-php

PHP version of mysqldump cli that comes with MySQL
https://github.com/ifsnop/mysqldump-php
GNU General Public License v3.0
1.25k stars 300 forks source link

Improve the library extensibility #200

Closed Luc45 closed 1 year ago

Luc45 commented 4 years ago

I've recently developed a small library that depends on this one. I had to use Reflection to get some stuff done that could be easily prevented if some methods and properties were marked as protected. This PR makes a few methods and properties protected, instead of private, and exposes the default settings on a constant, instead of having it in a local variable in the constructor.

The general goal of this PR is to improve extensibility of this library.

Thanks.

KamilBaczkowski commented 4 years ago

I stumbled upon a similar issue. I want to extend the class, but I can't, since the values provided are set to private, or in case of the defaults are not even accessible from a child class. Value of a private property can be fetched and modified using reflections, but the way a private method is used cannot be modified or overridden.