Пример #1
0
            require_once GP_PLUGINS_PATH . $plugin;
        }
    }
}
unset($plugins, $plugin);
GP::$router->set_default_routes();
do_action('plugins_loaded');
if (defined('GP_INSTALLING') && GP_INSTALLING) {
    return;
} else {
    define('GP_INSTALLING', false);
}
if (!defined('GP_ROUTING')) {
    define('GP_ROUTING', false);
}
if ((!defined('GP_INSTALLING') || !GP_INSTALLING) && !gp_is_installed()) {
    if (GP_ROUTING) {
        $install_uri = preg_replace('|/[^/]+?$|', '/', $_SERVER['PHP_SELF']) . 'install.php';
        header('Location: ' . $install_uri);
    }
    return;
}
gp_populate_notices();
function gp_shutdown_action_hook()
{
    do_action('shutdown');
}
register_shutdown_function('gp_shutdown_action_hook');
do_action('init');
if (GP_ROUTING) {
    GP::$router->route();
Пример #2
0
<?php

/**
 * Landing point for GlotPress installation
 */
define('GP_INSTALLING', true);
require_once 'gp-load.php';
require_once BACKPRESS_PATH . 'class.bp-sql-schema-parser.php';
require_once GP_PATH . GP_INC . 'install-upgrade.php';
require_once GP_PATH . GP_INC . 'schema.php';
$show_htaccess_instructions = false;
$action = 'upgrade';
if (gp_get_option('gp_db_version') <= gp_get_option_from_db('gp_db_version') && !isset($_GET['force'])) {
    $success_message = __('You already have the latest version, no need to upgrade!');
} else {
    if (gp_is_installed()) {
        $success_message = __('GlotPress was successully upgraded!');
        $errors = gp_upgrade();
        $show_htaccess_instructions = !gp_set_htaccess() && empty($errors);
    } else {
        if (defined('CUSTOM_USER_TABLE')) {
            $errors = gp_install();
            $success_message = __('GlotPress was successully installed!');
            if (!$errors) {
                gp_create_initial_contents();
            }
            $show_htaccess_instructions = !gp_set_htaccess() && empty($errors);
            $action = 'installed';
        } else {
            if (isset($_POST['user_name'], $_POST['user_name'], $_POST['admin_password'], $_POST['admin_password2'], $_POST['admin_email'])) {
                $user_name = trim(stripslashes_deep($_POST['user_name']));