Exemplo n.º 1
0
function patch_database()
{
    // sanity check. check that the version table exists.
    global $dbconfig, $db;
    $has_table = $db->getOne("SHOW TABLES LIKE '{$dbconfig['table_prefix']}version'");
    if (!$has_table) {
        init_database();
    }
    $last_patch = $db->getOne('SELECT ver_version FROM {{%version}}');
    if (!isset($last_patch)) {
        // insert initial value
        $db->query('INSERT INTO {{%version}} SET ver_version=0');
        $last_patch = 0;
    }
    $files = read_patches(__DIR__ . '/patches');
    $addCount = 0;
    foreach ($files as $number => $file) {
        if ($number > $last_patch) {
            echo '* Applying patch: ', $number, ' (', basename($file), ")\n";
            exec_sql_file($file);
            $db->query("UPDATE {{%version}} SET ver_version={$number}");
            $addCount++;
        }
    }
    $version = max(array_keys($files));
    if ($addCount == 0) {
        echo "* Your database is already up-to-date. Version {$version}\n";
    } else {
        echo "* Your database is now up-to-date. Updated from {$last_patch} to {$version}\n";
    }
}
Exemplo n.º 2
0
 * FROM, OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR
 * OTHER DEALINGS IN THE SOFTWARE.
 */
//
// This is the main admin UI script
//
// You can add applications by adding their respective bundle identifiers
// and you can delete applications and define if external symbolification
// should be turned on or not
//
require_once '../config.php';
require_once 'common.inc';
if ($acceptallapps) {
    die('<html><head><META http-equiv="refresh" content="0;URL=app_versions.php"></head><body></body></html>');
}
init_database();
parse_parameters(',bundleidentifier,symbolicate,id,name,issuetrackerurl,hockeyappidentifier,pushids,emails,');
if (!isset($bundleidentifier)) {
    $bundleidentifier = "";
}
if (!isset($symbolicate)) {
    $symbolicate = "";
}
if (!isset($id)) {
    $id = "";
}
if (!isset($name)) {
    $name = "";
}
if (!isset($issuetrackerurl)) {
    $issuetrackerurl = "";
Exemplo n.º 3
0
<?php

/* **************************************************
/  REST Webservice fuer Vereins Mitglieder Datenbank
/  created by Andreas Baierl, 09.02.2010
/  
/
/  orte.php -	get Listenressource: GET ".../strassen" (alle Strassen)
/					get Ressourcendetails: GET ".../strassen/1" (Details von Strasse 1)
/					create Ressource: POST ".../routen"
/
/* *************************************************/
require_once "includes.php";
$database = init_database();
$param = null;
if (isset($_GET['type'])) {
    $type = $_GET['type'];
}
// Check for the path elements
$path = $_SERVER[PATH_INFO];
if ($path != null) {
    $path_params = spliti("/", $path);
}
if ($_SERVER['REQUEST_METHOD'] == 'GET') {
    // GET Request
    set_headers($type);
    if ($path_params[1] != null) {
        render_result(get_ort($path_params[1]), "orte", $type);
        // Ressourcendarstellung
    } else {
        render_result(get_orte(), "orte", $type);
Exemplo n.º 4
0
require_once 'install_tables.php';
require_once 'install_functions.php';
require_once BASE . 'Hotaru.php';
require_once EXTENSIONS . 'csrf/csrf_class.php';
// protection against CSRF attacks
require_once EXTENSIONS . 'Inspekt/Inspekt.php';
// sanitation
require_once EXTENSIONS . 'ezSQL/ez_sql_core.php';
// database
require_once EXTENSIONS . 'ezSQL/mysql/ez_sql_mysql.php';
// database
$h = new Hotaru('install');
// must come before language inclusion
require_once INSTALL . 'install_language.php';
// language file for install
$db = init_database();
$cage = init_inspekt_cage();
$step = $cage->get->getInt('step');
// Installation steps.
switch ($step) {
    case 1:
        installation_welcome();
        // "Welcome to Hotaru CMS.
        break;
    case 2:
        database_setup();
        // DB name, user, password, prefix...
        break;
    case 3:
        database_creation();
        // Creates the database tables