docs: xPDO 3 Composer and model migration guide (#121) - #602
Conversation
Dedicated EN/RU upgrade reference for namespaced models, metadata maps, and Extra addPackage calls, linked from the 3.0 upgrade hub.
6df763c to
ca44f72
Compare
| sortorder: 5 | ||
| --- | ||
|
|
||
| MODX 3 ships **xPDO 3** through Composer (`xpdo/xpdo` in `composer.json`). The library no longer lives as loose files under `core/xpdo/`. Model classes use PHP namespaces and PSR-4 autoloading. [#14534](https://github.com/modxcms/revolution/pull/14534), [#13781](https://github.com/modxcms/revolution/pull/13781) |
There was a problem hiding this comment.
a 100k line pr isn't useful to reference to anyone
There was a problem hiding this comment.
Removed those PR links — agreed they are useless as references.
| - `src/Model/metadata.mysql.php` (`version` ≥ `3.0`, `namespace`, `namespacePrefix`, `class_map`) | ||
| - `src/Model/mysql/Task.php` (platform map) | ||
|
|
||
| Old 2.x layouts that only ship `model/mycomp/mysql/myobject.map.inc.php` without a 3.0 `metadata.mysql.php` will log a package metadata warning and will not register PSR-4 the same way. |
There was a problem hiding this comment.
this is wrong, 2.x also shipped metadata.mysql.php.
There was a problem hiding this comment.
Fixed. 2.x already had metadata.mysql.php; the 3.x change is regenerating it from a version="3.0" schema (namespace / class_map), not inventing the file.
|
|
||
| ## Composer and PSR-4 | ||
|
|
||
| Install or update dependencies from the project root (or wherever your `composer.json` lives): |
There was a problem hiding this comment.
this suggests users need to manually composer install to get xPDO 3 or even that they need a composer.json
There was a problem hiding this comment.
Rewrote that section. Normal upgrades already ship core/vendor/; no project composer.json or manual composer install is required for xPDO 3. Composer is called out only for Git/core rebuilds and Extras that manage their own deps.
Drop huge PR links, clarify that 2.x already had metadata.mysql.php, and state that normal upgrades ship vendor/ without a manual composer install.
Description
Adds a dedicated xPDO 3 upgrade guide (EN + RU) covering Composer delivery of
xpdo/xpdo, PSR-4 /src/model layout,metadata.mysql.php, namespacedaddPackage, schemaversion="3.0", and a 2.x → 3.x Extra migration checklist with before/after examples.Links the guide from the 3.0 upgrade index, breaking changes, class-names (xPDO aliases), the xPDO hub glossary, and the custom database tables tutorial. Closes the “xPDO 3 / PSR-4 Composer reference” and “2.x models → namespaced packages” gaps called out in #121.
Verified against Revolution
3.x(composer.json,modX/addPackage/setPackageMeta, coremetadata.mysql.php, changelog #14534 / #13781).Affected versions
3.x
Relevant issues
Refs #121