Overview

Packages

  • CONTENIDO
  • Core
    • Authentication
    • Backend
    • Cache
    • CEC
    • Chain
    • ContentType
    • Database
    • Debug
    • Exception
    • Frontend
      • Search
      • URI
      • Util
    • GenericDB
      • Model
    • GUI
      • HTML
    • I18N
    • LayoutHandler
    • Log
    • Security
    • Session
    • Util
    • Validation
    • Versioning
    • XML
  • Module
    • ContentSitemapHtml
    • ContentSitemapXml
    • ContentUserForum
    • NavigationTop
    • ScriptCookieDirective
  • mpAutoloaderClassMap
  • None
  • PHP
  • Plugin
    • ContentAllocation
    • CronjobOverview
    • FormAssistant
    • FrontendLogic
    • FrontendUsers
    • Linkchecker
    • ModRewrite
    • Newsletter
    • Repository
      • FrontendNavigation
      • KeywordDensity
    • 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
  • cUpgradeJob_0013
  • cUpgradeJob_0014
  • cUpgradeJob_0015
  • cUpgradeJob_0016
  • cUpgradeJob_0017
  • cUpgradeJob_0018
  • 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:  * @author     Mischa Holz
  8:  * @copyright  four for business AG <www.4fb.de>
  9:  * @license    http://www.contenido.org/license/LIZENZ.txt
 10:  * @link       http://www.4fb.de
 11:  * @link       http://www.contenido.org
 12:  */
 13: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
 14: 
 15: /**
 16:  * Upgrade job 9.
 17:  * Copy the example client to cms folder if needed
 18:  *
 19:  * @package    Setup
 20:  * @subpackage UpgradeJob
 21:  */
 22: class cUpgradeJob_0009 extends cUpgradeJobAbstract {
 23:     public $maxVersion = "4.9.0";
 24: 
 25:     public function _execute() {
 26: 
 27:         if ($this->_setupType !== 'setup') {
 28:             return;
 29:         }
 30: 
 31:         switch ($_SESSION["clientmode"]) {
 32:             case "NOCLIENT":
 33:                 break;
 34:             case "CLIENTEXAMPLES":
 35:                 // copy the styles folder to the cms folder for the example client
 36:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "css")) {
 37:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "css");
 38:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "css");
 39:                 }
 40:                 cDirHandler::recursiveCopy("data/examples/css", $this->_aCfgClient[1]["path"]["frontend"] . "css");
 41: 
 42:                 // copy the images folder to the cms folder for the example client
 43:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "images")) {
 44:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "images");
 45:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "images");
 46:                 }
 47:                 cDirHandler::recursiveCopy("data/examples/images", $this->_aCfgClient[1]["path"]["frontend"] . "images");
 48: 
 49:                 // copy the includes folder to the cms folder for the example client
 50:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "includes")) {
 51:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "includes");
 52:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "includes");
 53:                 }
 54:                 cDirHandler::recursiveCopy("data/examples/includes", $this->_aCfgClient[1]["path"]["frontend"] . "includes");
 55: 
 56:                 // copy the scripts folder to the cms folder for the example client
 57:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "js")) {
 58:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "js");
 59:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "js");
 60:                 }
 61:                 cDirHandler::recursiveCopy("data/examples/js", $this->_aCfgClient[1]["path"]["frontend"] . "js");
 62: 
 63:                 // copy the template folder to the cms folder for the example client
 64:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "templates")) {
 65:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "templates");
 66:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "templates");
 67:                 }
 68:                 cDirHandler::recursiveCopy("data/examples/templates", $this->_aCfgClient[1]["path"]["frontend"] . "templates");
 69: 
 70:                 // copy the upload folder to the cms folder for the example client
 71:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "upload")) {
 72:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "upload");
 73:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "upload");
 74:                 }
 75:                 cDirHandler::recursiveCopy("data/examples/upload", $this->_aCfgClient[1]["path"]["frontend"] . "upload");
 76: 
 77:                 // copy the layout folder to the cms folder for the example client
 78:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "data/layouts")) {
 79:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "data/layouts");
 80:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "data/layouts");
 81:                 }
 82:                 cDirHandler::recursiveCopy("data/examples/data/layouts", $this->_aCfgClient[1]["path"]["frontend"] . "data/layouts");
 83: 
 84:                 // copy the module folder to the cms folder for the example client
 85:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "data/modules")) {
 86:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "data/modules");
 87:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "data/modules");
 88:                 }
 89:                 cDirHandler::recursiveCopy("data/examples/data/modules", $this->_aCfgClient[1]["path"]["frontend"] . "data/modules");
 90: 
 91:                 $this->_copyClientConfigFiles();
 92:                 break;
 93:             case "CLIENTMODULES":
 94:                 // copy the module folder to the cms folder for the example client
 95:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "data/modules")) {
 96:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "data/modules");
 97:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "data/modules");
 98:                 }
 99:                 cDirHandler::recursiveCopy("data/examples/data/modules", $this->_aCfgClient[1]["path"]["frontend"] . "data/modules");
100: 
101:                 // copy the template folder to the cms folder for the example client
102:                 if (cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . "templates")) {
103:                     cDirHandler::recursiveRmdir($this->_aCfgClient[1]["path"]["frontend"] . "templates");
104:                     cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "templates");
105:                 }
106:                 cDirHandler::recursiveCopy("data/examples/templates", $this->_aCfgClient[1]["path"]["frontend"] . "templates");
107:                 $this->_copyClientConfigFiles();
108:                 break;
109:         }
110:     }
111: 
112:     /**
113:      * @throws cInvalidArgumentException
114:      */
115:     private function _copyClientConfigFiles() {
116: 
117:         // copy concache.php
118:         if (!is_dir($this->_aCfgClient[1]["path"]["frontend"] . "data")) {
119:             cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "data");
120:         }
121:         if (!is_dir($this->_aCfgClient[1]["path"]["frontend"] . "data/config")) {
122:             cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "data/config");
123:         }
124:         if (!is_dir($this->_aCfgClient[1]["path"]["frontend"] . "data/config/" . CON_ENVIRONMENT)) {
125:             cDirHandler::create($this->_aCfgClient[1]["path"]["frontend"] . "data/config/" . CON_ENVIRONMENT);
126:         }
127:         copy("data/examples/concache.php", $this->_aCfgClient[1]["path"]["frontend"] . "data/config/" . CON_ENVIRONMENT . "/concache.php");
128: 
129:         if (CON_ENVIRONMENT !== 'production' && !cFileHandler::exists($this->_aCfgClient[1]["path"]["frontend"] . 'data/config/' . CON_ENVIRONMENT . '/config.php')) {
130:             cFileHandler::copy($this->_aCfgClient[1]["path"]["frontend"] . 'data/config/production/config.php', $this->_aCfgClient[1]["path"]["frontend"] . 'data/config/' . CON_ENVIRONMENT . '/config.php');
131:         }
132:     }
133: }
134: 
135: ?>
CMS CONTENIDO 4.10.0 API documentation generated by ApiGen 2.8.0