예제 #1
0
ObjectData *eval_create_object_only_hook(CStrRef s, ObjectData *root) {
  Eval::ClassEvalState *ce = Eval::RequestEvalState::findClassState(s, true);
  if (ce) {
    Object tmp = ce->getClass()->create(*ce, root);
    return tmp.detach();
  }
  return 0;
}
예제 #2
0
bool eval_create_object_hook(Variant &res, const char *s, CArrRef params,
                             bool init, ObjectData *root) {
  Eval::ClassEvalState *ce = Eval::RequestEvalState::findClassState(s, true);
  if (ce) {
    res = ce->getClass()->create(*ce, params, init, root);
    return true;
  }
  return false;
}
예제 #3
0
bool eval_create_object_only_hook(Variant &res, const char *s,
    ObjectData *root) {
  Eval::ClassEvalState *ce = Eval::RequestEvalState::findClassState(s, true);
  if (ce) {
    res = ce->getClass()->create(*ce, null_array, false, root);
    return true;
  }
  return false;
}
예제 #4
0
bool eval_get_class_var_init_hook(Variant &res, CStrRef s,
                                  const char *var) {
  Eval::ClassEvalState *ce = Eval::RequestEvalState::findClassState(s, true);
  if (ce) {
    const Eval::ClassVariable *v = ce->getClass()->findVariable(var, true);
    if (v) {
      DummyVariableEnvironment env;
      v->eval(env, res);
      return true;
    }
  }
  return false;
}
예제 #5
0
ObjectData *eval_create_object_only_hook(CStrRef s, ObjectData *root) {
  if (hhvm) {
    assert_not_implemented(root == NULL);
    const StringData* className = StringData::GetStaticString(s.get());
    return g_vmContext->createObjectOnly((StringData*)className);
  } else {
    Eval::ClassEvalState *ce = Eval::RequestEvalState::findClassState(s, true);
    if (ce) {
      Object tmp = ce->getClass()->create(*ce, root);
      ObjectData* ret = tmp.detach();
      ret->decRefCount();
      return ret;
    }
    return 0;
  }
}