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 6.
 4:  *
 5:  * @package    Setup
 6:  * @subpackage UpgradeJob
 7:  * @version    SVN Revision $Rev:$
 8:  *
 9:  * @author     Murat Purc <murat@purc>
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: 
16: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
17: 
18: /**
19:  * Upgrade job 6.
20:  * Runs the upgrade job to move files/from old client folders to new client's data folders
21:  *
22:  * @package Setup
23:  * @subpackage UpgradeJob
24:  */
25: class cUpgradeJob_0006 extends cUpgradeJobAbstract {
26: 
27:     public $maxVersion = "4.9.0-beta1";
28: 
29:     const MODE = 0777;
30: 
31:     public function _execute() {
32: 
33:         global $cfg, $cfgClient;
34: 
35:         include_once($cfg['path']['contenido'] . 'includes/functions.file.php');
36: 
37:         if ($this->_setupType == 'upgrade') {
38: 
39:             // List of source and destination folder or files based on clients frontend dir.
40:             $clientCopyList = array(
41:                 'layouts/' => 'data/layouts/',
42:                 'logs/' => 'data/logs/',
43:                 'version/' => 'data/version/',
44:                 'data/config/config.php' => 'data/config/' . CON_ENVIRONMENT . '/config.php',
45:                 'data/config/config.local.php' => 'data/config/' . CON_ENVIRONMENT . '/config.local.php',
46:                 'data/config/config.after.php' => 'data/config/' . CON_ENVIRONMENT . '/config.after.php',
47:                 'config.php' => 'data/config/' . CON_ENVIRONMENT . '/config.php',
48:                 'config.local.php' => 'data/config/' . CON_ENVIRONMENT . '/config.local.php',
49:                 'config.after.php' => 'data/config/' . CON_ENVIRONMENT . '/config.after.php'
50:             );
51: 
52:             // Load client configuration
53:             setupInitializeCfgClient();
54: 
55:             $allClients = $this->_getAllClients();
56: 
57:             // Loop thru al clients and copy old data folder to new data folder
58:             foreach ($allClients as $idclient => $oClient) {
59:                 // check if config directory exists
60:                 $configDir = $cfgClient[$idclient]['path']['frontend'] . 'data/config/' . CON_ENVIRONMENT;
61:                 if (!is_dir($configDir)) {
62:                     @mkdir($configDir, self::MODE, true);
63:                 }
64: 
65:                 foreach ($clientCopyList as $src => $dst) {
66:                     $source = $cfgClient[$idclient]['path']['frontend'] . $src;
67:                     $destination = $cfgClient[$idclient]['path']['frontend'] . $dst;
68:                     if (is_dir($source)) {
69:                         if (!is_dir($destination)) {
70:                             @mkdir($destination, self::MODE, true);
71:                         }
72:                         if (!is_dir($destination)) {
73:                             logSetupFailure("Couldn't create client data directory $destination");
74:                             continue;
75:                         }
76: 
77:                         recursiveCopy($source, $destination, self::MODE);
78:                     } elseif (cFileHandler::exists($source) && cFileHandler::exists($destination)) {
79:                         if (cFileHandler::move($source, $destination)) {
80:                             cFileHandler::chmod($destination, self::MODE);
81:                         } else {
82:                             logSetupFailure("Couldn't copy client file $source");
83:                         }
84:                     }
85:                 }
86:             }
87:         }
88:     }
89: 
90: }
91: 
CMS CONTENIDO 4.9.0 API documentation generated by ApiGen 2.8.0