Skip to content

Commit

Permalink
API Split apart Versioned and Staged
Browse files Browse the repository at this point in the history
  • Loading branch information
emteknetnz committed Oct 29, 2024
1 parent a7e5891 commit 3cab6b4
Show file tree
Hide file tree
Showing 126 changed files with 3,276 additions and 3,159 deletions.
4 changes: 2 additions & 2 deletions _config/versionedcache.yml
Original file line number Diff line number Diff line change
Expand Up @@ -5,7 +5,7 @@ After:
---
SilverStripe\Core\Injector\Injector:
SilverStripe\Core\Cache\CacheFactory:
class: 'SilverStripe\Versioned\Caching\ProxyCacheFactory'
class: 'SilverStripe\Versioned\Mode\Caching\ProxyCacheFactory'
constructor:
args:
container: 'SilverStripe\Versioned\Caching\VersionedCacheAdapter'
container: 'SilverStripe\Versioned\Mode\Caching\VersionedCacheAdapter'
12 changes: 6 additions & 6 deletions _config/versionedextension.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,20 +3,20 @@ Name: versionedextension
---
SilverStripe\Core\Injector\Injector:
# Versioning only
SilverStripe\Versioned\Versioned.versioned:
class: SilverStripe\Versioned\Versioned
SilverStripe\Versioned\Mode\Versioned.versioned:
class: SilverStripe\Versioned\Mode\Versioned
constructor:
mode: Versioned
# Staging and Versioning
SilverStripe\Versioned\Versioned.stagedversioned:
class: SilverStripe\Versioned\Versioned
SilverStripe\Versioned\Mode\Versioned.stagedversioned:
class: SilverStripe\Versioned\Mode\Versioned
constructor:
mode: StagedVersioned
# Default is alias for .stagedversioned
SilverStripe\Versioned\Versioned: '%$SilverStripe\Versioned\Versioned.stagedversioned'
SilverStripe\Versioned\Mode\Versioned: '%$SilverStripe\Versioned\Mode\Versioned.stagedversioned'
---
Name: versioned-table
---
SilverStripe\ORM\DataQuery:
extensions:
- SilverStripe\Versioned\VersionedTableDataQueryExtension
- SilverStripe\Versioned\Staged\VersionedTableDataQueryExtension
2 changes: 1 addition & 1 deletion _config/versionedfiles.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,4 +3,4 @@ Name: versionedfiles
---
SilverStripe\Assets\File:
extensions:
Versioned: SilverStripe\Versioned\Versioned
Versioned: SilverStripe\Versioned\Mode\Versioned
12 changes: 6 additions & 6 deletions _config/versionedgridfield.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,19 +3,19 @@ Name: versionedgridfield
---
SilverStripe\Forms\GridField\GridFieldDetailForm:
extensions:
- SilverStripe\Versioned\VersionedGridFieldDetailForm
- SilverStripe\Versioned\Versioned\VersionedGridFieldDetailForm
# Add status row to gridfields by default
SilverStripe\Forms\GridField\GridFieldConfig_RecordEditor:
extensions:
- SilverStripe\Versioned\VersionedGridFieldStateExtension
- SilverStripe\Versioned\VersionedGridFieldArchiveExtension
- SilverStripe\Versioned\Versioned\VersionedGridFieldStateExtension
- SilverStripe\Versioned\Versioned\VersionedGridFieldArchiveExtension
SilverStripe\Forms\GridField\GridFieldConfig_Base:
extensions:
- SilverStripe\Versioned\VersionedGridFieldStateExtension
- SilverStripe\Versioned\Versioned\VersionedGridFieldStateExtension
SilverStripe\Forms\GridField\GridFieldConfig_RelationEditor:
extensions:
- SilverStripe\Versioned\VersionedGridFieldStateExtension
- SilverStripe\Versioned\VersionedGridFieldArchiveExtension
- SilverStripe\Versioned\Versioned\VersionedGridFieldStateExtension
- SilverStripe\Versioned\Versioned\VersionedGridFieldArchiveExtension
# Enable gridfield extensions for dataobjects by default
SilverStripe\ORM\DataObject:
versioned_gridfield_extensions: true
8 changes: 4 additions & 4 deletions _config/versionedownership.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,16 +3,16 @@ 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:
ModuleExists: silverstripe/admin
---
SilverStripe\Admin\LeftAndMain:
extensions:
RecursivePublishableHandler: SilverStripe\Versioned\RecursivePublishableHandler
RecursivePublishableHandler: SilverStripe\Versioned\Staged\RecursivePublishableHandler
2 changes: 1 addition & 1 deletion _config/versionedrequestprocessors.yml
Original file line number Diff line number Diff line change
Expand Up @@ -8,4 +8,4 @@ SilverStripe\Core\Injector\Injector:
SilverStripe\Control\Director:
properties:
Middlewares:
VersionedMiddleware: '%$SilverStripe\Versioned\VersionedHTTPMiddleware'
VersionedMiddleware: '%$SilverStripe\Versioned\Staged\VersionedHTTPMiddleware'
6 changes: 3 additions & 3 deletions _config/versionedstate.yml
Original file line number Diff line number Diff line change
Expand Up @@ -3,13 +3,13 @@ Name: versionedstate
---
SilverStripe\Control\RequestHandler:
extensions:
- SilverStripe\Versioned\VersionedStateExtension
- SilverStripe\Versioned\Mode\VersionedStateExtension
SilverStripe\ORM\DataObject:
extensions:
- SilverStripe\Versioned\VersionedStateExtension
- SilverStripe\Versioned\Mode\VersionedStateExtension
---
Name: versionedstate-test
---
SilverStripe\Dev\TestSession:
extensions:
- SilverStripe\Versioned\Dev\VersionedTestSessionExtension
- SilverStripe\Versioned\Mode\Dev\VersionedTestSessionExtension
2 changes: 1 addition & 1 deletion _config/versionedtests.yml
Original file line number Diff line number Diff line change
Expand Up @@ -7,4 +7,4 @@ SilverStripe\Core\Injector\Injector:
SilverStripe\Dev\State\SapphireTestState:
properties:
States:
versioned: '%$SilverStripe\Versioned\Dev\VersionedTestState'
versioned: '%$SilverStripe\Versioned\Mode\Dev\VersionedTestState'
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace SilverStripe\Versioned\Caching;
namespace SilverStripe\Versioned\Mode\Caching;

use Psr\Log\InvalidArgumentException;
use Psr\SimpleCache\CacheInterface;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;
use Symfony\Component\Cache\PruneableInterface;
use Symfony\Component\Cache\ResettableInterface;
use Traversable;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
<?php


namespace SilverStripe\Versioned\Caching;
namespace SilverStripe\Versioned\Mode\Caching;

use InvalidArgumentException;
use Psr\SimpleCache\CacheInterface;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
<?php


namespace SilverStripe\Versioned\Caching;
namespace SilverStripe\Versioned\Mode\Caching;

use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

class VersionedCacheAdapter extends ProxyCacheAdapter
{
Expand Down
2 changes: 1 addition & 1 deletion src/DataDifferencer.php → src/Mode/DataDifferencer.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SilverStripe\Versioned;
namespace SilverStripe\Versioned\Mode;

use SilverStripe\Assets\Image;
use SilverStripe\Core\Convert;
Expand Down
Original file line number Diff line number Diff line change
@@ -1,11 +1,11 @@
<?php


namespace SilverStripe\Versioned\Dev;
namespace SilverStripe\Versioned\Mode\Dev;

use SilverStripe\Dev\TestSession;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\VersionedStateExtension;
use SilverStripe\Versioned\Mode\Versioned;
use SilverStripe\Versioned\Mode\VersionedStateExtension;

/**
* Decorates TestSession object to update get / post requests with versioned querystring arguments.
Expand Down
Original file line number Diff line number Diff line change
@@ -1,10 +1,10 @@
<?php

namespace SilverStripe\Versioned\Dev;
namespace SilverStripe\Versioned\Mode\Dev;

use SilverStripe\Dev\SapphireTest;
use SilverStripe\Dev\State\TestState;
use SilverStripe\Versioned\Versioned;
use SilverStripe\Versioned\Mode\Versioned;

/**
* Decorate sapphire test with versioning
Expand Down
2 changes: 1 addition & 1 deletion src/ReadingMode.php → src/Mode/ReadingMode.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

namespace SilverStripe\Versioned;
namespace SilverStripe\Versioned\Mode;

use InvalidArgumentException;

Expand Down
Loading

0 comments on commit 3cab6b4

Please sign in to comment.