"Fossies" - the Fresh Open Source Software Archive  

Source code changes of the file "tine20/Setup/Controller.php" between
tine20-2020.08.3.tar.gz and tine20-2020.08.4.tar.gz

About: Tine 2.0 is a platform independent business software system which combines groupware and customer relationship management (CRM). Commercial support is available. Source code.

Controller.php  (tine20-2020.08.3):Controller.php  (tine20-2020.08.4)
skipping to change at line 440 skipping to change at line 440
return $applications; return $applications;
} }
protected function _getUpdatesByPrio(&$applicationCount) protected function _getUpdatesByPrio(&$applicationCount)
{ {
$applicationController = Tinebase_Application::getInstance(); $applicationController = Tinebase_Application::getInstance();
$updatesByPrio = []; $updatesByPrio = [];
$maxMajorV = Tinebase_Config::TINEBASE_VERSION; $maxMajorV = Tinebase_Config::TINEBASE_VERSION;
if (Setup_Core::isLogLevel(Zend_Log::DEBUG)) Setup_Core::getLogger()->de
bug(__METHOD__ . '::' . __LINE__
. ' Checking for updates up to major version: ' . $maxMajorV);
/** @var Tinebase_Model_Application $application */ /** @var Tinebase_Model_Application $application */
foreach ($applicationController->getApplications() as $application) { foreach ($applicationController->getApplications() as $application) {
if ($application->status !== Tinebase_Application::ENABLED) {
continue;
}
$stateUpdates = json_decode($applicationController->getApplicationSt ate($application, $stateUpdates = json_decode($applicationController->getApplicationSt ate($application,
Tinebase_Application::STATE_UPDATES, true), true); Tinebase_Application::STATE_UPDATES, true), true);
for ($majorV = 0; $majorV <= $maxMajorV; ++$majorV) { for ($majorV = 0; $majorV <= $maxMajorV; ++$majorV) {
/** @var Setup_Update_Abstract $class */ /** @var Setup_Update_Abstract $class */
$class = $application->name . '_Setup_Update_' . $majorV; $class = $application->name . '_Setup_Update_' . $majorV;
if (class_exists($class)) { if (class_exists($class)) {
$updates = $class::getAllUpdates(); $updates = $class::getAllUpdates();
$allUpdates = []; $allUpdates = [];
skipping to change at line 479 skipping to change at line 479
foreach ($allUpdates as $update) { foreach ($allUpdates as $update) {
if (!isset($updatesByPrio[$update['prio']])) { if (!isset($updatesByPrio[$update['prio']])) {
$updatesByPrio[$update['prio']] = []; $updatesByPrio[$update['prio']] = [];
} }
$updatesByPrio[$update['prio']][] = $update; $updatesByPrio[$update['prio']][] = $update;
} }
} }
} }
} }
if (Setup_Core::isLogLevel(Zend_Log::DEBUG)) Setup_Core::getLogger()->de
bug(__METHOD__ . '::' . __LINE__
. ' Got updates: ' . print_r($updatesByPrio, true));
return $updatesByPrio; return $updatesByPrio;
} }
protected function preUpdateHooks() protected function preUpdateHooks()
{ {
// put any db struct updates here that need to be executed before the up date stuff runs ... like changes to // put any db struct updates here that need to be executed before the up date stuff runs ... like changes to
// user / group table (as the setup user might get created!) // user / group table (as the setup user might get created!)
// application / application_state tables // application / application_state tables
// NOTE: this function, this code here will be executed every time someb ody does update // NOTE: this function, this code here will be executed every time someb ody does update
skipping to change at line 529 skipping to change at line 532
$updatesByPrio = $this->_getUpdatesByPrio($result['updated']); $updatesByPrio = $this->_getUpdatesByPrio($result['updated']);
if (!isset($updatesByPrio[Setup_Update_Abstract::PRIO_TINEBASE_AFTER _STRUCTURE])) { if (!isset($updatesByPrio[Setup_Update_Abstract::PRIO_TINEBASE_AFTER _STRUCTURE])) {
$updatesByPrio[Setup_Update_Abstract::PRIO_TINEBASE_AFTER_STRUCT URE] = []; $updatesByPrio[Setup_Update_Abstract::PRIO_TINEBASE_AFTER_STRUCT URE] = [];
} }
array_unshift($updatesByPrio[Setup_Update_Abstract::PRIO_TINEBASE_AF TER_STRUCTURE], [ array_unshift($updatesByPrio[Setup_Update_Abstract::PRIO_TINEBASE_AF TER_STRUCTURE], [
Setup_Update_Abstract::CLASS_CONST => self::class, Setup_Update_Abstract::CLASS_CONST => self::class,
Setup_Update_Abstract::FUNCTION_CONST => 'updateAllImportExpor tDefinitions', Setup_Update_Abstract::FUNCTION_CONST => 'updateAllImportExpor tDefinitions',
]); ]);
ksort($updatesByPrio); ksort($updatesByPrio, SORT_NUMERIC);
$db = Setup_Core::getDb(); $db = Setup_Core::getDb();
$classes = [self::class => $this]; $classes = [self::class => $this];
try { try {
$this->_prepareUpdate(Setup_Update_Abstract::getSetupFromConfigO rCreateOnTheFly()); $this->_prepareUpdate(Setup_Update_Abstract::getSetupFromConfigO rCreateOnTheFly());
foreach ($updatesByPrio as $prio => $updates) { foreach ($updatesByPrio as $prio => $updates) {
foreach ($updates as $update) { foreach ($updates as $update) {
$className = $update[Setup_Update_Abstract::CLASS_CONST] ; $className = $update[Setup_Update_Abstract::CLASS_CONST] ;
$functionName = $update[Setup_Update_Abstract::FUNCTION_ CONST]; $functionName = $update[Setup_Update_Abstract::FUNCTION_ CONST];
 End of changes. 4 change blocks. 
4 lines changed or deleted 9 lines changed or added

Home  |  About  |  Features  |  All  |  Newest  |  Dox  |  Diffs  |  RSS Feeds  |  Screenshots  |  Comments  |  Imprint  |  Privacy  |  HTTP(S)