Last active
January 11, 2016 09:27
-
-
Save rootindex/f9352d6751174998397c to your computer and use it in GitHub Desktop.
Magento2 Maintenance Mode
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
<?php | |
// 1) Enabled maintenance mode by creating file .maintenance.flag in the var folder | |
// 2) By pass maintenance mode by creating file .maintenance.ip in the var folder | |
// 3) IP addresses does not work for ranges only individual ip addresses | |
if (!preg_match('/^[^\s,]+(,[^\s,]+)*$/', $addresses)) { | |
throw new \InvalidArgumentException("One or more IP-addresses is expected (comma-separated)\n"); | |
} | |
// 4) Comma seperate ip addresses without any spaces | |
// ?) Creating a folder called .maintenance.flag will also trigger maintenance mode |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment