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

MysqlMetadata Enhancements #201

Open
wants to merge 1 commit into
base: 2.13.x
Choose a base branch
from

Conversation

willjones9
Copy link

Add support for column_key and extra fields in MysqlMetadata.

Removes the strange formatting of the names of constraints that aren't foreign keys. I'm unsure why that's ever been a thing, as it doesn't make much sense adding laminas{table name} to them?

Wraps the constraint array in a non-null check to prevent a possible null pointer exception

Converts a couple of closures to static functions for better scoping and potential performance improvements

Add support for column_key and extra fields in MysqlMetadata.

Removes the strange formatting of the names of constraints that aren't foreign keys. I'm unsure why that's ever been a thing, as it doesn't make much sense adding _laminas_{table name} to them?

Wraps the constraint array in a non-null check to prevent a possible null pointer exception

Converts a couple of closures to static functions for better scoping and potential performance improvements

Signed-off-by: Will Jones <will@stratagem-uk.tech>
@dfelton
Copy link

dfelton commented Jul 16, 2021

As much as I'd like to see this package continue to be maintained, my understanding is that it is in a security-only mode.

In the end, we voted to accept the results of the async vote held last month. As such, all of the components listed will go into security-only mode, and receive no new bugfixes unless we have maintainers step up with concrete plans for maintaining and evolving the component.

@froschdesign
Copy link
Member

@dfelton

As much as I'd like to see this package continue to be maintained, my understanding is that it is in a security-only mode.

This was last year but in the meantime, new maintainers have been found for laminas-db.

This works also for other components. Please look at the readme file of the components. Example: https://github.com/laminas/laminas-config#laminas-config

'table_name' => $row['TABLE_NAME'],
'columns' => [],
];
$constraints[$name]['columns'][] = $row['COLUMN_NAME'];
Copy link
Contributor

@tptrixtop tptrixtop Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

this $name will be empty if above case wont be triggered?)

Copy link
Author

@willjones9 willjones9 Jul 19, 2021

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@tptrixtop possibly, however that potential case isn't new to this commit; it has existed for some time.
PhpStorm also warns me about line 272, saying $isFK is probably undefined:

$constraints[$name]['columns'][] = $row['COLUMN_NAME'];
if ($isFK) {
    $constraints[$name]['referenced_columns'][] = $row['REFERENCED_COLUMN_NAME'];
}

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

looks like $name was initializing in else { case in previous version, in new version else case was removed and allows $name to be uninitialized or i am missing something

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.

4 participants