Exemplo n.º 1
0
 /**
  * Returns the singleton object for this class
  * @return QFrame_Config
  */
 public static function instance()
 {
     if (self::$instance === null) {
         self::$instance = new QFrame_Maintenance();
     }
     return self::$instance;
 }
Exemplo n.º 2
0
 * You should have received a copy of the GNU General Public License
 * along with this program.  If not, see <http://www.gnu.org/licenses/>.
 *
 * @copyright  Copyright (c) 2007 Collaborative Software Initiative (CSI)
 * @license    http://www.gnu.org/licenses/   GNU General Public License v3
 */
/*
 * Command-line arguments
 */
if ($_SERVER['argc'] < 3) {
    die("Usage: maintenance.php <on | off> <environment> [<message>]\n\n");
}
$state = $_SERVER['argv'][1];
define('QFRAME_ENV', $_SERVER['argv'][2]);
$comment = isset($_SERVER['argv'][3]) ? $_SERVER['argv'][3] : null;
if ($state !== 'on' && $state !== 'off') {
    die("You must specify 'on' or 'off' as the first argument\n\n");
}
/*
 * Include a few very basic utility functions
 */
include dirname(__FILE__) . '/../core/load.php';
/*
 * Modify maintenance configuration
 */
$config = QFrame_Maintenance::instance();
$config->maintenance = $state === 'on';
if (isset($comment)) {
    $config->comment = $comment;
}
$config->save();