Package com.caucho.quercus.function

Examples of com.caucho.quercus.function.AbstractFunction


          return NullValue.NULL;
        }
      }
    }
   
    AbstractFunction fun = env.findFunction(_funId);
   
    if (fun == null) {
      env.error(getLocationLine(), L.l("'{0}' is an unknown function.", _name));

      return NullValue.NULL;
    }

    Value []args = evalArgs(env, _args);

    env.pushCall(this, NullValue.NULL, args);
   
    // php/0249
    QuercusClass oldCallingClass = env.setCallingClass(null);
   
    // XXX: qa/1d14 Value oldThis = env.setThis(UnsetValue.NULL);
    try {
      env.checkTimeout();

      /*
      if (isRef)
        return fun.callRef(env, args);
      else if (isCopy)
        return fun.callCopy(env, args);
      else
        return fun.call(env, args);
        */
     
      if (isRef)
        return fun.callRef(env, args);
      else if (isCopy)
        return fun.call(env, args).copyReturn();
      else {
        return fun.call(env, args).toValue();
      }
    //} catch (Exception e) {
    //  throw QuercusException.create(e, env.getStackTrace());
    } finally {
      env.popCall();
View Full Code Here


  // Return an array containing the Values to be
  // passed in to this function.

  public Value []evalArguments(Env env)
  {
    AbstractFunction fun = env.findFunction(_name);

    if (fun == null) {
      return null;
    }

    return fun.evalArguments(env, this, _args);
  }
View Full Code Here

    for (ModuleInfo moduleInfo : env.getQuercus().getModules()) {
      Set<String> extensionSet = moduleInfo.getLoadedExtensions();

      if (extensionSet.contains(_name)) {
        for (String functionName : moduleInfo.getFunctions().keySet()) {
          AbstractFunction fun = env.findFunction(functionName);

          array.put(env.wrapJava(new ReflectionFunction(fun)));
        }
      }
    }
View Full Code Here

  {
  }
 
  public static ReflectionFunction __construct(Env env, String name)
  {
    AbstractFunction fun = env.findFunction(name);

    if (fun != null)
      return new ReflectionFunction(fun);
    else
      return null;
View Full Code Here

  /**
   * Finds a function.
   */
  public AbstractFunction findFunction(String name)
  {
    AbstractFunction fun = _functionMap.get(name);

    if (fun != null)
      return fun;

    if (! _quercus.isStrict())
View Full Code Here

   * @param name the method name
   * @return the found method or null if no method found.
   */
  public AbstractFunction findFunction(String name)
  {
    AbstractFunction fun = _funMap.get(name);

    if (fun == null) {
    }
    else if (fun instanceof UnsetFunction) {
      UnsetFunction unsetFun = (UnsetFunction) fun;
View Full Code Here

   * @param name the method name
   * @return the found method or null if no method found.
   */
  private AbstractFunction findModuleFunction(String name)
  {
    AbstractFunction fun = null;

    fun = _quercus.findFunction(name);
    if (fun != null)
      return fun;

View Full Code Here

  /**
   * Adds a function, e.g. from an include.
   */
  public Value addFunction(String name, AbstractFunction fun)
  {
    AbstractFunction oldFun = findFunction(name);

    if (oldFun != null) {
      throw new QuercusException(L.l("can't redefine function {0}", name));
    }

View Full Code Here

      javaClassDef = (JavaClassDef) classDef;
      _isJavaWrapper = ! javaClassDef.isDelegate();
    }
   
    for (QuercusClass cls = parent; cls != null; cls = cls.getParent()) {
      AbstractFunction cons = cls.getConstructor();
     
      if (cons != null) {
        addMethod(new StringBuilderValue(cls.getName()), cons);
      }
    }
View Full Code Here

      throw new NullPointerException(L.l("'{0}' is a null function", name));
   
    //php/09j9
    // XXX: this is a hack to get Zend Framework running, the better fix is
    // to initialize all interface classes before any concrete classes
    AbstractFunction existingFun = _methodMap.getRaw(name);
   
    if (existingFun == null || ! fun.isAbstract())
      _methodMap.put(name.toString(), fun);
    else if (! existingFun.isAbstract() && fun.isAbstract())
      Env.getInstance().error(L.l("cannot make non-abstract function {0}:{1}() abstract",
                                  getName(), name));
  }
View Full Code Here

TOP

Related Classes of com.caucho.quercus.function.AbstractFunction

Copyright © 2018 www.massapicom. All rights reserved.
All source code are property of their respective owners. Java is a trademark of Sun Microsystems, Inc and owned by ORACLE Inc. Contact coftware#gmail.com.