Overview

Packages

  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Datatype
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationMain
    • NavigationTop
  • mpAutoloaderClassMap
  • None
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • SearchSolr
    • SmartyWrapper
    • UrlShortener
    • UserForum
    • Workflow
  • PluginManager
  • Setup
    • Form
    • GUI
    • Helper
      • Environment
      • Filesystem
      • MySQL
      • PHP
    • UpgradeJob

Classes

  • cUpgradeJob_0001
  • cUpgradeJob_0002
  • cUpgradeJob_0003
  • cUpgradeJob_0004
  • cUpgradeJob_0005
  • cUpgradeJob_0006
  • cUpgradeJob_0007
  • cUpgradeJob_0008
  • cUpgradeJob_0009
  • cUpgradeJob_0010
  • cUpgradeJob_0011
  • cUpgradeJob_0012
  • cUpgradeJobAbstract
  • cUpgradeJobMain
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
 1: <?php
 2: /**
 3:  * This file contains the upgrade job 9.
 4:  *
 5:  * @package Setup
 6:  * @subpackage UpgradeJob
 7:  * @version SVN Revision $Rev:$
 8:  *
 9:  * @author Timo Trautmann
10:  * @copyright four for business AG <www.4fb.de>
11:  * @license http://www.contenido.org/license/LIZENZ.txt
12:  * @link http://www.4fb.de
13:  * @link http://www.contenido.org
14:  */
15: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
16: 
17: /**
18:  * Upgrade job 9.
19:  * Convert newsletter plugin tables
20:  *
21:  * @package Setup
22:  * @subpackage UpgradeJob
23:  */
24: class cUpgradeJob_0009 extends cUpgradeJobAbstract {
25: 
26:     private $_tableMapping = array( '%s_news' => '%s_pi_news',
27:                                    '%s_news_groupmembers' => '%s_pi_news_groupmembers',
28:                                    '%s_news_groups' => '%s_pi_news_groups',
29:                                    '%s_news_jobs' => '%s_pi_news_jobs',
30:                                    '%s_news_log' => '%s_pi_news_log',
31:                                    '%s_news_rcp' => '%s_pi_news_rcp');
32: 
33:     public function _execute() {
34:         global $cfg;
35: 
36:         if ($this->_setupType != 'upgrade') {
37:             return;
38:         }
39: 
40:         $updateDB = getSetupMySQLDBConnection(false);
41:         foreach ($this->_tableMapping as $oldName => $newName) {
42:              $this->_oDb->query('SHOW TABLES LIKE "%s"', sprintf($oldName, $cfg['sql']['sqlprefix']));
43:              $oldTable = $this->_oDb->nextRecord();
44: 
45:              $this->_oDb->query('SHOW TABLES LIKE "%s"', sprintf($newName, $cfg['sql']['sqlprefix']));
46:              $newTable = $this->_oDb->nextRecord();
47: 
48:              if ($newTable === false && $oldTable === true) {
49:                 $this->_oDb->query('RENAME TABLE ' . sprintf($oldName, $cfg['sql']['sqlprefix']) . ' TO ' . sprintf($newName, $cfg['sql']['sqlprefix']));
50: 
51:                 alterTableHandling(sprintf($newName, $cfg['sql']['sqlprefix']));
52:                 urlDecodeTable($updateDB, sprintf($newName, $cfg['sql']['sqlprefix']));
53:              }
54:         }
55:     }
56: 
57: }
58: 
59: ?>
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0