public function onApplyUpdates()
    {
        try {
            /*
             * Process core
             */
            $coreHash = post('hash');
            $coreBuild = post('build');
            $core = [$coreHash, $coreBuild];

            /*
             * Process plugins
             */
            $plugins = post('plugins');
            if (is_array($plugins)) {
                $pluginCodes = [];
                foreach ($plugins as $code => $hash) {
                    $pluginCodes[] = $this->decodeCode($code);
                }

                $plugins = array_combine($pluginCodes, $plugins);
            }
            else {
                $plugins = [];
            }

            /*
             * Process themes
             */
            $themes = post('themes');
            if (is_array($themes)) {
                $themeCodes = [];
                foreach ($themes as $code => $hash) {
                    $themeCodes[] = $this->decodeCode($code);
                }

                $themes = array_combine($themeCodes, $themes);
            }
            else {
                $themes = [];
            }

            /*
             * Process important update actions
             */
            $pluginActions = (array) post('plugin_actions');
            foreach ($plugins as $code => $hash) {
                $_code = $this->encodeCode($code);

                if (!array_key_exists($_code, $pluginActions)) {
                    continue;
                }

                $pluginAction = $pluginActions[$_code];

                if (!$pluginAction) {
                    throw new ApplicationException('Please select an action for plugin '. $code);
                }

                if ($pluginAction != 'confirm') {
                    unset($plugins[$code]);
                }

                if ($pluginAction == 'ignore') {
                    PluginVersion::whereCode($code)->update([
                        'is_frozen' => true
                    ]);
                }
            }

            /*
             * Update steps
             */
            $updateSteps = $this->buildUpdateSteps($core, $plugins, $themes, false);

            /*
             * Finish up
             */
            $updateSteps[] = [
                'code' => 'completeUpdate',
                'label' => Lang::get('system::lang.updates.update_completing'),
            ];

            $this->vars['updateSteps'] = $updateSteps;
        }
        catch (Exception $ex) {
            $this->handleError($ex);
        }

        return $this->makePartial('execute');
    }
public function onApplyUpdates()
    {
        try {
            /*
             * Process core
             */
            $coreHash = post('hash');
            $coreBuild = post('build');
            $core = [$coreHash, $coreBuild];

            /*
             * Process plugins
             */
            $plugins = post('plugins');
            if (is_array($plugins)) {
                $pluginCodes = [];
                foreach ($plugins as $code => $hash) {
                    $pluginCodes[] = $this->decodeCode($code);
                }

                $plugins = array_combine($pluginCodes, $plugins);
            }
            else {
                $plugins = [];
            }

            /*
             * Process themes
             */
            $themes = post('themes');
            if (is_array($themes)) {
                $themeCodes = [];
                foreach ($themes as $code => $hash) {
                    $themeCodes[] = $this->decodeCode($code);
                }

                $themes = array_combine($themeCodes, $themes);
            }
            else {
                $themes = [];
            }

            /*
             * Process important update actions
             */
            $pluginActions = (array) post('plugin_actions');
            foreach ($plugins as $code => $hash) {
                $_code = $this->encodeCode($code);

                if (!array_key_exists($_code, $pluginActions)) {
                    continue;
                }

                $pluginAction = $pluginActions[$_code];

                if (!$pluginAction) {
                    throw new ApplicationException('Please select an action for plugin '. $code);
                }

                if ($pluginAction != 'confirm') {
                    unset($plugins[$code]);
                }

                if ($pluginAction == 'ignore') {
                    PluginVersion::whereCode($code)->update([
                        'is_frozen' => true
                    ]);
                }
            }

            /*
             * Update steps
             */
            $updateSteps = $this->buildUpdateSteps($core, $plugins, $themes, false);

            /*
             * Finish up
             */
            $updateSteps[] = [
                'code' => 'completeUpdate',
                'label' => Lang::get('system::lang.updates.update_completing'),
            ];

            $this->vars['updateSteps'] = $updateSteps;
        }
        catch (Exception $ex) {
            $this->handleError($ex);
        }

        return $this->makePartial('execute');
    }
public function onApplyUpdates ( ) { try { /*
             * Process core
             */ $ coreHash = post ( 'hash' ) ; $ coreBuild = post ( 'build' ) ; $ core = [ $ coreHash , $ coreBuild ] ; /*
             * Process plugins
             */ $ plugins = post ( 'plugins' ) ; if ( is_array ( $ plugins ) ) { $ pluginCodes = [ ] ; foreach ( $ plugins as $ code => $ hash ) { $ pluginCodes [ ] = $ this -> decodeCode ( $ code ) ; } $ plugins = array_combine ( $ pluginCodes , $ plugins ) ; } else { $ plugins = [ ] ; } /*
             * Process themes
             */ $ themes = post ( 'themes' ) ; if ( is_array ( $ themes ) ) { $ themeCodes = [ ] ; foreach ( $ themes as $ code => $ hash ) { $ themeCodes [ ] = $ this -> decodeCode ( $ code ) ; } $ themes = array_combine ( $ themeCodes , $ themes ) ; } else { $ themes = [ ] ; } /*
             * Process important update actions
             */ $ pluginActions = ( array ) post ( 'plugin_actions' ) ; foreach ( $ plugins as $ code => $ hash ) { $ _code = $ this -> encodeCode ( $ code ) ; if ( ! array_key_exists ( $ _code , $ pluginActions ) ) { continue ; } $ pluginAction = $ pluginActions [ $ _code ] ; if ( ! $ pluginAction ) { throw new ApplicationException ( 'Please select an action for plugin ' . $ code ) ; } if ( $ pluginAction != 'confirm' ) { unset ( $ plugins [ $ code ] ) ; } if ( $ pluginAction == 'ignore' ) { PluginVersion :: whereCode ( $ code ) -> update ( [ 'is_frozen' => true ] ) ; } } /*
             * Update steps
             */ $ updateSteps = $ this -> buildUpdateSteps ( $ core , $ plugins , $ themes , false ) ; /*
             * Finish up
             */ $ updateSteps [ ] = [ 'code' => 'completeUpdate' , 'label' => Lang :: get ( 'system::lang.updates.update_completing' ) , ] ; $ this -> vars [ 'updateSteps' ] = $ updateSteps ; } catch ( Exception $ ex ) { $ this -> handleError ( $ ex ) ; } return $ this -> makePartial ( 'execute' ) ; }
Converts the update data to an actionable array of steps.
Converts the update data to an actionable array of steps .