DEP PHP Support in CMS5 (#77)

This commit is contained in:
Sabina Talipova 2023-01-10 13:24:13 +13:00 committed by GitHub
parent 48220dad3a
commit 9b92ba8d6c
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
3 changed files with 6 additions and 7 deletions

View File

@ -16,14 +16,14 @@
} }
], ],
"require": { "require": {
"php": "^7.4 || ^8.0", "php": "^8.1",
"silverstripe/cms": "^4", "silverstripe/cms": "^5",
"silverstripe/versioned": "^1", "silverstripe/versioned": "^2",
"silverstripe/siteconfig": "^4" "silverstripe/siteconfig": "^5"
}, },
"require-dev": { "require-dev": {
"phpunit/phpunit": "^9.5", "phpunit/phpunit": "^9.5",
"squizlabs/php_codesniffer": "^3.0" "squizlabs/php_codesniffer": "^3"
}, },
"autoload": { "autoload": {
"psr-4": { "psr-4": {

View File

@ -80,7 +80,7 @@ class VersionFeed extends SiteTreeExtension
$qLimit = (int)$limit + 1; $qLimit = (int)$limit + 1;
$versions = $this->owner->Versions( $versions = $this->owner->Versions(
"\"WasPublished\"='1' AND \"CanViewType\" IN ('Anyone', 'Inherit') $offset", "\"WasPublished\"='1' AND \"CanViewType\" IN ('Anyone', 'Inherit') $offset",
"\"SiteTree\".\"LastEdited\" DESC, \"SiteTree\".\"ID\" DESC", "\"LastEdited\" DESC, \"ID\" DESC",
$qLimit $qLimit
); );

View File

@ -114,7 +114,6 @@ class VersionFeedController extends Extension
AND ("PublicHistory" IS NULL OR "PublicHistory" = \'1\') AND ("PublicHistory" IS NULL OR "PublicHistory" = \'1\')
ORDER BY "LastEdited" DESC LIMIT ' . $limit); ORDER BY "LastEdited" DESC LIMIT ' . $limit);
$lastChange = $latestChanges->record(); $lastChange = $latestChanges->record();
$latestChanges->rewind();
if ($lastChange) { if ($lastChange) {
// Cache the diffs to remove DOS possibility. // Cache the diffs to remove DOS possibility.