Changeset 2784464
- Timestamp:
- 09/14/2022 08:40:59 AM (3 years ago)
- Location:
- pmpr-ir
- Files:
-
- 4 edited
-
tags/1.2.1/src/Pmpr/Plugin/Pmpr/Ajax.php (modified) (1 diff)
-
tags/1.2.1/src/Pmpr/Plugin/Pmpr/Traits/CommonTrait.php (modified) (4 diffs)
-
trunk/src/Pmpr/Plugin/Pmpr/Ajax.php (modified) (1 diff)
-
trunk/src/Pmpr/Plugin/Pmpr/Traits/CommonTrait.php (modified) (4 diffs)
Legend:
- Unmodified
- Added
- Removed
-
pmpr-ir/tags/1.2.1/src/Pmpr/Plugin/Pmpr/Ajax.php
r2784023 r2784464 70 70 71 71 // try to get last updates before install 72 $this->fetchCommonComponents(true); 73 if ($components = $this->getCommonComponents()) { 72 if ($components = $this->fetchCommonComponents(true)) { 74 73 75 74 $code = null; -
pmpr-ir/tags/1.2.1/src/Pmpr/Plugin/Pmpr/Traits/CommonTrait.php
r2784023 r2784464 118 118 foreach ($requirements as $requirement) { 119 119 120 if (Manipulate::getArrayItem($requirement, 'show' , false)) {120 if (Manipulate::getArrayItem($requirement, 'show')) { 121 121 122 122 $satisfied = false; … … 139 139 public function getCommonComponents(): array 140 140 { 141 $result = []; 142 if ($commons = get_transient(self::FETCHED_COMMONS)) { 141 $result = []; 142 $commons = get_transient(self::FETCHED_COMMONS); 143 144 if (!$commons) { 145 146 $commons = $this->fetchCommonComponents(true); 147 } 148 149 if ($commons && is_array($commons)) { 143 150 144 151 foreach ($commons as $common) { … … 164 171 public function fetchCommonComponents(bool $force = false) 165 172 { 166 if ($this->isRequirementsSatisfied(true)) { 167 168 if ($force || !get_transient(self::FETCHED_COMMONS)) { 173 $items = []; 174 if ($this->isRequirementsSatisfied()) { 175 176 $items = get_transient(self::FETCHED_COMMONS); 177 if ($force || !$items) { 169 178 170 179 if (!get_transient(self::FETCH_COMMON_COMPONENTS_RUNNING)) { … … 187 196 } 188 197 } 198 199 return $items; 189 200 } 190 201 -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Ajax.php
r2784023 r2784464 70 70 71 71 // try to get last updates before install 72 $this->fetchCommonComponents(true); 73 if ($components = $this->getCommonComponents()) { 72 if ($components = $this->fetchCommonComponents(true)) { 74 73 75 74 $code = null; -
pmpr-ir/trunk/src/Pmpr/Plugin/Pmpr/Traits/CommonTrait.php
r2784023 r2784464 118 118 foreach ($requirements as $requirement) { 119 119 120 if (Manipulate::getArrayItem($requirement, 'show' , false)) {120 if (Manipulate::getArrayItem($requirement, 'show')) { 121 121 122 122 $satisfied = false; … … 139 139 public function getCommonComponents(): array 140 140 { 141 $result = []; 142 if ($commons = get_transient(self::FETCHED_COMMONS)) { 141 $result = []; 142 $commons = get_transient(self::FETCHED_COMMONS); 143 144 if (!$commons) { 145 146 $commons = $this->fetchCommonComponents(true); 147 } 148 149 if ($commons && is_array($commons)) { 143 150 144 151 foreach ($commons as $common) { … … 164 171 public function fetchCommonComponents(bool $force = false) 165 172 { 166 if ($this->isRequirementsSatisfied(true)) { 167 168 if ($force || !get_transient(self::FETCHED_COMMONS)) { 173 $items = []; 174 if ($this->isRequirementsSatisfied()) { 175 176 $items = get_transient(self::FETCHED_COMMONS); 177 if ($force || !$items) { 169 178 170 179 if (!get_transient(self::FETCH_COMMON_COMPONENTS_RUNNING)) { … … 187 196 } 188 197 } 198 199 return $items; 189 200 } 190 201
Note: See TracChangeset
for help on using the changeset viewer.