Package com.caucho.quercus.env

Examples of com.caucho.quercus.env.Value


    _isUnmarshalNullAsFalse = isUnmarshalNullAsFalse;
  }

  public Object marshal(Env env, Expr expr, Class argClass)
  {
    Value value = expr.eval(env);

    return marshal(env, value, argClass);
  }
View Full Code Here


    // php/1427
    if (value == null) {
      return BooleanValue.FALSE;
    }

    Value result = _marshal.unmarshal(env, value);

    return (result == null || result.isNull()) ? BooleanValue.FALSE : result;
  }
View Full Code Here

      log.log(Level.FINE, e.toString(), e);
      return false;
    }

    for (int i = 0; i < size; i++) {
      Value val = outParams[i];

      if (! (val instanceof Var)) {
        env.error(L.l("Only variables can be passed by reference"));
        return false;
      }
View Full Code Here

  private static final StringValue SERVER_NAME
    = new ConstStringValue("SERVER_NAME");

  private static BamPhpActor getActor(Env env)
  {
    Value actorValue = env.getGlobalValue("_quercus_bam_actor");

    if (actorValue != null && ! actorValue.isNull())
      return (BamPhpActor) actorValue.toJavaObject();

    return null;
  }
View Full Code Here

    return connection;
  }

  private static BamPhpServiceManager getServiceManager(Env env)
  {
    Value managerValue = env.getGlobalValue("_quercus_bam_service_manager");

    if (managerValue != null && ! managerValue.isNull())
      return (BamPhpServiceManager) managerValue.toJavaObject();

    return null;
  }
View Full Code Here

        int i = 0;
        Iterator<Value> iterator = subject.getValueIterator(env);

        while (iterator.hasNext()) {
          Value subjectValue = iterator.next();

          if (! subjectValue.isString())
            return env.error("subject values must be strings");

          subjects[i++] = new Text(subjectValue.toString());
        }
      }
      else if (subject.isString()) {
        if (! subject.isString())
          return env.error("subject values must be strings");

        subjects = new Text[] { new Text(subject.toString()) };
      }
    }

    // extract body text
    Text[] bodies = null;

    if (body.isArray()) {
      bodies = new Text[body.getSize()];

      int i = 0;
      Iterator<Value> iterator = body.getValueIterator(env);

      while (iterator.hasNext()) {
        Value bodyValue = iterator.next();

        if (! bodyValue.isString())
          return env.error("body values must be strings");

        bodies[i++] = new Text(bodyValue.toString());
      }
    }
    else if (body.isString()) {
      if (! body.isString())
        return env.error("body values must be strings");
View Full Code Here

        env.setGlobalValue("_quercus_bam_function_return", BooleanValue.FALSE);

        return BooleanValue.FALSE;
      }

      Value jid = env.getGlobalValue("_quercus_bam_service_jid");
      Value ret = function.call(env, jid);

      env.setGlobalValue("_quercus_bam_function_return", ret);

      return BooleanValue.TRUE;
    }

    // actor script dispatch

    Value eventTypeValue = env.getGlobalValue("_quercus_bam_event_type");

    if (eventTypeValue == null)
      return BooleanValue.FALSE;

    BamEventType eventType = (BamEventType) eventTypeValue.toJavaObject();

    Value to = env.getGlobalValue("_quercus_bam_to");
    Value from = env.getGlobalValue("_quercus_bam_from");
    Value value = env.getGlobalValue("_quercus_bam_value");

    AbstractFunction function = findFunction(env, eventType.getPrefix(), value);

    if (function == null) {
      log.fine(L.l("bam handler function not found for {0}", eventType));

      return BooleanValue.FALSE;
    }

    Value functionReturn = BooleanValue.FALSE;

    if (eventType.hasId() && eventType.hasError()) {
      Value id = env.getGlobalValue("_quercus_bam_id");
      Value error = env.getGlobalValue("_quercus_bam_error");

      functionReturn = function.call(env, id, to, from, value, error);
    }
    else if (! eventType.hasId() && eventType.hasError()) {
      Value error = env.getGlobalValue("_quercus_bam_error");

      functionReturn = function.call(env, to, from, value, error);
    }
    else if (eventType.hasId() && ! eventType.hasError()) {
      Value id = env.getGlobalValue("_quercus_bam_id");

      functionReturn = function.call(env, id, to, from, value);
    }
    else {
      functionReturn = function.call(env, to, from, value);
View Full Code Here

        StringValue name
        = QuercusMimeUtility.decodeMime(env, header.getName(), charset);
        StringValue val
        = QuercusMimeUtility.decodeMime(env, header.getValue(), charset);

        Value headerName;
        if ((headerName = headers.containsKey(name)) == null) {
          headers.put(name, val);
          continue;
        }

        ArrayValue inner;
        if (headerName.isArray()) {
          inner = headerName.toArrayValue(env);
        }
        else {
          inner = new ArrayValueImpl();
          inner.put(headerName);
        }
View Full Code Here

                                   String sql,
                                   String catalog)
  {
    clearErrors();

    Value currentCatalog = getCatalog();

    try {
      Connection conn = getConnection(env);

      if (conn == null)
        return null;

      conn.setCatalog(catalog);

      // need to create statement after setting catalog or
      // else statement will have wrong catalog
      Statement stmt = conn.createStatement();
      stmt.setEscapeProcessing(false);

      if (stmt.execute(sql)) {
        MysqliResult result
          = (MysqliResult) createResult(getEnv(), stmt, stmt.getResultSet());
        conn.setCatalog(currentCatalog.toString());
        return result;
      } else {
        conn.setCatalog(currentCatalog.toString());
        return null;
      }
    } catch (SQLException e) {
      saveErrors(e);
      log.log(Level.WARNING, e.toString(), e);
View Full Code Here

    return marshal(env, expr.eval(env), expectedClass);
  }

  public Object marshal(Env env, Value value, Class expectedClass)
  {
    Value arg = value.toBinaryValue(env);

    assert arg instanceof BinaryValue : "" + value.getClass() + ".toBinaryValue() returned a " + arg.getClass();

    return arg;
  }
View Full Code Here

TOP

Related Classes of com.caucho.quercus.env.Value

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.