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
    • 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

  • PimPlugin
  • PimPluginArchiveExtractor
  • PimPluginCollection
  • PimPluginRelations
  • PimPluginRelationsCollection
  • PimPluginSetup
  • PimPluginSetupInstall
  • PimPluginSetupStatus
  • PimPluginSetupUninstall
  • PimPluginSetupUpdate
  • PimPluginViewNavSub
  • Overview
  • Package
  • Class
  • Tree
  • Deprecated
  • Todo
  1: <?php
  2: /**
  3:  * This file contains abstract class for installation new plugins
  4:  *
  5:  * @package Plugin
  6:  * @subpackage PluginManager
  7:  * @version SVN Revision $Rev:$
  8:  *
  9:  * @author Frederic Schneider
 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:  * Install class for new plugins, extends PimPluginSetup
 20:  *
 21:  * @package Plugin
 22:  * @subpackage PluginManager
 23:  * @author frederic.schneider
 24:  */
 25: class PimPluginSetupInstall extends PimPluginSetup {
 26: 
 27:     // Initializing variables
 28:     // Plugin specific data
 29:     // Foldername of installed plugin
 30:     private $PluginFoldername;
 31: 
 32:     // All area entries from database in an array
 33:     private $PluginInstalledAreas = array();
 34: 
 35:     // Classes
 36:     // Class variable for PimPluginCollection
 37:     protected $_PimPluginCollection;
 38: 
 39:     // Class variable for PimPluginRelationsCollection
 40:     protected $_PimPluginRelationsCollection;
 41: 
 42:     // Class variable for cApiAreaCollection;
 43:     protected $_ApiAreaCollection;
 44: 
 45:     // Class variable for cApiActionCollection
 46:     protected $_ApiActionCollection;
 47: 
 48:     // Class variable for cApiFileCollection
 49:     protected $_ApiFileCollection;
 50: 
 51:     // Class variable for cApiFrameFileCollection
 52:     protected $_ApiFrameFileCollection;
 53: 
 54:     // Class variable for cApiNavMainCollection
 55:     protected $_ApiNavMainCollection;
 56: 
 57:     // Class variable for cApiNavSubCollection
 58:     protected $_ApiNavSubCollection;
 59: 
 60:     // Class variable for cApiTypeCollection
 61:     protected $_ApiTypeCollection;
 62: 
 63:     // GET and SET methods for installation routine
 64:     /**
 65:      * Set variable for plugin foldername
 66:      *
 67:      * @param string $foldername
 68:      * @return string
 69:      */
 70:     private function _setPluginFoldername($foldername) {
 71:         return $this->PluginFoldername = cSecurity::escapeString($foldername);
 72:     }
 73: 
 74:     /**
 75:      * Initializing and set variable for PimPluginCollection class
 76:      *
 77:      * @return PimPluginCollection
 78:      */
 79:     private function _setPimPluginCollection() {
 80:         return $this->_PimPluginCollection = new PimPluginCollection();
 81:     }
 82: 
 83:     /**
 84:      * Initializing and set variable for PimPluginRelationsCollection class
 85:      *
 86:      * @return PimPluginRelationsCollection
 87:      */
 88:     private function _setPimPluginRelationsCollection() {
 89:         return $this->_PimPluginRelationsCollection = new PimPluginRelationsCollection();
 90:     }
 91: 
 92:     /**
 93:      * Initializing and set variable for cApiAreaCollection
 94:      *
 95:      * @return cApiAreaCollection
 96:      */
 97:     private function _setApiAreaCollection() {
 98:         return $this->_ApiAreaCollection = new cApiAreaCollection();
 99:     }
100: 
101:     /**
102:      * Initializing and set variable for cApiActionCollection
103:      *
104:      * @return cApiActionCollection
105:      */
106:     private function _setApiActionCollection() {
107:         return $this->_ApiActionCollection = new cApiActionCollection();
108:     }
109: 
110:     /**
111:      * Initializing and set variable for cApiAFileCollection
112:      *
113:      * @return cApiFileCollection
114:      */
115:     private function _setApiFileCollection() {
116:         return $this->_ApiFileCollection = new cApiFileCollection();
117:     }
118: 
119:     /**
120:      * Initializing and set variable for cApiFrameFileCollection
121:      *
122:      * @return cApiFrameFileCollection
123:      */
124:     private function _setApiFrameFileCollection() {
125:         return $this->_ApiFrameFileCollection = new cApiFrameFileCollection();
126:     }
127: 
128:     /**
129:      * Initializing and set variable for cApiNavMainFileCollection
130:      *
131:      * @return cApiNavMainCollection
132:      */
133:     private function _setApiNavMainCollection() {
134:         return $this->_ApiNavMainCollection = new cApiNavMainCollection();
135:     }
136: 
137:     /**
138:      * Initializing and set variable for cApiNavSubCollection
139:      *
140:      * @return cApiNavSubCollection
141:      */
142:     private function _setApiNavSubCollection() {
143:         return $this->_ApiNavSubCollection = new cApiNavSubCollection();
144:     }
145: 
146:     /**
147:      * Initializing and set variable for cApiTypeCollection
148:      *
149:      * @return cApiNavSubCollection
150:      */
151:     private function _setApiTypeCollection() {
152:         return $this->_ApiTypeCollection = new cApiTypeCollection();
153:     }
154: 
155:     /**
156:      * Get method for foldername of installed plugin
157:      *
158:      * @return string
159:      */
160:     protected function _getPluginFoldername() {
161:         return $this->PluginFoldername;
162:     }
163: 
164:     /**
165:      * Get method for installed areas
166:      *
167:      * @return multitype:
168:      */
169:     protected function _getInstalledAreas() {
170:         return $this->PluginInstalledAreas;
171:     }
172: 
173:     // Begin of installation routine
174:     /**
175:      * Construct function
176:      */
177:     public function __construct() {
178: 
179:         // Initializing and set classes
180:         // PluginManager classes
181:         $this->_setPimPluginCollection();
182:         $this->_setPimPluginRelationsCollection();
183: 
184:         // cApiClasses
185:         $this->_setApiAreaCollection();
186:         $this->_setApiActionCollection();
187:         $this->_setApiFileCollection();
188:         $this->_setApiFrameFileCollection();
189:         $this->_setApiNavMainCollection();
190:         $this->_setApiNavSubCollection();
191:         $this->_setApiTypeCollection();
192:     }
193: 
194:     /**
195:      * Installation method
196:      */
197:     public function install() {
198: 
199:         // Does this plugin already exist?
200:         $this->_installCheckUuid();
201: 
202:         // Requirement checks
203:         $this->_installCheckRequirements();
204: 
205:         // Add new plugin: *_plugins
206:         $this->_installAddPlugin();
207: 
208:         // Get all area names from database
209:         $this->_installFillAreas();
210: 
211:         // Add new CONTENIDO areas: *_area
212:         $this->_installAddAreas();
213: 
214:         // Add new CONTENIDO actions: *_actions
215:         $this->_installAddActions();
216: 
217:         // Add new CONTENIDO frames: *_frame_files and *_files
218:         $this->_installAddFrames();
219: 
220:         // Add new CONTENIDO main navigations: *_nav_main
221:         $this->_installAddNavMain();
222: 
223:         // Add new CONTENIDO sub navigations: *_nav_sub
224:         $this->_installAddNavSub();
225: 
226:         // Add specific sql queries, run only if we have no update sql file
227:         if (PimPluginSetup::_getUpdateSqlFileExist() == false) {
228:             $this->_installAddSpecificSql();
229:         }
230: 
231:         // Add new CONTENIDO content types: *_type
232:         $this->_installAddContentTypes();
233: 
234:         // Add new modules
235:         $this->_installAddModules();
236: 
237:         // Add plugin dir for uploaded plugins
238:         if (parent::getMode() == 2) {
239:             $this->_installAddDir();
240:         }
241: 
242:         // Success message for new plugins
243:         // Get only for extracted (1) and installed mode (2)
244:         if (parent::getMode() <= 2) {
245:             parent::info(i18n('The plugin has been successfully installed. To apply the changes please login into backend again.', 'pim'));
246:         }
247:     }
248: 
249:     /**
250:      * Check uuId: You can install a plugin only for one time
251:      */
252:     private function _installCheckUuid() {
253:         $this->_PimPluginCollection->setWhere('uuid', parent::$XmlGeneral->uuid);
254:         $this->_PimPluginCollection->query();
255:         if ($this->_PimPluginCollection->count() > 0) {
256:             parent::error(i18n('You can install this plugin only for one time.', 'pim'));
257:         }
258:     }
259: 
260:     /**
261:      * This function checks requirements for one plugin
262:      */
263:     private function _installCheckRequirements() {
264: 
265:         // Get config variables
266:         $cfg = cRegistry::getConfig();
267: 
268:         // Check min CONTENIDO version
269:         if (version_compare(CON_VERSION, parent::$XmlRequirements->contenido->attributes()->minversion, '<')) {
270:             parent::error(i18n('You have to install CONTENIDO <strong>', 'pim') . parent::$XmlRequirements->contenido->attributes()->minversion . i18n('</strong> or higher to install this plugin!', 'pim'));
271:         }
272: 
273:         // Check max CONTENIDO version
274:         if (parent::$XmlRequirements->contenido->attributes()->maxversion) {
275: 
276:             if (version_compare(CON_VERSION, parent::$XmlRequirements->contenido->attributes()->maxversion, '>')) {
277:                 parent::error(i18n('Your current CONTENIDO version is to new - max CONTENIDO version: ' . parent::$XmlRequirements->contenido->attributes()->maxversion . '', 'pim'));
278:             }
279:         }
280: 
281:         // Check PHP version
282:         if (version_compare(phpversion(), parent::$XmlRequirements->attributes()->php, '<')) {
283:             parent::error(i18n('You have to install PHP <strong>', 'pim') . parent::$XmlRequirements->attributes()->php . i18n('</strong> or higher to install this plugin!', 'pim'));
284:         }
285: 
286:         // Check extensions
287:         if (count(parent::$XmlRequirements->extension) != 0) {
288: 
289:             for ($i = 0; $i < count(parent::$XmlRequirements->extension); $i++) {
290: 
291:                 if (!extension_loaded(parent::$XmlRequirements->extension[$i]->attributes()->name)) {
292:                     parent::error(i18n('The plugin could not find the PHP extension <strong>', 'pim') . parent::$XmlRequirements->extension[$i]->attributes()->name . i18n('</strong>. Because this is required by the plugin, it can not be installed.', 'pim'));
293:                 }
294:             }
295:         }
296: 
297:         // Check classes
298:         if (count(parent::$XmlRequirements->class) != 0) {
299: 
300:             for ($i = 0; $i < count(parent::$XmlRequirements->class); $i++) {
301: 
302:                 if (!class_exists(parent::$XmlRequirements->class[$i]->attributes()->name)) {
303:                     parent::error(i18n('The plugin could not find the class <strong>', 'pim') . parent::$XmlRequirements->class[$i]->attributes()->name . i18n('</strong>. Because this is required by the plugin, it can not be installed.', 'pim'));
304:                 }
305:             }
306:         }
307: 
308:         // Check functions
309:         if (count(parent::$XmlRequirements->function) != 0) {
310: 
311:             for ($i = 0; $i < count(parent::$XmlRequirements->function); $i++) {
312: 
313:                 if (!function_exists(parent::$XmlRequirements->function[$i]->attributes()->name)) {
314:                     parent::error(i18n('The plugin could not find the function <strong>', 'pim') . parent::$XmlRequirements->function[$i]->attributes()->name . i18n('</strong>. Because this is required by the plugin, it can not be installed.', 'pim'));
315:                 }
316:             }
317:         }
318:     }
319: 
320:     /**
321:      * Add entries at *_plugins
322:      */
323:     private function _installAddPlugin() {
324:         // Add entry at *_plugins
325:         $pimPlugin = $this->_PimPluginCollection->create(parent::$XmlGeneral->plugin_name, parent::$XmlGeneral->description, parent::$XmlGeneral->author, parent::$XmlGeneral->copyright, parent::$XmlGeneral->mail, parent::$XmlGeneral->website, parent::$XmlGeneral->version, parent::$XmlGeneral->plugin_foldername, parent::$XmlGeneral->uuid, parent::$XmlGeneral->attributes()->active);
326: 
327:         // Get Id of new plugin
328:         $pluginId = $pimPlugin->get('idplugin');
329: 
330:         // Set pluginId
331:         parent::setPluginId($pluginId);
332: 
333:         // Set foldername of new plugin
334:         $this->_setPluginFoldername(parent::$XmlGeneral->plugin_foldername);
335:     }
336: 
337:     /**
338:      * Get all area names from database
339:      */
340:     private function _installFillAreas() {
341:         $oItem = $this->_ApiAreaCollection;
342:         $this->_ApiAreaCollection->select(NULL, NULL, 'name');
343:         while (($areas = $this->_ApiAreaCollection->next()) !== false) {
344:             $this->PluginInstalledAreas[] = $areas->get('name');
345:         }
346:     }
347: 
348:     /**
349:      * Add entries at *_area
350:      */
351:     private function _installAddAreas() {
352: 
353:         // Initializing attribute array
354:         $attributes = array();
355: 
356:         // Get Id of plugin
357:         $pluginId = parent::_getPluginId();
358: 
359:         $areaCount = count(parent::$XmlArea->area);
360:         for ($i = 0; $i < $areaCount; $i++) {
361: 
362:             $attributes = array();
363: 
364:             // Build attributes
365:             foreach (parent::$XmlArea->area[$i]->attributes() as $key => $value) {
366:                 $attributes[$key] = $value;
367:             }
368: 
369:             // Security check
370:             $area = cSecurity::escapeString(parent::$XmlArea->area[$i]);
371: 
372:             // Add attributes "parent" and "menuless" to an array
373:             $attributes = array(
374:                 'parent' => cSecurity::escapeString($attributes['parent']),
375:                 'menuless' => cSecurity::toInteger($attributes['menuless'])
376:             );
377: 
378:             // Fix for parent attribute
379:             if (empty($attributes['parent'])) {
380:                 $attributes['parent'] = 0;
381:             }
382: 
383:             // Create a new entry
384:             $item = $this->_ApiAreaCollection->create($area, $attributes['parent'], 1, 1, $attributes['menuless']);
385: 
386:             // Set a relation
387:             $this->_PimPluginRelationsCollection->create($item->get('idarea'), $pluginId, 'area');
388: 
389:             // Add new area to all area array
390:             $this->PluginInstalledAreas[] = $area;
391:         }
392:     }
393: 
394:     /**
395:      * Add entries at *_actions
396:      */
397:     private function _installAddActions() {
398: 
399:         // Initializing attribute array
400:         $attributes = array();
401: 
402:         // Get Id of plugin
403:         $pluginId = parent::_getPluginId();
404: 
405:         $actionCount = count(parent::$XmlActions->action);
406:         for ($i = 0; $i < $actionCount; $i++) {
407: 
408:             // Build attributes
409:             foreach (parent::$XmlActions->action[$i]->attributes() as $key => $value) {
410:                 $attributes[$key] = $value;
411:             }
412: 
413:             // Set relevant value if it is empty
414:             if (empty($attributes['relevant'])) {
415:                 $attributes['relevant'] = 1;
416:             }
417: 
418:             // Add attributes "area" and "relevant" to an safe array
419:             $attributes = array(
420:                 'area' => cSecurity::escapeString($attributes['area']),
421:                 'relevant' => cSecurity::toInteger($attributes['relevant'])
422:             );
423: 
424:             // Security check for action name
425:             $action = cSecurity::escapeString(parent::$XmlActions->action[$i]);
426: 
427:             // Check for valid area
428:             if (!in_array($attributes['area'], $this->_getInstalledAreas())) {
429:                 parent::error(i18n('Defined area', 'pim') . ' <strong>' . $attributes['area'] . '</strong> ' . i18n('are not found on your CONTENIDO installation. Please contact your plugin author.', 'pim'));
430:             }
431: 
432:             // Create a new entry
433:             $item = $this->_ApiActionCollection->create($attributes['area'], $action, '', '', '', $attributes['relevant']);
434: 
435:             // Set a relation
436:             $this->_PimPluginRelationsCollection->create($item->get('idaction'), $pluginId, 'action');
437:         }
438:     }
439: 
440:     /**
441:      * Add entries at *_frame_files and *_files
442:      */
443:     private function _installAddFrames() {
444: 
445:         // Initializing attribute array
446:         $attributes = array();
447: 
448:         $frameCount = count(parent::$XmlFrames->frame);
449:         for ($i = 0; $i < $frameCount; $i++) {
450: 
451:             // Build attributes with security checks
452:             foreach (parent::$XmlFrames->frame[$i]->attributes() as $sKey => $sValue) {
453:                 $attributes[$sKey] = cSecurity::escapeString($sValue);
454:             }
455: 
456:             // Check for valid area
457:             if (!in_array($attributes['area'], $this->_getInstalledAreas())) {
458:                 parent::error(i18n('Defined area', 'pim') . ' <strong>' . $attributes['area'] . '</strong> ' . i18n('are not found on your CONTENIDO installation. Please contact your plugin author.', 'pim'));
459:             }
460: 
461:             // Create a new entry at *_files
462:             $file = $this->_ApiFileCollection->create($attributes['area'], $attributes['name'], $attributes['filetype']);
463: 
464:             // Create a new entry at *_frame_files
465:             if (!empty($attributes['frameId'])) {
466:                 $this->_ApiFrameFileCollection->create($attributes['area'], $attributes['frameId'], $file->get('idfile'));
467:             }
468:         }
469:     }
470: 
471:     /**
472:      * Add entries at *_nav_main
473:      */
474:     private function _installAddNavMain() {
475: 
476:         // Get Id of plugin
477:         $pluginId = parent::_getPluginId();
478: 
479:         $navCount = count(parent::$XmlNavMain->nav);
480:         for ($i = 0; $i < $navCount; $i++) {
481:             // Security check
482:             $location = cSecurity::escapeString(parent::$XmlNavMain->nav[$i]);
483: 
484:             // Create a new entry at *_nav_main
485:             $navMain = $this->_ApiNavMainCollection->create($location);
486: 
487:             // Set a relation
488:             $this->_PimPluginRelationsCollection->create($navMain->get('idnavm'), $pluginId, 'navm');
489:         }
490:     }
491: 
492:     /**
493:      * Add entries at *_nav_sub
494:      */
495:     private function _installAddNavSub() {
496: 
497:         // Initializing attribute array
498:         $attributes = array();
499: 
500:         // Get Id of plugin
501:         $pluginId = parent::_getPluginId();
502: 
503:         $navCount = count(parent::$XmlNavSub->nav);
504:         for ($i = 0; $i < $navCount; $i++) {
505: 
506:             // Build attributes
507:             foreach (parent::$XmlNavSub->nav[$i]->attributes() as $key => $value) {
508:                 $attributes[$key] = $value;
509:             }
510: 
511:             // Convert area to string
512:             $attributes['area'] = cSecurity::toString($attributes['area']);
513: 
514:             // Check for valid area
515:             if (!in_array($attributes['area'], $this->_getInstalledAreas())) {
516:                 parent::error(i18n('Defined area', 'pim') . ' <strong>' . $attributes['area'] . '</strong> ' . i18n('are not found on your CONTENIDO installation. Please contact your plugin author.', 'pim'));
517:             }
518: 
519:             // Create a new entry at *_nav_sub
520:             $item = $this->_ApiNavSubCollection->create($attributes['navm'], $attributes['area'], $attributes['level'], parent::$XmlNavSub->nav[$i], 1);
521: 
522:             // Set a relation
523:             $this->_PimPluginRelationsCollection->create($item->get('idnavs'), $pluginId, 'navs');
524:         }
525:     }
526: 
527:     /**
528:      * Add specific sql queries
529:      */
530:     private function _installAddSpecificSql() {
531:         $cfg = cRegistry::getConfig();
532:         $db = cRegistry::getDb();
533: 
534:         if (parent::getMode() == 1) { // Plugin is already extracted
535:             $tempSqlFilename = $cfg['path']['contenido'] . $cfg['path']['plugins'] . $this->_getPluginFoldername() . DIRECTORY_SEPARATOR . 'plugin_install.sql';
536:         } elseif (parent::getMode() == 2 || parent::getMode() == 4) { // Plugin
537:                                                                       // is
538:                                                                       // uploaded
539:                                                                       // or /
540:                                                                       // and
541:                                                                       // update
542:                                                                       // mode
543:             $tempSqlFilename = parent::$_PimPluginArchiveExtractor->extractArchiveFileToVariable('plugin_install.sql', 0);
544:         }
545: 
546:         if (!cFileHandler::exists($tempSqlFilename)) {
547:             return;
548:         }
549: 
550:         $tempSqlContent = cFileHandler::read($tempSqlFilename);
551:         $tempSqlContent = str_replace("\r\n", "\n", $tempSqlContent);
552:         $tempSqlContent = explode("\n", $tempSqlContent);
553:         $tempSqlLines = count($tempSqlContent);
554: 
555:         $pattern = '/^(CREATE TABLE IF NOT EXISTS|INSERT INTO|UPDATE|ALTER TABLE) `?' . parent::SQL_PREFIX . '`?\b/';
556: 
557:         for ($i = 0; $i < $tempSqlLines; $i++) {
558:             if (preg_match($pattern, $tempSqlContent[$i])) {
559:                 $tempSqlContent[$i] = str_replace(parent::SQL_PREFIX, $cfg['sql']['sqlprefix'] . '_pi', $tempSqlContent[$i]);
560:                 $db->query($tempSqlContent[$i]);
561:             }
562:         }
563:     }
564: 
565:     /**
566:      * Add content types (*_type)
567:      */
568:     private function _installAddContentTypes() {
569: 
570:         // Get Id of plugin
571:         $pluginId = parent::_getPluginId();
572: 
573:         $pattern = '/^CMS_.+/';
574: 
575:         $typeCount = count(parent::$XmlContentType->type);
576:         for ($i = 0; $i < $typeCount; $i++) {
577: 
578:             $type = cSecurity::toString(parent::$XmlContentType->type[$i]);
579: 
580:             if (preg_match($pattern, $type)) {
581: 
582:                 // Create new content type
583:                 $item = $this->_ApiTypeCollection->create($type, '');
584: 
585:                 // Set a relation
586:                 $this->_PimPluginRelationsCollection->create($item->get('idtype'), $pluginId, 'ctype');
587:             }
588:         }
589:     }
590: 
591:     /**
592:      * Add modules
593:      */
594:     private function _installAddModules() {
595:         $cfg = cRegistry::getConfig();
596:         $module = new cApiModule();
597: 
598:         // Set path to modules path
599:         $modulesPath = $cfg['path']['contenido'] . $cfg['path']['plugins'] . $this->_getPluginFoldername() . DIRECTORY_SEPARATOR . "modules" . DIRECTORY_SEPARATOR;
600: 
601:         if (!is_dir($modulesPath)) {
602:             return false;
603:         }
604: 
605:         foreach (new DirectoryIterator($modulesPath) as $modulesFiles) {
606: 
607:             if (substr($modulesFiles->getBasename(), -4) == ".zip") {
608: 
609:                 // Import founded module
610:                 $module->import($modulesFiles->getBasename(), $modulesFiles->getBasename(), false);
611:             }
612:         }
613: 
614:         cDirHandler::recursiveRmdir($modulesPath);
615:     }
616: 
617:     /**
618:      * Add plugin dir
619:      */
620:     private function _installAddDir() {
621:         $cfg = cRegistry::getConfig();
622: 
623:         // Build the new plugin dir
624:         $tempPluginDir = $cfg['path']['contenido'] . $cfg['path']['plugins'] . parent::$XmlGeneral->plugin_foldername . DIRECTORY_SEPARATOR;
625: 
626:         // Set destination path
627:         try {
628:             parent::$_PimPluginArchiveExtractor->setDestinationPath($tempPluginDir);
629:         } catch (cException $e) {
630:             parent::$_PimPluginArchiveExtractor->destroyTempFiles();
631:         }
632: 
633:         // Extract Zip archive files into the new plugin dir
634:         try {
635:             parent::$_PimPluginArchiveExtractor->extractArchive();
636:         } catch (cException $e) {
637:             parent::$_PimPluginArchiveExtractor->destroyTempFiles();
638:         }
639:     }
640: 
641: }
642: ?>
CMS CONTENIDO 4.9.3 API documentation generated by ApiGen 2.8.0