Skip to content

Commit

Permalink
Merge pull request #148 from firebrandhq/add-php7.2-ss37-support
Browse files Browse the repository at this point in the history
Ensure compatibility with SS 3.7 & PHP 7.2
  • Loading branch information
gheggie authored Nov 3, 2020
2 parents 13c151c + 6d1ce5c commit 33c81f9
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 1 deletion.
6 changes: 6 additions & 0 deletions _config.php
Original file line number Diff line number Diff line change
Expand Up @@ -17,3 +17,9 @@
*/
);

// Ensure compatibility with PHP 7.2 ("object" is a reserved word),
// with SilverStripe 3.6 (using Object) and SilverStripe 3.7 (using SS_Object)
if (!class_exists('SS_Object')) {
class_alias('Object', 'SS_Object');
}
4 changes: 3 additions & 1 deletion code/RecursionReader.php
Original file line number Diff line number Diff line change
@@ -1,6 +1,6 @@
<?php

class RecursionReader extends Object {
class RecursionReader extends SS_Object {

const DAY = 86400;

Expand All @@ -19,6 +19,8 @@ public static function difference_in_months($dateObj1,$dateObj2) {
}

public function __construct(CalendarEvent $event) {
parent::__construct();

$this->event = $event;
$this->datetimeClass = $event->Parent()->getDateTimeClass();
$this->eventClass = $event->Parent()->getEventClass();
Expand Down

0 comments on commit 33c81f9

Please sign in to comment.