Skip to content

Commit

Permalink
Ensure compatibility with SS 3.7 & PHP 7.2
Browse files Browse the repository at this point in the history
marc-firebrand committed Oct 29, 2018
1 parent 13c151c commit 6d1ce5c
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
@@ -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;

@@ -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();

0 comments on commit 6d1ce5c

Please sign in to comment.