From e987568376cc02303002e1e2a194c2a88baa3962 Mon Sep 17 00:00:00 2001 From: Steve Boyd Date: Tue, 29 Oct 2024 13:58:14 +1300 Subject: [PATCH] API Split apart Versioned and Staged --- _config/versionedextension.yml | 2 +- _config/versionedownership.yml | 8 ++++---- _config/versionedrequestprocessors.yml | 2 +- src/{ => Staged}/ChangeSet.php | 2 +- src/{ => Staged}/ChangeSetItem.php | 3 ++- src/{ => Staged}/RecursivePublishable.php | 6 ++++-- src/{ => Staged}/RecursivePublishableHandler.php | 3 ++- src/{ => Staged}/RecursiveStagesInterface.php | 2 +- src/{ => Staged}/RecursiveStagesService.php | 3 ++- src/{ => Staged}/VersionedHTTPMiddleware.php | 3 ++- src/{ => Staged}/VersionedTableDataQueryExtension.php | 3 ++- src/Versioned.php | 1 + tests/php/ChangeSetItemTest.php | 2 +- tests/php/ChangeSetTest.php | 4 ++-- tests/php/ChangeSetTest/ChangeSetSyncStub.php | 2 +- .../PolymorphicIntermediary.php | 2 +- .../PolymorphicOwned.php | 2 +- .../PolymorphicOwner.php | 2 +- tests/php/PublishRecursive/PublishRecursiveTest.php | 2 +- tests/php/VersionedDeletedVersionsTest.php | 2 +- .../UnversionedObject.php | 2 +- .../UnversionedOwner.php | 2 +- .../VersionedGridFieldItemRequestTest/VersionedObject.php | 2 +- .../VersionedGridFieldItemRequestTest/VersionedOwner.php | 2 +- .../VersionedManyManyThroughListTest/VersionedObject.php | 2 +- tests/php/VersionedOwnershipTest.php | 4 ++-- tests/php/VersionedOwnershipTest/Attachment.php | 2 +- tests/php/VersionedOwnershipTest/Banner.php | 2 +- tests/php/VersionedOwnershipTest/CustomRelation.php | 2 +- tests/php/VersionedOwnershipTest/Image.php | 2 +- tests/php/VersionedOwnershipTest/OwnedByUnversioned.php | 2 +- tests/php/VersionedOwnershipTest/Related.php | 2 +- tests/php/VersionedOwnershipTest/RelatedMany.php | 2 +- tests/php/VersionedOwnershipTest/TestObject.php | 2 +- tests/php/VersionedOwnershipTest/TestPage.php | 2 +- tests/php/VersionedOwnershipTest/UnversionedOwner.php | 2 +- tests/php/VersionedTest.php | 2 +- tests/php/VersionedTest/ChangeSetTestObject.php | 2 +- tests/php/VersionedTest/TestObject.php | 2 +- .../VersionsDeletedVersionsTest/CompanyOfficeLocation.php | 2 +- tests/php/VersionsDeletedVersionsTest/CompanyPage.php | 2 +- tests/php/VersionsDeletedVersionsTest/GalleryBlock.php | 2 +- .../php/VersionsDeletedVersionsTest/GalleryBlockItem.php | 2 +- .../php/VersionsDeletedVersionsTest/GalleryBlockPage.php | 2 +- tests/php/VersionsDeletedVersionsTest/OfficeLocation.php | 2 +- 45 files changed, 58 insertions(+), 50 deletions(-) rename src/{ => Staged}/ChangeSet.php (99%) rename src/{ => Staged}/ChangeSetItem.php (99%) rename src/{ => Staged}/RecursivePublishable.php (98%) rename src/{ => Staged}/RecursivePublishableHandler.php (90%) rename src/{ => Staged}/RecursiveStagesInterface.php (91%) rename src/{ => Staged}/RecursiveStagesService.php (98%) rename src/{ => Staged}/VersionedHTTPMiddleware.php (96%) rename src/{ => Staged}/VersionedTableDataQueryExtension.php (91%) diff --git a/_config/versionedextension.yml b/_config/versionedextension.yml index 40a99720..1304cb9f 100644 --- a/_config/versionedextension.yml +++ b/_config/versionedextension.yml @@ -19,4 +19,4 @@ Name: versioned-table --- SilverStripe\ORM\DataQuery: extensions: - - SilverStripe\Versioned\VersionedTableDataQueryExtension + - SilverStripe\Versioned\Staged\VersionedTableDataQueryExtension diff --git a/_config/versionedownership.yml b/_config/versionedownership.yml index a6b43386..26833e2f 100644 --- a/_config/versionedownership.yml +++ b/_config/versionedownership.yml @@ -3,11 +3,11 @@ Name: versionedownership --- SilverStripe\ORM\DataObject: extensions: - RecursivePublishable: SilverStripe\Versioned\RecursivePublishable + RecursivePublishable: SilverStripe\Versioned\Staged\RecursivePublishable SilverStripe\Core\Injector\Injector: - SilverStripe\Versioned\RecursiveStagesInterface: - class: SilverStripe\Versioned\RecursiveStagesService + SilverStripe\Versioned\Staged\RecursiveStagesInterface: + class: SilverStripe\Versioned\Staged\RecursiveStagesService --- Name: versionedownership-admin OnlyIf: @@ -15,4 +15,4 @@ OnlyIf: --- SilverStripe\Admin\LeftAndMain: extensions: - RecursivePublishableHandler: SilverStripe\Versioned\RecursivePublishableHandler + RecursivePublishableHandler: SilverStripe\Versioned\Staged\RecursivePublishableHandler diff --git a/_config/versionedrequestprocessors.yml b/_config/versionedrequestprocessors.yml index 7161f7b6..8cefbd00 100644 --- a/_config/versionedrequestprocessors.yml +++ b/_config/versionedrequestprocessors.yml @@ -8,4 +8,4 @@ SilverStripe\Core\Injector\Injector: SilverStripe\Control\Director: properties: Middlewares: - VersionedMiddleware: '%$SilverStripe\Versioned\VersionedHTTPMiddleware' + VersionedMiddleware: '%$SilverStripe\Versioned\Staged\VersionedHTTPMiddleware' diff --git a/src/ChangeSet.php b/src/Staged/ChangeSet.php similarity index 99% rename from src/ChangeSet.php rename to src/Staged/ChangeSet.php index c3e5f315..364e1abc 100644 --- a/src/ChangeSet.php +++ b/src/Staged/ChangeSet.php @@ -1,6 +1,6 @@ write(); - $changeset->addObject($owner); + $changeset->addObject($owner); // will add a ChangeSetItem to $changeset->Changes() $result = $changeset->publish(true); if (!$result) { diff --git a/src/RecursivePublishableHandler.php b/src/Staged/RecursivePublishableHandler.php similarity index 90% rename from src/RecursivePublishableHandler.php rename to src/Staged/RecursivePublishableHandler.php index 6432fc49..99ee4354 100644 --- a/src/RecursivePublishableHandler.php +++ b/src/Staged/RecursivePublishableHandler.php @@ -1,10 +1,11 @@