src/Runtime/ClosureContainer.php
function runOnce($name, $params = array())
    {
        static $cache = array();
        if (isset($cache[$name])) {
            return $cache[$name];
        } elseif (isset($this->actions[$name])) {
            if (!is_array($params)) {
                $params = array($params);
            }

            $cache[$name] = call_user_func_array($this->actions[$name], $params);
            return $cache[$name];
        }

        return false;
    }
function runOnce($name, $params = array())
    {
        static $cache = array();
        if (isset($cache[$name])) {
            return $cache[$name];
        } elseif (isset($this->actions[$name])) {
            if (!is_array($params)) {
                $params = array($params);
            }

            $cache[$name] = call_user_func_array($this->actions[$name], $params);
            return $cache[$name];
        }

        return false;
    }
执行指定的匿名方法并缓存执行结果

@param string $name
@param array $params
@return mixed