Refactor $CFG->siteclosed to $CFG->siteclosedforupgrade

Bug #1526101 reported by Aaron Wells
6
This bug affects 1 person
Affects Status Importance Assigned to Milestone
Mahara
Fix Released
Low
Aaron Wells

Bug Description

Every time I look at init.php I get confused about what the difference is between "siteclosed" and "siteclosedbyadmin" and the various $siteclosedforupgrade variables.

Here's how it actually works:

1. $CFG->siteclosedbyadmin is the config that indicates whether the admin has used the "close site" button to put the site into maintenance mode

2. $CFG->siteclosed is set by Mahara itself, if it detects that there is a database upgrade ready to be deployed. It should *not* be manipulated by users, in normal circumstances.

I think it would make things clearer for future developers, if we renamed "siteclosed" to "siteautoclosedforupgrade". This indicates why we're closing it (for upgrade), and that it was done automatically.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Hm... actually maybe "siteclosedbyupgrade" would be better. It's shorter but still indicates why this was closed, and that it was closed automatically.

Revision history for this message
Aaron Wells (u-aaronw) wrote :

Nah, on third thought, my earlier idea of "siteclosedforupgrade" is *probably* good enough.

Revision history for this message
Mahara Bot (dev-mahara) wrote : A patch has been submitted for review

Patch for "master" branch: https://reviews.mahara.org/5849

Revision history for this message
Mahara Bot (dev-mahara) wrote : A change has been merged

Reviewed: https://reviews.mahara.org/5849
Committed: https://git.mahara.org/mahara/mahara/commit/1404fe80dc104fba789383502bc2adcda8ac5dc5
Submitter: Robert Lyon (<email address hidden>)
Branch: master

commit 1404fe80dc104fba789383502bc2adcda8ac5dc5
Author: Aaron Wells <email address hidden>
Date: Tue Dec 15 12:36:17 2015 +1300

Rename $CFG->siteclosed to $CFG->siteclosedforupgrade

Bug 1526101: This should help make it clearer what's going
on in init.php and the related auth code, by making the
distinction between $CFG->siteclosed and $CFG->siteclosedbyadmin
clearer.

behatnotneeded: Covered by existing tests

Change-Id: I8bc728622ae965ce25b55ee4b55278771fc1eedc

Robert Lyon (robertl-9)
Changed in mahara:
status: In Progress → Fix Committed
Changed in mahara:
status: Fix Committed → Fix Released
To post a comment you must log in.
This report contains Public information  
Everyone can see this information.

Other bug subscribers

Remote bug watches

Bug watches keep track of this bug in other bug trackers.