1: <?php
2: 3: 4: 5: 6: 7: 8: 9: 10: 11: 12:
13: defined('CON_FRAMEWORK') || die('Illegal call: Missing framework initialization - request aborted.');
14:
15: 16: 17: 18: 19: 20: 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:
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:
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:
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:
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:
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:
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:
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:
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:
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:
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: 114:
115: private function _copyClientConfigFiles() {
116:
117:
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: ?>