删除call方法的缓存
@param string|object $obj
@param string $func
@param mixed ...$params
@return bool
@throws Exception
480000
public function unsetCall($obj, string $func = '', ...$params): bool {
		$key = $this->generateKey($obj, $func, $params);
		return $this->driver->clear($key);
	}
888436
function doFunction( $name, $func_obj, $nspace, $current_nspace )
    {
        $func = $this->Functions[$name];
        if ( is_array( $func ) )
        {
            $this->loadAndRegisterFunctions( $this->Functions[$name] );
            $func = $this->Functions[$name];
        }
        if ( isset( $func ) and
             is_object( $func ) )
        {
            return $func->process( $this, $name, $func_obj, $nspace, $current_nspace );
        }
        else
        {
            $this->warning( "", "Function \"$name\" is not registered" );
            return false;
        }
    }
814123
public function invokeRequest($obj, $method, Request $request, Response $response) {
        try {
            $method = new \ReflectionMethod(get_class($obj), $method);
        } catch (\Exception $e) {
            throw new MsgException("对应的路径不存在方法");
        }
        $args = [];

        if ($method->getNumberOfParameters() > 0) {
            $params = $method->getParameters();
            $search_index = 0;
            $search = $request->search();
            /* @var $param \ReflectionParameter */
            foreach ($params as $param) {
                $name = $param->getName();
                $default = null;
                if ($param->isDefaultValueAvailable()) {
                    $default = $param->getDefaultValue();
                }
                $class = $param->getClass();
                if ($class) {
                    $className = $class->getName();
                    if ($className == Search::class) {
                        $args[$name] = new Search($search[ $search_index ]);
                        $search_index++;
                    } elseif ($className == Request::class) {
                        $args[$name] = $request;
                    } elseif ($className == Response::class) {
                        $args[$name] = $response;
                    } elseif ($className == Session::class) {
                        $args[$name] = $request->session();
                    } elseif ($className == File::class) {
                        $args[$name] = $request->file($name);
                    } else {
                        $className = $class->getName();
                        $bean = method_exists($className, 'instance') ? $className::instance() : new $className();
                        $properties = $class->getProperties();
                        foreach ($properties as $property) {
                            $name = $property->getName();
                            $val = $request->param($name);
                            if (isset($val)) {
                                $bean->$name = $val;
                            }
                        }
                        $args[$name] = $bean;
                    }
                } else {
                    if (key_exists($name, $this->params)) {
                        $args[ $name ] = $this->params[ $name ];
                    } else {
                        $args[ $name ] = $request->param($name, $default);
                    }
                }
            }
        }
        Context::set('request_params',$args);
        $val = $method->invokeArgs($obj, $args);
        return $val;
    }
481287
public function call(callable $func, $args = null)
    {
        $pid = pcntl_fork();

        if ($pid == -1) {
            throw new \Exception("Failed to fork");
        }

        # If this is the child process, then run the requested function
        if (!$pid) {
            try {
                if ($args === null) {
                    $func();
                } else {
                    call_user_func_array($func, $args);
                }
            } catch(\Exception $e) {
                $memory = shmop_open($this->memoryKey, "c", 0644, static::SHARED_MEMORY_LIMIT);
                $errors = shmop_read($memory, 0, static::SHARED_MEMORY_LIMIT);
                $errors = trim($errors);
                if ($errors) {
                    $errors .= "\n";
                }
                $errors .= "Exception: " . $e->getMessage() . " (" . $e->getFile() . ":" . $e->getLine() . ")";
                shmop_write($memory, $errors, 0);
                shmop_close($memory);
                exit(1);
            }

            # Then we must exit or else we will end up the child process running the parent processes code
            die();
        }

        $this->threads[$pid] = $pid;

        return $pid;
    }
1221287
public static Object invokeMethod(final Object obj, final String methodName, final Class<?>[] parameterTypes,
			final Object[] args) {
		Method method = getAccessibleMethod(obj, methodName, parameterTypes);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + methodName + "] on target [" + obj + "]");
		}

		try {
			return method.invoke(obj, args);
		} catch (Exception e) {
			throw convertReflectionExceptionToUnchecked(e);
		}
	}
346838
public static <T> T invokeWithCheck(Object obj, Method method, Object... args) throws UtilException {
		final Class<?>[] types = method.getParameterTypes();
		if (null != types && null != args) {
			Assert.isTrue(args.length == types.length, "Params length [{}] is not fit for param length [{}] of method !", args.length, types.length);
			Class<?> type;
			for (int i = 0; i < args.length; i++) {
				type = types[i];
				if (type.isPrimitive() && null == args[i]) {
					// 参数是原始类型，而传入参数为null时赋予默认值
					args[i] = ClassUtil.getDefaultValue(type);
				}
			}
		}

		return invoke(obj, method, args);
	}
170693
def call_func(self, req, *args, **kwargs):
        """"""
        try:
            return super(SdkWsgify, self).call_func(req, *args, **kwargs)
        except webob.exc.HTTPException as exc:
            msg = ('encounter %(error)s error') % {'error': exc}
            LOG.debug(msg)
            exc.json_formatter = json_error_formatter
            code = exc.status_int
            explanation = six.text_type(exc)

            fault_data = {
                'overallRC': 400,
                'rc': 400,
                'rs': code,
                'modID': SDKWSGI_MODID,
                'output': '',
                'errmsg': explanation}
            exc.text = six.text_type(json.dumps(fault_data))
            raise exc
174439
public static function jsonResponse(callable $fun): callable{
        return function (Request $request, Response $response, array $args) use ($fun){
            return $response->withJson($fun($request, $response, $args));
        };
    }
1159541
public function run(RunnableInterface $command, callable $func = null)
    {
        if ($func) {
            throw new \Exception('You cannot process passthru with a callable. Use another Runner instead.');
        }

        $command = (string) $command->getCommandAssembler();
        passthru($command, $status);
        return $this->getResponseClass($command, $status, '');
    }
1112455
public function invoke(
        $obj,
        string $method,
        array $params = []
    ) {
        if (is_string($obj)) {
            //Attempt to retrieve object from
            //the container.
            $obj = $this->get($obj);
        } elseif (!is_object($obj)) {
            //Not a valid argument.
            throw new \Exception('Invalid object');
        }

        $map = $this->generateArgumentsMap(
            $obj,
            $method,
            $params
        );
        $mapParams = $this->getParamsFromMap($map);

        return $obj->$method(...$mapParams);
    }
440506
public static function getObjectMethodArgs($obj, string $method)
    {
        if (!is_object($obj)) {
            throw new Exception('$obj is not an object');
        }
        return static::getClassMethodArgs(get_class($obj), $method);
    }
1337495
public static void callMethod(final Object obj, final String methodName, final boolean includePrivateMehtods, final Object... args)
			throws InvocationTargetException {
		final Class[] intArgsClass = initParamsClasses(args);
		try {
			Class<?> current = obj.getClass();
			Method method = null;
			while (current != Object.class) {
				try {
					method = current.getDeclaredMethod(methodName, intArgsClass);
					break;
				} catch (final NoSuchMethodException ex) {
					current = current.getSuperclass();
				}
			}
			if (method == null) {
				throw new NoSuchMethodException("Mehtod is not found in " + current);
			}
			method.setAccessible(true);
			method.invoke(obj, args);
		} catch (final InvocationTargetException e) {
			throw new InvocationTargetException(e.getCause());
		} catch (final Exception e) {
			throw new InvocationTargetException(e);
		}
	}
1305785
public static Object callMethod(Scriptable obj, String methodName,
                                    Object[] args)
    {
        return callMethod(null, obj, methodName, args);
    }
1374643
public static <T> T invokeMethod(final Object obj, final String methodName, final Object[] args,
			final Class<?>[] parameterTypes) {
		Method method = getMethod(obj.getClass(), methodName, parameterTypes);
		if (method == null) {
			throw new IllegalArgumentException("Could not find method [" + methodName + "] with parameter types:"
					+ ObjectUtil.toPrettyString(parameterTypes) + " on class [" + obj.getClass() + ']');
		}
		return invokeMethod(obj, method, args);
	}
873835
public function chunk($num = 100, callable $func)
    {
        $this->paramsAutoReset();
        $start = 0;
        $backComdition = $this->sql;//sql组装
        $backTable = $this->table;//操作的表
        $backJoin = $this->join;//是否内联
        $backleftJoin = $this->leftJoin;//是否左联结
        $backrightJoin = $this->rightJoin;//是否右联
        $backBindParams = $this->bindParams;

        while ($result = $this->select($start, $num)) {
            if ($func($result) === false) {
                break;
            }
            $start += count($result);

            $this->sql = $backComdition;//sql组装
            $this->table = $backTable;//操作的表
            $this->join = $backJoin;//是否内联
            $this->leftJoin = $backleftJoin;//是否左联结
            $this->rightJoin = $backrightJoin;//是否右联
            $this->bindParams = $backBindParams;
        }
        $this->paramsAutoReset();
        $this->reset();
        $this->clearBindParams();
    }
523316
public static function invokeWithIocParams($obj, $method) {
        $method = new \ReflectionMethod(get_class($obj), $method);
        $args = [];
        if ($method->getNumberOfParameters() > 0) {
            $params = $method->getParameters();
            foreach ($params as $param) {
                $class = $param->getClass();
                if ($class) {
                    $className = $class->getName();
                    $bean = Ioc::get($className);
                    if (!$bean) {
                        $args[] = method_exists($className, 'instance') ? $className::instance() : new $className();
                    } else {
                        $args[] = $bean;
                    }
                } else {
                    $args[] = null;
                }
            }
        }
        $val = $method->invokeArgs($obj, $args);
        return $val;
    }
453579
public static function iterate_profiles($func)
	{
		$db = \App::get('db');
		$db->setQuery("SELECT uidNumber FROM `#__xprofiles`;");

		$result = $db->loadColumn();

		if ($result === false)
		{
			throw new Exception('Error retrieving data from xprofiles table: ' . $db->getErrorMsg(), 500);
			return false;
		}

		foreach ($result as $row)
		{
			$func($row);
		}

		return true;
	}