PluginProbe
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager / 1.2
FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager v1.2
10.56 1.2.1 10 10.1 10.2 10.3 10.31 10.32 10.33 10.34 10.50 10.51 10.52 10.53 10.55 9.0 9.0.1 9.4 trunk 1.0.0 1.1 1.2
easy-code-manager / controllers / auto-upgrade.php

auto-upgrade.php in FluentSnippets – High-Performance Code Snippets, Header & Footer Code, Custom CSS & PHP Code Manager 1.2, at controllers/auto-upgrade.php

62 lines 1.7 KB
No matching file
Up and down to move Enter to open Esc to close
Raw Download Zip
1 <?php
2 /**
3 *
4 */
5
6 // Disallow direct access.
7 defined('ABSPATH') or die("Access denied");
8
9 /**
10 *
11 */
12 class CJTAutoUpgradeController extends CJTController
13 {
14
15 /**
16 * put your comment there...
17 *
18 * @var mixed
19 */
20 protected $controllerInfo = array('model' => 'setup');
21
22 /**
23 * put your comment there...
24 *
25 */
26 protected function enableAction()
27 {
28
29 $model = $this->model;
30 $cjtWebServer = cssJSToolbox::getCJTWebSiteURL();
31 $extensions =& CJTPlugin::getInstance()->extensions();
32
33 // Get all CJT-Plugins (Include CJT Plugin itself + all its extensions) that has activate
34 // license key!
35 $activeLicenses = $model->getStatedLicenses();
36
37 // Activate Automatic upgrade for all activated licenses/components!
38 foreach ($activeLicenses as $name => $state)
39 {
40 // Get extension def doc.
41 // Act only if extension has XMl DOC! This might happened i fthe extension
42 // removed while its key still in the database
43 if ($extDef = $extensions->getDefDoc(dirname($state['component']['pluginBase'])))
44 {
45 // Check CJT Server only if updateSrc points to Wordpress Repository
46 $updateSrcServer = (string) $extDef->license->attributes()->updateSrc;
47
48 if (!$updateSrcServer || ($updateSrcServer == 'CJT'))
49 {
50 // Initializingn vars for a single state/component!
51 $pluginFile = ABSPATH . PLUGINDIR . DIRECTORY_SEPARATOR . $state['component']['pluginBase'];
52 $license =& $state['license'];
53
54 // Set CJT Store Automatic Updater!
55 CJTExtensionAutoUpgrade::upgrade($name, $license['key'], $state['attrs'], $pluginFile);
56
57 }
58 }
59 }
60 }
61 } // End class.
62