Changeset View
Changeset View
Standalone View
Standalone View
branches/5.3.x/core/kernel/utility/unit_config_cloner.php
Show First 20 Lines • Show All 60 Lines • ▼ Show 20 Line(s) | |||||
return array( | return array( | ||||
'ConfigCloner.clones' => $this->clones, | 'ConfigCloner.clones' => $this->clones, | ||||
); | ); | ||||
} | } | ||||
/** | /** | ||||
* Creates unit configs, based on 'Clones' option. | * Creates unit configs, based on 'Clones' option. | ||||
* | * | ||||
* @param string $prefix Unit config prefix. | * @param string $prefix Unit config prefix. | ||||
* @param boolean $with_cached Process also cached clones. | |||||
* | * | ||||
* @return array | * @return array | ||||
*/ | */ | ||||
public function extrude($prefix) | public function extrude($prefix, $with_cached = true) | ||||
{ | { | ||||
$main_config = $this->reader->getUnitConfig($prefix); | $main_config = $this->reader->getUnitConfig($prefix); | ||||
$sub_configs = $main_config->getSetting('Clones', array()); | $sub_configs = $main_config->getSetting('Clones', array()); | ||||
if ( isset($this->clones[$prefix]) ) { | if ( $with_cached && isset($this->clones[$prefix]) ) { | ||||
$sub_configs = array_merge($sub_configs, $this->clones[$prefix]); | $sub_configs = array_merge($sub_configs, $this->clones[$prefix]); | ||||
} | } | ||||
if ( !$sub_configs ) { | if ( !$sub_configs ) { | ||||
return array(); | return array(); | ||||
} | } | ||||
$processed = array(); | $processed = array(); | ||||
▲ Show 20 Lines • Show All 86 Lines • Show Last 20 Lines |