执行Action
@param Action $action
@throws \Exception
322901
public function runAction(Action $action)
    {
        $priorAction = $this->_action;
        $this->_action = $action;
        if ($this->beforeAction($action)) {
            if (false === $action->runWithParams($this->getActionParams())) {
                $this->invalidActionParams($action);
            } else {
                $this->afterAction($action);
            }
        }
        $this->_action = $priorAction;
    }
280444
public function runAction($action)
	{
		$response 		= null;
		$priorAction   	= $this->_action;
		$this->_action 	= $action;
		
		if ($this->beforeAction($action))
		{
			try {
				$response = $action->runWithParams($this->getActionParams());
			} catch (CHttpException $e) {
				$response = null;
				$this->status = $e->statusCode;
				$this->message = $e->getMessage();
			} catch (Exception $e) {
				$response = null;
				$this->status = 500;
				$this->message = Yii::t('Api.Controller', 'An unexpected error occured.');

				if (YII_DEBUG)
					$response = $e->getMessage();

				// Log this error
				Yii::log($e->getMessage(), 'error', 'Api.controller');
			}

			if ($response === false)
				$this->invalidActionParams($action);
			else
				$this->afterAction($action);
		}

		$this->_action=$priorAction;

		$this->renderOutput($response);
	}
923326
public function handle(string $action = null)
    {
        if (!$action)
        {
            $action = $this->request()->getAttribute($this->attribute);
        }

        if ($action === null)
        {
            throw new Path('Action `' . $this->attribute . '` name not found!');
        }

        if (!method_exists($this, $action))
        {
            throw new Runtime('Action `' . $action . '` not found');
        }

        $data = $this->$action(...$this->arguments());

        if (is_object($data) && $data instanceof Dispatcher)
        {
            return $data;
        }

        if (is_string($data) && class_exists($data))
        {
            return new $data($this->factory, $this, $this->cookies);
        }

        return $this->processing($data);
    }
441458
public function setCurrentAction($action): void
    {
        if (!$action instanceof Action) {
            $action = $this->getAction($action);
        }
        $this->currentAction = $action;
    }
926909
public function execute($action) {
        admin_externalpage_setup('tool_usertours/tours');
        // Add the main content.
        switch($action) {
            case self::ACTION_NEWTOUR:
            case self::ACTION_EDITTOUR:
                $this->edit_tour(optional_param('id', null, PARAM_INT));
                break;

            case self::ACTION_MOVETOUR:
                $this->move_tour(required_param('id', PARAM_INT));
                break;

            case self::ACTION_EXPORTTOUR:
                $this->export_tour(required_param('id', PARAM_INT));
                break;

            case self::ACTION_IMPORTTOUR:
                $this->import_tour();
                break;

            case self::ACTION_VIEWTOUR:
                $this->view_tour(required_param('id', PARAM_INT));
                break;

            case self::ACTION_HIDETOUR:
                $this->hide_tour(required_param('id', PARAM_INT));
                break;

            case self::ACTION_SHOWTOUR:
                $this->show_tour(required_param('id', PARAM_INT));
                break;

            case self::ACTION_DELETETOUR:
                $this->delete_tour(required_param('id', PARAM_INT));
                break;

            case self::ACTION_RESETFORALL:
                $this->reset_tour_for_all(required_param('id', PARAM_INT));
                break;

            case self::ACTION_NEWSTEP:
            case self::ACTION_EDITSTEP:
                $this->edit_step(optional_param('id', null, PARAM_INT));
                break;

            case self::ACTION_MOVESTEP:
                $this->move_step(required_param('id', PARAM_INT));
                break;

            case self::ACTION_DELETESTEP:
                $this->delete_step(required_param('id', PARAM_INT));
                break;

            case self::ACTION_LISTTOURS:
            default:
                $this->print_tour_list();
                break;
        }
    }
1056307
protected void executeAdvice(Executable action) {
        if (log.isDebugEnabled()) {
            log.debug("Action " + action);
        }

        try {
            action.execute(this);
        } catch (Exception e) {
            setRaisedException(e);
            throw new ActionExecutionException("Failed to execute advice action " + action, e);
        }
    }
516593
private static function execController($controller,$action,$args){
        $controller = new $controller();
        $controller->doAction($action,$args);
    }
1078031
protected function runActionMethod($action, $vars = array()) {
		return call_user_func_array(
		    array($this, $action),
            $this->getActionArguments($action, $vars)
        );
	}
1123761
public function setAction($action)
    {
        //test validity of the action
        if ($action !== self::ACTION_CREATE && $action !== self::ACTION_OVERWRITE && $action !== self::ACTION_DELETE) {
            throw new \Exception('The action of the widget map is not valid. Action: ['.$action.']');
        }

        $this->action = $action;
    }
1180443
protected function actionRedirect($action)
    {
        if ($this->redirect)
        {
            return;
        }

        $this->redirect = $action->getAttribute('uri');
        /** @var TAdminUI $page */
        $page = Eresus_Kernel::app()->getPage();
        $this->redirect = $page->replaceMacros($this->redirect);
    }
824399
public function handle(Action $action)
    {
        $this->action = $action;
        $ref          = $action->getRef();
        $el           = $action->getElement();

        $this->query = str_ensure_left($action->param(0), '\\');

        // transform <a> attributes that wont matter modifiers
        $el->setAttribute('class', $el->getAttribute('class') . ' phpdoc-link');
        $el->setAttribute('href', $ref->phpdoc->url($action->param(0)));


        if ( $action->containsModifier('popover') ) {
            $this->popover();
        } elseif ( $action->containsModifier('modal') ) {
            $this->modal();
        } elseif ( $action->containsModifier('type') ) {
            $this->type();
        }
    }
1294043
public function action(Action $action) {
        if($action->register === Action::REGISTER_AT_END) {
            $this->registerActionsLast[] = $action;
        } else {
            if($action->register) {
                $this->registerAction($action);
            }
        }
    }
1194156
protected function execute($action, array $parameters = [])
    {
        $parameters += $this->input;

        return $this->server->dispatch(
            new ServerRequest($action, $parameters)
        )->getData();
    }
1127276
void executeAction( Action action ) throws PluginException {

		try {
			switch( action.actionType ) {
			case DELETE:
				this.logger.fine( "Deleting " + action.parameter + "..." );
				File f = new File( action.parameter );
				Utils.deleteFilesRecursively( f );
				break;

			case DOWNLOAD:
				this.logger.fine( "Downloading " + action.parameter + "..." );
				URI uri = UriUtils.urlToUri( action.parameter );
				File targetFile = new File( System.getProperty( "java.io.tmpdir" ), TMP_FILE );
				InputStream in = null;
				try {
					in = uri.toURL().openStream();
					Utils.copyStream( in, targetFile );

				} finally {
					Utils.closeQuietly( in );
				}

				break;

			case MOVE:
				List<String> parts = Utils.splitNicely( action.parameter, "->" );
				if( parts.size() != 2 ) {
					this.logger.warning( "Invalid syntax for 'move' action. " + action.parameter );
				} else {
					File source = new File( parts.get( 0 ));
					File target = new File( parts.get( 1 ));
					this.logger.fine( "Moving " + source + " to " + target + "..." );
					if( ! source.renameTo( target ))
						throw new IOException( source + " could not be moved to " + target );
				}

				break;

			case COPY:
				parts = Utils.splitNicely( action.parameter, "->" );
				if( parts.size() != 2 ) {
					this.logger.warning( "Invalid syntax for 'copy' action. " + action.parameter );
				} else {
					File source = new File( parts.get( 0 ));
					File target = new File( parts.get( 1 ));
					this.logger.fine( "Copying " + source + " to " + target + "..." );
					Utils.copyStream( source, target );
				}

				break;

			default:
				this.logger.fine( "Ignoring the action..." );
				break;
			}

		} catch( Exception e ) {
			throw new PluginException( e );
		}
	}
8622
public function action($action, $options = [])
    {
        if ($this->shouldValidate) $this->validate();
        if ($this->shouldCallGuard) $this->guard();
        if ($this->shouldFallThrough) return $this;

        if (is_string($action) && !class_exists($action)) {
            throw new Exception("{$action} does not exist.");
        }

        if (!is_subclass_of($action, Action::class)) {
            throw new Exception('Actions must extend '.Action::class.'.');
        }

        if (is_string($action)) {
            $action = new $action($this, $options);
        }

        $this->perform($action);

        return $this;
    }
773966
public function write($action, $data)
    {
        $message = http_build_query($data);

        $resource = $this->getResource();
        $length = strlen($message);
        $sent = 0;

        $content = $this->getHeader($action, $length) . $message;

        while ($this->isConnected() && $sent < $length) {
            $chunk = fwrite($resource, substr($content, $sent));

            if (false === $chunk) {
                throw new \RuntimeException('Could not write to socket');
            }

            $sent += $chunk;
        }
    }
366362
protected function runActionHandler($action, TreeNodeInterface $node)
    {
        if ($node instanceof Token) {
            try {
                return $action($node->getContent());
            } catch (AbortParsingException $e) {
                if (null === $e->getOffset()) {
                    throw new AbortParsingException($e->getMessage(), $node->getOffset(), $e);
                }
                throw $e;
            } catch (AbortNodeException $e) {
                throw new AbortParsingException($e->getMessage(), $node->getOffset(), $e);
            } catch (\Throwable $e) {
                throw new \RuntimeException("Action failure in `{$this::buildActionName($node)}`", 0, $e);
            }
        }

        $args = [];
        foreach ($node->getChildren() as $child) {
            $args[] = $child->made();
        }

        try {
             $result = $action(...$args);
        } catch (AbortNodeException $e) {
            throw new AbortParsingException(
                $e->getMessage(),
                $node->getChild($e->getNodeIndex() - 1)->getOffset(),
                $e
            );
        } catch (AbortParsingException $e) {
            if (null === $e->getOffset()) {
                throw new AbortParsingException($e->getMessage(), $node->getOffset(), $e);
            }
            throw $e;
        } catch (\Throwable $e) {
            throw new \RuntimeException("Action failure in `{$this::buildActionName($node)}`", 0, $e);
        }

        if ($this->prune) {
            $node->prune();
        }

        return $result;
    }