public BinaryStream fopen(Env env, StringValue path, StringValue mode, LongValue options) {
    boolean useIncludePath = (options.toLong() & StreamModule.STREAM_USE_PATH) != 0;

    Value pathComponent = UrlModule.parse_url(env, path, UrlModule.PHP_URL_PATH);

    if (!pathComponent.isset()) {
      log.info(L.l("no path component found in '{0}'", path.toString()));
      return null;
    }

    return ZlibModule.gzopen(
        env, pathComponent.toStringValue(env), mode.toString(), useIncludePath);
  }
Esempio n. 2
0
  /** Creates a function call expression */
  @Override
  public Expr createCall(QuercusParser parser, Location location, ArrayList<Expr> args)
      throws IOException {
    Expr var = parser.createVar(_varName.toString());
    ExprFactory factory = parser.getExprFactory();

    return factory.createClassMethodCall(location, _className, var, args);
  }
Esempio n. 3
0
 /** Returns true if the variable is a superglobal. */
 public static boolean isSuperGlobal(StringValue name) {
   return _superGlobals.contains(name.toString());
 }