XF 2.0 How to deactivate/activate my forum via CLI/cmd.php?

Cibox

Member
I want to write a shellscript which does:
  • deactivate my forum via CLI
  • run a mysqldump
  • reactivate it afterwards.

Is there a cmp.php option available for activate/deactivate xenforo2 ?

Thanks in advance
Cibox
 
Last edited:
No, and it wouldn't be useful anyways since there are so many actions which can be performed even though your site is disabled (like login etc.). These would trigger queries aswell.
What you probably would want to do is to manipulate your index.php, set a flag $boardActive = true and if that flag is active, display the usual content. Otherwise, display any custom static non-xf error page. You could manipulate that flag with a script at any given time.
No clue if that would be safe to use, though.

Anyways, if you're fine with your admins being able to trigger any query during backup process, you could manually fire up a query which disables your board (and do the backup and enable the board afterwards).
 
Top Bottom