Skip to content

Conversation

@PaulWebster
Copy link

Changes for PHP8 and remain backward compatible

Deprecated: Optional parameter $password declared before required parameter $table is implicitly treated as a required parameter in tableManager.php
2 options ...

  1. move $password to further down the list
    Would require simple changes to all callers to reflect the new parameter order. Best to make it the first optional in this case.

  2. make it mandatory
    Passwords is probably always set by caller - even if only an empty string Probably no change to callers.
    I have gone for option 2.

Testing of results in PDO operations needs to handle both int and string returns

For example:
validateTableName:
PHP7
array (size=1)
0 =>
array (size=1)
'count' => string '1' (length=1)

PHP8
array(1) { [0]=> array(1) { ["count"]=> int(1) } }

So change from === to == and let PHP juggle the types.

$mysqlDb needs to be declared at the top of the class to avoid "deprecated" warning

Chages for PHP8 and remain backward compatible

Deprecated: Optional parameter $password declared before required parameter $table is implicitly treated as a required parameter in tableManager.php
2 options ...
1) move $password to further down the list
Would require simple changes to all callers to reflect the new parameter order.
Best to make it the first optional in this case.

2) make it mandatory
Passwords is probably always set by caller - even if only an empty string
Probably no change to callers.

Testing of results in PDO operations needs to handle both int and string returns

For example:
validateTableName:
PHP7
array (size=1)
  0 =>
    array (size=1)
      'count' => string '1' (length=1)

PHP8
array(1) { [0]=> array(1) { ["count"]=> int(1) } }

So change from === to == and let PHP juggle the types.

$mysqlDb needs to be declared at the top of the class to avoid "deprecated" warning
@mrjones-plip
Copy link
Contributor

Hey @PaulWebster - thanks so much for the PR! With the last release being 3 years ago and me not being at PCH any more, I suspect this PR won't go anywhere. sorry :(

I'd merge your branch to your master and then keep adding improvements from there as needed. Anybody interested in this project will hopefully find your version. If you get sufficient traction, I'll see if I can call in a favor at PCH to get an update to the tableManager home page to direct traffic to your version.

best of luck!

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants