Exemplo n.º 1
0
    $file = __DIR__ . '/lib/' . str_replace('_', '/', $class) . '.php';
    if (file_exists($file)) {
        require $file;
    }
}
function db()
{
    return $GLOBALS['db'];
}
if (!file_exists('inc/mysql.config.php')) {
    echo 'MYSQL config not found';
}
// Funktion
require __DIR__ . '/inc/functions.php';
// Datenbankverbindung herstellen
require __DIR__ . '/inc/database.config.php';
require __DIR__ . '/install/init.mysql.php';
initDb($db);
foreach (update_migration::listPending() as $value) {
    echo '1';
    $migrations = new update_migration();
    $migrations->install($value);
    echo $value . 'installed.';
}
mkdir('cache', 0777);
echo '
<h1>DONE</h1>
<p>
<strong>Erstellen sie bitte in der Datenbank Ihren Admin User (Passwort 2x MD5 verschlüsselt) und entfernen Sie diese Datei.</strong>
</p>
';
Exemplo n.º 2
0
    die('Please run this script in cli mode only');
}
// Autoloading für Klassen
function __autoload($class)
{
    $file = 'lib/' . str_replace('_', '/', $class) . '.php';
    if (file_exists($file)) {
        require $file;
    }
}
function db()
{
    return $GLOBALS['db'];
}
// Funktion
require 'inc/functions.php';
// Datenbankverbindung herstellen
require 'inc/database.config.php';
if (empty($argv[1])) {
    require 'install/init.mysql.php';
    initDb($db);
    foreach (update_migration::listPending() as $migration) {
        if (!system('php setup.php ' . $migration)) {
            break;
        }
    }
} else {
    $migrations = new update_migration();
    $migrations->install($argv[1]);
    echo "\t {$argv[1]} installed.\n";
}
Exemplo n.º 3
0
<?php

function db()
{
    return $GLOBALS['db'];
}
if (file_exists('inc/ftp.config.php')) {
    require_once 'inc/ftp.config.php';
    $writer = new writer_ftp($ftp_host, $ftp_user, $ftp_pass, $ftp_dir);
} else {
    $writer = new writer_fs();
}
if (isset($_GET['storefile'])) {
    $pkg = new update_package(array('id' => $_POST['pkg']));
    $pkg->updateFile($_POST['path'], $_POST['content']);
    die('ok');
} elseif (isset($_GET['addpackage'])) {
    $pkg = new update_package($_POST);
    $pkg->install($writer);
    die('ok');
} elseif (isset($_GET['getmigrations'])) {
    die(json_encode(update_migration::listPending()));
} elseif (!empty($_GET['install'])) {
    $migrations = new update_migration();
    $migrations->install($_GET['install']);
    die;
}