Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add support of setConnectionParameter to mysqli driver #188

Closed
mnewnham opened this issue Jan 7, 2016 · 1 comment
Closed

Add support of setConnectionParameter to mysqli driver #188

mnewnham opened this issue Jan 7, 2016 · 1 comment
Assignees
Labels
enhancement mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1)
Milestone

Comments

@mnewnham
Copy link
Contributor

mnewnham commented Jan 7, 2016

Driver should support standard parameter passing method instead of driver specific $optionFlags

@mnewnham mnewnham added enhancement mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1) labels Jan 7, 2016
@mnewnham mnewnham self-assigned this Jan 7, 2016
@mnewnham mnewnham added this to the v5.21 milestone Jan 7, 2016
mnewnham added a commit that referenced this issue Jan 7, 2016
The driver now supports the ADOdb standard method setConnectionParameter
for setting pre-connection parameters, e.g. 
  setConnectionParameter(MYSQLI_READ_DEFAULT_FILE,'/home/test/my.cnf')
The driver specific optionFlags is now deprecated and will be removed in
a later release
@mnewnham mnewnham closed this as completed Jan 7, 2016
@dregad
Copy link
Member

dregad commented Jan 7, 2016

See my note in the commit.

To deprecate the $optionFlags feature, I'd sugest removing the empty array assignment, and instead add an information message to inform users they're relying on an obsolete feature, e.g. something like

if ($this->debug) {
    ADOConnection::outp("optionFlags is deprecated, please use setConnectionParameter() instead");
}

I would also add a docblock before the property definition to indicate its deprecated status.

@dregad dregad reopened this Jan 7, 2016
mnewnham referenced this issue Jan 7, 2016
The setConnectionParameter(key,value) method only accepts a single
unique value, but in mysql, parameters with the same key can be
'stacked', e.g.

$db->setConnectionParameter(MYSQLI_READ_DEFAULT_GROUP, "max_allowed_packet=50M");
$db->setConnectionParameter(MYSQLI_READ_DEFAULT_GROUP, "default-character-set=big5");

Method has been changed to allow this to occur.

Fixes #187
@dregad dregad closed this as completed in 8b20bc7 Jan 10, 2016
dregad pushed a commit that referenced this issue Jan 10, 2016
Until deprecated optionFlags is removed, connectionParameters should
merge with it.

Re-initialization of array accidentally left in due to debugging
commit 8b20bc7.

Issue #188
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement mysqli MySQL and compatible drivers (MariaDB, etc) (Tier 1)
Projects
None yet
Development

No branches or pull requests

2 participants