Process URL and work out controller/action
@return void
550389
public function Process ()
	{

		// Work out which HTTP method were using and set as controller action
		// Default to get

		$this->action	= isset ($_SERVER['REQUEST_METHOD'])? strtolower ($_SERVER['REQUEST_METHOD']) : 'get';

		// HTTP_X_HTTP_METHOD override

		if ($this->action == 'post' && array_key_exists ('HTTP_X_HTTP_METHOD', $_SERVER))
		{
			if ($_SERVER['HTTP_X_HTTP_METHOD'] == 'DELETE' ||
				$_SERVER['HTTP_X_HTTP_METHOD'] == 'PUT')
			{
				$this->action = strtolower ($_SERVER['HTTP_X_HTTP_METHOD']);
			}
			else
			{
				throw new \Sonic\Exception ('Unexpected HTTP_X_HTTP_METHOD header');
			}
		}

		// Check method is valid

		if (!in_array ($this->action, ['get','put','post','delete']))
		{
			throw new \Sonic\Exception ('Invalid Method', 405);
		}

		// Get redirect path

		$redirect	= isset ($_SERVER['REQUEST_URI'])? strtok ($_SERVER['REQUEST_URI'], '?') : '';

		// Get the position of the last / in the URL

		$pos		= strrpos ($redirect, '/');

		// If there is no / besides the first one then there is no ID

		if ($pos < 1)
		{
			$controller = substr ($redirect, $pos+1);
		}
		else
		{

			// Set the object ID and controller

			$this->id	= substr ($redirect, $pos+1);
			$controller	= substr ($redirect, 1, $pos-1);

		}

		// If there is a controller
		// Split controller by module and uppercase first character of each module
		// to keep in fitting with the rest of the framework

		if ($controller)
		{

			$arrController	= explode ('/', $controller);

			foreach ($arrController as &$controllerModule)
			{
				$controllerModule	= ucfirst ($controllerModule);
			}

			// Replace / in controller with \ for correct path and set controller

			$this->controller	= join ('\\', $arrController);

		}

	}
443287
public function execute()
	{
		// Incoming task
		$this->_task = strtolower(\Request::getCmd('task', \Request::getWord('layout', '')));

		// Check if the task is in the taskMap
		if (isset($this->_taskMap[$this->_task]))
		{
			$doTask = $this->_taskMap[$this->_task];
		}
		// Check if the default task is set
		elseif (isset($this->_taskMap['__default']))
		{
			$doTask = $this->_taskMap['__default'];
		}
		// Raise an error (hopefully, this shouldn't happen)
		else
		{
			throw new InvalidTaskException(Lang::txt('The requested task "%s" was not found.', $this->_task), 404);
		}

		$name = $this->_controller;
		$layout = preg_replace('/[^A-Z0-9_]/i', '', $doTask);
		if (!$this->_controller)
		{
			$cls = get_class($this);
			// Attempt to parse the controller name from the class name
			if ((ucfirst($this->_name) . 'Controller') != $cls
			 && preg_match('/(\w)Controller(.*)/i', $cls, $r))
			{
				$this->_controller = strtolower($r[2]);
				$name   = $this->_controller;
				$layout = preg_replace('/[^A-Z0-9_]/i', '', $doTask);
			}
			// Namepsaced component
			else if (preg_match('/(.?)Controllers\\\(.*)/i', $cls, $r))
			{
				$this->_controller = strtolower($r[2]);
				$name   = $this->_controller;
				$layout = preg_replace('/[^A-Z0-9_]/i', '', $doTask);
			}
			// No controller name found - single controller component
			else
			{
				$name = $doTask;
			}
		}

		// Instantiate a view with layout the same name as the task
		$this->view = new View(array(
			'base_path' => $this->_basePath,
			'name'      => $name,
			'layout'    => $layout
		));

		// Set some commonly used vars
		$this->view->set('option', $this->_option)
					->set('task', $doTask)
					->set('controller', $this->_controller);

		// Record the actual task being fired
		$doTask .= 'Task';

		// On before do task hook
		$this->_onBeforeDoTask();

		// Call the task
		$this->$doTask();
	}
74848
protected function doProcess(): void
    {
        $module = Request::getModule();
        $controller = Request::getController();
        $params = Request::getParams();

        try {
            // try to dispatch controller
            $result = $this->dispatch($module, $controller, $params);
        } catch (ForbiddenException $e) {
            // dispatch default error controller
            $result = $this->forbidden($e);
        } catch (RedirectException $e) {
            // should return `null` for disable output and setup redirect headers
            $result = $this->redirect($e);
        } catch (\Exception $e) {
            // dispatch default error controller
            $result = $this->error($e);
        }

        // setup layout, if needed
        if ($this->useLayout()) {
            // render view to layout
            // needed for headScript and headStyle helpers
            Layout::setContent($result->render());
            Response::setBody(Layout::getInstance());
        } else {
            Response::setBody($result);
        }
    }
471524
public function process()
    {
        // Your controller name
        $this->controller = Inflector::classify($this->argument('name')).'Controller';

        // By default we will generate basic controller, if resource set then we will generate
        // REST-ful Resource controller
        $this->setControllerType();

        try {
            $this->makeController();
        } catch (\Exception $e) {
            throw $e;
        }

        $this->info('Controller '.$this->controller.' Generated Successfully By Cygnite Cli.');
    }
87939
public function process(){
    if ( $this->check() ){
      $this->obj = new \stdClass();
      if ( !\is_array($this->info)){
        $this->log("No info in MVC", $this->info);
        die("No info in MVC");
      }
      if ( !$this->controller ){
        $this->controller = new mvc\controller($this, $this->info, $this->data, $this->obj);
      }
      $this->controller->process();
    }
	}
1078625
public function process_url_edit() {
        global $CFG, $DB, $PAGE, $OUTPUT;

        $blockid = optional_param('bui_editid', null, PARAM_INT);
        if (!$blockid) {
            return false;
        }

        require_sesskey();
        require_once($CFG->dirroot . '/blocks/edit_form.php');

        $block = $this->find_instance($blockid);

        if (!$block->user_can_edit() && !$this->page->user_can_edit_blocks()) {
            throw new moodle_exception('nopermissions', '', $this->page->url->out(), get_string('editblock'));
        }

        $editpage = new moodle_page();
        $editpage->set_pagelayout('admin');
        $editpage->blocks->show_only_fake_blocks(true);
        $editpage->set_course($this->page->course);
        //$editpage->set_context($block->context);
        $editpage->set_context($this->page->context);
        if ($this->page->cm) {
            $editpage->set_cm($this->page->cm);
        }
        $editurlbase = str_replace($CFG->wwwroot . '/', '/', $this->page->url->out_omit_querystring());
        $editurlparams = $this->page->url->params();
        $editurlparams['bui_editid'] = $blockid;
        $editpage->set_url($editurlbase, $editurlparams);
        $editpage->set_block_actions_done();
        // At this point we are either going to redirect, or display the form, so
        // overwrite global $PAGE ready for this. (Formslib refers to it.)
        $PAGE = $editpage;
        //some functions like MoodleQuickForm::addHelpButton use $OUTPUT so we need to replace that to
        $output = $editpage->get_renderer('core');
        $OUTPUT = $output;

        $formfile = $CFG->dirroot . '/blocks/' . $block->name() . '/edit_form.php';
        if (is_readable($formfile)) {
            require_once($formfile);
            $classname = 'block_' . $block->name() . '_edit_form';
            if (!class_exists($classname)) {
                $classname = 'block_edit_form';
            }
        } else {
            $classname = 'block_edit_form';
        }

        $mform = new $classname($editpage->url, $block, $this->page);
        $mform->set_data($block->instance);

        if ($mform->is_cancelled()) {
            redirect($this->page->url);

        } else if ($data = $mform->get_data()) {
            $bi = new stdClass;
            $bi->id = $block->instance->id;

            // This may get overwritten by the special case handling below.
            $bi->pagetypepattern = $data->bui_pagetypepattern;
            $bi->showinsubcontexts = (bool) $data->bui_contexts;
            if (empty($data->bui_subpagepattern) || $data->bui_subpagepattern == '%@NULL@%') {
                $bi->subpagepattern = null;
            } else {
                $bi->subpagepattern = $data->bui_subpagepattern;
            }

            $systemcontext = context_system::instance();
            $frontpagecontext = context_course::instance(SITEID);
            $parentcontext = context::instance_by_id($data->bui_parentcontextid);

            // Updating stickiness and contexts.  See MDL-21375 for details.
            if (has_capability('moodle/site:manageblocks', $parentcontext)) { // Check permissions in destination

                // Explicitly set the default context
                $bi->parentcontextid = $parentcontext->id;

                if ($data->bui_editingatfrontpage) {   // The block is being edited on the front page

                    // The interface here is a special case because the pagetype pattern is
                    // totally derived from the context menu.  Here are the excpetions.   MDL-30340

                    switch ($data->bui_contexts) {
                        case BUI_CONTEXTS_ENTIRE_SITE:
                            // The user wants to show the block across the entire site
                            $bi->parentcontextid = $systemcontext->id;
                            $bi->showinsubcontexts = true;
                            $bi->pagetypepattern  = '*';
                            break;
                        case BUI_CONTEXTS_FRONTPAGE_SUBS:
                            // The user wants the block shown on the front page and all subcontexts
                            $bi->parentcontextid = $frontpagecontext->id;
                            $bi->showinsubcontexts = true;
                            $bi->pagetypepattern  = '*';
                            break;
                        case BUI_CONTEXTS_FRONTPAGE_ONLY:
                            // The user want to show the front page on the frontpage only
                            $bi->parentcontextid = $frontpagecontext->id;
                            $bi->showinsubcontexts = false;
                            $bi->pagetypepattern  = 'site-index';
                            // This is the only relevant page type anyway but we'll set it explicitly just
                            // in case the front page grows site-index-* subpages of its own later
                            break;
                    }
                }
            }

            $bits = explode('-', $bi->pagetypepattern);
            // hacks for some contexts
            if (($parentcontext->contextlevel == CONTEXT_COURSE) && ($parentcontext->instanceid != SITEID)) {
                // For course context
                // is page type pattern is mod-*, change showinsubcontext to 1
                if ($bits[0] == 'mod' || $bi->pagetypepattern == '*') {
                    $bi->showinsubcontexts = 1;
                } else {
                    $bi->showinsubcontexts = 0;
                }
            } else  if ($parentcontext->contextlevel == CONTEXT_USER) {
                // for user context
                // subpagepattern should be null
                if ($bits[0] == 'user' or $bits[0] == 'my') {
                    // we don't need subpagepattern in usercontext
                    $bi->subpagepattern = null;
                }
            }

            $bi->defaultregion = $data->bui_defaultregion;
            $bi->defaultweight = $data->bui_defaultweight;
            $bi->timemodified = time();
            $DB->update_record('block_instances', $bi);

            if (!empty($block->config)) {
                $config = clone($block->config);
            } else {
                $config = new stdClass;
            }
            foreach ($data as $configfield => $value) {
                if (strpos($configfield, 'config_') !== 0) {
                    continue;
                }
                $field = substr($configfield, 7);
                $config->$field = $value;
            }
            $block->instance_config_save($config);

            $bp = new stdClass;
            $bp->visible = $data->bui_visible;
            $bp->region = $data->bui_region;
            $bp->weight = $data->bui_weight;
            $needbprecord = !$data->bui_visible || $data->bui_region != $data->bui_defaultregion ||
                    $data->bui_weight != $data->bui_defaultweight;

            if ($block->instance->blockpositionid && !$needbprecord) {
                $DB->delete_records('block_positions', array('id' => $block->instance->blockpositionid));

            } else if ($block->instance->blockpositionid && $needbprecord) {
                $bp->id = $block->instance->blockpositionid;
                $DB->update_record('block_positions', $bp);

            } else if ($needbprecord) {
                $bp->blockinstanceid = $block->instance->id;
                $bp->contextid = $this->page->context->id;
                $bp->pagetype = $this->page->pagetype;
                if ($this->page->subpage) {
                    $bp->subpage = $this->page->subpage;
                } else {
                    $bp->subpage = '';
                }
                $DB->insert_record('block_positions', $bp);
            }

            redirect($this->page->url);

        } else {
            $strheading = get_string('blockconfiga', 'moodle', $block->get_title());
            $editpage->set_title($strheading);
            $editpage->set_heading($strheading);
            $bits = explode('-', $this->page->pagetype);
            if ($bits[0] == 'tag' && !empty($this->page->subpage)) {
                // better navbar for tag pages
                $editpage->navbar->add(get_string('tags'), new moodle_url('/tag/'));
                $tag = core_tag_tag::get($this->page->subpage);
                // tag search page doesn't have subpageid
                if ($tag) {
                    $editpage->navbar->add($tag->get_display_name(), $tag->get_view_url());
                }
            }
            $editpage->navbar->add($block->get_title());
            $editpage->navbar->add(get_string('configuration'));
            echo $output->header();
            echo $output->heading($strheading, 2);
            $mform->display();
            echo $output->footer();
            exit;
        }
    }
508828
public function process()
	{
		$context = $this->getContext();
		$view = $this->getView();

		try
		{
			$site = $context->getLocale()->getSite()->getCode();
			$params = $this->getClientParams( $view->param() );
			$context->getSession()->set( 'aimeos/catalog/detail/params/last/' . $site, $params );

			parent::process();
		}
		catch( \Aimeos\Client\Html\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', $e->getMessage() ) );
			$view->detailErrorList = $view->get( 'detailErrorList', [] ) + $error;
		}
		catch( \Aimeos\Controller\Frontend\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->detailErrorList = $view->get( 'detailErrorList', [] ) + $error;
		}
		catch( \Aimeos\MShop\Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->detailErrorList = $view->get( 'detailErrorList', [] ) + $error;
		}
		catch( \Exception $e )
		{
			$error = array( $context->getI18n()->dt( 'client', 'A non-recoverable error occured' ) );
			$view->detailErrorList = $view->get( 'detailErrorList', [] ) + $error;
			$this->logException( $e );
		}
	}
593390
public static function process($options = []) {
		// start buffering
		\Helper\Ob::start(true);
		$controller_class = self::$settings['mvc']['controller_class'];
		// processing options
 		if (!empty($options)) {
			foreach ($options as $k => $v) {
				self::$controller->{$k} = $v;
			}
 		}
		// put action into controller
		self::$controller->action_code = self::$settings['mvc']['controller_action_code'];
		self::$controller->action_method = self::$settings['mvc']['controller_action'];
		// check ACL
		if ($controller_class != '\Controller\Errors') {
			if (!self::$controller->permitted(['redirect' => true])) {
				Throw new \Exception('Permission denied!', -1);
			}
		}
		// auto populating input property in controller
 		if (!empty(self::$settings['application']['controller']['input'])) {
			self::$controller->input = \Request::input(null, true, true);
 		}
		// init method
		if (method_exists(self::$controller, 'init')) {
			call_user_func(array(self::$controller, 'init'));
		}
		// check if action exists
		if (!method_exists(self::$controller, self::$controller->action_method)) {
			Throw new \Exception('Action does not exists!');
		}
		// calling action
		echo call_user_func(array(self::$controller, self::$controller->action_method));
		// auto rendering view only if view exists, processing extension order as specified in .ini file
		$temp_reflection_obj = new ReflectionClass(self::$controller);
		$controller_dir = pathinfo($temp_reflection_obj->getFileName(), PATHINFO_DIRNAME) . '/';
		$controller_file = end(self::$settings['mvc']['controllers']);
		$view = self::$settings['mvc']['controller_view'];
		$flag_view_found = false;
		if (!empty($view)) {
			$extensions = explode(',', isset(self::$settings['application']['view']['extension']) ? self::$settings['application']['view']['extension'] : 'html');
			foreach ($extensions as $extension) {
				$file = $controller_dir  . $controller_file . '.' . $view . '.' . $extension;
				if (file_exists($file)) {
					$view_object = new \View(self::$controller, $file, $extension);
					$flag_view_found = true;
					break;
				}
			}
			// if views are mandatory
			if (!empty(self::$settings['application']['view']['mandatory']) && !$flag_view_found) {
				Throw new \Exception('View ' . $view . ' does not exists!');
			}
		}
		// autoloading media files
		\Layout::includeMedia($controller_dir, $controller_file, $view, $controller_class);
		// appending view after controllers output
		self::$controller->data->view = (self::$controller->data->view ?? '') . \Helper\Ob::clean();
		// if we have to render debug toolbar
		if (\Debug::$toolbar) {
			\Helper\Ob::start();
		}
		// call pre rendering method in bootstrap
		\Bootstrap::preRender();
		// rendering layout
		$__skip_layout = self::get('flag.global.__skip_layout');
		if (!empty(self::$settings['mvc']['controller_layout']) && empty($__skip_layout)) {
			\Helper\Ob::start();
			if (file_exists(self::$settings['mvc']['controller_layout_file'])) {
				$layout_object = new \Layout(self::$controller, self::$settings['mvc']['controller_layout_file'], self::$settings['mvc']['controller_layout_extension']);
			}
			// session expiry dialog before replaces
			\Session::expiryDialog();
			// buffer output and handling javascript files, chicken and egg problem
			$from = [
				'<!-- [numbers: messages] -->',
				'<!-- [numbers: title] -->',
				'<!-- [numbers: document title] -->',
				'<!-- [numbers: actions] -->',
				'<!-- [numbers: breadcrumbs] -->',
				'<!-- [numbers: javascript links] -->',
				'<!-- [numbers: javascript data] -->',
				'<!-- [numbers: css links] -->',
				'<!-- [numbers: layout onload] -->',
				'<!-- [numbers: layout onhtml] -->',
				'<!-- [numbers: workflows] -->'
			];
			$to = [
				\Layout::renderMessages(),
				\Layout::renderTitle(),
				\Layout::renderDocumentTitle(),
				\Layout::renderActions(),
				\Layout::renderBreadcrumbs(),
				\Layout::renderJs(),
				\Layout::renderJsData(),
				\Layout::renderCss(),
				\Layout::renderOnload(),
				\Layout::$onhtml,
				\Object\Form\Workflow\Base::render()
			];
			echo str_replace($from, $to, \Helper\Ob::clean());
		} else {
			echo self::$controller->view;
		}
		// headers
		if (!empty(self::$settings['header']) && !headers_sent()) {
			foreach (self::$settings['header'] as $k => $v) {
				header($v);
			}
		}
		// ajax calls that has not been processed by application
		if (self::get('flag.global.__ajax')) {
			\Layout::renderAs(['success' => false, 'error' => [\I18n(null, 'Could not process ajax call!')]], 'application/json');
		}
	}
1211173
public function run() {
		if ($this->url === null) {
			throw new \Exception("No URL configured for redirection.");
		}
		if (strpos($this->url, '/') === 0 || strpos($this->url, 'http://') === 0 || strpos($this->url, 'https://') === 0) {
			$url = ValueUtils::val($this->url);
		} else {
			$url = ROOT_URL.ValueUtils::val($this->url);
		}
		header("Location: ".$url);
	}
22600
public function process()
	{
		$context = $this->_getContext();
		$view = $this->getView();

		try
		{
			$view->stageParams = $this->_getParamStage( $view );

			parent::process();
		}
		catch( Client_Html_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'client/html', $e->getMessage() ) );
			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
		}
		catch( Controller_Frontend_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
		}
		catch( MShop_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
		}
		catch( Exception $e )
		{
			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );

			$error = array( $context->getI18n()->dt( 'client/html', 'A non-recoverable error occured' ) );
			$view->stageErrorList = $view->get( 'stageErrorList', array() ) + $error;
		}
	}
790085
public function execute()
    {
        $request = $this->get('request');
        $router = $this->get('router');
        $response = $this->get('response');

        // Attempt to match the requested route with a registered route
        if ($router->matchRequest($request->route(), $request->httpMethod())) {

            // A match was found - pass any route params to the Request instance
            $request->routeParams($router->params());

            // The closure associated with the matched route
            $closure = $router->getClosure($this);

            // Attempt to call the closure
            if ($closure) {
                // Call the output
                $closure($request, $response);
            } else {
                // There was a problem calling the route's closure
                $response->send(500, 'This route\'s callback is invalid.');
            }

        } else {

            // A route wasn't matched - return a 404
            $response->send(404, 'The requested resource was not found.');
        }
    }
1238172
public function process()
	{
		$view = $this->getView();

		// only start if there's something to do
		if( ( $option = $view->param( 'cs-option-terms', null ) ) === null ) {
			return;
		}

		if( ( $option = $view->param( 'cs-option-terms-value', 0 ) ) != 1 )
		{
			$view->standardStepActive = 'summary';
			$view->termsError = true;

			$error = array( $view->translate( 'client/html', 'Please accept the terms and conditions' ) );
			$view->standardErrorList = $error + $view->get( 'standardErrorList', array() );
		}

		parent::process();
	}
342362
public function run()
    {
        // initialize infinite loop counter
        $redirects = 0;

        // create the request
        $requestParser = $this->getRequestParser();
        $request = $requestParser->createRequest();

        // start of the request loop
        do
        {
            // do the infinite loop check
            $this->checkRedirectLimit( $redirects );
            $continue = false;

            // run pre-routing filters
            $this->configuration->runPreRoutingFilters( $request );

            // create the router from the configuration
            $router = $this->getRouter( $request );

            // router creates routing information
            try
            {
                $routingInformation = $router->getRoutingInformation();
            }
            catch ( ezcMvcRouteNotFoundException $e )
            {
                $request = $this->getFatalRedirectRequest( $request, new ezcMvcResult, $e );
                $continue = true;
                continue;
            }
            // here's the reason to override ezcMvcConfigurableDispatcher::run()
            catch ( ezpRouteMethodNotAllowedException $e )
            {
                $request = $this->getFatalRedirectRequest( $request, new ezcMvcResult, $e );
                $continue = true;
                continue;
            }
            // end diff


            // run request filters
            $filterResult = $this->configuration->runRequestFilters( $routingInformation, $request );

            if ( $filterResult instanceof ezcMvcInternalRedirect )
            {
                $request = $filterResult->request;
                $continue = true;
                continue;
            }

            // create the controller
            $controller = $this->getController( $routingInformation, $request );

            // run the controller
            try
            {
                $result = $controller->createResult();
            }
            catch ( Exception $e )
            {
                $request = $this->getFatalRedirectRequest( $request, new ezcMvcResult, $e );
                $continue = true;
                continue;
            }

            if ( $result instanceof ezcMvcInternalRedirect )
            {
                $request = $result->request;
                $continue = true;
                continue;
            }
            if ( !$result instanceof ezcMvcResult )
            {
                throw new ezcMvcControllerException( "The action '{$routingInformation->action}' of controller '{$routingInformation->controllerClass}' did not return an ezcMvcResult object." );
            }

            $this->configuration->runResultFilters( $routingInformation, $request, $result );

            if ( $result->status !== 0 )
            {
                $response = new ezcMvcResponse;
                $response->status = $result->status;
            }
            else
            {
                // want the view manager to use my filters
                $view = $this->getView( $routingInformation, $request, $result );

                // create the response
                try
                {
                    $response = $view->createResponse();
                }
                catch ( Exception $e )
                {
                    $request = $this->getFatalRedirectRequest( $request, $result, $e );
                    $continue = true;
                    continue;
                }
            }
            $this->configuration->runResponseFilters( $routingInformation, $request, $result, $response );

            // create the response writer
            $responseWriter = $this->getResponseWriter( $routingInformation, $request, $result, $response );

            // handle the response
            $responseWriter->handleResponse();
        }
        while ( $continue );
    }
839926
public function process()
	{
		$view = $this->getView();
		$context = $this->_getContext();

		try
		{
			parent::process();
		}
		catch( Client_Html_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'client/html', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( Controller_Frontend_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'controller/frontend', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( MShop_Plugin_Provider_Exception $e )
		{
			$errors = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$errors = array_merge( $errors, $this->_translatePluginErrorCodes( $e->getErrorCodes() ) );

			$view->summaryErrorCodes = $e->getErrorCodes();
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $errors;
		}
		catch( MShop_Exception $e )
		{
			$error = array( $this->_getContext()->getI18n()->dt( 'mshop', $e->getMessage() ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
		catch( Exception $e )
		{
			$context->getLogger()->log( $e->getMessage() . PHP_EOL . $e->getTraceAsString() );

			$error = array( $context->getI18n()->dt( 'client/html', 'A non-recoverable error occured' ) );
			$view->standardErrorList = $view->get( 'standardErrorList', array() ) + $error;
		}
	}
1210473
protected function prepareRequest(): void
    {
        // HTTP method
        $method = Request::getMethod();
        $this->method = strtoupper($method);

        // get path
        // %module% / %controller% / %id% / %relation% / %id%
        $path = Router::getCleanUri();

        $this->params = explode('/', rtrim($path, '/'));

        // module
        $this->module = array_shift($this->params);

        // controller
        $this->controller = array_shift($this->params);

        $data = Request::getParams();

        unset($data['_method'], $data['_module'], $data['_controller']);

        $this->data = array_merge($data, $this->data);

        $primary = $this->crud->getPrimaryKey();

        $this->primary = array_intersect_key($this->data, array_flip($primary));
    }
214875
protected function process()
    {

        // process the new URL rewrites first
        parent::process();

        // create redirect URL rewrites for the existing URL rewrites
        foreach ($this->existingUrlRewrites as $existingUrlRewrite) {
            // query whether or not 301 redirects have to be created, so don't
            // create redirects if the the rewrite history has been deactivated
            if ($this->getSubject()->getCoreConfigData(CoreConfigDataKeys::CATALOG_SEO_SAVE_REWRITES_HISTORY, true)) {
                // if the URL rewrite already IS a redirect
                if ((integer) $existingUrlRewrite[MemberNames::REDIRECT_TYPE] !== 0 &&
                    (integer) $existingUrlRewrite[MemberNames::IS_AUTOGENERATED] === 0
                ) {
                    // do NOT create another redirect
                    continue;
                }

                // load target path
                $targetPath = $this->prepareRequestPath();

                // override data with the 301 configuration
                $attr = array(
                    MemberNames::REDIRECT_TYPE    => 301,
                    MemberNames::TARGET_PATH      => $targetPath,
                    MemberNames::IS_AUTOGENERATED => 0
                );

                // merge and return the prepared URL rewrite
                $existingUrlRewrite = $this->mergeEntity($existingUrlRewrite, $attr);

                // create the URL rewrite
                $this->persistUrlRewrite($existingUrlRewrite);
            } else {
                // query whether or not the URL rewrite has to be removed
                if ($this->getSubject()->getConfiguration()->hasParam(ConfigurationKeys::CLEAN_UP_URL_REWRITES) &&
                    $this->getSubject()->getConfiguration()->getParam(ConfigurationKeys::CLEAN_UP_URL_REWRITES)
                ) {
                    // delete the existing URL rewrite
                    $this->deleteUrlRewrite($existingUrlRewrite);

                    // log a message, that old URL rewrites have been cleaned-up
                    $this->getSubject()
                         ->getSystemLogger()
                         ->warning(
                             sprintf(
                                 'Cleaned-up %d URL rewrite "%s" for category with path "%s"',
                                 $existingUrlRewrite[MemberNames::REQUEST_PATH],
                                 $this->getValue(ColumnKeys::PATH)
                             )
                         );
                }
            }
        }
    }
875785
public function process()
    {
        list($action, $ids) = $this->Process->getRequestVars($this->name);
        return $this->Process->make($this->Groups, $action, $ids);
    }