Skip to content

Commit

Permalink
Release 2.0.32
Browse files Browse the repository at this point in the history
added compatibility handling for massmail
Setup now drop all tables first
  • Loading branch information
hertsch committed Nov 2, 2013
1 parent 9da373f commit 8bf8b00
Show file tree
Hide file tree
Showing 13 changed files with 197 additions and 11 deletions.
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.31
2.0.32
2 changes: 1 addition & 1 deletion info.php
Original file line number Diff line number Diff line change
Expand Up @@ -23,7 +23,7 @@
$module_directory = 'sync_data';
$module_name = 'SyncData';
$module_function = 'tool';
$module_version = '2.0.31';
$module_version = '2.0.32';
$module_status = 'Stable';
$module_platform = '2.8';
$module_author = 'Team phpManufaktur <[email protected]>';
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/BackupFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a new record into the table
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/BackupMaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a table to the backup master
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/BackupTables.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a new record into the table
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -209,6 +209,9 @@ protected function getConfigurationFromCMS()
),
'pages' => array(
'enabled' => false
),
'mod_massmail' => array(
'enabled' => true
)
)
),
Expand Down
2 changes: 1 addition & 1 deletion vendor/phpManufaktur/SyncData/Data/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -351,7 +351,7 @@ public function insert($table, $data, $replace_cms_url=true)
$table_name = substr($table, strlen(CMS_TABLE_PREFIX));

if (isset($this->app['config']['restore']['tables']['utf-8']['compatibility']['table'][$table_name]) &&
($this->app['config']['restore']['tables']['utf-8']['compatibility'][$table_name]['enabled'])) {
($this->app['config']['restore']['tables']['utf-8']['compatibility']['table'][$table_name]['enabled'])) {
// force the compatibility mode for this table
return $this->compatibilityInsert($table, $data, $replace_cms_url);
}
Expand Down
15 changes: 15 additions & 0 deletions vendor/phpManufaktur/SyncData/Data/Setup/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,27 +54,42 @@ public function exec()
try {
// Backup Master table
$BackupMaster = new BackupMaster($this->app);
$BackupMaster->dropTable();
$BackupMaster->createTable();

// Backup Tables
$BackupTables = new BackupTables($this->app);
$BackupTables->dropTable();
$BackupTables->createTable();

// Synchronize Tables
$SynchronizeTables = new SynchronizeTables($this->app);
$SynchronizeTables->dropTable();
$SynchronizeTables->createTable();

// Backup files
$BackupFiles = new BackupFiles($this->app);
$BackupFiles->dropTable();
$BackupFiles->createTable();

// Synchronize Master
$SynchronizeMaster = new SynchronizeMaster($this->app);
$SynchronizeMaster->dropTable();
$SynchronizeMaster->createTable();

// Synchronize Files
$SynchronizeFiles = new SynchronizeFiles($this->app);
$SynchronizeFiles->dropTable();
$SynchronizeFiles->createTable();

// Synchronize Archives
$SynchronizeArchives = new SynchronizeArchives($this->app);
$SynchronizeArchives->dropTable();
$SynchronizeArchives->createTable();

// Synchronize Client
$SynchronizeClient = new SynchronizeClient($this->app);
$SynchronizeClient->dropTable();
$SynchronizeClient->createTable();

$this->app['monolog']->addInfo('Setup is complete',
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/SynchronizeArchives.php
Original file line number Diff line number Diff line change
Expand Up @@ -69,7 +69,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a new record into the table
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/SynchronizeClient.php
Original file line number Diff line number Diff line change
Expand Up @@ -71,7 +71,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a new record into the table
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/SynchronizeFiles.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a new record into the table
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/SynchronizeMaster.php
Original file line number Diff line number Diff line change
Expand Up @@ -70,7 +70,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a new record into the table
Expand Down
23 changes: 22 additions & 1 deletion vendor/phpManufaktur/SyncData/Data/SynchronizeTables.php
Original file line number Diff line number Diff line change
Expand Up @@ -72,7 +72,28 @@ public function createTable ()
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
}
} // createTable()
}

/**
* Delete table - switching check for foreign keys off before executing
*
* @throws \Exception
*/
public function dropTable()
{
try {
$table = self::$table_name;
$SQL = <<<EOD
SET foreign_key_checks = 0;
DROP TABLE IF EXISTS `$table`;
SET foreign_key_checks = 1;
EOD;
$this->app['db']->query($SQL);
$this->app['monolog']->addInfo("Drop table ".self::$table_name, array(__METHOD__, __LINE__));
} catch (\Doctrine\DBAL\DBALException $e) {
throw new \Exception($e);
}
}

/**
* Insert a new record into the table
Expand Down

0 comments on commit 8bf8b00

Please sign in to comment.