<?php /** * PHP Server Monitor * Monitor your servers and websites. * * This file is part of PHP Server Monitor. * PHP Server Monitor is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PHP Server Monitor is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>. * * @package phpservermon * @author Pepijn Over <*****@*****.**> * @copyright Copyright (c) 2008-2014 Pepijn Over <*****@*****.**> * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ **/ require 'src/bootstrap.php'; psm_no_cache(); $router = new psm\Router(); $router->run();
<?php /** * PHP Server Monitor * Monitor your servers and websites. * * This file is part of PHP Server Monitor. * PHP Server Monitor is free software: you can redistribute it and/or modify * it under the terms of the GNU General Public License as published by * the Free Software Foundation, either version 3 of the License, or * (at your option) any later version. * * PHP Server Monitor is distributed in the hope that it will be useful, * but WITHOUT ANY WARRANTY; without even the implied warranty of * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the * GNU General Public License for more details. * * You should have received a copy of the GNU General Public License * along with PHP Server Monitor. If not, see <http://www.gnu.org/licenses/>. * * @package phpservermon * @author Pepijn Over <*****@*****.**> * @copyright Copyright (c) 2008-2014 Pepijn Over <*****@*****.**> * @license http://www.gnu.org/licenses/gpl.txt GNU GPL v3 * @version Release: @package_version@ * @link http://www.phpservermonitor.org/ **/ define('PSM_INSTALL', true); require 'src/bootstrap.php'; $router = new psm\Router(); $router->run('install');
if (!defined('PSM_DEBUG')) { define('PSM_DEBUG', false); } if (PSM_DEBUG) { error_reporting(E_ALL); ini_set('display_errors', 1); } else { error_reporting(0); ini_set('display_errors', 0); } $vendor_autoload = PSM_PATH_SRC . '..' . DIRECTORY_SEPARATOR . 'vendor' . DIRECTORY_SEPARATOR . 'autoload.php'; if (!file_exists($vendor_autoload)) { die('No dependencies found in vendor dir. Did you install the dependencies? Please run "php composer.phar install".'); } require_once $vendor_autoload; $router = new psm\Router(); // this may seem insignificant, but right now lots of functions depend on the following global var definition: $db = $router->getService('db'); // sanity check! if (!defined('PSM_INSTALL') || !PSM_INSTALL) { if ($db->getDbHost() === null) { // no config file has been loaded, redirect the user to the install header('Location: install.php'); die; } // config file has been loaded, check if we have a connection if (!$db->status()) { die('Unable to establish database connection...'); } // attempt to load configuration from database if (!psm_load_conf()) {