Skip to content

Commit

Permalink
Release 2.0.33
Browse files Browse the repository at this point in the history
removed UTF-8 force settings (wrong way)
added Uninstall routine for the SyncData tables
  • Loading branch information
hertsch committed Nov 6, 2013
1 parent 8bf8b00 commit b2a11e4
Show file tree
Hide file tree
Showing 7 changed files with 104 additions and 62 deletions.
5 changes: 5 additions & 0 deletions CHANGELOG.md
Original file line number Diff line number Diff line change
Expand Up @@ -3,6 +3,11 @@
(c) 2011, 2013 phpManufaktur by Ralf Hertsch<br/>
MIT License (MIT) - <http://www.opensource.org/licenses/MIT>

**2.0.32** - 2013-11-06

* removed UTF-8 force settings (wrong way)
* added Uninstall routine for the SyncData tables

**2.0.31** - 2013-11-01

* added UTF-8 compatibility and force settings to the `syncdata.json`
Expand Down
2 changes: 1 addition & 1 deletion VERSION
Original file line number Diff line number Diff line change
@@ -1 +1 @@
2.0.32
2.0.33
3 changes: 3 additions & 0 deletions bootstrap.php
Original file line number Diff line number Diff line change
Expand Up @@ -27,6 +27,7 @@
use phpManufaktur\ConfirmationLog\Data\Setup\SetupTool;
use phpManufaktur\ConfirmationLog\Data\Import\ImportOldLog;
use phpManufaktur\SyncData\Control\Confirmations;
use phpManufaktur\SyncData\Data\Setup\Uninstall;

// set the error handling
ini_set('display_errors', 1);
Expand Down Expand Up @@ -119,6 +120,8 @@
}
$ConfirmationUninstall = new confirmationUninstall();
$app_result = $ConfirmationUninstall->exec($app);
$Uninstall = new Uninstall($app);
$app_result = $Uninstall->exec();
break;
case '/import_log':
if (!$CheckKey->check()) {
Expand Down
34 changes: 0 additions & 34 deletions vendor/phpManufaktur/SyncData/Data/Configuration/Configuration.php
Original file line number Diff line number Diff line change
Expand Up @@ -214,40 +214,6 @@ protected function getConfigurationFromCMS()
'enabled' => true
)
)
),
'force' => array(
'table' => array(
'mod_wysiwyg' => array(
'enabled' => true,
'field' => array(
'content'
)
),
'mod_news_posts' => array(
'enabled' => true,
'field' => array(
'content_short',
'content_long',
'title'
)
),
'pages' => array(
'enabled' => true,
'field' => array(
'page_title',
'menu_title',
'description',
'keywords'
)
),
'mod_droplets' => array(
'enabled' => true,
'field' => array(
'code',
'description'
)
)
)
)
)
)
Expand Down
20 changes: 1 addition & 19 deletions vendor/phpManufaktur/SyncData/Data/General.php
Original file line number Diff line number Diff line change
Expand Up @@ -359,28 +359,10 @@ public function insert($table, $data, $replace_cms_url=true)
// replace the shematic URL
$content = array();
foreach ($data as $key => $value) {
$value = is_string($value) ? str_replace('{{ SyncData:CMS_URL }}', CMS_URL, $value) : $value;
$content[$key] = $value;
}
$data = $content;
}

if (isset($this->app['config']['restore']['tables']['utf-8']['force']['table'][$table_name])) {
$content = array();
foreach ($data as $key => $value) {
if ($this->app['config']['restore']['tables']['utf-8']['force']['table'][$table_name]['enabled'] &&
(in_array($key, $this->app['config']['restore']['tables']['utf-8']['force']['table'][$table_name]['field']))) {
// force utf-8 encoding
$content[$key] = utf8_encode($value);
$this->app['monolog']->addDebug("Forced UTF-8 for $table => $key");
}
else {
$content[$key] = $value;
}
$content[$key] = is_string($value) ? str_replace('{{ SyncData:CMS_URL }}', CMS_URL, $value) : $value;
}
$data = $content;
}

$this->app['db']->insert($table, $data);
} catch (\Doctrine\DBAL\DBALException $e) {
throw $e;
Expand Down
8 changes: 0 additions & 8 deletions vendor/phpManufaktur/SyncData/Data/Setup/Setup.php
Original file line number Diff line number Diff line change
Expand Up @@ -54,42 +54,34 @@ 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
94 changes: 94 additions & 0 deletions vendor/phpManufaktur/SyncData/Data/Setup/Uninstall.php
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
<?php

/**
* SyncData
*
* @author Team phpManufaktur <[email protected]>
* @link https://addons.phpmanufaktur.de/SyncData
* @copyright 2013 Ralf Hertsch <[email protected]>
* @license MIT License (MIT) http://www.opensource.org/licenses/MIT
*/

namespace phpManufaktur\SyncData\Data\Setup;

use phpManufaktur\SyncData\Control\Application;
use phpManufaktur\SyncData\Data\BackupMaster;
use phpManufaktur\SyncData\Data\BackupTables;
use phpManufaktur\SyncData\Data\SynchronizeTables;
use phpManufaktur\SyncData\Data\BackupFiles;
use phpManufaktur\SyncData\Data\SynchronizeMaster;
use phpManufaktur\SyncData\Data\SynchronizeFiles;
use phpManufaktur\SyncData\Data\SynchronizeArchives;
use phpManufaktur\SyncData\Data\SynchronizeClient;

/**
* Setup routines for SyncData
*
* @author [email protected]
*
*/
class Uninstall
{

protected $app = null;

/**
* Constructor
*
* @param Application $app
*/
public function __construct(Application $app)
{
$this->app = $app;
}

/**
* Action handler for the uninstall routines
*
* @throws Exception
* @return string
*/
public function exec()
{
// delete the tables
try {
// Backup Master table
$BackupMaster = new BackupMaster($this->app);
$BackupMaster->dropTable();

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

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

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

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

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

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

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

$this->app['monolog']->addInfo('All tables removed',
array('method' => __METHOD__, 'line' => __LINE__));
return 'All tables removed';
} catch (\Exception $e) {
throw new \Exception($e);
}
}
}

0 comments on commit b2a11e4

Please sign in to comment.