コード例 #1
0
ファイル: web.php プロジェクト: xafr/gallery3
 * This program 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 this program; if not, write to the Free Software
 * Foundation, Inc., 51 Franklin Street - Fifth Floor, Boston, MA  02110-1301, USA.
 */
if (installer::already_installed()) {
    $content = render("success.html.php");
} else {
    switch (@$_GET["step"]) {
        default:
        case "welcome":
            $errors = check_environment();
            if ($errors) {
                $content = render("environment_errors.html.php", array("errors" => $errors));
            } else {
                $content = render("get_db_info.html.php");
            }
            break;
        case "save_db_info":
            $config = array("host" => $_POST["dbhost"], "user" => $_POST["dbuser"], "password" => $_POST["dbpass"], "dbname" => $_POST["dbname"], "prefix" => $_POST["prefix"], "type" => function_exists("mysqli_set_charset") ? "mysqli" : "mysql");
            if (!installer::connect($config)) {
                $content = render("invalid_db_info.html.php");
            } else {
                if (!installer::select_db($config)) {
                    $content = render("missing_db.html.php");
                } else {
                    if (!installer::db_empty($config)) {
コード例 #2
0
ファイル: setup.php プロジェクト: hunter2814/reason_package
        if (file_is_included(CARL_UTIL_INC . 'error_handler/error_handler.php')) {
            echo '<p><strong>...loaded error handler</strong> (' . CARL_UTIL_INC . 'error_handler/error_handler.php' . ')</p>';
        }
        echo '<h4>Checking component availability</h4>';
        if (is_readable(INCLUDE_PATH . 'paths.php')) {
            // verify settings files loaded by header.php before we load the header
            check_environment_and_trailing_slash(WEB_PATH, 'web path', 'Check the WEB_PATH constant in package_settings.php.</p><p>
								 The value should resolve to (or be set explicitly to)</p>
								 <p><pre>' . rtrim($_SERVER['DOCUMENT_ROOT'], DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR . '</pre>');
            check_environment_must_be_outside_of_web_tree(DB_CREDENTIALS_FILEPATH, 'db credentials xml file', 'Verify that DB_CREDENTIALS_FILEPATH in package_settings.php is correct and points to a readable file outside the web tree');
            check_environment(DISCO_INC . 'disco.php', 'disco include path', 'Verify the path to DISCO_INC in package_settings.php');
            check_environment(TYR_INC . 'tyr.php', 'tyr include path', 'Verify the path to TYR_INC in package_settings.php');
            check_environment(THOR_INC . 'thor.php', 'thor include path ', 'Verify the path to THOR_INC in package_settings.php');
            check_environment(XML_PARSER_INC . 'xmlparser.php', 'xml parser', 'Verify the path to XML_PARSER_INC in package_settings.php');
            check_environment(HTML_PURIFIER_INC . 'htmlpurifier.php', 'html purifier', 'Verify the path to HTML_PURIFIER_INC in package_settings.php');
            check_environment(REASON_INC . 'header.php', 'reason header', 'Verify the path stored in the constant REASON_INC in package_settings.php');
            echo '<h4>Bootstrapping</h4>';
            include_once SETTINGS_INC . 'reason_settings.php';
            if (file_is_included(SETTINGS_INC . 'reason_settings.php')) {
                echo '<p><strong>...loaded reason settings</strong> (' . SETTINGS_INC . 'reason_settings.php' . ')</p>';
            }
            // connect to Reason DB - we do this right here to make sure we can load the reason_db
            include_once CARL_UTIL_INC . 'db/connectDB.php';
            if ($db_info = get_db_credentials(REASON_DB, false)) {
                echo '<p><strong>...loaded db credentials</strong> (the connection name is ' . REASON_DB . ')</p>';
                $db = mysql_connect($db_info['host'], $db_info['user'], $db_info['password']);
                if (empty($db)) {
                    $msg = '<div class="error">';
                    $msg .= '<p>mysql connection ' . REASON_DB . ' check failed</span> - count not connect to server - could be one of the following</p>';
                    $msg .= '<ul>';
                    $msg .= '<li>Improper username and/or password in the db credentials file in ' . SETTINGS_INC . 'dbs.xml</li>';
コード例 #3
0
<?php

/*
+---------------------------------------------------------------------------+
| Revive Adserver                                                           |
| http://www.revive-adserver.com                                            |
|                                                                           |
| Copyright: See the COPYRIGHT.txt file.                                    |
| License: GPLv2 or later, see the LICENSE.txt file.                        |
+---------------------------------------------------------------------------+
*/
check_environment();
if (array_key_exists('submit', $_REQUEST)) {
    $file = download_scenarios($_REQUEST['download']);
    header('Content-type: application/x-gzip');
    header('Content-Disposition: attachment; filename="' . $file . '"');
    readfile(TMP_PATH . '/' . $file);
    die;
}
include TPL_PATH . '/frameheader.html';
$aSims = get_simulation_file_list(FOLDER_SAVE, 'php', true);
include TPL_PATH . '/body_download_scenario.html';
コード例 #4
-2
function main()
{
    $options = parse_args();
    if (array_key_exists('version', $options)) {
        print 'Plugin version: ' . VERSION;
        fullusage();
        nagios_exit('', STATUS_OK);
    }
    check_environment();
    check_domain($options);
}