Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Ensure compatibility with SS 3.7 & PHP 7.2 #148

Merged
merged 1 commit into from
Nov 3, 2020
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
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