示例#1
0
        public void close()
        {
            QuercusClass cls = _wrapper.getQuercusClass();

            if (cls != null)
            {
                StringValue funName;

                if (_env.isUnicodeSemantics())
                {
                    funName = STREAM_CLOSE_U;
                }
                else
                {
                    funName = STREAM_CLOSE;
                }

                AbstractFunction fun = cls.findFunction(funName);

                if (fun == null)
                {
                    //_env.warning(L.l("{0}::{1} @is not implemented", cls.getName(), funName));

                    return;
                }

                _wrapper.callMethod(_env, funName);
            }
        }
示例#2
0
        public ReflectionMethod getMethod(Env env, StringValue name)
        {
            AbstractFunction fun = _cls.findFunction(name);

            if (fun == null)
            {
                throw new QuercusLanguageException(
                          env.createException("ReflectionException",
                                              L.l("method {0}::{1}() does not exist",
                                                  _name,
                                                  name)));
            }

            return(new ReflectionMethod(_name, _cls.getFunction(name)));
        }
        public bool unlink(Env env, StringValue path)
        {
            // php/1e23
            Value            obj      = _qClass.createObject(env);
            AbstractFunction function = _qClass.findFunction("unlink");

            if (function == null)
            {
                return(false);
            }

            Value result = function.callMethod(env, _qClass, obj, path);

            return(result.toBoolean());
        }
        public ReflectionClass getDeclaringClass(Env env)
        {
            if (_clsName != null)
            {
                QuercusClass cls    = env.findClass(_clsName);
                QuercusClass parent = cls.getParent();

                if (parent == null ||
                    parent.findFunction(_fun.getCallbackName()) != _fun)
                {
                    return(new ReflectionClass(cls));
                }
                else
                {
                    return(getDeclaringClass(env, parent));
                }
            }
            else
            {
                return(null);
            }
        }
        private ReflectionClass getDeclaringClass(Env env, QuercusClass cls)
        {
            if (cls == null)
            {
                return(null);
            }

            ReflectionClass refClass = getDeclaringClass(env, cls.getParent());

            if (refClass != null)
            {
                return(refClass);
            }
            else if (cls.findFunction(_fun.getCallbackName()) != null)
            {
                return(new ReflectionClass(cls));
            }
            else
            {
                return(null);
            }
        }