Пример #1
0
    $error .= sprintf('<p>[Installation] %s</p>', $dbCronjobData->getError());
}
// Blindwerte eintragen
$datas = array(array(dbCronjobData::field_item => dbCronjobData::item_last_call, dbCronjobData::field_value => ''), array(dbCronjobData::field_item => dbCronjobData::item_last_job, dbCronjobData::field_value => ''), array(dbCronjobData::field_item => dbCronjobData::item_last_nl_id, dbCronjobData::field_value => ''));
foreach ($datas as $data) {
    if (!$dbCronjobData->sqlInsertRecord($data)) {
        $error .= sprintf('<p>[Installation] %s</p>', $dbCronjobData->getError());
    }
}
$dbCronjobNewsletterLog = new dbCronjobNewsletterLog(true);
if ($dbCronjobNewsletterLog->isError()) {
    $error .= sprintf('<p>[Installation] %s</p>', $dbCronjobNewsletterLog->getError());
}
$dbCronjobErrorLog = new dbCronjobErrorLog(true);
if ($dbCronjobErrorLog->isError()) {
    $error .= sprintf('<p>[Installation] %s</p>', $dbCronjobErrorLog->getError());
}
$dbLanguages = new dbKITlanguages(true);
if ($dbLanguages->isError()) {
    $error .= sprintf('<p>[Installation] %s</p>', $dbLanguages->getError());
}
// create the kit_link table
$SQL = "CREATE TABLE IF NOT EXISTS `" . TABLE_PREFIX . "mod_kit_links` ( " . "`id` INT(11) NOT NULL AUTO_INCREMENT, " . "`url` TEXT NOT NULL, " . "`guid` VARCHAR(128) NOT NULL DEFAULT '', " . "`type` ENUM('DOWNLOAD','UPLOAD','UNDEFINED') NOT NULL DEFAULT 'UNDEFINED', " . "`option` ENUM('THROW-AWAY','PERMANENT') NOT NULL DEFAULT 'THROW-AWAY', " . "`status` ENUM('ACTIVE','LOCKED','DELETED') NOT NULL DEFAULT 'ACTIVE', " . "`file_url` TEXT NOT NULL, " . "`count` INT(11) NOT NULL DEFAULT '0', " . "`last_call` DATETIME NOT NULL DEFAULT '0000-00-00 00:00:00', " . "`kit_id` INT(11) NOT NULL DEFAULT '-1', " . "`timestamp` TIMESTAMP, " . "PRIMARY KEY (`id`), " . "KEY (`guid`,`kit_id`)" . ") ENGINE=MyIsam AUTO_INCREMENT=1 DEFAULT CHARSET=utf8 COLLATE=utf8_general_ci";
$database->query($SQL);
if ($database->is_error()) {
    $error .= sprintf('[INSTALLATION kit_links] %s', $database->get_error());
}
// Prompt Errors
if (!empty($error)) {
    $admin->print_error($error);
}
 /**
  * Constructor
  *
  * @param boolean $create_tables - create table if not exists
  */
 public function __construct($create_tables = false)
 {
     $this->create_tables = $create_tables;
     // use another table prefix?
     if (file_exists(WB_PATH . '/modules/' . basename(dirname(__FILE__)) . '/config.json')) {
         $config = json_decode(file_get_contents(WB_PATH . '/modules/' . basename(dirname(__FILE__)) . '/config.json'), true);
         if (isset($config['table_prefix'])) {
             self::$table_prefix = $config['table_prefix'];
         }
     }
     parent::__construct();
     $this->setTablePrefix(self::$table_prefix);
     $this->setTableName('mod_kit_languages');
     $this->addFieldDefinition(self::FIELD_ID, "INT(11) NOT NULL AUTO_INCREMENT", true);
     $this->addFieldDefinition(self::FIELD_ISO, "VARCHAR(2) NOT NULL DEFAULT 'nn'");
     $this->addFieldDefinition(self::FIELD_LOCAL, "VARCHAR(64) NOT NULL DEFAULT '-undefined-'");
     $this->addFieldDefinition(self::FIELD_ENGLISH, "VARCHAR(64) NOT NULL DEFAULT '-undefined-'");
     $this->checkFieldDefinitions();
     // set default timezone
     date_default_timezone_set(CFG_TIME_ZONE);
     if ($this->create_tables) {
         $this->initTables();
     }
 }
Пример #3
0
    $error .= sprintf('[<p>[ALTER TABLE mod_kit_cronjob_data] %s</p>', $dbCronjobData->getError());
}
/**
 * Release 0.51
 */
// add field 'relaying' to email provider
if (!$dbKITprovider->sqlFieldExists(dbKITprovider::field_relaying)) {
    if (!$dbKITprovider->sqlAlterTableAddField(dbKITprovider::field_relaying, "TINYINT NOT NULL DEFAULT '0'", dbKITprovider::field_smtp_pass)) {
        $error .= sprintf('<p>[ALTER TABLE mod_kit_provider] %s</p>', $dbKITprovider->getError());
    }
}
/**
 * Release 0.54
 */
// new table mod_kit_languages
$dbKITlanguages = new dbKITlanguages();
if (!$dbKITlanguages->sqlTableExists()) {
    if (!$dbKITlanguages->initTables()) {
        $error .= sprintf('<p>[CREATE TABLE mod_kit_languages] %s</p>', $dbKITlanguages->getError());
    }
}
// add field 'contact_language' to contact db
if (!$dbKITcontact->sqlFieldExists(dbKITcontact::field_contact_language)) {
    if (!$dbKITcontact->sqlAlterTableAddField(dbKITcontact::field_contact_language, "VARCHAR(2) NOT NULL DEFAULT 'en'", dbKITcontact::field_contact_note)) {
        $error .= sprintf('<p>[ALTER TABLE mod_kit_contact] %s</p>', $dbKITcontact->getError());
    }
}
/**
 * Release 0.56
 */
$dbKITcfg = new dbKITcfg();
Пример #4
0
        $error .= sprintf('<p>[Delete Table] %s</p>', $dbKITnewsletterProcess->getError());
    }
}
$dbCronjobData = new dbCronjobData();
if ($dbCronjobData->sqlTableExists()) {
    if (!$dbCronjobData->sqlDeleteTable()) {
        $error .= sprintf('<p>[Delete Table] %s</p>', $dbCronjobData->getError());
    }
}
$dbCronjobNewsletterLog = new dbCronjobNewsletterLog();
if ($dbCronjobNewsletterLog->sqlTableExists()) {
    if (!$dbCronjobNewsletterLog->sqlDeleteTable()) {
        $error .= sprintf('<p>[Delete Table] %s</p>', $dbCronjobNewsletterLog->getError());
    }
}
$dbCronjobErrorLog = new dbCronjobErrorLog();
if ($dbCronjobErrorLog->sqlTableExists()) {
    if (!$dbCronjobErrorLog->sqlDeleteTable()) {
        $error .= sprintf('<p>[Delete Table] %s</p>', $dbCronjobErrorLog->getError());
    }
}
$dbKITlanguages = new dbKITlanguages();
if ($dbKITlanguages->sqlTableExists()) {
    if (!$dbKITlanguages->sqlDeleteTable()) {
        $error .= sprintf('<p>[Delete Table] %s</p>', $dbKITlanguages->getError());
    }
}
// Prompt Errors
if (!empty($error)) {
    $admin->print_error($error);
}