-
Notifications
You must be signed in to change notification settings - Fork 53
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
[xpdo3] addPackage ignores $prefix, while setPackage uses it incorrectly #161
Comments
var_dump ($xpdo->packages):
This is still happening for the MODX 3 Alpha build. If I use setPackge MODX 3 Alpha can't see some of its own databases as the prefix gets swapped to bbl_. If I use addPackage the prefix is still ignored. |
Honestly, I've been wanting to get rid of the package-specific table prefixes. I really don't see the point in them. |
Its just a mess to deal with with everything modx_ . At least let us use the table name defined in the schema. If we want to have a prefix, we could just do it there manually -- as long as it is not being forced somewhere else. I have sites with multiple projects with up to 75 tables in addition to the CMS. |
The intention of the prefix has always been to apply it to the entire database being connected to so that multiple instances of the same tables could be kept in a single database container. If you are using a prefix with MODX, then use it with the rest of the tables in the same database. If you don't want the prefix, then don't use one. |
OK. So, I reworked the schema tables. modx_ is still applied per your container statement. To avoid collisions I removed the prefix and altered the table names to match the namespace and package. Resulting in modx_namespace_package_tablename (i.g. modx_sanity_devotional_awards) from
I guess with namespaces we can also get rid of the prefix before the classnames now. |
I'm still going to look into fixing the issue as it is a feature of xPDO currently. I was just mentioning that it didn't make a lot of sense to me to create tables with different prefixes. But that said, considering working with tables from other systems where you don't have control of how they are created can be simplified by getting this working properly. |
Creates the tables in the schema, but with the modx_ prefix.
switching it to
Performs as expected subsequently allowing tables to be created correctly. But also has the problem of changing the prefix for the MODX\Revolution package.
As mentioned in #154 PSR-4 is a bit of a pain. The Parser can create the base files anywhere you point it to, but then xpdo->addPackage / setPackage can not load them.
The Not Found is solved by using an autoloader within the main addon Class,
but then appears to not be needed.Using the exact same format as the MODX installer:
$this->prefix is set to 'bbl_'
The prefix is ignored. I even tried placing it within the schema like we did in legacy versions.
For what it is worth, I do have PSR-4 working. It is just using the wrong prefix.
The text was updated successfully, but these errors were encountered: