Separate resources from objects, part 1
In HHVM (and HPHPc before it) we've been piggybacking resources on the KindOfObject machinery. At the language level, resource is considered to be a different type than object, and there are a number of differences in behavior between objects and resources (ex. resources don't allow for dynamic properties, resources don't work with the clone operator, the "(object)" cast behaves differently for resources vs. objects, etc). Piggybacking resources on the KindOfObject machinery has some downsides. Code that deals with KindOfObject values often needs to check if the value is a resource and go down a different code path. This makes things harder to maintain and harder to keep parity with Zend. Also, these extra branches hurt performance a little, and they make it harder for the JIT to do a good job in some cases when its generating machine code that operates on objects. This diff prepares the code base for a new KindOfResource type by adding a new "Resource" smart pointer type (currently a typedef for the Object smart pointer type) and it updates the C++ code and the idl files appropriately. This diff is essentially a cosmetic change and should not impact run time behavior. In the next diff (part 2) we'll actually add a new KindOfResource type, detach ResourceData from the ObjectData inheritence hierarchy, and provide a real implementation for the Resource smart pointer type (instead of just aliasing the Object smart pointer type).
Esse commit está contido em:
@@ -126,7 +126,7 @@ Variant File::Open(CStrRef filename, CStrRef mode,
|
||||
if (file != nullptr) {
|
||||
file->m_name = filename.data();
|
||||
file->m_mode = mode.data();
|
||||
return Object(file);
|
||||
return Resource(file);
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -45,8 +45,8 @@ File* HttpStreamWrapper::open(CStrRef filename, CStrRef mode,
|
||||
}
|
||||
|
||||
std::unique_ptr<UrlFile> file;
|
||||
StreamContext *ctx = !context.isObject() ? nullptr :
|
||||
context.toObject().getTyped<StreamContext>();
|
||||
StreamContext *ctx = !context.isResource() ? nullptr :
|
||||
context.toResource().getTyped<StreamContext>();
|
||||
if (!ctx || ctx->m_options.isNull() || ctx->m_options[s_http].isNull()) {
|
||||
file = std::unique_ptr<UrlFile>(NEWOBJ(UrlFile)());
|
||||
} else {
|
||||
|
||||
@@ -608,7 +608,7 @@ bool SSLSocket::enableCrypto(bool activate /* = true */) {
|
||||
/* allow the script to capture the peer cert
|
||||
* and/or the certificate chain */
|
||||
if (m_context[s_capture_peer_cert].toBoolean()) {
|
||||
Object cert(new Certificate(peer_cert));
|
||||
Resource cert(new Certificate(peer_cert));
|
||||
m_context.set(s_peer_certificate, cert);
|
||||
peer_cert = nullptr;
|
||||
}
|
||||
@@ -619,7 +619,7 @@ bool SSLSocket::enableCrypto(bool activate /* = true */) {
|
||||
if (chain) {
|
||||
for (int i = 0; i < sk_X509_num(chain); i++) {
|
||||
X509 *mycert = X509_dup(sk_X509_value(chain, i));
|
||||
arr.append(Object(new Certificate(mycert)));
|
||||
arr.append(Resource(new Certificate(mycert)));
|
||||
}
|
||||
}
|
||||
m_context.set(s_peer_certificate_chain, arr);
|
||||
@@ -705,14 +705,14 @@ BIO *Certificate::ReadData(CVarRef var, bool *file /* = NULL */) {
|
||||
}
|
||||
|
||||
|
||||
Object Certificate::Get(CVarRef var) {
|
||||
Resource Certificate::Get(CVarRef var) {
|
||||
if (var.isResource()) {
|
||||
return var.toObject();
|
||||
return var.toResource();
|
||||
}
|
||||
if (var.isString() || var.isObject()) {
|
||||
bool file;
|
||||
BIO *in = ReadData(var, &file);
|
||||
if (in == nullptr) return Object();
|
||||
if (in == nullptr) return Resource();
|
||||
|
||||
X509 *cert;
|
||||
/*
|
||||
@@ -726,10 +726,10 @@ Object Certificate::Get(CVarRef var) {
|
||||
cert = PEM_read_bio_X509(in, nullptr, nullptr, nullptr);
|
||||
BIO_free(in);
|
||||
if (cert) {
|
||||
return Object(new Certificate(cert));
|
||||
return Resource(new Certificate(cert));
|
||||
}
|
||||
}
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
* to that cert
|
||||
* . it will be interpreted as the cert data
|
||||
*/
|
||||
static Object Get(CVarRef var);
|
||||
static Resource Get(CVarRef var);
|
||||
static BIO *ReadData(CVarRef var, bool *file = nullptr);
|
||||
};
|
||||
|
||||
|
||||
@@ -24,8 +24,7 @@ namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
/**
|
||||
* Base class of all resources used by extensions for opaquely passing object
|
||||
* pointers.
|
||||
* Base class of all PHP resources.
|
||||
*/
|
||||
class ResourceData : public ObjectData {
|
||||
public:
|
||||
|
||||
@@ -315,24 +315,24 @@ void PageletServer::Stop() {
|
||||
}
|
||||
}
|
||||
|
||||
Object PageletServer::TaskStart(CStrRef url, CArrRef headers,
|
||||
CStrRef remote_host,
|
||||
CStrRef post_data /* = null_string */,
|
||||
CArrRef files /* = null_array */) {
|
||||
Resource PageletServer::TaskStart(CStrRef url, CArrRef headers,
|
||||
CStrRef remote_host,
|
||||
CStrRef post_data /* = null_string */,
|
||||
CArrRef files /* = null_array */) {
|
||||
{
|
||||
Lock l(s_dispatchMutex);
|
||||
if (!s_dispatcher) {
|
||||
return null_object;
|
||||
return null_resource;
|
||||
}
|
||||
if (RuntimeOption::PageletServerQueueLimit > 0 &&
|
||||
s_dispatcher->getQueuedJobs() >
|
||||
RuntimeOption::PageletServerQueueLimit) {
|
||||
return null_object;
|
||||
return null_resource;
|
||||
}
|
||||
}
|
||||
PageletTask *task = NEWOBJ(PageletTask)(url, headers, remote_host, post_data,
|
||||
get_uploaded_files(), files);
|
||||
Object ret(task);
|
||||
Resource ret(task);
|
||||
PageletTransport *job = task->getJob();
|
||||
Lock l(s_dispatchMutex);
|
||||
if (s_dispatcher) {
|
||||
@@ -340,10 +340,10 @@ Object PageletServer::TaskStart(CStrRef url, CArrRef headers,
|
||||
s_dispatcher->enqueue(job);
|
||||
return ret;
|
||||
}
|
||||
return null_object;
|
||||
return null_resource;
|
||||
}
|
||||
|
||||
int64_t PageletServer::TaskStatus(CObjRef task) {
|
||||
int64_t PageletServer::TaskStatus(CResRef task) {
|
||||
PageletTask *ptask = task.getTyped<PageletTask>();
|
||||
PageletTransport *job = ptask->getJob();
|
||||
if (!job->isPipelineEmpty()) {
|
||||
@@ -355,7 +355,7 @@ int64_t PageletServer::TaskStatus(CObjRef task) {
|
||||
return PAGELET_NOT_READY;
|
||||
}
|
||||
|
||||
String PageletServer::TaskResult(CObjRef task, Array &headers, int &code,
|
||||
String PageletServer::TaskResult(CResRef task, Array &headers, int &code,
|
||||
int64_t timeout_ms) {
|
||||
PageletTask *ptask = task.getTyped<PageletTask>();
|
||||
return ptask->getJob()->getResults(headers, code, timeout_ms);
|
||||
|
||||
@@ -32,22 +32,22 @@ public:
|
||||
* Create a task. This returns a task handle, or null object
|
||||
* if there are no worker threads.
|
||||
*/
|
||||
static Object TaskStart(CStrRef url, CArrRef headers,
|
||||
CStrRef remote_host,
|
||||
CStrRef post_data = null_string,
|
||||
CArrRef files = null_array);
|
||||
static Resource TaskStart(CStrRef url, CArrRef headers,
|
||||
CStrRef remote_host,
|
||||
CStrRef post_data = null_string,
|
||||
CArrRef files = null_array);
|
||||
|
||||
/**
|
||||
* Query if a task is finished. This is non-blocking and can be called as
|
||||
* many times as desired.
|
||||
*/
|
||||
static int64_t TaskStatus(CObjRef task);
|
||||
static int64_t TaskStatus(CResRef task);
|
||||
|
||||
/**
|
||||
* Get results of a task. This is blocking until task is finished or times
|
||||
* out. The status code is set to -1 in the event of a timeout.
|
||||
*/
|
||||
static String TaskResult(CObjRef task,
|
||||
static String TaskResult(CResRef task,
|
||||
Array &headers,
|
||||
int &code,
|
||||
int64_t timeout_ms);
|
||||
|
||||
@@ -392,7 +392,7 @@ StaticString XboxTask::s_class_name("XboxTask");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Object XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) {
|
||||
Resource XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) {
|
||||
{
|
||||
Lock l(s_dispatchMutex);
|
||||
if (s_dispatcher &&
|
||||
@@ -401,7 +401,7 @@ Object XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) {
|
||||
s_dispatcher->getQueuedJobs() <
|
||||
RuntimeOption::XboxServerMaxQueueLength)) {
|
||||
XboxTask *task = NEWOBJ(XboxTask)(msg, reqInitDoc);
|
||||
Object ret(task);
|
||||
Resource ret(task);
|
||||
XboxTransport *job = task->getJob();
|
||||
job->incRefCount(); // paired with worker's decRefCount()
|
||||
Transport *transport = g_context->getTransport();
|
||||
@@ -422,15 +422,15 @@ Object XboxServer::TaskStart(CStrRef msg, CStrRef reqInitDoc /* = "" */) {
|
||||
|
||||
Object e = SystemLib::AllocExceptionObject(errMsg);
|
||||
throw_exception(e);
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
|
||||
bool XboxServer::TaskStatus(CObjRef task) {
|
||||
bool XboxServer::TaskStatus(CResRef task) {
|
||||
XboxTask *ptask = task.getTyped<XboxTask>();
|
||||
return ptask->getJob()->isDone();
|
||||
}
|
||||
|
||||
int XboxServer::TaskResult(CObjRef task, int timeout_ms, Variant &ret) {
|
||||
int XboxServer::TaskResult(CResRef task, int timeout_ms, Variant &ret) {
|
||||
XboxTask *ptask = task.getTyped<XboxTask>();
|
||||
|
||||
int code = 0;
|
||||
|
||||
@@ -47,9 +47,9 @@ public:
|
||||
/**
|
||||
* Local tasklet for parallel processing.
|
||||
*/
|
||||
static Object TaskStart(CStrRef msg, CStrRef reqInitDoc = "");
|
||||
static bool TaskStatus(CObjRef task);
|
||||
static int TaskResult(CObjRef task, int timeout_ms, Variant &ret);
|
||||
static Resource TaskStart(CStrRef msg, CStrRef reqInitDoc = "");
|
||||
static bool TaskStatus(CResRef task);
|
||||
static int TaskResult(CResRef task, int timeout_ms, Variant &ret);
|
||||
|
||||
/**
|
||||
* Gets the ServerInfo and RequestHandler for the current xbox worker thread.
|
||||
|
||||
@@ -162,7 +162,7 @@ String DateInterval::format(CStrRef format_spec) {
|
||||
return s.detach();
|
||||
}
|
||||
|
||||
SmartObject<DateInterval> DateInterval::cloneDateInterval() const {
|
||||
SmartResource<DateInterval> DateInterval::cloneDateInterval() const {
|
||||
if (!m_di) return NEWOBJ(DateInterval)();
|
||||
return NEWOBJ(DateInterval)(timelib_rel_time_clone(m_di.get()));
|
||||
}
|
||||
|
||||
@@ -70,8 +70,8 @@ public:
|
||||
CStrRef o_getClassNameHook() const { return s_class_name; }
|
||||
|
||||
DateInterval();
|
||||
DateInterval(CStrRef date_interval, bool date_string = false);
|
||||
DateInterval(timelib_rel_time *di);
|
||||
explicit DateInterval(CStrRef date_interval, bool date_string = false);
|
||||
explicit DateInterval(timelib_rel_time *di);
|
||||
|
||||
int64_t getYears() const { return m_di->y; }
|
||||
int64_t getMonths() const { return m_di->m; }
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
String format(CStrRef format_spec);
|
||||
|
||||
bool isValid() const { return get(); }
|
||||
SmartObject<DateInterval> cloneDateInterval() const;
|
||||
SmartResource<DateInterval> cloneDateInterval() const;
|
||||
|
||||
protected:
|
||||
friend class DateTime;
|
||||
|
||||
@@ -101,7 +101,7 @@ bool DateTime::IsValid(int y, int m, int d) {
|
||||
d <= timelib_days_in_month(y, m);
|
||||
}
|
||||
|
||||
SmartObject<DateTime> DateTime::Current(bool utc /* = false */) {
|
||||
SmartResource<DateTime> DateTime::Current(bool utc /* = false */) {
|
||||
return NEWOBJ(DateTime)(time(0), utc);
|
||||
}
|
||||
|
||||
@@ -411,7 +411,7 @@ void DateTime::setTime(int hour, int minute, int second) {
|
||||
update();
|
||||
}
|
||||
|
||||
void DateTime::setTimezone(SmartObject<TimeZone> timezone) {
|
||||
void DateTime::setTimezone(SmartResource<TimeZone> timezone) {
|
||||
if (!timezone.isNull()) {
|
||||
m_tz = timezone->cloneTimeZone();
|
||||
if (m_tz.get() && m_tz->get()) {
|
||||
@@ -447,12 +447,12 @@ void DateTime::internalModify(timelib_rel_time *rel,
|
||||
timelib_update_from_sse(m_time.get());
|
||||
}
|
||||
|
||||
void DateTime::add(const SmartObject<DateInterval> &interval) {
|
||||
void DateTime::add(const SmartResource<DateInterval> &interval) {
|
||||
timelib_rel_time *rel = interval->get();
|
||||
internalModify(rel, true, TIMELIB_REL_INVERT(rel) ? -1 : 1);
|
||||
}
|
||||
|
||||
void DateTime::sub(const SmartObject<DateInterval> &interval) {
|
||||
void DateTime::sub(const SmartResource<DateInterval> &interval) {
|
||||
timelib_rel_time *rel = interval->get();
|
||||
internalModify(rel, true, TIMELIB_REL_INVERT(rel) ? 1 : -1);
|
||||
}
|
||||
@@ -734,7 +734,7 @@ Array DateTime::toArray(ArrayFormat format) const {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool DateTime::fromString(CStrRef input, SmartObject<TimeZone> tz,
|
||||
bool DateTime::fromString(CStrRef input, SmartResource<TimeZone> tz,
|
||||
const char* format /*=NUL*/) {
|
||||
struct timelib_error_container *error;
|
||||
timelib_time *t;
|
||||
@@ -782,9 +782,9 @@ bool DateTime::fromString(CStrRef input, SmartObject<TimeZone> tz,
|
||||
return true;
|
||||
}
|
||||
|
||||
SmartObject<DateTime> DateTime::cloneDateTime() const {
|
||||
SmartResource<DateTime> DateTime::cloneDateTime() const {
|
||||
bool err;
|
||||
SmartObject<DateTime> ret(NEWOBJ(DateTime)(toTimeStamp(err), true));
|
||||
SmartResource<DateTime> ret(NEWOBJ(DateTime)(toTimeStamp(err), true));
|
||||
ret->setTimezone(m_tz);
|
||||
return ret;
|
||||
}
|
||||
@@ -792,13 +792,14 @@ SmartObject<DateTime> DateTime::cloneDateTime() const {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// comparison
|
||||
|
||||
SmartObject<DateInterval> DateTime::diff(SmartObject<DateTime> datetime2, bool absolute) {
|
||||
SmartResource<DateInterval>
|
||||
DateTime::diff(SmartResource<DateTime> datetime2, bool absolute) {
|
||||
#ifdef TIMELIB_HAVE_INTERVAL
|
||||
timelib_rel_time *rel = timelib_diff(m_time.get(), datetime2.get()->m_time.get());
|
||||
if (absolute) {
|
||||
TIMELIB_REL_INVERT_SET(rel, 0);
|
||||
}
|
||||
SmartObject<DateInterval> di(NEWOBJ(DateInterval)(rel));
|
||||
SmartResource<DateInterval> di(NEWOBJ(DateInterval)(rel));
|
||||
return di;
|
||||
#else
|
||||
throw NotImplementedException("timelib version too old");
|
||||
|
||||
@@ -211,7 +211,7 @@ public:
|
||||
/**
|
||||
* What time is it?
|
||||
*/
|
||||
static SmartObject<DateTime> Current(bool utc = false);
|
||||
static SmartResource<DateTime> Current(bool utc = false);
|
||||
|
||||
/**
|
||||
* Returns are really in special PHP formats, and please read datetime.cpp
|
||||
@@ -247,7 +247,7 @@ public:
|
||||
int isoYear() const;
|
||||
int isoDow() const;
|
||||
int offset() const; // timezone offset from UTC
|
||||
SmartObject<TimeZone> timezone() const { return m_tz->cloneTimeZone();}
|
||||
SmartResource<TimeZone> timezone() const { return m_tz->cloneTimeZone();}
|
||||
|
||||
const char *weekdayName() const;
|
||||
const char *shortWeekdayName() const;
|
||||
@@ -259,10 +259,10 @@ public:
|
||||
void setDate(int year, int month, int day);
|
||||
void setISODate(int year, int week, int day = 1);
|
||||
void setTime(int hour, int minute, int second = 0);
|
||||
void setTimezone(SmartObject<TimeZone> tz);
|
||||
void setTimezone(SmartResource<TimeZone> tz);
|
||||
void modify(CStrRef diff); // PHP's date_modify() function, very powerful
|
||||
void add(const SmartObject<DateInterval> &interval);
|
||||
void sub(const SmartObject<DateInterval> &interval);
|
||||
void add(const SmartResource<DateInterval> &interval);
|
||||
void sub(const SmartResource<DateInterval> &interval);
|
||||
void internalModify(timelib_rel_time *rel, bool have_relative, char bias);
|
||||
|
||||
// conversions
|
||||
@@ -273,13 +273,15 @@ public:
|
||||
String toString(DateFormat format) const;
|
||||
Array toArray(ArrayFormat format) const;
|
||||
void fromTimeStamp(int64_t timestamp, bool utc = false);
|
||||
bool fromString(CStrRef input, SmartObject<TimeZone> tz, const char* format=nullptr);
|
||||
bool fromString(CStrRef input, SmartResource<TimeZone> tz,
|
||||
const char* format=nullptr);
|
||||
|
||||
// comparison
|
||||
SmartObject<DateInterval> diff(SmartObject<DateTime> datetime2, bool absolute = false);
|
||||
SmartResource<DateInterval> diff(SmartResource<DateTime> datetime2,
|
||||
bool absolute = false);
|
||||
|
||||
// cloning
|
||||
SmartObject<DateTime> cloneDateTime() const;
|
||||
SmartResource<DateTime> cloneDateTime() const;
|
||||
|
||||
// sun info
|
||||
Array getSunInfo(double latitude, double longitude) const;
|
||||
@@ -343,7 +345,7 @@ private:
|
||||
typedef boost::shared_ptr<timelib_time> TimePtr;
|
||||
|
||||
TimePtr m_time;
|
||||
SmartObject<TimeZone> m_tz;
|
||||
SmartResource<TimeZone> m_tz;
|
||||
mutable int64_t m_timestamp;
|
||||
mutable bool m_timestampSet;
|
||||
|
||||
|
||||
@@ -69,7 +69,7 @@ int64_t TimeStamp::Get(bool &error, int hou, int min, int sec, int mon, int day,
|
||||
int yea, bool gmt) {
|
||||
DateTime dt(Current());
|
||||
if (gmt) {
|
||||
dt.setTimezone(SmartObject<TimeZone>(NEWOBJ(TimeZone)("UTC")));
|
||||
dt.setTimezone(SmartResource<TimeZone>(NEWOBJ(TimeZone)("UTC")));
|
||||
}
|
||||
dt.set(hou, min, sec, mon, day, yea);
|
||||
return dt.toTimeStamp(error);
|
||||
|
||||
@@ -136,7 +136,7 @@ String TimeZone::CurrentName() {
|
||||
return String(s_guessed_timezone.m_tzid);
|
||||
}
|
||||
|
||||
SmartObject<TimeZone> TimeZone::Current() {
|
||||
SmartResource<TimeZone> TimeZone::Current() {
|
||||
return NEWOBJ(TimeZone)(CurrentName());
|
||||
}
|
||||
|
||||
@@ -213,7 +213,7 @@ TimeZone::TimeZone(timelib_tzinfo *tzi) {
|
||||
m_tzi = TimeZoneInfo(tzi, tzinfo_deleter());
|
||||
}
|
||||
|
||||
SmartObject<TimeZone> TimeZone::cloneTimeZone() const {
|
||||
SmartResource<TimeZone> TimeZone::cloneTimeZone() const {
|
||||
if (!m_tzi) return NEWOBJ(TimeZone)();
|
||||
return NEWOBJ(TimeZone)(timelib_tzinfo_clone(m_tzi.get()));
|
||||
}
|
||||
|
||||
@@ -43,7 +43,7 @@ public:
|
||||
* Get/set current timezone that controls how local time is interpreted.
|
||||
*/
|
||||
static String CurrentName(); // current timezone's name
|
||||
static SmartObject<TimeZone> Current(); // current timezone
|
||||
static SmartResource<TimeZone> Current(); // current timezone
|
||||
static bool SetCurrent(CStrRef name); // returns false if invalid
|
||||
|
||||
/**
|
||||
@@ -109,7 +109,7 @@ public:
|
||||
/**
|
||||
* Make a copy of this timezone object, so it can be changed independently.
|
||||
*/
|
||||
SmartObject<TimeZone> cloneTimeZone() const;
|
||||
SmartResource<TimeZone> cloneTimeZone() const;
|
||||
|
||||
protected:
|
||||
friend class DateTime;
|
||||
|
||||
@@ -429,6 +429,5 @@ bool tvCoerceParamToObjectInPlace(TypedValue* tv) {
|
||||
return tv->m_type == KindOfObject;
|
||||
}
|
||||
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -154,4 +154,5 @@ void Object::setToDefaultObject() {
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
}
|
||||
|
||||
@@ -219,6 +219,9 @@ private:
|
||||
}
|
||||
};
|
||||
|
||||
typedef Object Resource;
|
||||
#define null_resource Object::s_nullObject
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
|
||||
@@ -413,6 +413,11 @@ class Variant : private TypedValue {
|
||||
return *reinterpret_cast<Object*>(&m_data.pobj);
|
||||
}
|
||||
|
||||
inline ALWAYS_INLINE Resource & asResRef() {
|
||||
assert(m_type == KindOfObject && m_data.pobj);
|
||||
return *reinterpret_cast<Object*>(&m_data.pobj);
|
||||
}
|
||||
|
||||
inline ALWAYS_INLINE Object& toObjRef() {
|
||||
assert(is(KindOfObject));
|
||||
assert(m_type == KindOfRef ? m_data.pref->var()->m_data.pobj : m_data.pobj);
|
||||
@@ -660,6 +665,10 @@ class Variant : private TypedValue {
|
||||
if (m_type == KindOfObject) return m_data.pobj;
|
||||
return toObjectHelper();
|
||||
}
|
||||
Resource toResource () const {
|
||||
if (m_type == KindOfObject) return m_data.pobj;
|
||||
return toObjectHelper();
|
||||
}
|
||||
/**
|
||||
* Whether or not calling toKey() will throw a bad type exception
|
||||
*/
|
||||
@@ -1202,6 +1211,7 @@ public:
|
||||
StringData *getStringData() const { return m_var.getStringData(); }
|
||||
Array toArray() const { return m_var.toArray(); }
|
||||
Object toObject() const { return m_var.toObject(); }
|
||||
Resource toResource() const { return m_var.toResource(); }
|
||||
ObjectData *getObjectData() const { return m_var.getObjectData(); }
|
||||
|
||||
CVarRef append(CVarRef v) const { return m_var.append(v); }
|
||||
|
||||
@@ -48,6 +48,7 @@ class StaticString;
|
||||
class Array;
|
||||
class Object;
|
||||
template<typename T> class SmartObject;
|
||||
#define SmartResource SmartObject
|
||||
class Variant;
|
||||
class VarNR;
|
||||
class RefData;
|
||||
@@ -151,6 +152,7 @@ typedef const char * litstr; /* literal string */
|
||||
typedef const String & CStrRef;
|
||||
typedef const Array & CArrRef;
|
||||
typedef const Object & CObjRef;
|
||||
typedef const Object & CResRef;
|
||||
typedef const Variant & CVarRef;
|
||||
|
||||
typedef const class VRefParamValue &VRefParam;
|
||||
|
||||
@@ -110,7 +110,7 @@ std::string CmdPrint::FormatResult(const char *format, CVarRef ret) {
|
||||
if (strcmp(format, "time") == 0) {
|
||||
DateTime dt;
|
||||
int64_t ts = -1;
|
||||
if (dt.fromString(ret.toString(), SmartObject<TimeZone>())) {
|
||||
if (dt.fromString(ret.toString(), SmartResource<TimeZone>())) {
|
||||
bool err;
|
||||
ts = dt.toTimeStamp(err);
|
||||
}
|
||||
|
||||
@@ -530,7 +530,7 @@ bool DebuggerClient::connectRemote(const std::string &host, int port) {
|
||||
// API mode, and in client mode we expect to destruct it ourselves
|
||||
// when ~DebuggerClient runs.
|
||||
sock->unregister();
|
||||
Object obj(sock); // Destroy sock if we don't connect.
|
||||
Resource obj(sock); // Destroy sock if we don't connect.
|
||||
if (f_socket_connect(sock, String(host), port)) {
|
||||
DMachineInfoPtr machine(new DMachineInfo());
|
||||
machine->m_name = host;
|
||||
@@ -555,7 +555,7 @@ bool DebuggerClient::reconnect() {
|
||||
Socket *sock = new Socket(socket(PF_INET, SOCK_STREAM, 0), PF_INET,
|
||||
host.c_str(), port);
|
||||
sock->unregister();
|
||||
Object obj(sock); // Destroy sock if we don't connect.
|
||||
Resource obj(sock); // Destroy sock if we don't connect.
|
||||
if (f_socket_connect(sock, String(host), port)) {
|
||||
for (unsigned int i = 0; i < m_machines.size(); i++) {
|
||||
if (m_machines[i] == m_machine) {
|
||||
|
||||
@@ -261,10 +261,10 @@ bool f_apc_bin_load(CStrRef data, int64_t flags /* = 0 */, int64_t cache_id /* =
|
||||
}
|
||||
Variant f_apc_bin_dumpfile(int64_t cache_id, CVarRef filter,
|
||||
CStrRef filename, int64_t flags /* = 0 */,
|
||||
CObjRef context /* = uninit_null() */) {
|
||||
CResRef context /* = uninit_null() */) {
|
||||
throw NotSupportedException(__func__, "feature not supported");
|
||||
}
|
||||
bool f_apc_bin_loadfile(CStrRef filename, CObjRef context /* = uninit_null() */,
|
||||
bool f_apc_bin_loadfile(CStrRef filename, CResRef context /* = uninit_null() */,
|
||||
int64_t flags /* = 0 */, int64_t cache_id /* = 0 */) {
|
||||
throw NotSupportedException(__func__, "feature not supported");
|
||||
}
|
||||
|
||||
@@ -52,9 +52,9 @@ Variant f_apc_bin_dump(int64_t cache_id = 0, CVarRef filter = null_variant);
|
||||
bool f_apc_bin_load(CStrRef data, int64_t flags = 0, int64_t cache_id = 0);
|
||||
Variant f_apc_bin_dumpfile(int64_t cache_id, CVarRef filter,
|
||||
CStrRef filename, int64_t flags = 0,
|
||||
CObjRef context = Object());
|
||||
CResRef context = Resource());
|
||||
bool f_apc_bin_loadfile(CStrRef filename,
|
||||
CObjRef context = Object(),
|
||||
CResRef context = Resource(),
|
||||
int64_t flags = 0, int64_t cache_id = 0);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -22,15 +22,15 @@
|
||||
namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Variant f_bzclose(CObjRef bz) {
|
||||
Variant f_bzclose(CResRef bz) {
|
||||
return f_fclose(bz);
|
||||
}
|
||||
|
||||
Variant f_bzread(CObjRef bz, int length /* = 1024 */) {
|
||||
Variant f_bzread(CResRef bz, int length /* = 1024 */) {
|
||||
return f_fread(bz, length);
|
||||
}
|
||||
|
||||
Variant f_bzwrite(CObjRef bz, CStrRef data, int length /* = 0 */) {
|
||||
Variant f_bzwrite(CResRef bz, CStrRef data, int length /* = 0 */) {
|
||||
return f_fwrite(bz, data, length);
|
||||
}
|
||||
|
||||
@@ -61,7 +61,7 @@ Variant f_bzopen(CVarRef filename, CStrRef mode) {
|
||||
raise_warning("first parameter has to be string or file-resource");
|
||||
return false;
|
||||
}
|
||||
PlainFile* f = filename.cast<PlainFile>();
|
||||
PlainFile* f = filename.toResource().getTyped<PlainFile>();
|
||||
if (!f) {
|
||||
return false;
|
||||
}
|
||||
@@ -91,26 +91,26 @@ Variant f_bzopen(CVarRef filename, CStrRef mode) {
|
||||
|
||||
bz = NEWOBJ(BZ2File)(f);
|
||||
}
|
||||
Object handle(bz);
|
||||
Resource handle(bz);
|
||||
return handle;
|
||||
}
|
||||
|
||||
Variant f_bzflush(CObjRef bz) {
|
||||
Variant f_bzflush(CResRef bz) {
|
||||
BZ2File *f = bz.getTyped<BZ2File>();
|
||||
return f->flush();
|
||||
}
|
||||
|
||||
String f_bzerrstr(CObjRef bz) {
|
||||
String f_bzerrstr(CResRef bz) {
|
||||
BZ2File *f = bz.getTyped<BZ2File>();
|
||||
return f->errstr();
|
||||
}
|
||||
|
||||
Variant f_bzerror(CObjRef bz) {
|
||||
Variant f_bzerror(CResRef bz) {
|
||||
BZ2File *f = bz.getTyped<BZ2File>();
|
||||
return f->error();
|
||||
}
|
||||
|
||||
int64_t f_bzerrno(CObjRef bz) {
|
||||
int64_t f_bzerrno(CResRef bz) {
|
||||
BZ2File *f = bz.getTyped<BZ2File>();
|
||||
return f->errnu();
|
||||
}
|
||||
|
||||
@@ -55,7 +55,7 @@ private:
|
||||
|
||||
int method;
|
||||
Variant callback;
|
||||
SmartObject<File> fp;
|
||||
SmartResource<File> fp;
|
||||
StringBuffer buf;
|
||||
String content;
|
||||
int type;
|
||||
@@ -67,7 +67,7 @@ private:
|
||||
|
||||
int method;
|
||||
Variant callback;
|
||||
SmartObject<File> fp;
|
||||
SmartResource<File> fp;
|
||||
};
|
||||
|
||||
DECLARE_BOOST_TYPES(ToFree);
|
||||
@@ -409,11 +409,11 @@ public:
|
||||
case CURLOPT_WRITEHEADER:
|
||||
case CURLOPT_STDERR:
|
||||
{
|
||||
if (!value.is(KindOfObject)) {
|
||||
if (!value.isResource()) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Object obj = value.toObject();
|
||||
Resource obj = value.toResource();
|
||||
if (obj.isNull() || obj.getTyped<File>(true) == NULL) {
|
||||
return false;
|
||||
}
|
||||
@@ -627,7 +627,7 @@ public:
|
||||
{
|
||||
int data_size = size * nmemb;
|
||||
Variant ret = ch->do_callback(
|
||||
t->callback, CREATE_VECTOR3(Object(ch), t->fp->fd(), data_size));
|
||||
t->callback, CREATE_VECTOR3(Resource(ch), t->fp->fd(), data_size));
|
||||
if (ret.isString()) {
|
||||
String sret = ret.toString();
|
||||
length = data_size < sret.size() ? data_size : sret.size();
|
||||
@@ -659,7 +659,7 @@ public:
|
||||
{
|
||||
Variant ret = ch->do_callback(
|
||||
t->callback,
|
||||
CREATE_VECTOR2(Object(ch), String(data, length, CopyString)));
|
||||
CREATE_VECTOR2(Resource(ch), String(data, length, CopyString)));
|
||||
length = ret.toInt64();
|
||||
}
|
||||
break;
|
||||
@@ -689,7 +689,7 @@ public:
|
||||
{
|
||||
Variant ret = ch->do_callback(
|
||||
t->callback,
|
||||
CREATE_VECTOR2(Object(ch), String(data, length, CopyString)));
|
||||
CREATE_VECTOR2(Resource(ch), String(data, length, CopyString)));
|
||||
length = ret.toInt64();
|
||||
}
|
||||
break;
|
||||
@@ -759,7 +759,7 @@ Variant f_curl_init(CStrRef url /* = null_string */) {
|
||||
return NEWOBJ(CurlResource)(url);
|
||||
}
|
||||
|
||||
Variant f_curl_copy_handle(CObjRef ch) {
|
||||
Variant f_curl_copy_handle(CResRef ch) {
|
||||
CHECK_RESOURCE(curl);
|
||||
return NEWOBJ(CurlResource)(curl);
|
||||
}
|
||||
@@ -801,12 +801,12 @@ Variant f_curl_version(int uversion /* = k_CURLVERSION_NOW */) {
|
||||
return ret.create();
|
||||
}
|
||||
|
||||
bool f_curl_setopt(CObjRef ch, int option, CVarRef value) {
|
||||
bool f_curl_setopt(CResRef ch, int option, CVarRef value) {
|
||||
CHECK_RESOURCE(curl);
|
||||
return curl->setOption(option, value);
|
||||
}
|
||||
|
||||
bool f_curl_setopt_array(CObjRef ch, CArrRef options) {
|
||||
bool f_curl_setopt_array(CResRef ch, CArrRef options) {
|
||||
CHECK_RESOURCE(curl);
|
||||
for (ArrayIter iter(options); iter; ++iter) {
|
||||
if (!curl->setOption(iter.first().toInt32(), iter.second())) {
|
||||
@@ -816,12 +816,12 @@ bool f_curl_setopt_array(CObjRef ch, CArrRef options) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant f_fb_curl_getopt(CObjRef ch, int opt /* = 0 */) {
|
||||
Variant f_fb_curl_getopt(CResRef ch, int opt /* = 0 */) {
|
||||
CHECK_RESOURCE(curl);
|
||||
return curl->getOption(opt);
|
||||
}
|
||||
|
||||
Variant f_curl_exec(CObjRef ch) {
|
||||
Variant f_curl_exec(CResRef ch) {
|
||||
CHECK_RESOURCE(curl);
|
||||
return curl->execute();
|
||||
}
|
||||
@@ -850,7 +850,7 @@ const StaticString
|
||||
s_redirect_time("redirect_time"),
|
||||
s_request_header("request_header");
|
||||
|
||||
Variant f_curl_getinfo(CObjRef ch, int opt /* = 0 */) {
|
||||
Variant f_curl_getinfo(CResRef ch, int opt /* = 0 */) {
|
||||
CHECK_RESOURCE(curl);
|
||||
CURL *cp = curl->get();
|
||||
|
||||
@@ -998,17 +998,17 @@ Variant f_curl_getinfo(CObjRef ch, int opt /* = 0 */) {
|
||||
return uninit_null();
|
||||
}
|
||||
|
||||
Variant f_curl_errno(CObjRef ch) {
|
||||
Variant f_curl_errno(CResRef ch) {
|
||||
CHECK_RESOURCE(curl);
|
||||
return curl->getError();
|
||||
}
|
||||
|
||||
Variant f_curl_error(CObjRef ch) {
|
||||
Variant f_curl_error(CResRef ch) {
|
||||
CHECK_RESOURCE(curl);
|
||||
return curl->getErrorString();
|
||||
}
|
||||
|
||||
Variant f_curl_close(CObjRef ch) {
|
||||
Variant f_curl_close(CResRef ch) {
|
||||
CHECK_RESOURCE(curl);
|
||||
curl->close();
|
||||
return uninit_null();
|
||||
@@ -1040,13 +1040,13 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
void add(CObjRef ch) {
|
||||
void add(CResRef ch) {
|
||||
m_easyh.append(ch);
|
||||
}
|
||||
|
||||
void remove(CurlResource *curle) {
|
||||
for (ArrayIter iter(m_easyh); iter; ++iter) {
|
||||
if (iter.second().toObject().getTyped<CurlResource>()->get(true) ==
|
||||
if (iter.second().toResource().getTyped<CurlResource>()->get(true) ==
|
||||
curle->get()) {
|
||||
m_easyh.remove(iter.first());
|
||||
return;
|
||||
@@ -1054,20 +1054,21 @@ public:
|
||||
}
|
||||
}
|
||||
|
||||
Object find(CURL *cp) {
|
||||
Resource find(CURL *cp) {
|
||||
for (ArrayIter iter(m_easyh); iter; ++iter) {
|
||||
if (iter.second().toObject().getTyped<CurlResource>()->get(true) == cp) {
|
||||
return iter.second().toObject();
|
||||
if (iter.second().toResource().
|
||||
getTyped<CurlResource>()->get(true) == cp) {
|
||||
return iter.second().toResource();
|
||||
}
|
||||
}
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
|
||||
void check_exceptions() {
|
||||
ObjectData* phpException = 0;
|
||||
Exception* cppException = 0;
|
||||
for (ArrayIter iter(m_easyh); iter; ++iter) {
|
||||
CurlResource* curl = iter.second().toCObjRef(). getTyped<CurlResource>();
|
||||
CurlResource* curl = iter.second().toResource().getTyped<CurlResource>();
|
||||
if (ObjectData* e = curl->getAndClearPhpException()) {
|
||||
if (phpException) {
|
||||
e->o_set(s_previous, Variant(phpException), s_exception);
|
||||
@@ -1119,25 +1120,25 @@ StaticString CurlMultiResource::s_class_name("cURL Multi Handle");
|
||||
return uninit_null(); \
|
||||
} \
|
||||
|
||||
Object f_curl_multi_init() {
|
||||
Resource f_curl_multi_init() {
|
||||
return NEWOBJ(CurlMultiResource)();
|
||||
}
|
||||
|
||||
Variant f_curl_multi_add_handle(CObjRef mh, CObjRef ch) {
|
||||
Variant f_curl_multi_add_handle(CResRef mh, CResRef ch) {
|
||||
CHECK_MULTI_RESOURCE(curlm);
|
||||
CurlResource *curle = ch.getTyped<CurlResource>();
|
||||
curlm->add(ch);
|
||||
return curl_multi_add_handle(curlm->get(), curle->get());
|
||||
}
|
||||
|
||||
Variant f_curl_multi_remove_handle(CObjRef mh, CObjRef ch) {
|
||||
Variant f_curl_multi_remove_handle(CResRef mh, CResRef ch) {
|
||||
CHECK_MULTI_RESOURCE(curlm);
|
||||
CurlResource *curle = ch.getTyped<CurlResource>();
|
||||
curlm->remove(curle);
|
||||
return curl_multi_remove_handle(curlm->get(), curle->get());
|
||||
}
|
||||
|
||||
Variant f_curl_multi_exec(CObjRef mh, VRefParam still_running) {
|
||||
Variant f_curl_multi_exec(CResRef mh, VRefParam still_running) {
|
||||
CHECK_MULTI_RESOURCE(curlm);
|
||||
int running = still_running;
|
||||
IOStatusHelper io("curl_multi_exec");
|
||||
@@ -1192,7 +1193,7 @@ static void hphp_curl_multi_select(CURLM *mh, int timeout_ms, int *ret) {
|
||||
# endif
|
||||
#endif
|
||||
|
||||
Variant f_curl_multi_select(CObjRef mh, double timeout /* = 1.0 */) {
|
||||
Variant f_curl_multi_select(CResRef mh, double timeout /* = 1.0 */) {
|
||||
CHECK_MULTI_RESOURCE(curlm);
|
||||
int ret;
|
||||
unsigned long timeout_ms = (unsigned long)(timeout * 1000.0);
|
||||
@@ -1201,7 +1202,7 @@ Variant f_curl_multi_select(CObjRef mh, double timeout /* = 1.0 */) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_curl_multi_getcontent(CObjRef ch) {
|
||||
Variant f_curl_multi_getcontent(CResRef ch) {
|
||||
CHECK_RESOURCE(curl);
|
||||
return curl->getContents();
|
||||
}
|
||||
@@ -1217,7 +1218,7 @@ Array f_curl_convert_fd_to_stream(fd_set *fd, int max_fd) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_fb_curl_multi_fdset(CObjRef mh,
|
||||
Variant f_fb_curl_multi_fdset(CResRef mh,
|
||||
VRefParam read_fd_set,
|
||||
VRefParam write_fd_set,
|
||||
VRefParam exc_fd_set,
|
||||
@@ -1249,7 +1250,7 @@ const StaticString
|
||||
s_headers("headers"),
|
||||
s_requests("requests");
|
||||
|
||||
Variant f_curl_multi_info_read(CObjRef mh,
|
||||
Variant f_curl_multi_info_read(CResRef mh,
|
||||
VRefParam msgs_in_queue /* = null */) {
|
||||
CHECK_MULTI_RESOURCE(curlm);
|
||||
|
||||
@@ -1264,14 +1265,14 @@ Variant f_curl_multi_info_read(CObjRef mh,
|
||||
Array ret;
|
||||
ret.set(s_msg, tmp_msg->msg);
|
||||
ret.set(s_result, tmp_msg->data.result);
|
||||
Object curle = curlm->find(tmp_msg->easy_handle);
|
||||
Resource curle = curlm->find(tmp_msg->easy_handle);
|
||||
if (!curle.isNull()) {
|
||||
ret.set(s_handle, curle);
|
||||
}
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_curl_multi_close(CObjRef mh) {
|
||||
Variant f_curl_multi_close(CResRef mh) {
|
||||
CHECK_MULTI_RESOURCE(curlm);
|
||||
curlm->close();
|
||||
return uninit_null();
|
||||
@@ -1424,7 +1425,7 @@ Variant f_evhttp_async_get(CStrRef url, CArrRef headers /* = null_array */,
|
||||
LibEventHttpClientPtr client = prepare_client(url, "", headers, timeout,
|
||||
true, false);
|
||||
if (client) {
|
||||
return Object(NEWOBJ(LibEventHttpHandle)(client));
|
||||
return Resource(NEWOBJ(LibEventHttpHandle)(client));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1438,12 +1439,12 @@ Variant f_evhttp_async_post(CStrRef url, CStrRef data,
|
||||
LibEventHttpClientPtr client = prepare_client(url, data, headers, timeout,
|
||||
true, true);
|
||||
if (client) {
|
||||
return Object(NEWOBJ(LibEventHttpHandle)(client));
|
||||
return Resource(NEWOBJ(LibEventHttpHandle)(client));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
|
||||
Variant f_evhttp_recv(CObjRef handle) {
|
||||
Variant f_evhttp_recv(CResRef handle) {
|
||||
if (RuntimeOption::ServerHttpSafeMode) {
|
||||
throw_fatal("evhttp_recv is disabled");
|
||||
}
|
||||
|
||||
@@ -29,31 +29,31 @@ namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Variant f_curl_init(CStrRef url = null_string);
|
||||
Variant f_curl_copy_handle(CObjRef ch);
|
||||
Variant f_curl_copy_handle(CResRef ch);
|
||||
Variant f_curl_version(int uversion = k_CURLVERSION_NOW);
|
||||
bool f_curl_setopt(CObjRef ch, int option, CVarRef value);
|
||||
bool f_curl_setopt_array(CObjRef ch, CArrRef options);
|
||||
Variant f_fb_curl_getopt(CObjRef ch, int opt = 0);
|
||||
Variant f_curl_exec(CObjRef ch);
|
||||
Variant f_curl_getinfo(CObjRef ch, int opt = 0);
|
||||
Variant f_curl_errno(CObjRef ch);
|
||||
Variant f_curl_error(CObjRef ch);
|
||||
Variant f_curl_close(CObjRef ch);
|
||||
Object f_curl_multi_init();
|
||||
Variant f_curl_multi_add_handle(CObjRef mh, CObjRef ch);
|
||||
Variant f_curl_multi_remove_handle(CObjRef mh, CObjRef ch);
|
||||
Variant f_curl_multi_exec(CObjRef mh, VRefParam still_running);
|
||||
Variant f_curl_multi_select(CObjRef mh, double timeout = 1.0);
|
||||
Variant f_fb_curl_multi_fdset(CObjRef mh, VRefParam read_fd_set, VRefParam write_fd_set, VRefParam exc_fd_set, VRefParam max_fd = null_object);
|
||||
Variant f_curl_multi_getcontent(CObjRef ch);
|
||||
Variant f_curl_multi_info_read(CObjRef mh, VRefParam msgs_in_queue = uninit_null());
|
||||
Variant f_curl_multi_close(CObjRef mh);
|
||||
bool f_curl_setopt(CResRef ch, int option, CVarRef value);
|
||||
bool f_curl_setopt_array(CResRef ch, CArrRef options);
|
||||
Variant f_fb_curl_getopt(CResRef ch, int opt = 0);
|
||||
Variant f_curl_exec(CResRef ch);
|
||||
Variant f_curl_getinfo(CResRef ch, int opt = 0);
|
||||
Variant f_curl_errno(CResRef ch);
|
||||
Variant f_curl_error(CResRef ch);
|
||||
Variant f_curl_close(CResRef ch);
|
||||
Resource f_curl_multi_init();
|
||||
Variant f_curl_multi_add_handle(CResRef mh, CResRef ch);
|
||||
Variant f_curl_multi_remove_handle(CResRef mh, CResRef ch);
|
||||
Variant f_curl_multi_exec(CResRef mh, VRefParam still_running);
|
||||
Variant f_curl_multi_select(CResRef mh, double timeout = 1.0);
|
||||
Variant f_fb_curl_multi_fdset(CResRef mh, VRefParam read_fd_set, VRefParam write_fd_set, VRefParam exc_fd_set, VRefParam max_fd = null_object);
|
||||
Variant f_curl_multi_getcontent(CResRef ch);
|
||||
Variant f_curl_multi_info_read(CResRef mh, VRefParam msgs_in_queue = uninit_null());
|
||||
Variant f_curl_multi_close(CResRef mh);
|
||||
void f_evhttp_set_cache(CStrRef address, int max_conn, int port = 80);
|
||||
Variant f_evhttp_get(CStrRef url, CArrRef headers = null_array, int timeout = 5);
|
||||
Variant f_evhttp_post(CStrRef url, CStrRef data, CArrRef headers = null_array, int timeout = 5);
|
||||
Variant f_evhttp_async_get(CStrRef url, CArrRef headers = null_array, int timeout = 5);
|
||||
Variant f_evhttp_async_post(CStrRef url, CStrRef data, CArrRef headers = null_array, int timeout = 5);
|
||||
Variant f_evhttp_recv(CObjRef handle);
|
||||
Variant f_evhttp_recv(CResRef handle);
|
||||
|
||||
extern const int64_t k_CURLINFO_LOCAL_PORT;
|
||||
extern const int64_t k_CURLOPT_TIMEOUT_MS;
|
||||
|
||||
@@ -118,7 +118,7 @@ int64_t c_DateTime::t_gettimestamp() {
|
||||
}
|
||||
|
||||
Variant c_DateTime::t_gettimezone() {
|
||||
SmartObject<TimeZone> tz = m_dt->timezone();
|
||||
SmartResource<TimeZone> tz = m_dt->timezone();
|
||||
if (tz->isValid()) {
|
||||
return c_DateTimeZone::wrap(tz);
|
||||
}
|
||||
@@ -308,7 +308,7 @@ Variant c_DateInterval::t___set(Variant member, Variant value) {
|
||||
}
|
||||
|
||||
Object c_DateInterval::ti_createfromdatestring(CStrRef time) {
|
||||
SmartObject<DateInterval> di(NEWOBJ(DateInterval)(time, true));
|
||||
SmartResource<DateInterval> di(NEWOBJ(DateInterval)(time, true));
|
||||
return c_DateInterval::wrap(di);
|
||||
}
|
||||
|
||||
@@ -429,7 +429,7 @@ Variant f_strtotime(CStrRef input,
|
||||
}
|
||||
|
||||
DateTime dt(timestamp);
|
||||
if (!dt.fromString(input, SmartObject<TimeZone>())) {
|
||||
if (!dt.fromString(input, SmartResource<TimeZone>())) {
|
||||
return false;
|
||||
}
|
||||
bool error;
|
||||
|
||||
@@ -67,7 +67,7 @@ class c_DateTime : public ExtObjectData {
|
||||
public: Object t_sub(CObjRef interval);
|
||||
|
||||
// Helper for DateTime -> c_DateTime conversion
|
||||
public: static Object wrap(SmartObject<DateTime> dt) {
|
||||
public: static Object wrap(SmartResource<DateTime> dt) {
|
||||
c_DateTime *cdt = NEWOBJ(c_DateTime)();
|
||||
Object ret(cdt);
|
||||
cdt->m_dt = dt;
|
||||
@@ -75,15 +75,15 @@ class c_DateTime : public ExtObjectData {
|
||||
}
|
||||
|
||||
// Helper for c_DateTime -> DateTime conversion
|
||||
public: static SmartObject<DateTime> unwrap(CObjRef datetime) {
|
||||
public: static SmartResource<DateTime> unwrap(CObjRef datetime) {
|
||||
SmartObject<c_DateTime> cdt = datetime.getTyped<c_DateTime>(true);
|
||||
if (cdt.get() == NULL)
|
||||
return SmartObject<DateTime>();
|
||||
return SmartResource<DateTime>();
|
||||
return cdt->m_dt;
|
||||
}
|
||||
|
||||
private:
|
||||
SmartObject<DateTime> m_dt;
|
||||
SmartResource<DateTime> m_dt;
|
||||
public:
|
||||
virtual c_DateTime* clone();
|
||||
};
|
||||
@@ -123,7 +123,7 @@ class c_DateTimeZone : public ExtObjectData {
|
||||
public: static Array ti_listidentifiers();
|
||||
|
||||
// Helper for TimeZone -> c_DateTimeZone conversion
|
||||
public: static Object wrap(SmartObject<TimeZone> tz) {
|
||||
public: static Object wrap(SmartResource<TimeZone> tz) {
|
||||
c_DateTimeZone *ctz = NEWOBJ(c_DateTimeZone)();
|
||||
Object ret(ctz);
|
||||
ctz->m_tz = tz;
|
||||
@@ -131,15 +131,15 @@ class c_DateTimeZone : public ExtObjectData {
|
||||
}
|
||||
|
||||
// Helper for c_DateTimeZone -> TimeZone conversion
|
||||
public: static SmartObject<TimeZone> unwrap(CObjRef timezone) {
|
||||
public: static SmartResource<TimeZone> unwrap(CObjRef timezone) {
|
||||
SmartObject<c_DateTimeZone> ctz = timezone.getTyped<c_DateTimeZone>(true);
|
||||
if (ctz.get() == NULL)
|
||||
return SmartObject<TimeZone>();
|
||||
return SmartResource<TimeZone>();
|
||||
return ctz->m_tz;
|
||||
}
|
||||
|
||||
private:
|
||||
SmartObject<TimeZone> m_tz;
|
||||
SmartResource<TimeZone> m_tz;
|
||||
public:
|
||||
virtual c_DateTimeZone* clone();
|
||||
};
|
||||
@@ -162,23 +162,23 @@ class c_DateInterval : public ExtObjectDataFlags<ObjectData::UseGet|ObjectData::
|
||||
public: String t_format(CStrRef format);
|
||||
|
||||
|
||||
public: static Object wrap(SmartObject<DateInterval> di) {
|
||||
public: static Object wrap(SmartResource<DateInterval> di) {
|
||||
c_DateInterval *cdi = NEWOBJ(c_DateInterval)();
|
||||
Object ret(cdi);
|
||||
cdi->m_di = di;
|
||||
return ret;
|
||||
}
|
||||
|
||||
public: static SmartObject<DateInterval> unwrap(CObjRef dateinterval) {
|
||||
public: static SmartResource<DateInterval> unwrap(CObjRef dateinterval) {
|
||||
SmartObject<c_DateInterval>
|
||||
cdi = dateinterval.getTyped<c_DateInterval>(true);
|
||||
if (cdi.get() == NULL)
|
||||
return SmartObject<DateInterval>();
|
||||
return SmartResource<DateInterval>();
|
||||
return cdi->m_di;
|
||||
}
|
||||
|
||||
private:
|
||||
SmartObject<DateInterval> m_di;
|
||||
SmartResource<DateInterval> m_di;
|
||||
public:
|
||||
virtual c_DateInterval* clone();
|
||||
|
||||
|
||||
@@ -147,7 +147,8 @@ Variant f_fopen(CStrRef filename, CStrRef mode,
|
||||
bool use_include_path /* = false */,
|
||||
CVarRef context /* = null */) {
|
||||
if (!context.isNull() &&
|
||||
(!context.isObject() || !context.toObject().getTyped<StreamContext>())) {
|
||||
(!context.isResource() ||
|
||||
!context.toResource().getTyped<StreamContext>())) {
|
||||
raise_warning("$context must be a valid Stream Context or NULL");
|
||||
return false;
|
||||
}
|
||||
@@ -159,7 +160,7 @@ Variant f_fopen(CStrRef filename, CStrRef mode,
|
||||
|
||||
Variant f_popen(CStrRef command, CStrRef mode) {
|
||||
File *file = NEWOBJ(Pipe)();
|
||||
Object handle(file);
|
||||
Resource handle(file);
|
||||
bool ret = CHECK_ERROR(file->open(File::TranslateCommand(command), mode));
|
||||
if (!ret) {
|
||||
return false;
|
||||
@@ -167,29 +168,29 @@ Variant f_popen(CStrRef command, CStrRef mode) {
|
||||
return handle;
|
||||
}
|
||||
|
||||
bool f_fclose(CObjRef handle) {
|
||||
bool f_fclose(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return CHECK_ERROR(f->close());
|
||||
}
|
||||
|
||||
Variant f_pclose(CObjRef handle) {
|
||||
Variant f_pclose(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
CHECK_ERROR(f->close());
|
||||
return s_file_data->m_pcloseRet;
|
||||
}
|
||||
|
||||
Variant f_fseek(CObjRef handle, int64_t offset,
|
||||
Variant f_fseek(CResRef handle, int64_t offset,
|
||||
int64_t whence /* = k_SEEK_SET */) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return CHECK_ERROR(f->seek(offset, whence)) ? 0 : -1;
|
||||
}
|
||||
|
||||
bool f_rewind(CObjRef handle) {
|
||||
bool f_rewind(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return CHECK_ERROR(f->rewind());
|
||||
}
|
||||
|
||||
Variant f_ftell(CObjRef handle) {
|
||||
Variant f_ftell(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
int64_t ret = f->tell();
|
||||
if (!CHECK_ERROR(ret != -1)) {
|
||||
@@ -198,12 +199,12 @@ Variant f_ftell(CObjRef handle) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_feof(CObjRef handle) {
|
||||
bool f_feof(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return f->eof();
|
||||
}
|
||||
|
||||
Variant f_fstat(CObjRef handle) {
|
||||
Variant f_fstat(CResRef handle) {
|
||||
PlainFile *file = handle.getTyped<PlainFile>(true, true);
|
||||
if (file == NULL) {
|
||||
raise_warning("Not a valid stream resource");
|
||||
@@ -214,12 +215,12 @@ Variant f_fstat(CObjRef handle) {
|
||||
return stat_impl(&sb);
|
||||
}
|
||||
|
||||
Variant f_fread(CObjRef handle, int64_t length) {
|
||||
Variant f_fread(CResRef handle, int64_t length) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return f->read(length);
|
||||
}
|
||||
|
||||
Variant f_fgetc(CObjRef handle) {
|
||||
Variant f_fgetc(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
int result = f->getc();
|
||||
if (result == EOF) {
|
||||
@@ -228,7 +229,7 @@ Variant f_fgetc(CObjRef handle) {
|
||||
return String::FromChar(result);
|
||||
}
|
||||
|
||||
Variant f_fgets(CObjRef handle, int64_t length /* = 0 */) {
|
||||
Variant f_fgets(CResRef handle, int64_t length /* = 0 */) {
|
||||
if (length < 0) {
|
||||
throw_invalid_argument("length (negative): %" PRId64, length);
|
||||
return false;
|
||||
@@ -241,7 +242,7 @@ Variant f_fgets(CObjRef handle, int64_t length /* = 0 */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Variant f_fgetss(CObjRef handle, int64_t length /* = 0 */,
|
||||
Variant f_fgetss(CResRef handle, int64_t length /* = 0 */,
|
||||
CStrRef allowable_tags /* = null_string */) {
|
||||
Variant ret = f_fgets(handle, length);
|
||||
if (!same(ret, false)) {
|
||||
@@ -250,53 +251,55 @@ Variant f_fgetss(CObjRef handle, int64_t length /* = 0 */,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_fscanf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv /* = null_array */) {
|
||||
Variant f_fscanf(int _argc, CResRef handle, CStrRef format,
|
||||
CArrRef _argv /* = null_array */) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return f_sscanf(_argc, f->readLine(), format, _argv);
|
||||
}
|
||||
|
||||
Variant f_fpassthru(CObjRef handle) {
|
||||
Variant f_fpassthru(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return f->print();
|
||||
}
|
||||
|
||||
Variant f_fwrite(CObjRef handle, CStrRef data, int64_t length /* = 0 */) {
|
||||
Variant f_fwrite(CResRef handle, CStrRef data, int64_t length /* = 0 */) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
int64_t ret = f->write(data, length);
|
||||
if (ret < 0) ret = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_fputs(CObjRef handle, CStrRef data, int64_t length /* = 0 */) {
|
||||
Variant f_fputs(CResRef handle, CStrRef data, int64_t length /* = 0 */) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
int64_t ret = f->write(data, length);
|
||||
if (ret < 0) ret = 0;
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_fprintf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv /* = null_array */) {
|
||||
Variant f_fprintf(int _argc, CResRef handle, CStrRef format,
|
||||
CArrRef _argv /* = null_array */) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return f->printf(format, _argv);
|
||||
}
|
||||
|
||||
Variant f_vfprintf(CObjRef handle, CStrRef format, CArrRef args) {
|
||||
Variant f_vfprintf(CResRef handle, CStrRef format, CArrRef args) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return f->printf(format, args);
|
||||
}
|
||||
|
||||
bool f_fflush(CObjRef handle) {
|
||||
bool f_fflush(CResRef handle) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return CHECK_ERROR(f->flush());
|
||||
}
|
||||
|
||||
bool f_ftruncate(CObjRef handle, int64_t size) {
|
||||
bool f_ftruncate(CResRef handle, int64_t size) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
return CHECK_ERROR(f->truncate(size));
|
||||
}
|
||||
|
||||
static int flock_values[] = { LOCK_SH, LOCK_EX, LOCK_UN };
|
||||
|
||||
bool f_flock(CObjRef handle, int operation, VRefParam wouldblock /* = null */) {
|
||||
bool f_flock(CResRef handle, int operation, VRefParam wouldblock /* = null */) {
|
||||
CHECK_HANDLE(handle, f);
|
||||
bool block = false;
|
||||
int act;
|
||||
@@ -312,7 +315,7 @@ bool f_flock(CObjRef handle, int operation, VRefParam wouldblock /* = null */) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter /* = "," */,
|
||||
Variant f_fputcsv(CResRef handle, CArrRef fields, CStrRef delimiter /* = "," */,
|
||||
CStrRef enclosure /* = "\"" */) {
|
||||
if (delimiter.size() != 1) {
|
||||
throw_invalid_argument("delimiter: %s", delimiter.data());
|
||||
@@ -326,7 +329,7 @@ Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter /* = "," */,
|
||||
return f->writeCSV(fields, delimiter.charAt(0), enclosure.charAt(0));
|
||||
}
|
||||
|
||||
Variant f_fgetcsv(CObjRef handle, int64_t length /* = 0 */,
|
||||
Variant f_fgetcsv(CResRef handle, int64_t length /* = 0 */,
|
||||
CStrRef delimiter /* = "," */,
|
||||
CStrRef enclosure /* = "\"" */,
|
||||
CStrRef escape /* = "\\" */) {
|
||||
@@ -360,7 +363,7 @@ Variant f_file_get_contents(CStrRef filename,
|
||||
int64_t maxlen /* = 0 */) {
|
||||
Variant stream = f_fopen(filename, "rb", use_include_path, context);
|
||||
if (same(stream, false)) return false;
|
||||
return f_stream_get_contents(stream.toObject(), maxlen, offset);
|
||||
return f_stream_get_contents(stream.toResource(), maxlen, offset);
|
||||
}
|
||||
|
||||
Variant f_file_put_contents(CStrRef filename, CVarRef data,
|
||||
@@ -370,7 +373,7 @@ Variant f_file_put_contents(CStrRef filename, CVarRef data,
|
||||
if (!fvar.toBoolean()) {
|
||||
return false;
|
||||
}
|
||||
File *f = fvar.asObjRef().getTyped<File>();
|
||||
File *f = fvar.asResRef().getTyped<File>();
|
||||
|
||||
if ((flags & LOCK_EX) && flock(f->fd(), LOCK_EX)) {
|
||||
return false;
|
||||
@@ -380,7 +383,7 @@ Variant f_file_put_contents(CStrRef filename, CVarRef data,
|
||||
switch (data.getType()) {
|
||||
case KindOfObject:
|
||||
{
|
||||
File *fsrc = data.toObject().getTyped<File>(true, true);
|
||||
File *fsrc = data.toResource().getTyped<File>(true, true);
|
||||
if (fsrc == NULL) {
|
||||
raise_warning("Not a valid stream resource");
|
||||
return false;
|
||||
@@ -500,7 +503,7 @@ Variant f_readfile(CStrRef filename, bool use_include_path /* = false */,
|
||||
Util::safe_strerror(errno).c_str());
|
||||
return false;
|
||||
}
|
||||
Variant ret = f_fpassthru(f.toObject());
|
||||
Variant ret = f_fpassthru(f.toResource());
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -1038,8 +1041,8 @@ bool f_copy(CStrRef source, CStrRef dest,
|
||||
return false;
|
||||
}
|
||||
|
||||
return f_stream_copy_to_stream(sfile.toObject(),
|
||||
dfile.toObject()).toBoolean();
|
||||
return f_stream_copy_to_stream(sfile.toResource(),
|
||||
dfile.toResource()).toBoolean();
|
||||
} else {
|
||||
int ret =
|
||||
RuntimeOption::UseDirectCopy ?
|
||||
@@ -1232,7 +1235,7 @@ Variant f_tempnam(CStrRef dir, CStrRef prefix) {
|
||||
Variant f_tmpfile() {
|
||||
FILE *f = tmpfile();
|
||||
if (f) {
|
||||
return Object(NEWOBJ(PlainFile)(f));
|
||||
return Resource(NEWOBJ(PlainFile)(f));
|
||||
}
|
||||
return false;
|
||||
}
|
||||
@@ -1321,7 +1324,7 @@ public:
|
||||
defaultDirectory.reset();
|
||||
}
|
||||
|
||||
Object defaultDirectory;
|
||||
Resource defaultDirectory;
|
||||
};
|
||||
IMPLEMENT_STATIC_REQUEST_LOCAL(DirectoryRequestData, s_directory_data);
|
||||
|
||||
@@ -1329,14 +1332,14 @@ const StaticString
|
||||
s_handle("handle"),
|
||||
s_path("path");
|
||||
|
||||
static DIR *get_dir(CObjRef dir_handle) {
|
||||
Object obj;
|
||||
static DIR *get_dir(CResRef dir_handle) {
|
||||
Resource obj;
|
||||
if (dir_handle.isNull()) {
|
||||
obj = s_directory_data->defaultDirectory;
|
||||
} else {
|
||||
Array arr = dir_handle.toArray();
|
||||
if (arr.exists(s_handle)) {
|
||||
obj = arr[s_handle].toObject();
|
||||
obj = arr[s_handle].toResource();
|
||||
} else {
|
||||
obj = dir_handle;
|
||||
}
|
||||
@@ -1371,10 +1374,10 @@ Variant f_opendir(CStrRef path, CVarRef context /* = null */) {
|
||||
|
||||
Directory *p = new Directory(dir);
|
||||
s_directory_data->defaultDirectory = p;
|
||||
return Object(p);
|
||||
return Resource(p);
|
||||
}
|
||||
|
||||
Variant f_readdir(CObjRef dir_handle) {
|
||||
Variant f_readdir(CResRef dir_handle) {
|
||||
DIR *dir = get_dir(dir_handle);
|
||||
if (dir) {
|
||||
struct dirent entry;
|
||||
@@ -1387,7 +1390,7 @@ Variant f_readdir(CObjRef dir_handle) {
|
||||
return false;
|
||||
}
|
||||
|
||||
void f_rewinddir(CObjRef dir_handle) {
|
||||
void f_rewinddir(CResRef dir_handle) {
|
||||
DIR *dir = get_dir(dir_handle);
|
||||
if (dir) {
|
||||
rewinddir(dir);
|
||||
@@ -1408,7 +1411,7 @@ Variant f_scandir(CStrRef directory, bool descending /* = false */,
|
||||
if (dir == NULL) {
|
||||
return false;
|
||||
}
|
||||
Object deleter(new Directory(dir));
|
||||
Resource deleter(new Directory(dir));
|
||||
|
||||
std::vector<String> names;
|
||||
while (true) {
|
||||
@@ -1434,12 +1437,12 @@ Variant f_scandir(CStrRef directory, bool descending /* = false */,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void f_closedir(CObjRef dir_handle) {
|
||||
void f_closedir(CResRef dir_handle) {
|
||||
if (!dir_handle.isNull()) {
|
||||
Object obj;
|
||||
Resource obj;
|
||||
Array arr = dir_handle.toArray();
|
||||
if (arr.exists(s_handle)) {
|
||||
obj = arr[s_handle].toObject();
|
||||
obj = arr[s_handle].toResource();
|
||||
} else {
|
||||
obj = dir_handle;
|
||||
}
|
||||
|
||||
@@ -34,30 +34,30 @@ namespace HPHP {
|
||||
Variant f_fopen(CStrRef filename, CStrRef mode, bool use_include_path = false,
|
||||
CVarRef context = uninit_null());
|
||||
Variant f_popen(CStrRef command, CStrRef mode);
|
||||
bool f_fclose(CObjRef handle);
|
||||
Variant f_pclose(CObjRef handle);
|
||||
Variant f_fseek(CObjRef handle, int64_t offset, int64_t whence = k_SEEK_SET);
|
||||
bool f_rewind(CObjRef handle);
|
||||
Variant f_ftell(CObjRef handle);
|
||||
bool f_feof(CObjRef handle);
|
||||
Variant f_fstat(CObjRef handle);
|
||||
Variant f_fread(CObjRef handle, int64_t length);
|
||||
Variant f_fgetc(CObjRef handle);
|
||||
Variant f_fgets(CObjRef handle, int64_t length = 0);
|
||||
Variant f_fgetss(CObjRef handle, int64_t length = 0,
|
||||
bool f_fclose(CResRef handle);
|
||||
Variant f_pclose(CResRef handle);
|
||||
Variant f_fseek(CResRef handle, int64_t offset, int64_t whence = k_SEEK_SET);
|
||||
bool f_rewind(CResRef handle);
|
||||
Variant f_ftell(CResRef handle);
|
||||
bool f_feof(CResRef handle);
|
||||
Variant f_fstat(CResRef handle);
|
||||
Variant f_fread(CResRef handle, int64_t length);
|
||||
Variant f_fgetc(CResRef handle);
|
||||
Variant f_fgets(CResRef handle, int64_t length = 0);
|
||||
Variant f_fgetss(CResRef handle, int64_t length = 0,
|
||||
CStrRef allowable_tags = null_string);
|
||||
Variant f_fscanf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv = null_array);
|
||||
Variant f_fpassthru(CObjRef handle);
|
||||
Variant f_fwrite(CObjRef handle, CStrRef data, int64_t length = 0);
|
||||
Variant f_fputs(CObjRef handle, CStrRef data, int64_t length = 0);
|
||||
Variant f_fprintf(int _argc, CObjRef handle, CStrRef format, CArrRef _argv = null_array);
|
||||
Variant f_vfprintf(CObjRef handle, CStrRef format, CArrRef args);
|
||||
bool f_fflush(CObjRef handle);
|
||||
bool f_ftruncate(CObjRef handle, int64_t size);
|
||||
bool f_flock(CObjRef handle, int operation, VRefParam wouldblock = uninit_null());
|
||||
Variant f_fputcsv(CObjRef handle, CArrRef fields, CStrRef delimiter = ",",
|
||||
Variant f_fscanf(int _argc, CResRef handle, CStrRef format, CArrRef _argv = null_array);
|
||||
Variant f_fpassthru(CResRef handle);
|
||||
Variant f_fwrite(CResRef handle, CStrRef data, int64_t length = 0);
|
||||
Variant f_fputs(CResRef handle, CStrRef data, int64_t length = 0);
|
||||
Variant f_fprintf(int _argc, CResRef handle, CStrRef format, CArrRef _argv = null_array);
|
||||
Variant f_vfprintf(CResRef handle, CStrRef format, CArrRef args);
|
||||
bool f_fflush(CResRef handle);
|
||||
bool f_ftruncate(CResRef handle, int64_t size);
|
||||
bool f_flock(CResRef handle, int operation, VRefParam wouldblock = uninit_null());
|
||||
Variant f_fputcsv(CResRef handle, CArrRef fields, CStrRef delimiter = ",",
|
||||
CStrRef enclosure = "\"");
|
||||
Variant f_fgetcsv(CObjRef handle, int64_t length = 0, CStrRef delimiter = ",",
|
||||
Variant f_fgetcsv(CResRef handle, int64_t length = 0, CStrRef delimiter = ",",
|
||||
CStrRef enclosure = "\"", CStrRef escape = "\\");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -149,11 +149,11 @@ bool f_chdir(CStrRef directory);
|
||||
bool f_chroot(CStrRef directory);
|
||||
Variant f_dir(CStrRef directory);
|
||||
Variant f_opendir(CStrRef path, CVarRef context = uninit_null());
|
||||
Variant f_readdir(CObjRef dir_handle);
|
||||
void f_rewinddir(CObjRef dir_handle);
|
||||
Variant f_readdir(CResRef dir_handle);
|
||||
void f_rewinddir(CResRef dir_handle);
|
||||
Variant f_scandir(CStrRef directory, bool descending = false,
|
||||
CVarRef context = uninit_null());
|
||||
void f_closedir(CObjRef dir_handle);
|
||||
void f_closedir(CResRef dir_handle);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -181,8 +181,9 @@ static Variant php_hash_do_hash(CStrRef algo, CStrRef data, bool isfilename,
|
||||
ops->hash_init(context);
|
||||
|
||||
if (isfilename) {
|
||||
for (Variant chunk = f_fread(f.toObject(), 1024); !is_empty_string(chunk);
|
||||
chunk = f_fread(f.toObject(), 1024)) {
|
||||
for (Variant chunk = f_fread(f.toResource(), 1024);
|
||||
!is_empty_string(chunk);
|
||||
chunk = f_fread(f.toResource(), 1024)) {
|
||||
String schunk = chunk.toString();
|
||||
ops->hash_update(context, (unsigned char *)schunk.data(), schunk.size());
|
||||
}
|
||||
@@ -272,8 +273,9 @@ static Variant php_hash_do_hash_hmac(CStrRef algo, CStrRef data,
|
||||
char *K = prepare_hmac_key(ops, context, key);
|
||||
|
||||
if (isfilename) {
|
||||
for (Variant chunk = f_fread(f.toObject(), 1024); !is_empty_string(chunk);
|
||||
chunk = f_fread(f.toObject(), 1024)) {
|
||||
for (Variant chunk = f_fread(f.toResource(), 1024);
|
||||
!is_empty_string(chunk);
|
||||
chunk = f_fread(f.toResource(), 1024)) {
|
||||
String schunk = chunk.toString();
|
||||
ops->hash_update(context, (unsigned char *)schunk.data(), schunk.size());
|
||||
}
|
||||
@@ -324,26 +326,27 @@ Variant f_hash_init(CStrRef algo, int options /* = 0 */,
|
||||
if (options & k_HASH_HMAC) {
|
||||
hash->key = prepare_hmac_key(ops, context, key);
|
||||
}
|
||||
return Object(hash);
|
||||
return Resource(hash);
|
||||
}
|
||||
|
||||
bool f_hash_update(CObjRef context, CStrRef data) {
|
||||
bool f_hash_update(CResRef context, CStrRef data) {
|
||||
HashContext *hash = context.getTyped<HashContext>();
|
||||
hash->ops->hash_update(hash->context, (unsigned char *)data.data(),
|
||||
data.size());
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_hash_update_file(CObjRef init_context, CStrRef filename,
|
||||
CObjRef stream_context /* = null */) {
|
||||
bool f_hash_update_file(CResRef init_context, CStrRef filename,
|
||||
CResRef stream_context /* = null */) {
|
||||
Variant f = f_fopen(filename, "rb");
|
||||
if (same(f, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
HashContext *hash = init_context.getTyped<HashContext>();
|
||||
for (Variant chunk = f_fread(f.toObject(), 1024); !is_empty_string(chunk);
|
||||
chunk = f_fread(f.toObject(), 1024)) {
|
||||
for (Variant chunk = f_fread(f.toResource(), 1024);
|
||||
!is_empty_string(chunk);
|
||||
chunk = f_fread(f.toResource(), 1024)) {
|
||||
String schunk = chunk.toString();
|
||||
hash->ops->hash_update(hash->context, (unsigned char *)schunk.data(),
|
||||
schunk.size());
|
||||
@@ -351,7 +354,7 @@ bool f_hash_update_file(CObjRef init_context, CStrRef filename,
|
||||
return true;
|
||||
}
|
||||
|
||||
int64_t f_hash_update_stream(CObjRef context, CObjRef handle,
|
||||
int64_t f_hash_update_stream(CResRef context, CResRef handle,
|
||||
int length /* = -1 */) {
|
||||
HashContext *hash = context.getTyped<HashContext>();
|
||||
int didread = 0;
|
||||
@@ -369,7 +372,7 @@ int64_t f_hash_update_stream(CObjRef context, CObjRef handle,
|
||||
return didread;
|
||||
}
|
||||
|
||||
String f_hash_final(CObjRef context, bool raw_output /* = false */) {
|
||||
String f_hash_final(CResRef context, bool raw_output /* = false */) {
|
||||
HashContext *hash = context.getTyped<HashContext>();
|
||||
|
||||
String raw = String(hash->ops->digest_size, ReserveString);
|
||||
|
||||
@@ -29,12 +29,12 @@ Variant f_hash(CStrRef algo, CStrRef data, bool raw_output = false);
|
||||
Array f_hash_algos();
|
||||
Variant f_hash_init(CStrRef algo, int options = 0, CStrRef key = null_string);
|
||||
Variant f_hash_file(CStrRef algo, CStrRef filename, bool raw_output = false);
|
||||
String f_hash_final(CObjRef context, bool raw_output = false);
|
||||
String f_hash_final(CResRef context, bool raw_output = false);
|
||||
Variant f_hash_hmac_file(CStrRef algo, CStrRef filename, CStrRef key, bool raw_output = false);
|
||||
Variant f_hash_hmac(CStrRef algo, CStrRef data, CStrRef key, bool raw_output = false);
|
||||
bool f_hash_update_file(CObjRef init_context, CStrRef filename, CObjRef stream_context = Object());
|
||||
int64_t f_hash_update_stream(CObjRef context, CObjRef handle, int length = -1);
|
||||
bool f_hash_update(CObjRef context, CStrRef data);
|
||||
bool f_hash_update_file(CResRef init_context, CStrRef filename, CObjRef stream_context = Object());
|
||||
int64_t f_hash_update_stream(CResRef context, CObjRef handle, int length = -1);
|
||||
bool f_hash_update(CResRef context, CStrRef data);
|
||||
int64_t f_furchash_hphp_ext(CStrRef key, int len, int nPart);
|
||||
bool f_furchash_hphp_ext_supported();
|
||||
int64_t f_hphp_murmurhash(CStrRef key, int len, int seed);
|
||||
|
||||
+160
-160
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
@@ -35,7 +35,7 @@ struct gfxinfo {
|
||||
class Image : public SweepableResourceData {
|
||||
public:
|
||||
Image() { m_gdImage = NULL;}
|
||||
Image(gdImagePtr gdImage) { m_gdImage = gdImage;}
|
||||
explicit Image(gdImagePtr gdImage) { m_gdImage = gdImage;}
|
||||
~Image();
|
||||
gdImagePtr get() { return m_gdImage;}
|
||||
void reset() { m_gdImage = NULL;}
|
||||
@@ -53,34 +53,34 @@ Array f_gd_info();
|
||||
Variant f_getimagesize(CStrRef filename, VRefParam imageinfo = uninit_null());
|
||||
String f_image_type_to_extension(int imagetype, bool include_dot = true);
|
||||
String f_image_type_to_mime_type(int imagetype);
|
||||
bool f_image2wbmp(CObjRef image, CStrRef filename = null_string, int threshold = -1);
|
||||
bool f_imagealphablending(CObjRef image, bool blendmode);
|
||||
bool f_imageantialias(CObjRef image, bool on);
|
||||
bool f_imagearc(CObjRef image, int cx, int cy, int width, int height, int start, int end, int color);
|
||||
bool f_imagechar(CObjRef image, int font, int x, int y, CStrRef c, int color);
|
||||
bool f_imagecharup(CObjRef image, int font, int x, int y, CStrRef c, int color);
|
||||
Variant f_imagecolorallocate(CObjRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorallocatealpha(CObjRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolorat(CObjRef image, int x, int y);
|
||||
Variant f_imagecolorclosest(CObjRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorclosestalpha(CObjRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolorclosesthwb(CObjRef image, int red, int green, int blue);
|
||||
bool f_imagecolordeallocate(CObjRef image, int color);
|
||||
Variant f_imagecolorexact(CObjRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorexactalpha(CObjRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolormatch(CObjRef image1, CObjRef image2);
|
||||
Variant f_imagecolorresolve(CObjRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorresolvealpha(CObjRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolorset(CObjRef image, int index, int red, int green, int blue);
|
||||
Variant f_imagecolorsforindex(CObjRef image, int index);
|
||||
Variant f_imagecolorstotal(CObjRef image);
|
||||
Variant f_imagecolortransparent(CObjRef image, int color = -1);
|
||||
bool f_imageconvolution(CObjRef image, CArrRef matrix, double div, double offset);
|
||||
bool f_imagecopy(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h);
|
||||
bool f_imagecopymerge(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct);
|
||||
bool f_imagecopymergegray(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct);
|
||||
bool f_imagecopyresampled(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h);
|
||||
bool f_imagecopyresized(CObjRef dst_im, CObjRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h);
|
||||
bool f_image2wbmp(CResRef image, CStrRef filename = null_string, int threshold = -1);
|
||||
bool f_imagealphablending(CResRef image, bool blendmode);
|
||||
bool f_imageantialias(CResRef image, bool on);
|
||||
bool f_imagearc(CResRef image, int cx, int cy, int width, int height, int start, int end, int color);
|
||||
bool f_imagechar(CResRef image, int font, int x, int y, CStrRef c, int color);
|
||||
bool f_imagecharup(CResRef image, int font, int x, int y, CStrRef c, int color);
|
||||
Variant f_imagecolorallocate(CResRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorallocatealpha(CResRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolorat(CResRef image, int x, int y);
|
||||
Variant f_imagecolorclosest(CResRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorclosestalpha(CResRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolorclosesthwb(CResRef image, int red, int green, int blue);
|
||||
bool f_imagecolordeallocate(CResRef image, int color);
|
||||
Variant f_imagecolorexact(CResRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorexactalpha(CResRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolormatch(CResRef image1, CResRef image2);
|
||||
Variant f_imagecolorresolve(CResRef image, int red, int green, int blue);
|
||||
Variant f_imagecolorresolvealpha(CResRef image, int red, int green, int blue, int alpha);
|
||||
Variant f_imagecolorset(CResRef image, int index, int red, int green, int blue);
|
||||
Variant f_imagecolorsforindex(CResRef image, int index);
|
||||
Variant f_imagecolorstotal(CResRef image);
|
||||
Variant f_imagecolortransparent(CResRef image, int color = -1);
|
||||
bool f_imageconvolution(CResRef image, CArrRef matrix, double div, double offset);
|
||||
bool f_imagecopy(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h);
|
||||
bool f_imagecopymerge(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct);
|
||||
bool f_imagecopymergegray(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int src_w, int src_h, int pct);
|
||||
bool f_imagecopyresampled(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h);
|
||||
bool f_imagecopyresized(CResRef dst_im, CResRef src_im, int dst_x, int dst_y, int src_x, int src_y, int dst_w, int dst_h, int src_w, int src_h);
|
||||
Variant f_imagecreate(int width, int height);
|
||||
Variant f_imagecreatefromgd2part(CStrRef filename, int srcx, int srcy, int width, int height);
|
||||
Variant f_imagecreatefromgd(CStrRef filename);
|
||||
@@ -93,60 +93,60 @@ Variant f_imagecreatefromwbmp(CStrRef filename);
|
||||
Variant f_imagecreatefromxbm(CStrRef filename);
|
||||
Variant f_imagecreatefromxpm(CStrRef filename);
|
||||
Variant f_imagecreatetruecolor(int width, int height);
|
||||
bool f_imagedashedline(CObjRef image, int x1, int y1, int x2, int y2, int color);
|
||||
bool f_imagedestroy(CObjRef image);
|
||||
bool f_imageellipse(CObjRef image, int cx, int cy, int width, int height, int color);
|
||||
bool f_imagefill(CObjRef image, int x, int y, int color);
|
||||
bool f_imagefilledarc(CObjRef image, int cx, int cy, int width, int height, int start, int end, int color, int style);
|
||||
bool f_imagefilledellipse(CObjRef image, int cx, int cy, int width, int height, int color);
|
||||
bool f_imagefilledpolygon(CObjRef image, CArrRef points, int num_points, int color);
|
||||
bool f_imagefilledrectangle(CObjRef image, int x1, int y1, int x2, int y2, int color);
|
||||
bool f_imagefilltoborder(CObjRef image, int x, int y, int border, int color);
|
||||
bool f_imagefilter(CObjRef image, int filtertype, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0);
|
||||
bool f_imagedashedline(CResRef image, int x1, int y1, int x2, int y2, int color);
|
||||
bool f_imagedestroy(CResRef image);
|
||||
bool f_imageellipse(CResRef image, int cx, int cy, int width, int height, int color);
|
||||
bool f_imagefill(CResRef image, int x, int y, int color);
|
||||
bool f_imagefilledarc(CResRef image, int cx, int cy, int width, int height, int start, int end, int color, int style);
|
||||
bool f_imagefilledellipse(CResRef image, int cx, int cy, int width, int height, int color);
|
||||
bool f_imagefilledpolygon(CResRef image, CArrRef points, int num_points, int color);
|
||||
bool f_imagefilledrectangle(CResRef image, int x1, int y1, int x2, int y2, int color);
|
||||
bool f_imagefilltoborder(CResRef image, int x, int y, int border, int color);
|
||||
bool f_imagefilter(CResRef image, int filtertype, int arg1 = 0, int arg2 = 0, int arg3 = 0, int arg4 = 0);
|
||||
int64_t f_imagefontheight(int font);
|
||||
int64_t f_imagefontwidth(int font);
|
||||
Variant f_imageftbbox(double size, double angle, CStrRef font_file, CStrRef text, CArrRef extrainfo = Array());
|
||||
Variant f_imagefttext(CObjRef image, double size, double angle, int x, int y, int col, CStrRef font_file, CStrRef text, CArrRef extrainfo = Array());
|
||||
bool f_imagegammacorrect(CObjRef image, double inputgamma, double outputgamma);
|
||||
bool f_imagegd2(CObjRef image, CStrRef filename = null_string, int chunk_size = 0, int type = 0);
|
||||
bool f_imagegd(CObjRef image, CStrRef filename = null_string);
|
||||
bool f_imagegif(CObjRef image, CStrRef filename = null_string);
|
||||
Variant f_imagefttext(CResRef image, double size, double angle, int x, int y, int col, CStrRef font_file, CStrRef text, CArrRef extrainfo = Array());
|
||||
bool f_imagegammacorrect(CResRef image, double inputgamma, double outputgamma);
|
||||
bool f_imagegd2(CResRef image, CStrRef filename = null_string, int chunk_size = 0, int type = 0);
|
||||
bool f_imagegd(CResRef image, CStrRef filename = null_string);
|
||||
bool f_imagegif(CResRef image, CStrRef filename = null_string);
|
||||
Variant f_imagegrabscreen();
|
||||
Variant f_imagegrabwindow(int window, int client_area = 0);
|
||||
Variant f_imageinterlace(CObjRef image, int interlace = 0);
|
||||
bool f_imageistruecolor(CObjRef image);
|
||||
bool f_imagejpeg(CObjRef image, CStrRef filename = null_string, int quality = -1);
|
||||
bool f_imagelayereffect(CObjRef image, int effect);
|
||||
bool f_imageline(CObjRef image, int x1, int y1, int x2, int y2, int color);
|
||||
Variant f_imageinterlace(CResRef image, int interlace = 0);
|
||||
bool f_imageistruecolor(CResRef image);
|
||||
bool f_imagejpeg(CResRef image, CStrRef filename = null_string, int quality = -1);
|
||||
bool f_imagelayereffect(CResRef image, int effect);
|
||||
bool f_imageline(CResRef image, int x1, int y1, int x2, int y2, int color);
|
||||
Variant f_imageloadfont(CStrRef file);
|
||||
void f_imagepalettecopy(CObjRef destination, CObjRef source);
|
||||
bool f_imagepng(CObjRef image, CStrRef filename = null_string, int quality = -1, int filters = -1);
|
||||
bool f_imagepolygon(CObjRef image, CArrRef points, int num_points, int color);
|
||||
void f_imagepalettecopy(CResRef destination, CResRef source);
|
||||
bool f_imagepng(CResRef image, CStrRef filename = null_string, int quality = -1, int filters = -1);
|
||||
bool f_imagepolygon(CResRef image, CArrRef points, int num_points, int color);
|
||||
Array f_imagepsbbox(CStrRef text, int font, int size, int space = 0, int tightness = 0, double angle = 0.0);
|
||||
bool f_imagepsencodefont(CObjRef font_index, CStrRef encodingfile);
|
||||
bool f_imagepsencodefont(CResRef font_index, CStrRef encodingfile);
|
||||
bool f_imagepsextendfont(int font_index, double extend);
|
||||
bool f_imagepsfreefont(CObjRef fontindex);
|
||||
bool f_imagepsfreefont(CResRef fontindex);
|
||||
Object f_imagepsloadfont(CStrRef filename);
|
||||
bool f_imagepsslantfont(CObjRef font_index, double slant);
|
||||
Array f_imagepstext(CObjRef image, CStrRef text, CObjRef font, int size, int foreground, int background, int x, int y, int space = 0, int tightness = 0, double angle = 0.0, int antialias_steps = 0);
|
||||
bool f_imagerectangle(CObjRef image, int x1, int y1, int x2, int y2, int color);
|
||||
Variant f_imagerotate(CObjRef source_image, double angle, int bgd_color, int ignore_transparent = 0);
|
||||
bool f_imagesavealpha(CObjRef image, bool saveflag);
|
||||
bool f_imagesetbrush(CObjRef image, CObjRef brush);
|
||||
bool f_imagesetpixel(CObjRef image, int x, int y, int color);
|
||||
bool f_imagesetstyle(CObjRef image, CArrRef style);
|
||||
bool f_imagesetthickness(CObjRef image, int thickness);
|
||||
bool f_imagesettile(CObjRef image, CObjRef tile);
|
||||
bool f_imagestring(CObjRef image, int font, int x, int y, CStrRef str, int color);
|
||||
bool f_imagestringup(CObjRef image, int font, int x, int y, CStrRef str, int color);
|
||||
Variant f_imagesx(CObjRef image);
|
||||
Variant f_imagesy(CObjRef image);
|
||||
Variant f_imagetruecolortopalette(CObjRef image, bool dither, int ncolors);
|
||||
bool f_imagepsslantfont(CResRef font_index, double slant);
|
||||
Array f_imagepstext(CResRef image, CStrRef text, CResRef font, int size, int foreground, int background, int x, int y, int space = 0, int tightness = 0, double angle = 0.0, int antialias_steps = 0);
|
||||
bool f_imagerectangle(CResRef image, int x1, int y1, int x2, int y2, int color);
|
||||
Variant f_imagerotate(CResRef source_image, double angle, int bgd_color, int ignore_transparent = 0);
|
||||
bool f_imagesavealpha(CResRef image, bool saveflag);
|
||||
bool f_imagesetbrush(CResRef image, CResRef brush);
|
||||
bool f_imagesetpixel(CResRef image, int x, int y, int color);
|
||||
bool f_imagesetstyle(CResRef image, CArrRef style);
|
||||
bool f_imagesetthickness(CResRef image, int thickness);
|
||||
bool f_imagesettile(CResRef image, CResRef tile);
|
||||
bool f_imagestring(CResRef image, int font, int x, int y, CStrRef str, int color);
|
||||
bool f_imagestringup(CResRef image, int font, int x, int y, CStrRef str, int color);
|
||||
Variant f_imagesx(CResRef image);
|
||||
Variant f_imagesy(CResRef image);
|
||||
Variant f_imagetruecolortopalette(CResRef image, bool dither, int ncolors);
|
||||
Variant f_imagettfbbox(double size, double angle, CStrRef fontfile, CStrRef text);
|
||||
Variant f_imagettftext(CObjRef image, double size, double angle, int x, int y, int color, CStrRef fontfile, CStrRef text);
|
||||
Variant f_imagettftext(CResRef image, double size, double angle, int x, int y, int color, CStrRef fontfile, CStrRef text);
|
||||
int64_t f_imagetypes();
|
||||
bool f_imagewbmp(CObjRef image, CStrRef filename = null_string, int foreground = -1);
|
||||
bool f_imagexbm(CObjRef image, CStrRef filename = null_string, int foreground = -1);
|
||||
bool f_imagewbmp(CResRef image, CStrRef filename = null_string, int foreground = -1);
|
||||
bool f_imagexbm(CResRef image, CStrRef filename = null_string, int foreground = -1);
|
||||
Variant f_iptcembed(CStrRef iptcdata, CStrRef jpeg_file_name, int spool = 0);
|
||||
Variant f_iptcparse(CStrRef iptcblock);
|
||||
bool f_jpeg2wbmp(CStrRef jpegname, CStrRef wbmpname, int dest_height, int dest_width, int threshold);
|
||||
|
||||
@@ -772,7 +772,7 @@ Variant f_imap_alerts() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_imap_append(CObjRef imap_stream, CStrRef mailbox, CStrRef message,
|
||||
bool f_imap_append(CResRef imap_stream, CStrRef mailbox, CStrRef message,
|
||||
CStrRef options /* = "" */) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
@@ -805,7 +805,7 @@ Variant f_imap_binary(CStrRef str) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_imap_body(CObjRef imap_stream, int64_t msg_number,
|
||||
Variant f_imap_body(CResRef imap_stream, int64_t msg_number,
|
||||
int64_t options /* = 0 */) {
|
||||
if (options && ((options & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
|
||||
raise_warning("invalid value for the options parameter");
|
||||
@@ -838,7 +838,7 @@ Variant f_imap_body(CObjRef imap_stream, int64_t msg_number,
|
||||
}
|
||||
}
|
||||
|
||||
Variant f_imap_bodystruct(CObjRef imap_stream, int64_t msg_number,
|
||||
Variant f_imap_bodystruct(CResRef imap_stream, int64_t msg_number,
|
||||
CStrRef section) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (!obj->checkMsgNumber(msg_number)) {
|
||||
@@ -856,7 +856,7 @@ Variant f_imap_bodystruct(CObjRef imap_stream, int64_t msg_number,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_imap_check(CObjRef imap_stream) {
|
||||
Variant f_imap_check(CResRef imap_stream) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_ping(obj->m_stream) == NIL) {
|
||||
return false;
|
||||
@@ -875,7 +875,7 @@ Variant f_imap_check(CObjRef imap_stream) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool f_imap_clearflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag,
|
||||
bool f_imap_clearflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag,
|
||||
int64_t options /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
mail_clearflag_full(obj->m_stream, (char *)sequence.data(),
|
||||
@@ -883,7 +883,7 @@ bool f_imap_clearflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_imap_close(CObjRef imap_stream, int64_t flag /* = 0 */) {
|
||||
bool f_imap_close(CResRef imap_stream, int64_t flag /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (flag) {
|
||||
if (flag != PHP_EXPUNGE) {
|
||||
@@ -897,7 +897,7 @@ bool f_imap_close(CObjRef imap_stream, int64_t flag /* = 0 */) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_imap_createmailbox(CObjRef imap_stream, CStrRef mailbox) {
|
||||
bool f_imap_createmailbox(CResRef imap_stream, CStrRef mailbox) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_create(obj->m_stream, (char *)mailbox.data()) == T) {
|
||||
return true;
|
||||
@@ -906,7 +906,7 @@ bool f_imap_createmailbox(CObjRef imap_stream, CStrRef mailbox) {
|
||||
}
|
||||
}
|
||||
|
||||
bool f_imap_delete(CObjRef imap_stream, CStrRef msg_number,
|
||||
bool f_imap_delete(CResRef imap_stream, CStrRef msg_number,
|
||||
int64_t options /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
mail_setflag_full(obj->m_stream, (char *)msg_number.data(),
|
||||
@@ -915,7 +915,7 @@ bool f_imap_delete(CObjRef imap_stream, CStrRef msg_number,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_imap_deletemailbox(CObjRef imap_stream, CStrRef mailbox) {
|
||||
bool f_imap_deletemailbox(CResRef imap_stream, CStrRef mailbox) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_delete(obj->m_stream, (char *)mailbox.data()) == T) {
|
||||
return true;
|
||||
@@ -939,13 +939,13 @@ Variant f_imap_errors() {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_imap_expunge(CObjRef imap_stream) {
|
||||
bool f_imap_expunge(CResRef imap_stream) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
mail_expunge(obj->m_stream);
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant f_imap_fetch_overview(CObjRef imap_stream, CStrRef sequence,
|
||||
Variant f_imap_fetch_overview(CResRef imap_stream, CStrRef sequence,
|
||||
int64_t options /* = 0 */) {
|
||||
if (options && options != FT_UID) {
|
||||
Logger::Warning("invalid value for the options parameter");
|
||||
@@ -1008,7 +1008,7 @@ Variant f_imap_fetch_overview(CObjRef imap_stream, CStrRef sequence,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_imap_fetchbody(CObjRef imap_stream, int64_t msg_number,
|
||||
Variant f_imap_fetchbody(CResRef imap_stream, int64_t msg_number,
|
||||
CStrRef section, int64_t options /* = 0 */) {
|
||||
if (options && ((options & ~(FT_UID|FT_PEEK|FT_INTERNAL)) != 0)) {
|
||||
raise_warning("invalid value for the options parameter");
|
||||
@@ -1036,7 +1036,7 @@ Variant f_imap_fetchbody(CObjRef imap_stream, int64_t msg_number,
|
||||
return String(body, len, CopyString);
|
||||
}
|
||||
|
||||
Variant f_imap_fetchheader(CObjRef imap_stream, int64_t msg_number,
|
||||
Variant f_imap_fetchheader(CResRef imap_stream, int64_t msg_number,
|
||||
int64_t options /* = 0 */) {
|
||||
if (options && ((options & ~(FT_UID|FT_INTERNAL|FT_PREFETCHTEXT)) != 0)) {
|
||||
Logger::Warning("invalid value for the options parameter");
|
||||
@@ -1062,7 +1062,7 @@ Variant f_imap_fetchheader(CObjRef imap_stream, int64_t msg_number,
|
||||
(options ? options : NIL)), CopyString);
|
||||
}
|
||||
|
||||
Variant f_imap_fetchstructure(CObjRef imap_stream, int64_t msg_number,
|
||||
Variant f_imap_fetchstructure(CResRef imap_stream, int64_t msg_number,
|
||||
int64_t options /* = 0 */) {
|
||||
if (options && ((options & ~FT_UID) != 0)) {
|
||||
raise_warning("invalid value for the options parameter");
|
||||
@@ -1104,7 +1104,7 @@ Variant f_imap_fetchstructure(CObjRef imap_stream, int64_t msg_number,
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_imap_gc(CObjRef imap_stream, int64_t caches) {
|
||||
bool f_imap_gc(CResRef imap_stream, int64_t caches) {
|
||||
if (caches && ((caches & ~(GC_TEXTS | GC_ELT | GC_ENV)) != 0)) {
|
||||
raise_warning("invalid value for the caches parameter");
|
||||
return false;
|
||||
@@ -1115,29 +1115,29 @@ bool f_imap_gc(CObjRef imap_stream, int64_t caches) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant f_imap_get_quota(CObjRef imap_stream, CStrRef quota_root) {
|
||||
Variant f_imap_get_quota(CResRef imap_stream, CStrRef quota_root) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_get_quotaroot(CObjRef imap_stream, CStrRef quota_root) {
|
||||
Variant f_imap_get_quotaroot(CResRef imap_stream, CStrRef quota_root) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_getacl(CObjRef imap_stream, CStrRef mailbox) {
|
||||
Variant f_imap_getacl(CResRef imap_stream, CStrRef mailbox) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_getmailboxes(CObjRef imap_stream, CStrRef ref,
|
||||
Variant f_imap_getmailboxes(CResRef imap_stream, CStrRef ref,
|
||||
CStrRef pattern) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_getsubscribed(CObjRef imap_stream, CStrRef ref,
|
||||
Variant f_imap_getsubscribed(CResRef imap_stream, CStrRef ref,
|
||||
CStrRef pattern) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_header(CObjRef imap_stream, int64_t msg_number,
|
||||
Variant f_imap_header(CResRef imap_stream, int64_t msg_number,
|
||||
int64_t fromlength /* = 0 */,
|
||||
int64_t subjectlength /* = 0 */,
|
||||
CStrRef defaulthost /* = "" */) {
|
||||
@@ -1145,7 +1145,7 @@ Variant f_imap_header(CObjRef imap_stream, int64_t msg_number,
|
||||
fromlength, subjectlength, defaulthost);
|
||||
}
|
||||
|
||||
Variant f_imap_headerinfo(CObjRef imap_stream, int64_t msg_number,
|
||||
Variant f_imap_headerinfo(CResRef imap_stream, int64_t msg_number,
|
||||
int64_t fromlength /* = 0 */,
|
||||
int64_t subjectlength /* = 0 */,
|
||||
CStrRef defaulthost /* = "" */) {
|
||||
@@ -1207,7 +1207,7 @@ Variant f_imap_headerinfo(CObjRef imap_stream, int64_t msg_number,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_imap_headers(CObjRef imap_stream) {
|
||||
Variant f_imap_headers(CResRef imap_stream) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
@@ -1224,7 +1224,7 @@ Variant f_imap_last_error() {
|
||||
return uninit_null();
|
||||
}
|
||||
|
||||
Variant f_imap_list(CObjRef imap_stream, CStrRef ref, CStrRef pattern) {
|
||||
Variant f_imap_list(CResRef imap_stream, CStrRef ref, CStrRef pattern) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
|
||||
/* set flag for normal, old mailbox list */
|
||||
@@ -1245,21 +1245,21 @@ Variant f_imap_list(CObjRef imap_stream, CStrRef ref, CStrRef pattern) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_imap_listmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern) {
|
||||
Variant f_imap_listmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern) {
|
||||
return f_imap_list(imap_stream, ref, pattern);
|
||||
}
|
||||
|
||||
Variant f_imap_listscan(CObjRef imap_stream, CStrRef ref, CStrRef pattern,
|
||||
Variant f_imap_listscan(CResRef imap_stream, CStrRef ref, CStrRef pattern,
|
||||
CStrRef content) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_listsubscribed(CObjRef imap_stream, CStrRef ref,
|
||||
Variant f_imap_listsubscribed(CResRef imap_stream, CStrRef ref,
|
||||
CStrRef pattern) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_lsub(CObjRef imap_stream, CStrRef ref, CStrRef pattern) {
|
||||
Variant f_imap_lsub(CResRef imap_stream, CStrRef ref, CStrRef pattern) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
@@ -1267,7 +1267,7 @@ Variant f_imap_mail_compose(CArrRef envelope, CArrRef body) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_imap_mail_copy(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox,
|
||||
bool f_imap_mail_copy(CResRef imap_stream, CStrRef msglist, CStrRef mailbox,
|
||||
int64_t options /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_copy_full(obj->m_stream, (char *)msglist.data(),
|
||||
@@ -1278,7 +1278,7 @@ bool f_imap_mail_copy(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox,
|
||||
}
|
||||
}
|
||||
|
||||
bool f_imap_mail_move(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox,
|
||||
bool f_imap_mail_move(CResRef imap_stream, CStrRef msglist, CStrRef mailbox,
|
||||
int64_t options /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_copy_full(obj->m_stream, (char *)msglist.data(),
|
||||
@@ -1340,7 +1340,7 @@ bool f_imap_mail(CStrRef to, CStrRef subject, CStrRef message,
|
||||
}
|
||||
}
|
||||
|
||||
Variant f_imap_mailboxmsginfo(CObjRef imap_stream) {
|
||||
Variant f_imap_mailboxmsginfo(CResRef imap_stream) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
Object ret(SystemLib::AllocStdClassObject());
|
||||
|
||||
@@ -1379,16 +1379,16 @@ Variant f_imap_mime_header_decode(CStrRef text) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_msgno(CObjRef imap_stream, int64_t uid) {
|
||||
Variant f_imap_msgno(CResRef imap_stream, int64_t uid) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
return (int64_t)mail_msgno(obj->m_stream, uid);
|
||||
}
|
||||
|
||||
Variant f_imap_num_msg(CObjRef imap_stream) {
|
||||
Variant f_imap_num_msg(CResRef imap_stream) {
|
||||
return (int64_t)imap_stream.getTyped<ImapStream>()->m_stream->nmsgs;
|
||||
}
|
||||
|
||||
Variant f_imap_num_recent(CObjRef imap_stream) {
|
||||
Variant f_imap_num_recent(CResRef imap_stream) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
return (int64_t)obj->m_stream->recent;
|
||||
}
|
||||
@@ -1423,7 +1423,7 @@ Variant f_imap_open(CStrRef mailbox, CStrRef username, CStrRef password,
|
||||
return NEWOBJ(ImapStream)(stream, (options & PHP_EXPUNGE) ? CL_EXPUNGE : NIL);
|
||||
}
|
||||
|
||||
bool f_imap_ping(CObjRef imap_stream) {
|
||||
bool f_imap_ping(CResRef imap_stream) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
return mail_ping(obj->m_stream);
|
||||
}
|
||||
@@ -1442,7 +1442,7 @@ Variant f_imap_qprint(CStrRef str) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_imap_renamemailbox(CObjRef imap_stream, CStrRef old_mbox,
|
||||
bool f_imap_renamemailbox(CResRef imap_stream, CStrRef old_mbox,
|
||||
CStrRef new_mbox) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_rename(obj->m_stream, (char *)old_mbox.data(),
|
||||
@@ -1453,7 +1453,7 @@ bool f_imap_renamemailbox(CObjRef imap_stream, CStrRef old_mbox,
|
||||
}
|
||||
}
|
||||
|
||||
bool f_imap_reopen(CObjRef imap_stream, CStrRef mailbox,
|
||||
bool f_imap_reopen(CResRef imap_stream, CStrRef mailbox,
|
||||
int64_t options /* = 0 */, int64_t retries /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
long flags = NIL;
|
||||
@@ -1494,17 +1494,17 @@ Variant f_imap_rfc822_write_address(CStrRef mailbox, CStrRef host,
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_imap_savebody(CObjRef imap_stream, CVarRef file, int64_t msg_number,
|
||||
bool f_imap_savebody(CResRef imap_stream, CVarRef file, int64_t msg_number,
|
||||
CStrRef part_number /* = "" */, int64_t options /* = 0 */) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_scanmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern,
|
||||
Variant f_imap_scanmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern,
|
||||
CStrRef content) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_search(CObjRef imap_stream, CStrRef criteria,
|
||||
Variant f_imap_search(CResRef imap_stream, CStrRef criteria,
|
||||
int64_t options /* = 0 */, CStrRef charset /* = "" */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
|
||||
@@ -1537,17 +1537,17 @@ Variant f_imap_search(CObjRef imap_stream, CStrRef criteria,
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_imap_set_quota(CObjRef imap_stream, CStrRef quota_root,
|
||||
bool f_imap_set_quota(CResRef imap_stream, CStrRef quota_root,
|
||||
int64_t quota_limit) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_imap_setacl(CObjRef imap_stream, CStrRef mailbox, CStrRef id,
|
||||
bool f_imap_setacl(CResRef imap_stream, CStrRef mailbox, CStrRef id,
|
||||
CStrRef rights) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_imap_setflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag,
|
||||
bool f_imap_setflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag,
|
||||
int64_t options /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
mail_setflag_full(obj->m_stream, (char*)sequence.data(), (char*)flag.data(),
|
||||
@@ -1555,14 +1555,14 @@ bool f_imap_setflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag,
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant f_imap_sort(CObjRef imap_stream, int64_t criteria, int64_t reverse,
|
||||
Variant f_imap_sort(CResRef imap_stream, int64_t criteria, int64_t reverse,
|
||||
int64_t options /* = 0 */,
|
||||
CStrRef search_criteria /* = "" */,
|
||||
CStrRef charset /* = "" */) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_imap_status(CObjRef imap_stream, CStrRef mailbox,
|
||||
Variant f_imap_status(CResRef imap_stream, CStrRef mailbox,
|
||||
int64_t options /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
Object ret(SystemLib::AllocStdClassObject());
|
||||
@@ -1591,7 +1591,7 @@ Variant f_imap_status(CObjRef imap_stream, CStrRef mailbox,
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_imap_subscribe(CObjRef imap_stream, CStrRef mailbox) {
|
||||
bool f_imap_subscribe(CResRef imap_stream, CStrRef mailbox) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_subscribe(obj->m_stream, (char *)mailbox.data()) == T) {
|
||||
return true;
|
||||
@@ -1600,7 +1600,7 @@ bool f_imap_subscribe(CObjRef imap_stream, CStrRef mailbox) {
|
||||
}
|
||||
}
|
||||
|
||||
Variant f_imap_thread(CObjRef imap_stream, int64_t options /* = 0 */) {
|
||||
Variant f_imap_thread(CResRef imap_stream, int64_t options /* = 0 */) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
@@ -1649,7 +1649,7 @@ Variant f_imap_timeout(int64_t timeout_type, int64_t timeout /* = -1 */) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Variant f_imap_uid(CObjRef imap_stream, int64_t msg_number) {
|
||||
Variant f_imap_uid(CResRef imap_stream, int64_t msg_number) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (!obj->checkMsgNumber(msg_number)) {
|
||||
return false;
|
||||
@@ -1657,7 +1657,7 @@ Variant f_imap_uid(CObjRef imap_stream, int64_t msg_number) {
|
||||
return (int64_t)mail_uid(obj->m_stream, msg_number);
|
||||
}
|
||||
|
||||
bool f_imap_undelete(CObjRef imap_stream, CStrRef msg_number,
|
||||
bool f_imap_undelete(CResRef imap_stream, CStrRef msg_number,
|
||||
int64_t flags /* = 0 */) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
mail_clearflag_full(obj->m_stream, (char *)msg_number.data(),
|
||||
@@ -1665,7 +1665,7 @@ bool f_imap_undelete(CObjRef imap_stream, CStrRef msg_number,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_imap_unsubscribe(CObjRef imap_stream, CStrRef mailbox) {
|
||||
bool f_imap_unsubscribe(CResRef imap_stream, CStrRef mailbox) {
|
||||
ImapStream *obj = imap_stream.getTyped<ImapStream>();
|
||||
if (mail_unsubscribe(obj->m_stream, (char *)mailbox.data()) == T) {
|
||||
return true;
|
||||
|
||||
@@ -27,69 +27,69 @@ namespace HPHP {
|
||||
|
||||
Variant f_imap_8bit(CStrRef str);
|
||||
Variant f_imap_alerts();
|
||||
bool f_imap_append(CObjRef imap_stream, CStrRef mailbox, CStrRef message, CStrRef options = "");
|
||||
bool f_imap_append(CResRef imap_stream, CStrRef mailbox, CStrRef message, CStrRef options = "");
|
||||
Variant f_imap_base64(CStrRef text);
|
||||
Variant f_imap_binary(CStrRef str);
|
||||
Variant f_imap_body(CObjRef imap_stream, int64_t msg_number, int64_t options = 0);
|
||||
Variant f_imap_bodystruct(CObjRef imap_stream, int64_t msg_number, CStrRef section);
|
||||
Variant f_imap_check(CObjRef imap_stream);
|
||||
bool f_imap_clearflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0);
|
||||
bool f_imap_close(CObjRef imap_stream, int64_t flag = 0);
|
||||
bool f_imap_createmailbox(CObjRef imap_stream, CStrRef mailbox);
|
||||
bool f_imap_delete(CObjRef imap_stream, CStrRef msg_number, int64_t options = 0);
|
||||
bool f_imap_deletemailbox(CObjRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_body(CResRef imap_stream, int64_t msg_number, int64_t options = 0);
|
||||
Variant f_imap_bodystruct(CResRef imap_stream, int64_t msg_number, CStrRef section);
|
||||
Variant f_imap_check(CResRef imap_stream);
|
||||
bool f_imap_clearflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0);
|
||||
bool f_imap_close(CResRef imap_stream, int64_t flag = 0);
|
||||
bool f_imap_createmailbox(CResRef imap_stream, CStrRef mailbox);
|
||||
bool f_imap_delete(CResRef imap_stream, CStrRef msg_number, int64_t options = 0);
|
||||
bool f_imap_deletemailbox(CResRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_errors();
|
||||
bool f_imap_expunge(CObjRef imap_stream);
|
||||
Variant f_imap_fetch_overview(CObjRef imap_stream, CStrRef sequence, int64_t options = 0);
|
||||
Variant f_imap_fetchbody(CObjRef imap_stream, int64_t msg_number, CStrRef section, int64_t options = 0);
|
||||
Variant f_imap_fetchheader(CObjRef imap_stream, int64_t msg_number, int64_t options = 0);
|
||||
Variant f_imap_fetchstructure(CObjRef imap_stream, int64_t msg_number, int64_t options = 0);
|
||||
bool f_imap_gc(CObjRef imap_stream, int64_t caches);
|
||||
Variant f_imap_get_quota(CObjRef imap_stream, CStrRef quota_root);
|
||||
Variant f_imap_get_quotaroot(CObjRef imap_stream, CStrRef quota_root);
|
||||
Variant f_imap_getacl(CObjRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_getmailboxes(CObjRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_getsubscribed(CObjRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_header(CObjRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = "");
|
||||
Variant f_imap_headerinfo(CObjRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = "");
|
||||
Variant f_imap_headers(CObjRef imap_stream);
|
||||
bool f_imap_expunge(CResRef imap_stream);
|
||||
Variant f_imap_fetch_overview(CResRef imap_stream, CStrRef sequence, int64_t options = 0);
|
||||
Variant f_imap_fetchbody(CResRef imap_stream, int64_t msg_number, CStrRef section, int64_t options = 0);
|
||||
Variant f_imap_fetchheader(CResRef imap_stream, int64_t msg_number, int64_t options = 0);
|
||||
Variant f_imap_fetchstructure(CResRef imap_stream, int64_t msg_number, int64_t options = 0);
|
||||
bool f_imap_gc(CResRef imap_stream, int64_t caches);
|
||||
Variant f_imap_get_quota(CResRef imap_stream, CStrRef quota_root);
|
||||
Variant f_imap_get_quotaroot(CResRef imap_stream, CStrRef quota_root);
|
||||
Variant f_imap_getacl(CResRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_getmailboxes(CResRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_getsubscribed(CResRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_header(CResRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = "");
|
||||
Variant f_imap_headerinfo(CResRef imap_stream, int64_t msg_number, int64_t fromlength = 0, int64_t subjectlength = 0, CStrRef defaulthost = "");
|
||||
Variant f_imap_headers(CResRef imap_stream);
|
||||
Variant f_imap_last_error();
|
||||
Variant f_imap_list(CObjRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_listmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_listscan(CObjRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content);
|
||||
Variant f_imap_listsubscribed(CObjRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_lsub(CObjRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_list(CResRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_listmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_listscan(CResRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content);
|
||||
Variant f_imap_listsubscribed(CResRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_lsub(CResRef imap_stream, CStrRef ref, CStrRef pattern);
|
||||
Variant f_imap_mail_compose(CArrRef envelope, CArrRef body);
|
||||
bool f_imap_mail_copy(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0);
|
||||
bool f_imap_mail_move(CObjRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0);
|
||||
bool f_imap_mail_copy(CResRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0);
|
||||
bool f_imap_mail_move(CResRef imap_stream, CStrRef msglist, CStrRef mailbox, int64_t options = 0);
|
||||
bool f_imap_mail(CStrRef to, CStrRef subject, CStrRef message, CStrRef additional_headers = "", CStrRef cc = "", CStrRef bcc = "", CStrRef rpath = "");
|
||||
Variant f_imap_mailboxmsginfo(CObjRef imap_stream);
|
||||
Variant f_imap_mailboxmsginfo(CResRef imap_stream);
|
||||
Variant f_imap_mime_header_decode(CStrRef text);
|
||||
Variant f_imap_msgno(CObjRef imap_stream, int64_t uid);
|
||||
Variant f_imap_num_msg(CObjRef imap_stream);
|
||||
Variant f_imap_num_recent(CObjRef imap_stream);
|
||||
Variant f_imap_msgno(CResRef imap_stream, int64_t uid);
|
||||
Variant f_imap_num_msg(CResRef imap_stream);
|
||||
Variant f_imap_num_recent(CResRef imap_stream);
|
||||
Variant f_imap_open(CStrRef mailbox, CStrRef username, CStrRef password, int64_t options = 0, int64_t retries = 0);
|
||||
bool f_imap_ping(CObjRef imap_stream);
|
||||
bool f_imap_ping(CResRef imap_stream);
|
||||
Variant f_imap_qprint(CStrRef str);
|
||||
bool f_imap_renamemailbox(CObjRef imap_stream, CStrRef old_mbox, CStrRef new_mbox);
|
||||
bool f_imap_reopen(CObjRef imap_stream, CStrRef mailbox, int64_t options = 0, int64_t retries = 0);
|
||||
bool f_imap_renamemailbox(CResRef imap_stream, CStrRef old_mbox, CStrRef new_mbox);
|
||||
bool f_imap_reopen(CResRef imap_stream, CStrRef mailbox, int64_t options = 0, int64_t retries = 0);
|
||||
Variant f_imap_rfc822_parse_adrlist(CStrRef address, CStrRef default_host);
|
||||
Variant f_imap_rfc822_parse_headers(CStrRef headers, CStrRef defaulthost = "");
|
||||
Variant f_imap_rfc822_write_address(CStrRef mailbox, CStrRef host, CStrRef personal);
|
||||
bool f_imap_savebody(CObjRef imap_stream, CVarRef file, int64_t msg_number, CStrRef part_number = "", int64_t options = 0);
|
||||
Variant f_imap_scanmailbox(CObjRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content);
|
||||
Variant f_imap_search(CObjRef imap_stream, CStrRef criteria, int64_t options = 0, CStrRef charset = "");
|
||||
bool f_imap_set_quota(CObjRef imap_stream, CStrRef quota_root, int64_t quota_limit);
|
||||
bool f_imap_setacl(CObjRef imap_stream, CStrRef mailbox, CStrRef id, CStrRef rights);
|
||||
bool f_imap_setflag_full(CObjRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0);
|
||||
Variant f_imap_sort(CObjRef imap_stream, int64_t criteria, int64_t reverse, int64_t options = 0, CStrRef search_criteria = "", CStrRef charset = "");
|
||||
Variant f_imap_status(CObjRef imap_stream, CStrRef mailbox, int64_t options = 0);
|
||||
bool f_imap_subscribe(CObjRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_thread(CObjRef imap_stream, int64_t options = 0);
|
||||
bool f_imap_savebody(CResRef imap_stream, CVarRef file, int64_t msg_number, CStrRef part_number = "", int64_t options = 0);
|
||||
Variant f_imap_scanmailbox(CResRef imap_stream, CStrRef ref, CStrRef pattern, CStrRef content);
|
||||
Variant f_imap_search(CResRef imap_stream, CStrRef criteria, int64_t options = 0, CStrRef charset = "");
|
||||
bool f_imap_set_quota(CResRef imap_stream, CStrRef quota_root, int64_t quota_limit);
|
||||
bool f_imap_setacl(CResRef imap_stream, CStrRef mailbox, CStrRef id, CStrRef rights);
|
||||
bool f_imap_setflag_full(CResRef imap_stream, CStrRef sequence, CStrRef flag, int64_t options = 0);
|
||||
Variant f_imap_sort(CResRef imap_stream, int64_t criteria, int64_t reverse, int64_t options = 0, CStrRef search_criteria = "", CStrRef charset = "");
|
||||
Variant f_imap_status(CResRef imap_stream, CStrRef mailbox, int64_t options = 0);
|
||||
bool f_imap_subscribe(CResRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_thread(CResRef imap_stream, int64_t options = 0);
|
||||
Variant f_imap_timeout(int64_t timeout_type, int64_t timeout = -1);
|
||||
Variant f_imap_uid(CObjRef imap_stream, int64_t msg_number);
|
||||
bool f_imap_undelete(CObjRef imap_stream, CStrRef msg_number, int64_t flags = 0);
|
||||
bool f_imap_unsubscribe(CObjRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_uid(CResRef imap_stream, int64_t msg_number);
|
||||
bool f_imap_undelete(CResRef imap_stream, CStrRef msg_number, int64_t flags = 0);
|
||||
bool f_imap_unsubscribe(CResRef imap_stream, CStrRef mailbox);
|
||||
Variant f_imap_utf7_decode(CStrRef text);
|
||||
Variant f_imap_utf7_encode(CStrRef data);
|
||||
Variant f_imap_utf8(CStrRef mime_encoded_text);
|
||||
|
||||
@@ -94,14 +94,14 @@ Variant f_msg_get_queue(int64_t key, int64_t perms /* = 0666 */) {
|
||||
MessageQueue *q = NEWOBJ(MessageQueue)();
|
||||
q->key = key;
|
||||
q->id = id;
|
||||
return Object(q);
|
||||
return Resource(q);
|
||||
}
|
||||
|
||||
bool f_msg_queue_exists(int64_t key) {
|
||||
return msgget(key, 0) >= 0;
|
||||
}
|
||||
|
||||
bool f_msg_remove_queue(CObjRef queue) {
|
||||
bool f_msg_remove_queue(CResRef queue) {
|
||||
MessageQueue *q = queue.getTyped<MessageQueue>();
|
||||
if (!q) {
|
||||
raise_warning("Invalid message queue was specified");
|
||||
@@ -123,7 +123,7 @@ const StaticString
|
||||
s_msg_lspid("msg_lspid"),
|
||||
s_msg_lrpid("msg_lrpid");
|
||||
|
||||
bool f_msg_set_queue(CObjRef queue, CArrRef data) {
|
||||
bool f_msg_set_queue(CResRef queue, CArrRef data) {
|
||||
MessageQueue *q = queue.getTyped<MessageQueue>();
|
||||
if (!q) {
|
||||
raise_warning("Invalid message queue was specified");
|
||||
@@ -148,7 +148,7 @@ bool f_msg_set_queue(CObjRef queue, CArrRef data) {
|
||||
return false;
|
||||
}
|
||||
|
||||
Array f_msg_stat_queue(CObjRef queue) {
|
||||
Array f_msg_stat_queue(CResRef queue) {
|
||||
MessageQueue *q = queue.getTyped<MessageQueue>();
|
||||
if (!q) {
|
||||
raise_warning("Invalid message queue was specified");
|
||||
@@ -174,7 +174,7 @@ Array f_msg_stat_queue(CObjRef queue) {
|
||||
return Array();
|
||||
}
|
||||
|
||||
bool f_msg_send(CObjRef queue, int64_t msgtype, CVarRef message,
|
||||
bool f_msg_send(CResRef queue, int64_t msgtype, CVarRef message,
|
||||
bool serialize /* = true */, bool blocking /* = true */,
|
||||
VRefParam errorcode /* = null */) {
|
||||
MessageQueue *q = queue.getTyped<MessageQueue>();
|
||||
@@ -209,7 +209,7 @@ bool f_msg_send(CObjRef queue, int64_t msgtype, CVarRef message,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_msg_receive(CObjRef queue, int64_t desiredmsgtype, VRefParam msgtype,
|
||||
bool f_msg_receive(CResRef queue, int64_t desiredmsgtype, VRefParam msgtype,
|
||||
int64_t maxsize, VRefParam message,
|
||||
bool unserialize /* = true */,
|
||||
int64_t flags /* = 0 */, VRefParam errorcode /* = null */) {
|
||||
@@ -364,11 +364,11 @@ public:
|
||||
|
||||
StaticString Semaphore::s_class_name("Semaphore");
|
||||
|
||||
bool f_sem_acquire(CObjRef sem_identifier) {
|
||||
bool f_sem_acquire(CResRef sem_identifier) {
|
||||
return sem_identifier.getTyped<Semaphore>()->op(true);
|
||||
}
|
||||
|
||||
bool f_sem_release(CObjRef sem_identifier) {
|
||||
bool f_sem_release(CResRef sem_identifier) {
|
||||
return sem_identifier.getTyped<Semaphore>()->op(false);
|
||||
}
|
||||
|
||||
@@ -457,14 +457,14 @@ Variant f_sem_get(int64_t key, int64_t max_acquire /* = 1 */,
|
||||
sem_ptr->semid = semid;
|
||||
sem_ptr->count = 0;
|
||||
sem_ptr->auto_release = auto_release;
|
||||
return Object(sem_ptr);
|
||||
return Resource(sem_ptr);
|
||||
}
|
||||
|
||||
/**
|
||||
* contributed by Gavin Sherry gavin@linuxworld.com.au
|
||||
* Fri Mar 16 00:50:13 EST 2001
|
||||
*/
|
||||
bool f_sem_remove(CObjRef sem_identifier) {
|
||||
bool f_sem_remove(CResRef sem_identifier) {
|
||||
Semaphore *sem_ptr = sem_identifier.getTyped<Semaphore>();
|
||||
|
||||
union semun un;
|
||||
|
||||
@@ -28,24 +28,24 @@ int64_t f_ftok(CStrRef pathname, CStrRef proj);
|
||||
|
||||
Variant f_msg_get_queue(int64_t key, int64_t perms = 0666);
|
||||
bool f_msg_queue_exists(int64_t key);
|
||||
bool f_msg_send(CObjRef queue, int64_t msgtype, CVarRef message,
|
||||
bool f_msg_send(CResRef queue, int64_t msgtype, CVarRef message,
|
||||
bool serialize = true, bool blocking = true,
|
||||
VRefParam errorcode = uninit_null());
|
||||
bool f_msg_receive(CObjRef queue, int64_t desiredmsgtype, VRefParam msgtype,
|
||||
bool f_msg_receive(CResRef queue, int64_t desiredmsgtype, VRefParam msgtype,
|
||||
int64_t maxsize, VRefParam message, bool unserialize = true,
|
||||
int64_t flags = 0, VRefParam errorcode = uninit_null());
|
||||
bool f_msg_remove_queue(CObjRef queue);
|
||||
bool f_msg_set_queue(CObjRef queue, CArrRef data);
|
||||
Array f_msg_stat_queue(CObjRef queue);
|
||||
bool f_msg_remove_queue(CResRef queue);
|
||||
bool f_msg_set_queue(CResRef queue, CArrRef data);
|
||||
Array f_msg_stat_queue(CResRef queue);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// semaphore
|
||||
|
||||
bool f_sem_acquire(CObjRef sem_identifier);
|
||||
bool f_sem_acquire(CResRef sem_identifier);
|
||||
Variant f_sem_get(int64_t key, int64_t max_acquire = 1, int64_t perm = 0666,
|
||||
bool auto_release = true);
|
||||
bool f_sem_release(CObjRef sem_identifier);
|
||||
bool f_sem_remove(CObjRef sem_identifier);
|
||||
bool f_sem_release(CResRef sem_identifier);
|
||||
bool f_sem_remove(CResRef sem_identifier);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// shared memory
|
||||
|
||||
@@ -114,7 +114,7 @@ public:
|
||||
|
||||
LDAPMessage *data;
|
||||
BerElement *ber;
|
||||
Object result; // Reference to LdapResult to avoid premature deallocation
|
||||
Resource result; // Reference to LdapResult to avoid premature deallocation
|
||||
};
|
||||
IMPLEMENT_OBJECT_ALLOCATION_NO_DEFAULT_SWEEP(LdapResultEntry)
|
||||
void LdapResultEntry::sweep() {
|
||||
@@ -131,7 +131,7 @@ static int _get_lderrno(LDAP *ldap) {
|
||||
return lderr;
|
||||
}
|
||||
|
||||
static bool php_ldap_do_modify(CObjRef link, CStrRef dn, CArrRef entry,
|
||||
static bool php_ldap_do_modify(CResRef link, CStrRef dn, CArrRef entry,
|
||||
int oper) {
|
||||
bool is_full_add = false; /* flag for full add operation so ldap_mod_add
|
||||
can be put back into oper, gerrit THomson */
|
||||
@@ -352,7 +352,7 @@ static Variant php_ldap_do_search(CVarRef link, CVarRef base_dn,
|
||||
ArrayIter iterdn(base_dn.toArray());
|
||||
ArrayIter iterfilter(filter.toArray());
|
||||
for (int i = 0; i < nlinks; i++) {
|
||||
ld = iter.second().toObject().getTyped<LdapLink>(true, true);
|
||||
ld = iter.second().toResource().getTyped<LdapLink>(true, true);
|
||||
if (ld == NULL) {
|
||||
ldap_err = 0;
|
||||
goto cleanup_parallel;
|
||||
@@ -394,7 +394,7 @@ static Variant php_ldap_do_search(CVarRef link, CVarRef base_dn,
|
||||
NULL, &ldap_res);
|
||||
}
|
||||
if (rcs[i] != -1) {
|
||||
ret.append(Object(NEWOBJ(LdapResult)(ldap_res)));
|
||||
ret.append(Resource(NEWOBJ(LdapResult)(ldap_res)));
|
||||
} else {
|
||||
ret.append(false);
|
||||
}
|
||||
@@ -413,7 +413,7 @@ cleanup_parallel:
|
||||
ldap_base_dn = (char*)base_dn.toString().data();
|
||||
}
|
||||
|
||||
ld = link.toObject().getTyped<LdapLink>(true, true);
|
||||
ld = link.toResource().getTyped<LdapLink>(true, true);
|
||||
if (ld == NULL) {
|
||||
ldap_err = 0;
|
||||
goto cleanup;
|
||||
@@ -447,7 +447,7 @@ cleanup_parallel:
|
||||
}
|
||||
#endif
|
||||
parallel_search = 0;
|
||||
ret.append(Object(NEWOBJ(LdapResult)(ldap_res)));
|
||||
ret.append(Resource(NEWOBJ(LdapResult)(ldap_res)));
|
||||
}
|
||||
}
|
||||
cleanup:
|
||||
@@ -483,7 +483,7 @@ static int _ldap_rebind_proc(LDAP *ldap, const char *url, ber_tag_t req,
|
||||
|
||||
/* callback */
|
||||
Variant ret = vm_call_user_func
|
||||
(ld->rebindproc, CREATE_VECTOR2(Object(ld), String(url, CopyString)));
|
||||
(ld->rebindproc, CREATE_VECTOR2(Resource(ld), String(url, CopyString)));
|
||||
return ret.toInt64();
|
||||
}
|
||||
|
||||
@@ -536,7 +536,7 @@ Variant f_ldap_connect(CStrRef hostname /* = null_string */,
|
||||
}
|
||||
|
||||
LdapLink *ld = NEWOBJ(LdapLink)();
|
||||
Object ret(ld);
|
||||
Resource ret(ld);
|
||||
|
||||
LDAP *ldap = NULL;
|
||||
if (!hostname.empty() && hostname.find('/') >= 0) {
|
||||
@@ -595,27 +595,27 @@ String f_ldap_err2str(int errnum) {
|
||||
return String(ldap_err2string(errnum), CopyString);
|
||||
}
|
||||
|
||||
bool f_ldap_add(CObjRef link, CStrRef dn, CArrRef entry) {
|
||||
bool f_ldap_add(CResRef link, CStrRef dn, CArrRef entry) {
|
||||
return php_ldap_do_modify(link, dn, entry, PHP_LD_FULL_ADD);
|
||||
}
|
||||
|
||||
bool f_ldap_mod_add(CObjRef link, CStrRef dn, CArrRef entry) {
|
||||
bool f_ldap_mod_add(CResRef link, CStrRef dn, CArrRef entry) {
|
||||
return php_ldap_do_modify(link, dn, entry, LDAP_MOD_ADD);
|
||||
}
|
||||
|
||||
bool f_ldap_mod_del(CObjRef link, CStrRef dn, CArrRef entry) {
|
||||
bool f_ldap_mod_del(CResRef link, CStrRef dn, CArrRef entry) {
|
||||
return php_ldap_do_modify(link, dn, entry, LDAP_MOD_DELETE);
|
||||
}
|
||||
|
||||
bool f_ldap_mod_replace(CObjRef link, CStrRef dn, CArrRef entry) {
|
||||
bool f_ldap_mod_replace(CResRef link, CStrRef dn, CArrRef entry) {
|
||||
return php_ldap_do_modify(link, dn, entry, LDAP_MOD_REPLACE);
|
||||
}
|
||||
|
||||
bool f_ldap_modify(CObjRef link, CStrRef dn, CArrRef entry) {
|
||||
bool f_ldap_modify(CResRef link, CStrRef dn, CArrRef entry) {
|
||||
return php_ldap_do_modify(link, dn, entry, LDAP_MOD_REPLACE);
|
||||
}
|
||||
|
||||
bool f_ldap_bind(CObjRef link, CStrRef bind_rdn /* = null_string */,
|
||||
bool f_ldap_bind(CResRef link, CStrRef bind_rdn /* = null_string */,
|
||||
CStrRef bind_password /* = null_string */) {
|
||||
int rc;
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
@@ -628,7 +628,7 @@ bool f_ldap_bind(CObjRef link, CStrRef bind_rdn /* = null_string */,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_set_rebind_proc(CObjRef link, CVarRef callback) {
|
||||
bool f_ldap_set_rebind_proc(CResRef link, CVarRef callback) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
|
||||
if (callback.isString() && callback.toString().empty()) {
|
||||
@@ -657,7 +657,7 @@ bool f_ldap_set_rebind_proc(CObjRef link, CVarRef callback) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_sort(CObjRef link, CObjRef result, CStrRef sortfilter) {
|
||||
bool f_ldap_sort(CResRef link, CResRef result, CStrRef sortfilter) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResult *res = result.getTyped<LdapResult>();
|
||||
|
||||
@@ -670,7 +670,7 @@ bool f_ldap_sort(CObjRef link, CObjRef result, CStrRef sortfilter) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_start_tls(CObjRef link) {
|
||||
bool f_ldap_start_tls(CResRef link) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
int rc, protocol = LDAP_VERSION3;
|
||||
if (((rc = ldap_set_option(ld->link, LDAP_OPT_PROTOCOL_VERSION, &protocol))
|
||||
@@ -682,13 +682,13 @@ bool f_ldap_start_tls(CObjRef link) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_unbind(CObjRef link) {
|
||||
bool f_ldap_unbind(CResRef link) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
ld->close();
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_get_option(CObjRef link, int option, VRefParam retval) {
|
||||
bool f_ldap_get_option(CResRef link, int option, VRefParam retval) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
|
||||
switch (option) {
|
||||
@@ -779,7 +779,7 @@ const StaticString
|
||||
bool f_ldap_set_option(CVarRef link, int option, CVarRef newval) {
|
||||
LDAP *ldap = NULL;
|
||||
if (!link.isNull()) {
|
||||
LdapLink *ld = link.toObject().getTyped<LdapLink>();
|
||||
LdapLink *ld = link.toResource().getTyped<LdapLink>();
|
||||
ldap = ld->link;
|
||||
}
|
||||
|
||||
@@ -921,7 +921,7 @@ bool f_ldap_set_option(CVarRef link, int option, CVarRef newval) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_close(CObjRef link) {
|
||||
bool f_ldap_close(CResRef link) {
|
||||
return f_ldap_unbind(link);
|
||||
}
|
||||
|
||||
@@ -949,7 +949,7 @@ Variant f_ldap_search(CVarRef link, CVarRef base_dn, CVarRef filter,
|
||||
sizelimit, timelimit, deref, LDAP_SCOPE_SUBTREE);
|
||||
}
|
||||
|
||||
bool f_ldap_rename(CObjRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent,
|
||||
bool f_ldap_rename(CResRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent,
|
||||
bool deleteoldrdn) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
int rc = ldap_rename_s(ld->link, (char*)dn.data(), (char*)newrdn.data(),
|
||||
@@ -958,7 +958,7 @@ bool f_ldap_rename(CObjRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent,
|
||||
return rc == LDAP_SUCCESS;
|
||||
}
|
||||
|
||||
bool f_ldap_delete(CObjRef link, CStrRef dn) {
|
||||
bool f_ldap_delete(CResRef link, CStrRef dn) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
int rc;
|
||||
if ((rc = ldap_delete_s(ld->link, (char*)dn.data())) != LDAP_SUCCESS) {
|
||||
@@ -968,7 +968,7 @@ bool f_ldap_delete(CObjRef link, CStrRef dn) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant f_ldap_compare(CObjRef link, CStrRef dn, CStrRef attribute,
|
||||
Variant f_ldap_compare(CResRef link, CStrRef dn, CStrRef attribute,
|
||||
CStrRef value) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
int rc = ldap_compare_s(ld->link, (char*)dn.data(), (char*)attribute.data(),
|
||||
@@ -981,18 +981,18 @@ Variant f_ldap_compare(CObjRef link, CStrRef dn, CStrRef attribute,
|
||||
return -1LL;
|
||||
}
|
||||
|
||||
int64_t f_ldap_errno(CObjRef link) {
|
||||
int64_t f_ldap_errno(CResRef link) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
return _get_lderrno(ld->link);
|
||||
}
|
||||
|
||||
String f_ldap_error(CObjRef link) {
|
||||
String f_ldap_error(CResRef link) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
int ld_errno = _get_lderrno(ld->link);
|
||||
return String(ldap_err2string(ld_errno), CopyString);
|
||||
}
|
||||
|
||||
Variant f_ldap_get_dn(CObjRef link, CObjRef result_entry) {
|
||||
Variant f_ldap_get_dn(CResRef link, CResRef result_entry) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
|
||||
@@ -1005,13 +1005,13 @@ Variant f_ldap_get_dn(CObjRef link, CObjRef result_entry) {
|
||||
return false;
|
||||
}
|
||||
|
||||
int64_t f_ldap_count_entries(CObjRef link, CObjRef result) {
|
||||
int64_t f_ldap_count_entries(CResRef link, CResRef result) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResult *res = result.getTyped<LdapResult>();
|
||||
return ldap_count_entries(ld->link, res->data);
|
||||
}
|
||||
|
||||
Variant f_ldap_get_entries(CObjRef link, CObjRef result) {
|
||||
Variant f_ldap_get_entries(CResRef link, CResRef result) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResult *res = result.getTyped<LdapResult>();
|
||||
|
||||
@@ -1048,7 +1048,7 @@ Variant f_ldap_get_entries(CObjRef link, CObjRef result) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_ldap_first_entry(CObjRef link, CObjRef result) {
|
||||
Variant f_ldap_first_entry(CResRef link, CResRef result) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResult *res = result.getTyped<LdapResult>();
|
||||
|
||||
@@ -1060,7 +1060,7 @@ Variant f_ldap_first_entry(CObjRef link, CObjRef result) {
|
||||
return NEWOBJ(LdapResultEntry)(entry, res);
|
||||
}
|
||||
|
||||
Variant f_ldap_next_entry(CObjRef link, CObjRef result_entry) {
|
||||
Variant f_ldap_next_entry(CResRef link, CResRef result_entry) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
|
||||
@@ -1072,7 +1072,7 @@ Variant f_ldap_next_entry(CObjRef link, CObjRef result_entry) {
|
||||
return NEWOBJ(LdapResultEntry)(msg, entry->result.get());
|
||||
}
|
||||
|
||||
Array f_ldap_get_attributes(CObjRef link, CObjRef result_entry) {
|
||||
Array f_ldap_get_attributes(CResRef link, CResRef result_entry) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
Array ret = Array::Create();
|
||||
@@ -1080,7 +1080,7 @@ Array f_ldap_get_attributes(CObjRef link, CObjRef result_entry) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_ldap_first_attribute(CObjRef link, CObjRef result_entry) {
|
||||
Variant f_ldap_first_attribute(CResRef link, CResRef result_entry) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
|
||||
@@ -1094,7 +1094,7 @@ Variant f_ldap_first_attribute(CObjRef link, CObjRef result_entry) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_ldap_next_attribute(CObjRef link, CObjRef result_entry) {
|
||||
Variant f_ldap_next_attribute(CResRef link, CResRef result_entry) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
|
||||
@@ -1118,7 +1118,7 @@ Variant f_ldap_next_attribute(CObjRef link, CObjRef result_entry) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_ldap_first_reference(CObjRef link, CObjRef result) {
|
||||
Variant f_ldap_first_reference(CResRef link, CResRef result) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResult *res = result.getTyped<LdapResult>();
|
||||
|
||||
@@ -1130,7 +1130,7 @@ Variant f_ldap_first_reference(CObjRef link, CObjRef result) {
|
||||
return NEWOBJ(LdapResultEntry)(entry, res);
|
||||
}
|
||||
|
||||
Variant f_ldap_next_reference(CObjRef link, CObjRef result_entry) {
|
||||
Variant f_ldap_next_reference(CResRef link, CResRef result_entry) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
|
||||
@@ -1142,7 +1142,7 @@ Variant f_ldap_next_reference(CObjRef link, CObjRef result_entry) {
|
||||
return NEWOBJ(LdapResultEntry)(entry_next, entry->result.get());
|
||||
}
|
||||
|
||||
bool f_ldap_parse_reference(CObjRef link, CObjRef result_entry,
|
||||
bool f_ldap_parse_reference(CResRef link, CResRef result_entry,
|
||||
VRefParam referrals) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
@@ -1166,7 +1166,7 @@ bool f_ldap_parse_reference(CObjRef link, CObjRef result_entry,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_parse_result(CObjRef link, CObjRef result, VRefParam errcode,
|
||||
bool f_ldap_parse_result(CResRef link, CResRef result, VRefParam errcode,
|
||||
VRefParam matcheddn /* = null */,
|
||||
VRefParam errmsg /* = null */,
|
||||
VRefParam referrals /* = null */) {
|
||||
@@ -1214,13 +1214,13 @@ bool f_ldap_parse_result(CObjRef link, CObjRef result, VRefParam errcode,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_ldap_free_result(CObjRef result) {
|
||||
bool f_ldap_free_result(CResRef result) {
|
||||
LdapResult *res = result.getTyped<LdapResult>();
|
||||
res->close();
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant f_ldap_get_values_len(CObjRef link, CObjRef result_entry,
|
||||
Variant f_ldap_get_values_len(CResRef link, CResRef result_entry,
|
||||
CStrRef attribute) {
|
||||
LdapLink *ld = link.getTyped<LdapLink>();
|
||||
LdapResultEntry *entry = result_entry.getTyped<LdapResultEntry>();
|
||||
@@ -1245,7 +1245,7 @@ Variant f_ldap_get_values_len(CObjRef link, CObjRef result_entry,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_ldap_get_values(CObjRef link, CObjRef result_entry,
|
||||
Variant f_ldap_get_values(CResRef link, CResRef result_entry,
|
||||
CStrRef attribute) {
|
||||
return f_ldap_get_values_len(link, result_entry, attribute);
|
||||
}
|
||||
|
||||
@@ -29,42 +29,42 @@ Variant f_ldap_connect(CStrRef hostname = null_string, int port = 389);
|
||||
Variant f_ldap_explode_dn(CStrRef dn, int with_attrib);
|
||||
Variant f_ldap_dn2ufn(CStrRef db);
|
||||
String f_ldap_err2str(int errnum);
|
||||
bool f_ldap_add(CObjRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_mod_add(CObjRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_mod_del(CObjRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_mod_replace(CObjRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_modify(CObjRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_bind(CObjRef link, CStrRef bind_rdn = null_string, CStrRef bind_password = null_string);
|
||||
bool f_ldap_set_rebind_proc(CObjRef link, CVarRef callback);
|
||||
bool f_ldap_sort(CObjRef link, CObjRef result, CStrRef sortfilter);
|
||||
bool f_ldap_start_tls(CObjRef link);
|
||||
bool f_ldap_unbind(CObjRef link);
|
||||
bool f_ldap_get_option(CObjRef link, int option, VRefParam retval);
|
||||
bool f_ldap_add(CResRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_mod_add(CResRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_mod_del(CResRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_mod_replace(CResRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_modify(CResRef link, CStrRef dn, CArrRef entry);
|
||||
bool f_ldap_bind(CResRef link, CStrRef bind_rdn = null_string, CStrRef bind_password = null_string);
|
||||
bool f_ldap_set_rebind_proc(CResRef link, CVarRef callback);
|
||||
bool f_ldap_sort(CResRef link, CResRef result, CStrRef sortfilter);
|
||||
bool f_ldap_start_tls(CResRef link);
|
||||
bool f_ldap_unbind(CResRef link);
|
||||
bool f_ldap_get_option(CResRef link, int option, VRefParam retval);
|
||||
bool f_ldap_set_option(CVarRef link, int option, CVarRef newval);
|
||||
bool f_ldap_close(CObjRef link);
|
||||
bool f_ldap_close(CResRef link);
|
||||
Variant f_ldap_list(CVarRef link, CVarRef base_dn, CVarRef filter, CArrRef attributes = null_array, int attrsonly = 0, int sizelimit = -1, int timelimit = -1, int deref = -1);
|
||||
Variant f_ldap_read(CVarRef link, CVarRef base_dn, CVarRef filter, CArrRef attributes = null_array, int attrsonly = 0, int sizelimit = -1, int timelimit = -1, int deref = -1);
|
||||
Variant f_ldap_search(CVarRef link, CVarRef base_dn, CVarRef filter, CArrRef attributes = null_array, int attrsonly = 0, int sizelimit = -1, int timelimit = -1, int deref = -1);
|
||||
bool f_ldap_rename(CObjRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent, bool deleteoldrdn);
|
||||
bool f_ldap_delete(CObjRef link, CStrRef dn);
|
||||
Variant f_ldap_compare(CObjRef link, CStrRef dn, CStrRef attribute, CStrRef value);
|
||||
int64_t f_ldap_errno(CObjRef link);
|
||||
String f_ldap_error(CObjRef link);
|
||||
Variant f_ldap_get_dn(CObjRef link, CObjRef result_entry);
|
||||
int64_t f_ldap_count_entries(CObjRef link, CObjRef result);
|
||||
Variant f_ldap_get_entries(CObjRef link, CObjRef result);
|
||||
Variant f_ldap_first_entry(CObjRef link, CObjRef result);
|
||||
Variant f_ldap_next_entry(CObjRef link, CObjRef result_entry);
|
||||
Array f_ldap_get_attributes(CObjRef link, CObjRef result_entry);
|
||||
Variant f_ldap_first_attribute(CObjRef link, CObjRef result_entry);
|
||||
Variant f_ldap_next_attribute(CObjRef link, CObjRef result_entry);
|
||||
Variant f_ldap_first_reference(CObjRef link, CObjRef result);
|
||||
Variant f_ldap_next_reference(CObjRef link, CObjRef result_entry);
|
||||
bool f_ldap_parse_reference(CObjRef link, CObjRef result_entry, VRefParam referrals);
|
||||
bool f_ldap_parse_result(CObjRef link, CObjRef result, VRefParam errcode, VRefParam matcheddn = uninit_null(), VRefParam errmsg = uninit_null(), VRefParam referrals = uninit_null());
|
||||
bool f_ldap_free_result(CObjRef result);
|
||||
Variant f_ldap_get_values_len(CObjRef link, CObjRef result_entry, CStrRef attribute);
|
||||
Variant f_ldap_get_values(CObjRef link, CObjRef result_entry, CStrRef attribute);
|
||||
bool f_ldap_rename(CResRef link, CStrRef dn, CStrRef newrdn, CStrRef newparent, bool deleteoldrdn);
|
||||
bool f_ldap_delete(CResRef link, CStrRef dn);
|
||||
Variant f_ldap_compare(CResRef link, CStrRef dn, CStrRef attribute, CStrRef value);
|
||||
int64_t f_ldap_errno(CResRef link);
|
||||
String f_ldap_error(CResRef link);
|
||||
Variant f_ldap_get_dn(CResRef link, CResRef result_entry);
|
||||
int64_t f_ldap_count_entries(CResRef link, CResRef result);
|
||||
Variant f_ldap_get_entries(CResRef link, CResRef result);
|
||||
Variant f_ldap_first_entry(CResRef link, CResRef result);
|
||||
Variant f_ldap_next_entry(CResRef link, CResRef result_entry);
|
||||
Array f_ldap_get_attributes(CResRef link, CResRef result_entry);
|
||||
Variant f_ldap_first_attribute(CResRef link, CResRef result_entry);
|
||||
Variant f_ldap_next_attribute(CResRef link, CResRef result_entry);
|
||||
Variant f_ldap_first_reference(CResRef link, CResRef result);
|
||||
Variant f_ldap_next_reference(CResRef link, CResRef result_entry);
|
||||
bool f_ldap_parse_reference(CResRef link, CResRef result_entry, VRefParam referrals);
|
||||
bool f_ldap_parse_result(CResRef link, CResRef result, VRefParam errcode, VRefParam matcheddn = uninit_null(), VRefParam errmsg = uninit_null(), VRefParam referrals = uninit_null());
|
||||
bool f_ldap_free_result(CResRef result);
|
||||
Variant f_ldap_get_values_len(CResRef link, CResRef result_entry, CStrRef attribute);
|
||||
Variant f_ldap_get_values(CResRef link, CResRef result_entry, CStrRef attribute);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
+482
-406
Diferenças do arquivo suprimidas por serem muito extensas
Carregar Diff
+406
-406
@@ -39,420 +39,420 @@ Array f_magickqueryconfigureoptions(CStrRef pattern);
|
||||
Array f_magickqueryfonts(CStrRef pattern);
|
||||
Array f_magickqueryformats(CStrRef pattern);
|
||||
bool f_magicksetresourcelimit(int resource_type, double limit);
|
||||
Object f_newdrawingwand();
|
||||
Object f_newmagickwand();
|
||||
Object f_newpixeliterator(CObjRef mgck_wnd);
|
||||
Object f_newpixelregioniterator(CObjRef mgck_wnd, int x, int y, int columns, int rows);
|
||||
Object f_newpixelwand(CStrRef imagemagick_col_str = null_string);
|
||||
Resource f_newdrawingwand();
|
||||
Resource f_newmagickwand();
|
||||
Resource f_newpixeliterator(CResRef mgck_wnd);
|
||||
Resource f_newpixelregioniterator(CResRef mgck_wnd, int x, int y, int columns, int rows);
|
||||
Resource f_newpixelwand(CStrRef imagemagick_col_str = null_string);
|
||||
Array f_newpixelwandarray(int num_pxl_wnds);
|
||||
Array f_newpixelwands(int num_pxl_wnds);
|
||||
void f_destroydrawingwand(CObjRef drw_wnd);
|
||||
void f_destroymagickwand(CObjRef mgck_wnd);
|
||||
void f_destroypixeliterator(CObjRef pxl_iter);
|
||||
void f_destroypixelwand(CObjRef pxl_wnd);
|
||||
void f_destroydrawingwand(CResRef drw_wnd);
|
||||
void f_destroymagickwand(CResRef mgck_wnd);
|
||||
void f_destroypixeliterator(CResRef pxl_iter);
|
||||
void f_destroypixelwand(CResRef pxl_wnd);
|
||||
void f_destroypixelwandarray(CArrRef pxl_wnd_array);
|
||||
void f_destroypixelwands(CArrRef pxl_wnd_array);
|
||||
bool f_isdrawingwand(CVarRef var);
|
||||
bool f_ismagickwand(CVarRef var);
|
||||
bool f_ispixeliterator(CVarRef var);
|
||||
bool f_ispixelwand(CVarRef var);
|
||||
void f_cleardrawingwand(CObjRef drw_wnd);
|
||||
void f_clearmagickwand(CObjRef mgck_wnd);
|
||||
void f_clearpixeliterator(CObjRef pxl_iter);
|
||||
void f_clearpixelwand(CObjRef pxl_wnd);
|
||||
Object f_clonedrawingwand(CObjRef drw_wnd);
|
||||
Object f_clonemagickwand(CObjRef mgck_wnd);
|
||||
Array f_wandgetexception(CObjRef wnd);
|
||||
String f_wandgetexceptionstring(CObjRef wnd);
|
||||
int64_t f_wandgetexceptiontype(CObjRef wnd);
|
||||
bool f_wandhasexception(CObjRef wnd);
|
||||
void f_drawaffine(CObjRef drw_wnd, double sx, double sy, double rx, double ry, double tx, double ty);
|
||||
void f_drawannotation(CObjRef drw_wnd, double x, double y, CStrRef text);
|
||||
void f_drawarc(CObjRef drw_wnd, double sx, double sy, double ex, double ey, double sd, double ed);
|
||||
void f_drawbezier(CObjRef drw_wnd, CArrRef x_y_points_array);
|
||||
void f_drawcircle(CObjRef drw_wnd, double ox, double oy, double px, double py);
|
||||
void f_drawcolor(CObjRef drw_wnd, double x, double y, int paint_method);
|
||||
void f_drawcomment(CObjRef drw_wnd, CStrRef comment);
|
||||
bool f_drawcomposite(CObjRef drw_wnd, int composite_operator, double x, double y, double width, double height, CObjRef mgck_wnd);
|
||||
void f_drawellipse(CObjRef drw_wnd, double ox, double oy, double rx, double ry, double start, double end);
|
||||
String f_drawgetclippath(CObjRef drw_wnd);
|
||||
int64_t f_drawgetcliprule(CObjRef drw_wnd);
|
||||
int64_t f_drawgetclipunits(CObjRef drw_wnd);
|
||||
Array f_drawgetexception(CObjRef drw_wnd);
|
||||
String f_drawgetexceptionstring(CObjRef drw_wnd);
|
||||
int64_t f_drawgetexceptiontype(CObjRef drw_wnd);
|
||||
double f_drawgetfillalpha(CObjRef drw_wnd);
|
||||
Object f_drawgetfillcolor(CObjRef drw_wnd);
|
||||
double f_drawgetfillopacity(CObjRef drw_wnd);
|
||||
int64_t f_drawgetfillrule(CObjRef drw_wnd);
|
||||
String f_drawgetfont(CObjRef drw_wnd);
|
||||
String f_drawgetfontfamily(CObjRef drw_wnd);
|
||||
double f_drawgetfontsize(CObjRef drw_wnd);
|
||||
int64_t f_drawgetfontstretch(CObjRef drw_wnd);
|
||||
int64_t f_drawgetfontstyle(CObjRef drw_wnd);
|
||||
double f_drawgetfontweight(CObjRef drw_wnd);
|
||||
int64_t f_drawgetgravity(CObjRef drw_wnd);
|
||||
double f_drawgetstrokealpha(CObjRef drw_wnd);
|
||||
bool f_drawgetstrokeantialias(CObjRef drw_wnd);
|
||||
Object f_drawgetstrokecolor(CObjRef drw_wnd);
|
||||
Array f_drawgetstrokedasharray(CObjRef drw_wnd);
|
||||
double f_drawgetstrokedashoffset(CObjRef drw_wnd);
|
||||
int64_t f_drawgetstrokelinecap(CObjRef drw_wnd);
|
||||
int64_t f_drawgetstrokelinejoin(CObjRef drw_wnd);
|
||||
double f_drawgetstrokemiterlimit(CObjRef drw_wnd);
|
||||
double f_drawgetstrokeopacity(CObjRef drw_wnd);
|
||||
double f_drawgetstrokewidth(CObjRef drw_wnd);
|
||||
int64_t f_drawgettextalignment(CObjRef drw_wnd);
|
||||
bool f_drawgettextantialias(CObjRef drw_wnd);
|
||||
int64_t f_drawgettextdecoration(CObjRef drw_wnd);
|
||||
String f_drawgettextencoding(CObjRef drw_wnd);
|
||||
Object f_drawgettextundercolor(CObjRef drw_wnd);
|
||||
String f_drawgetvectorgraphics(CObjRef drw_wnd);
|
||||
void f_drawline(CObjRef drw_wnd, double sx, double sy, double ex, double ey);
|
||||
void f_drawmatte(CObjRef drw_wnd, double x, double y, int paint_method);
|
||||
void f_drawpathclose(CObjRef drw_wnd);
|
||||
void f_drawpathcurvetoabsolute(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbezierabsolute(CObjRef drw_wnd, double x1, double y1, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbezierrelative(CObjRef drw_wnd, double x1, double y1, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbeziersmoothabsolute(CObjRef drw_wnd, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbeziersmoothrelative(CObjRef drw_wnd, double x, double y);
|
||||
void f_drawpathcurvetorelative(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y);
|
||||
void f_drawpathcurvetosmoothabsolute(CObjRef drw_wnd, double x2, double y2, double x, double y);
|
||||
void f_drawpathcurvetosmoothrelative(CObjRef drw_wnd, double x2, double y2, double x, double y);
|
||||
void f_drawpathellipticarcabsolute(CObjRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y);
|
||||
void f_drawpathellipticarcrelative(CObjRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y);
|
||||
void f_drawpathfinish(CObjRef drw_wnd);
|
||||
void f_drawpathlinetoabsolute(CObjRef drw_wnd, double x, double y);
|
||||
void f_drawpathlinetohorizontalabsolute(CObjRef drw_wnd, double x);
|
||||
void f_drawpathlinetohorizontalrelative(CObjRef drw_wnd, double x);
|
||||
void f_drawpathlinetorelative(CObjRef drw_wnd, double x, double y);
|
||||
void f_drawpathlinetoverticalabsolute(CObjRef drw_wnd, double y);
|
||||
void f_drawpathlinetoverticalrelative(CObjRef drw_wnd, double y);
|
||||
void f_drawpathmovetoabsolute(CObjRef drw_wnd, double x, double y);
|
||||
void f_drawpathmovetorelative(CObjRef drw_wnd, double x, double y);
|
||||
void f_drawpathstart(CObjRef drw_wnd);
|
||||
void f_drawpoint(CObjRef drw_wnd, double x, double y);
|
||||
void f_drawpolygon(CObjRef drw_wnd, CArrRef x_y_points_array);
|
||||
void f_drawpolyline(CObjRef drw_wnd, CArrRef x_y_points_array);
|
||||
void f_drawrectangle(CObjRef drw_wnd, double x1, double y1, double x2, double y2);
|
||||
bool f_drawrender(CObjRef drw_wnd);
|
||||
void f_drawrotate(CObjRef drw_wnd, double degrees);
|
||||
void f_drawroundrectangle(CObjRef drw_wnd, double x1, double y1, double x2, double y2, double rx, double ry);
|
||||
void f_drawscale(CObjRef drw_wnd, double x, double y);
|
||||
bool f_drawsetclippath(CObjRef drw_wnd, CStrRef clip_path);
|
||||
void f_drawsetcliprule(CObjRef drw_wnd, int fill_rule);
|
||||
void f_drawsetclipunits(CObjRef drw_wnd, int clip_path_units);
|
||||
void f_drawsetfillalpha(CObjRef drw_wnd, double fill_opacity);
|
||||
void f_drawsetfillcolor(CObjRef drw_wnd, CObjRef fill_pxl_wnd);
|
||||
void f_drawsetfillopacity(CObjRef drw_wnd, double fill_opacity);
|
||||
bool f_drawsetfillpatternurl(CObjRef drw_wnd, CStrRef fill_url);
|
||||
void f_drawsetfillrule(CObjRef drw_wnd, int fill_rule);
|
||||
bool f_drawsetfont(CObjRef drw_wnd, CStrRef font_file);
|
||||
bool f_drawsetfontfamily(CObjRef drw_wnd, CStrRef font_family);
|
||||
void f_drawsetfontsize(CObjRef drw_wnd, double pointsize);
|
||||
void f_drawsetfontstretch(CObjRef drw_wnd, int stretch_type);
|
||||
void f_drawsetfontstyle(CObjRef drw_wnd, int style_type);
|
||||
void f_drawsetfontweight(CObjRef drw_wnd, double font_weight);
|
||||
void f_drawsetgravity(CObjRef drw_wnd, int gravity_type);
|
||||
void f_drawsetstrokealpha(CObjRef drw_wnd, double stroke_opacity);
|
||||
void f_drawsetstrokeantialias(CObjRef drw_wnd, bool stroke_antialias = true);
|
||||
void f_drawsetstrokecolor(CObjRef drw_wnd, CObjRef strokecolor_pxl_wnd);
|
||||
void f_drawsetstrokedasharray(CObjRef drw_wnd, CArrRef dash_array = null_array);
|
||||
void f_drawsetstrokedashoffset(CObjRef drw_wnd, double dash_offset);
|
||||
void f_drawsetstrokelinecap(CObjRef drw_wnd, int line_cap);
|
||||
void f_drawsetstrokelinejoin(CObjRef drw_wnd, int line_join);
|
||||
void f_drawsetstrokemiterlimit(CObjRef drw_wnd, double miterlimit);
|
||||
void f_drawsetstrokeopacity(CObjRef drw_wnd, double stroke_opacity);
|
||||
bool f_drawsetstrokepatternurl(CObjRef drw_wnd, CStrRef stroke_url);
|
||||
void f_drawsetstrokewidth(CObjRef drw_wnd, double stroke_width);
|
||||
void f_drawsettextalignment(CObjRef drw_wnd, int align_type);
|
||||
void f_drawsettextantialias(CObjRef drw_wnd, bool text_antialias = true);
|
||||
void f_drawsettextdecoration(CObjRef drw_wnd, int decoration_type);
|
||||
void f_drawsettextencoding(CObjRef drw_wnd, CStrRef encoding);
|
||||
void f_drawsettextundercolor(CObjRef drw_wnd, CObjRef undercolor_pxl_wnd);
|
||||
bool f_drawsetvectorgraphics(CObjRef drw_wnd, CStrRef vector_graphics);
|
||||
void f_drawsetviewbox(CObjRef drw_wnd, double x1, double y1, double x2, double y2);
|
||||
void f_drawskewx(CObjRef drw_wnd, double degrees);
|
||||
void f_drawskewy(CObjRef drw_wnd, double degrees);
|
||||
void f_drawtranslate(CObjRef drw_wnd, double x, double y);
|
||||
void f_pushdrawingwand(CObjRef drw_wnd);
|
||||
void f_drawpushclippath(CObjRef drw_wnd, CStrRef clip_path_id);
|
||||
void f_drawpushdefs(CObjRef drw_wnd);
|
||||
void f_drawpushpattern(CObjRef drw_wnd, CStrRef pattern_id, double x, double y, double width, double height);
|
||||
void f_popdrawingwand(CObjRef drw_wnd);
|
||||
void f_drawpopclippath(CObjRef drw_wnd);
|
||||
void f_drawpopdefs(CObjRef drw_wnd);
|
||||
void f_drawpoppattern(CObjRef drw_wnd);
|
||||
bool f_magickadaptivethresholdimage(CObjRef mgck_wnd, double width, double height, double offset);
|
||||
bool f_magickaddimage(CObjRef mgck_wnd, CObjRef add_wand);
|
||||
bool f_magickaddnoiseimage(CObjRef mgck_wnd, int noise_type);
|
||||
bool f_magickaffinetransformimage(CObjRef mgck_wnd, CObjRef drw_wnd);
|
||||
bool f_magickannotateimage(CObjRef mgck_wnd, CObjRef drw_wnd, double x, double y, double angle, CStrRef text);
|
||||
Object f_magickappendimages(CObjRef mgck_wnd, bool stack_vertical = false);
|
||||
Object f_magickaverageimages(CObjRef mgck_wnd);
|
||||
bool f_magickblackthresholdimage(CObjRef mgck_wnd, CObjRef threshold_pxl_wnd);
|
||||
bool f_magickblurimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type = 0);
|
||||
bool f_magickborderimage(CObjRef mgck_wnd, CObjRef bordercolor, double width, double height);
|
||||
bool f_magickcharcoalimage(CObjRef mgck_wnd, double radius, double sigma);
|
||||
bool f_magickchopimage(CObjRef mgck_wnd, double width, double height, int x, int y);
|
||||
bool f_magickclipimage(CObjRef mgck_wnd);
|
||||
bool f_magickclippathimage(CObjRef mgck_wnd, CStrRef pathname, bool inside);
|
||||
Object f_magickcoalesceimages(CObjRef mgck_wnd);
|
||||
bool f_magickcolorfloodfillimage(CObjRef mgck_wnd, CObjRef fillcolor_pxl_wnd, double fuzz, CObjRef bordercolor_pxl_wnd, int x, int y);
|
||||
bool f_magickcolorizeimage(CObjRef mgck_wnd, CObjRef colorize, CObjRef opacity_pxl_wnd);
|
||||
Object f_magickcombineimages(CObjRef mgck_wnd, int channel_type);
|
||||
bool f_magickcommentimage(CObjRef mgck_wnd, CStrRef comment);
|
||||
Array f_magickcompareimages(CObjRef mgck_wnd, CObjRef reference_wnd, int metric_type, int channel_type = 0);
|
||||
bool f_magickcompositeimage(CObjRef mgck_wnd, CObjRef composite_wnd, int composite_operator, int x, int y);
|
||||
bool f_magickconstituteimage(CObjRef mgck_wnd, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array);
|
||||
bool f_magickcontrastimage(CObjRef mgck_wnd, bool sharpen);
|
||||
bool f_magickconvolveimage(CObjRef mgck_wnd, CArrRef kernel_array, int channel_type = 0);
|
||||
bool f_magickcropimage(CObjRef mgck_wnd, double width, double height, int x, int y);
|
||||
bool f_magickcyclecolormapimage(CObjRef mgck_wnd, int num_positions);
|
||||
Object f_magickdeconstructimages(CObjRef mgck_wnd);
|
||||
String f_magickdescribeimage(CObjRef mgck_wnd);
|
||||
bool f_magickdespeckleimage(CObjRef mgck_wnd);
|
||||
bool f_magickdrawimage(CObjRef mgck_wnd, CObjRef drw_wnd);
|
||||
bool f_magickechoimageblob(CObjRef mgck_wnd);
|
||||
bool f_magickechoimagesblob(CObjRef mgck_wnd);
|
||||
bool f_magickedgeimage(CObjRef mgck_wnd, double radius);
|
||||
bool f_magickembossimage(CObjRef mgck_wnd, double radius, double sigma);
|
||||
bool f_magickenhanceimage(CObjRef mgck_wnd);
|
||||
bool f_magickequalizeimage(CObjRef mgck_wnd);
|
||||
bool f_magickevaluateimage(CObjRef mgck_wnd, int evaluate_op, double constant, int channel_type = 0);
|
||||
Object f_magickflattenimages(CObjRef mgck_wnd);
|
||||
bool f_magickflipimage(CObjRef mgck_wnd);
|
||||
bool f_magickflopimage(CObjRef mgck_wnd);
|
||||
bool f_magickframeimage(CObjRef mgck_wnd, CObjRef matte_color, double width, double height, int inner_bevel, int outer_bevel);
|
||||
Object f_magickfximage(CObjRef mgck_wnd, CStrRef expression, int channel_type = 0);
|
||||
bool f_magickgammaimage(CObjRef mgck_wnd, double gamma, int channel_type = 0);
|
||||
bool f_magickgaussianblurimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type = 0);
|
||||
double f_magickgetcharheight(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgetcharwidth(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
Array f_magickgetexception(CObjRef mgck_wnd);
|
||||
String f_magickgetexceptionstring(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetexceptiontype(CObjRef mgck_wnd);
|
||||
String f_magickgetfilename(CObjRef mgck_wnd);
|
||||
String f_magickgetformat(CObjRef mgck_wnd);
|
||||
Object f_magickgetimage(CObjRef mgck_wnd);
|
||||
Object f_magickgetimagebackgroundcolor(CObjRef mgck_wnd);
|
||||
String f_magickgetimageblob(CObjRef mgck_wnd);
|
||||
Array f_magickgetimageblueprimary(CObjRef mgck_wnd);
|
||||
Object f_magickgetimagebordercolor(CObjRef mgck_wnd);
|
||||
Array f_magickgetimagechannelmean(CObjRef mgck_wnd, int channel_type);
|
||||
Object f_magickgetimagecolormapcolor(CObjRef mgck_wnd, double index);
|
||||
double f_magickgetimagecolors(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimagecolorspace(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimagecompose(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimagecompression(CObjRef mgck_wnd);
|
||||
double f_magickgetimagecompressionquality(CObjRef mgck_wnd);
|
||||
double f_magickgetimagedelay(CObjRef mgck_wnd);
|
||||
double f_magickgetimagedepth(CObjRef mgck_wnd, int channel_type = 0);
|
||||
int64_t f_magickgetimagedispose(CObjRef mgck_wnd);
|
||||
Array f_magickgetimageextrema(CObjRef mgck_wnd, int channel_type = 0);
|
||||
String f_magickgetimagefilename(CObjRef mgck_wnd);
|
||||
String f_magickgetimageformat(CObjRef mgck_wnd);
|
||||
double f_magickgetimagegamma(CObjRef mgck_wnd);
|
||||
Array f_magickgetimagegreenprimary(CObjRef mgck_wnd);
|
||||
double f_magickgetimageheight(CObjRef mgck_wnd);
|
||||
Array f_magickgetimagehistogram(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimageindex(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimageinterlacescheme(CObjRef mgck_wnd);
|
||||
double f_magickgetimageiterations(CObjRef mgck_wnd);
|
||||
Object f_magickgetimagemattecolor(CObjRef mgck_wnd);
|
||||
String f_magickgetimagemimetype(CObjRef mgck_wnd);
|
||||
Array f_magickgetimagepixels(CObjRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type);
|
||||
String f_magickgetimageprofile(CObjRef mgck_wnd, CStrRef name);
|
||||
Array f_magickgetimageredprimary(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimagerenderingintent(CObjRef mgck_wnd);
|
||||
Array f_magickgetimageresolution(CObjRef mgck_wnd);
|
||||
double f_magickgetimagescene(CObjRef mgck_wnd);
|
||||
String f_magickgetimagesignature(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimagesize(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimagetype(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimageunits(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetimagevirtualpixelmethod(CObjRef mgck_wnd);
|
||||
Array f_magickgetimagewhitepoint(CObjRef mgck_wnd);
|
||||
double f_magickgetimagewidth(CObjRef mgck_wnd);
|
||||
String f_magickgetimagesblob(CObjRef mgck_wnd);
|
||||
int64_t f_magickgetinterlacescheme(CObjRef mgck_wnd);
|
||||
double f_magickgetmaxtextadvance(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
String f_magickgetmimetype(CObjRef mgck_wnd);
|
||||
double f_magickgetnumberimages(CObjRef mgck_wnd);
|
||||
Array f_magickgetsamplingfactors(CObjRef mgck_wnd);
|
||||
Array f_magickgetsize(CObjRef mgck_wnd);
|
||||
double f_magickgetstringheight(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgetstringwidth(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgettextascent(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgettextdescent(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
Array f_magickgetwandsize(CObjRef mgck_wnd);
|
||||
bool f_magickhasnextimage(CObjRef mgck_wnd);
|
||||
bool f_magickhaspreviousimage(CObjRef mgck_wnd);
|
||||
bool f_magickimplodeimage(CObjRef mgck_wnd, double amount);
|
||||
bool f_magicklabelimage(CObjRef mgck_wnd, CStrRef label);
|
||||
bool f_magicklevelimage(CObjRef mgck_wnd, double black_point, double gamma, double white_point, int channel_type = 0);
|
||||
bool f_magickmagnifyimage(CObjRef mgck_wnd);
|
||||
bool f_magickmapimage(CObjRef mgck_wnd, CObjRef map_wand, bool dither);
|
||||
bool f_magickmattefloodfillimage(CObjRef mgck_wnd, double opacity, double fuzz, CObjRef bordercolor_pxl_wnd, int x, int y);
|
||||
bool f_magickmedianfilterimage(CObjRef mgck_wnd, double radius);
|
||||
bool f_magickminifyimage(CObjRef mgck_wnd);
|
||||
bool f_magickmodulateimage(CObjRef mgck_wnd, double brightness, double saturation, double hue);
|
||||
Object f_magickmontageimage(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef tile_geometry, CStrRef thumbnail_geometry, int montage_mode, CStrRef frame);
|
||||
Object f_magickmorphimages(CObjRef mgck_wnd, double number_frames);
|
||||
Object f_magickmosaicimages(CObjRef mgck_wnd);
|
||||
bool f_magickmotionblurimage(CObjRef mgck_wnd, double radius, double sigma, double angle);
|
||||
bool f_magicknegateimage(CObjRef mgck_wnd, bool only_the_gray = false, int channel_type = 0);
|
||||
bool f_magicknewimage(CObjRef mgck_wnd, double width, double height, CStrRef imagemagick_col_str = null_string);
|
||||
bool f_magicknextimage(CObjRef mgck_wnd);
|
||||
bool f_magicknormalizeimage(CObjRef mgck_wnd);
|
||||
bool f_magickoilpaintimage(CObjRef mgck_wnd, double radius);
|
||||
bool f_magickpaintopaqueimage(CObjRef mgck_wnd, CObjRef target_pxl_wnd, CObjRef fill_pxl_wnd, double fuzz = 0.0);
|
||||
bool f_magickpainttransparentimage(CObjRef mgck_wnd, CObjRef target, double opacity = k_MW_TransparentOpacity, double fuzz = 0.0);
|
||||
bool f_magickpingimage(CObjRef mgck_wnd, CStrRef filename);
|
||||
bool f_magickposterizeimage(CObjRef mgck_wnd, double levels, bool dither);
|
||||
Object f_magickpreviewimages(CObjRef mgck_wnd, int preview);
|
||||
bool f_magickpreviousimage(CObjRef mgck_wnd);
|
||||
bool f_magickprofileimage(CObjRef mgck_wnd, CStrRef name, CStrRef profile = null_string);
|
||||
bool f_magickquantizeimage(CObjRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error);
|
||||
bool f_magickquantizeimages(CObjRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error);
|
||||
Array f_magickqueryfontmetrics(CObjRef mgck_wnd, CObjRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
bool f_magickradialblurimage(CObjRef mgck_wnd, double angle);
|
||||
bool f_magickraiseimage(CObjRef mgck_wnd, double width, double height, int x, int y, bool raise);
|
||||
bool f_magickreadimage(CObjRef mgck_wnd, CStrRef filename);
|
||||
bool f_magickreadimageblob(CObjRef mgck_wnd, CStrRef blob);
|
||||
bool f_magickreadimagefile(CObjRef mgck_wnd, CObjRef handle);
|
||||
bool f_magickreadimages(CObjRef mgck_wnd, CArrRef img_filenames_array);
|
||||
bool f_magickreducenoiseimage(CObjRef mgck_wnd, double radius);
|
||||
bool f_magickremoveimage(CObjRef mgck_wnd);
|
||||
String f_magickremoveimageprofile(CObjRef mgck_wnd, CStrRef name);
|
||||
bool f_magickremoveimageprofiles(CObjRef mgck_wnd);
|
||||
bool f_magickresampleimage(CObjRef mgck_wnd, double x_resolution, double y_resolution, int filter_type, double blur);
|
||||
void f_magickresetiterator(CObjRef mgck_wnd);
|
||||
bool f_magickresizeimage(CObjRef mgck_wnd, double columns, double rows, int filter_type, double blur);
|
||||
bool f_magickrollimage(CObjRef mgck_wnd, int x_offset, int y_offset);
|
||||
bool f_magickrotateimage(CObjRef mgck_wnd, CObjRef background, double degrees);
|
||||
bool f_magicksampleimage(CObjRef mgck_wnd, double columns, double rows);
|
||||
bool f_magickscaleimage(CObjRef mgck_wnd, double columns, double rows);
|
||||
bool f_magickseparateimagechannel(CObjRef mgck_wnd, int channel_type);
|
||||
bool f_magicksetcompressionquality(CObjRef mgck_wnd, double quality);
|
||||
bool f_magicksetfilename(CObjRef mgck_wnd, CStrRef filename = null_string);
|
||||
void f_magicksetfirstiterator(CObjRef mgck_wnd);
|
||||
bool f_magicksetformat(CObjRef mgck_wnd, CStrRef format);
|
||||
bool f_magicksetimage(CObjRef mgck_wnd, CObjRef replace_wand);
|
||||
bool f_magicksetimagebackgroundcolor(CObjRef mgck_wnd, CObjRef background_pxl_wnd);
|
||||
bool f_magicksetimagebias(CObjRef mgck_wnd, double bias);
|
||||
bool f_magicksetimageblueprimary(CObjRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetimagebordercolor(CObjRef mgck_wnd, CObjRef border_pxl_wnd);
|
||||
bool f_magicksetimagecolormapcolor(CObjRef mgck_wnd, double index, CObjRef mapcolor_pxl_wnd);
|
||||
bool f_magicksetimagecolorspace(CObjRef mgck_wnd, int colorspace_type);
|
||||
bool f_magicksetimagecompose(CObjRef mgck_wnd, int composite_operator);
|
||||
bool f_magicksetimagecompression(CObjRef mgck_wnd, int compression_type);
|
||||
bool f_magicksetimagecompressionquality(CObjRef mgck_wnd, double quality);
|
||||
bool f_magicksetimagedelay(CObjRef mgck_wnd, double delay);
|
||||
bool f_magicksetimagedepth(CObjRef mgck_wnd, int depth, int channel_type = 0);
|
||||
bool f_magicksetimagedispose(CObjRef mgck_wnd, int dispose_type);
|
||||
bool f_magicksetimagefilename(CObjRef mgck_wnd, CStrRef filename = null_string);
|
||||
bool f_magicksetimageformat(CObjRef mgck_wnd, CStrRef format);
|
||||
bool f_magicksetimagegamma(CObjRef mgck_wnd, double gamma);
|
||||
bool f_magicksetimagegreenprimary(CObjRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetimageindex(CObjRef mgck_wnd, int index);
|
||||
bool f_magicksetimageinterlacescheme(CObjRef mgck_wnd, int interlace_type);
|
||||
bool f_magicksetimageiterations(CObjRef mgck_wnd, double iterations);
|
||||
bool f_magicksetimagemattecolor(CObjRef mgck_wnd, CObjRef matte_pxl_wnd);
|
||||
bool f_magicksetimageoption(CObjRef mgck_wnd, CStrRef format, CStrRef key, CStrRef value);
|
||||
bool f_magicksetimagepixels(CObjRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array);
|
||||
bool f_magicksetimageprofile(CObjRef mgck_wnd, CStrRef name, CStrRef profile);
|
||||
bool f_magicksetimageredprimary(CObjRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetimagerenderingintent(CObjRef mgck_wnd, int rendering_intent);
|
||||
bool f_magicksetimageresolution(CObjRef mgck_wnd, double x_resolution, double y_resolution);
|
||||
bool f_magicksetimagescene(CObjRef mgck_wnd, double scene);
|
||||
bool f_magicksetimagetype(CObjRef mgck_wnd, int image_type);
|
||||
bool f_magicksetimageunits(CObjRef mgck_wnd, int resolution_type);
|
||||
bool f_magicksetimagevirtualpixelmethod(CObjRef mgck_wnd, int virtual_pixel_method);
|
||||
bool f_magicksetimagewhitepoint(CObjRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetinterlacescheme(CObjRef mgck_wnd, int interlace_type);
|
||||
void f_magicksetlastiterator(CObjRef mgck_wnd);
|
||||
bool f_magicksetpassphrase(CObjRef mgck_wnd, CStrRef passphrase);
|
||||
bool f_magicksetresolution(CObjRef mgck_wnd, double x_resolution, double y_resolution);
|
||||
bool f_magicksetsamplingfactors(CObjRef mgck_wnd, double number_factors, CArrRef sampling_factors);
|
||||
bool f_magicksetsize(CObjRef mgck_wnd, int columns, int rows);
|
||||
bool f_magicksetwandsize(CObjRef mgck_wnd, int columns, int rows);
|
||||
bool f_magicksharpenimage(CObjRef mgck_wnd, double radius, double sigma, int channel_type = 0);
|
||||
bool f_magickshaveimage(CObjRef mgck_wnd, int columns, int rows);
|
||||
bool f_magickshearimage(CObjRef mgck_wnd, CObjRef background, double x_shear, double y_shear);
|
||||
bool f_magicksolarizeimage(CObjRef mgck_wnd, double threshold);
|
||||
bool f_magickspliceimage(CObjRef mgck_wnd, double width, double height, int x, int y);
|
||||
bool f_magickspreadimage(CObjRef mgck_wnd, double radius);
|
||||
Object f_magicksteganoimage(CObjRef mgck_wnd, CObjRef watermark_wand, int offset);
|
||||
bool f_magickstereoimage(CObjRef mgck_wnd, CObjRef offset_wand);
|
||||
bool f_magickstripimage(CObjRef mgck_wnd);
|
||||
bool f_magickswirlimage(CObjRef mgck_wnd, double degrees);
|
||||
Object f_magicktextureimage(CObjRef mgck_wnd, CObjRef texture_wand);
|
||||
bool f_magickthresholdimage(CObjRef mgck_wnd, double threshold, int channel_type = 0);
|
||||
bool f_magicktintimage(CObjRef mgck_wnd, int tint_pxl_wnd, CObjRef opacity_pxl_wnd);
|
||||
Object f_magicktransformimage(CObjRef mgck_wnd, CStrRef crop, CStrRef geometry);
|
||||
bool f_magicktrimimage(CObjRef mgck_wnd, double fuzz);
|
||||
bool f_magickunsharpmaskimage(CObjRef mgck_wnd, double radius, double sigma, double amount, double threshold, int channel_type = 0);
|
||||
bool f_magickwaveimage(CObjRef mgck_wnd, double amplitude, double wave_length);
|
||||
bool f_magickwhitethresholdimage(CObjRef mgck_wnd, CObjRef threshold_pxl_wnd);
|
||||
bool f_magickwriteimage(CObjRef mgck_wnd, CStrRef filename);
|
||||
bool f_magickwriteimagefile(CObjRef mgck_wnd, CObjRef handle);
|
||||
bool f_magickwriteimages(CObjRef mgck_wnd, CStrRef filename = "", bool join_images = false);
|
||||
bool f_magickwriteimagesfile(CObjRef mgck_wnd, CObjRef handle);
|
||||
double f_pixelgetalpha(CObjRef pxl_wnd);
|
||||
double f_pixelgetalphaquantum(CObjRef pxl_wnd);
|
||||
double f_pixelgetblack(CObjRef pxl_wnd);
|
||||
double f_pixelgetblackquantum(CObjRef pxl_wnd);
|
||||
double f_pixelgetblue(CObjRef pxl_wnd);
|
||||
double f_pixelgetbluequantum(CObjRef pxl_wnd);
|
||||
String f_pixelgetcolorasstring(CObjRef pxl_wnd);
|
||||
double f_pixelgetcolorcount(CObjRef pxl_wnd);
|
||||
double f_pixelgetcyan(CObjRef pxl_wnd);
|
||||
double f_pixelgetcyanquantum(CObjRef pxl_wnd);
|
||||
Array f_pixelgetexception(CObjRef pxl_wnd);
|
||||
String f_pixelgetexceptionstring(CObjRef pxl_wnd);
|
||||
int64_t f_pixelgetexceptiontype(CObjRef pxl_wnd);
|
||||
double f_pixelgetgreen(CObjRef pxl_wnd);
|
||||
double f_pixelgetgreenquantum(CObjRef pxl_wnd);
|
||||
double f_pixelgetindex(CObjRef pxl_wnd);
|
||||
double f_pixelgetmagenta(CObjRef pxl_wnd);
|
||||
double f_pixelgetmagentaquantum(CObjRef pxl_wnd);
|
||||
double f_pixelgetopacity(CObjRef pxl_wnd);
|
||||
double f_pixelgetopacityquantum(CObjRef pxl_wnd);
|
||||
Array f_pixelgetquantumcolor(CObjRef pxl_wnd);
|
||||
double f_pixelgetred(CObjRef pxl_wnd);
|
||||
double f_pixelgetredquantum(CObjRef pxl_wnd);
|
||||
double f_pixelgetyellow(CObjRef pxl_wnd);
|
||||
double f_pixelgetyellowquantum(CObjRef pxl_wnd);
|
||||
void f_pixelsetalpha(CObjRef pxl_wnd, double alpha);
|
||||
void f_pixelsetalphaquantum(CObjRef pxl_wnd, double alpha);
|
||||
void f_pixelsetblack(CObjRef pxl_wnd, double black);
|
||||
void f_pixelsetblackquantum(CObjRef pxl_wnd, double black);
|
||||
void f_pixelsetblue(CObjRef pxl_wnd, double blue);
|
||||
void f_pixelsetbluequantum(CObjRef pxl_wnd, double blue);
|
||||
void f_pixelsetcolor(CObjRef pxl_wnd, CStrRef imagemagick_col_str);
|
||||
void f_pixelsetcolorcount(CObjRef pxl_wnd, int count);
|
||||
void f_pixelsetcyan(CObjRef pxl_wnd, double cyan);
|
||||
void f_pixelsetcyanquantum(CObjRef pxl_wnd, double cyan);
|
||||
void f_pixelsetgreen(CObjRef pxl_wnd, double green);
|
||||
void f_pixelsetgreenquantum(CObjRef pxl_wnd, double green);
|
||||
void f_pixelsetindex(CObjRef pxl_wnd, double index);
|
||||
void f_pixelsetmagenta(CObjRef pxl_wnd, double magenta);
|
||||
void f_pixelsetmagentaquantum(CObjRef pxl_wnd, double magenta);
|
||||
void f_pixelsetopacity(CObjRef pxl_wnd, double opacity);
|
||||
void f_pixelsetopacityquantum(CObjRef pxl_wnd, double opacity);
|
||||
void f_pixelsetquantumcolor(CObjRef pxl_wnd, double red, double green, double blue, double opacity = 0.0);
|
||||
void f_pixelsetred(CObjRef pxl_wnd, double red);
|
||||
void f_pixelsetredquantum(CObjRef pxl_wnd, double red);
|
||||
void f_pixelsetyellow(CObjRef pxl_wnd, double yellow);
|
||||
void f_pixelsetyellowquantum(CObjRef pxl_wnd, double yellow);
|
||||
Array f_pixelgetiteratorexception(CObjRef pxl_iter);
|
||||
String f_pixelgetiteratorexceptionstring(CObjRef pxl_iter);
|
||||
int64_t f_pixelgetiteratorexceptiontype(CObjRef pxl_iter);
|
||||
Array f_pixelgetnextiteratorrow(CObjRef pxl_iter);
|
||||
void f_pixelresetiterator(CObjRef pxl_iter);
|
||||
bool f_pixelsetiteratorrow(CObjRef pxl_iter, int row);
|
||||
bool f_pixelsynciterator(CObjRef pxl_iter);
|
||||
void f_cleardrawingwand(CResRef drw_wnd);
|
||||
void f_clearmagickwand(CResRef mgck_wnd);
|
||||
void f_clearpixeliterator(CResRef pxl_iter);
|
||||
void f_clearpixelwand(CResRef pxl_wnd);
|
||||
Resource f_clonedrawingwand(CResRef drw_wnd);
|
||||
Resource f_clonemagickwand(CResRef mgck_wnd);
|
||||
Array f_wandgetexception(CResRef wnd);
|
||||
String f_wandgetexceptionstring(CResRef wnd);
|
||||
int64_t f_wandgetexceptiontype(CResRef wnd);
|
||||
bool f_wandhasexception(CResRef wnd);
|
||||
void f_drawaffine(CResRef drw_wnd, double sx, double sy, double rx, double ry, double tx, double ty);
|
||||
void f_drawannotation(CResRef drw_wnd, double x, double y, CStrRef text);
|
||||
void f_drawarc(CResRef drw_wnd, double sx, double sy, double ex, double ey, double sd, double ed);
|
||||
void f_drawbezier(CResRef drw_wnd, CArrRef x_y_points_array);
|
||||
void f_drawcircle(CResRef drw_wnd, double ox, double oy, double px, double py);
|
||||
void f_drawcolor(CResRef drw_wnd, double x, double y, int paint_method);
|
||||
void f_drawcomment(CResRef drw_wnd, CStrRef comment);
|
||||
bool f_drawcomposite(CResRef drw_wnd, int composite_operator, double x, double y, double width, double height, CResRef mgck_wnd);
|
||||
void f_drawellipse(CResRef drw_wnd, double ox, double oy, double rx, double ry, double start, double end);
|
||||
String f_drawgetclippath(CResRef drw_wnd);
|
||||
int64_t f_drawgetcliprule(CResRef drw_wnd);
|
||||
int64_t f_drawgetclipunits(CResRef drw_wnd);
|
||||
Array f_drawgetexception(CResRef drw_wnd);
|
||||
String f_drawgetexceptionstring(CResRef drw_wnd);
|
||||
int64_t f_drawgetexceptiontype(CResRef drw_wnd);
|
||||
double f_drawgetfillalpha(CResRef drw_wnd);
|
||||
Resource f_drawgetfillcolor(CResRef drw_wnd);
|
||||
double f_drawgetfillopacity(CResRef drw_wnd);
|
||||
int64_t f_drawgetfillrule(CResRef drw_wnd);
|
||||
String f_drawgetfont(CResRef drw_wnd);
|
||||
String f_drawgetfontfamily(CResRef drw_wnd);
|
||||
double f_drawgetfontsize(CResRef drw_wnd);
|
||||
int64_t f_drawgetfontstretch(CResRef drw_wnd);
|
||||
int64_t f_drawgetfontstyle(CResRef drw_wnd);
|
||||
double f_drawgetfontweight(CResRef drw_wnd);
|
||||
int64_t f_drawgetgravity(CResRef drw_wnd);
|
||||
double f_drawgetstrokealpha(CResRef drw_wnd);
|
||||
bool f_drawgetstrokeantialias(CResRef drw_wnd);
|
||||
Resource f_drawgetstrokecolor(CResRef drw_wnd);
|
||||
Array f_drawgetstrokedasharray(CResRef drw_wnd);
|
||||
double f_drawgetstrokedashoffset(CResRef drw_wnd);
|
||||
int64_t f_drawgetstrokelinecap(CResRef drw_wnd);
|
||||
int64_t f_drawgetstrokelinejoin(CResRef drw_wnd);
|
||||
double f_drawgetstrokemiterlimit(CResRef drw_wnd);
|
||||
double f_drawgetstrokeopacity(CResRef drw_wnd);
|
||||
double f_drawgetstrokewidth(CResRef drw_wnd);
|
||||
int64_t f_drawgettextalignment(CResRef drw_wnd);
|
||||
bool f_drawgettextantialias(CResRef drw_wnd);
|
||||
int64_t f_drawgettextdecoration(CResRef drw_wnd);
|
||||
String f_drawgettextencoding(CResRef drw_wnd);
|
||||
Resource f_drawgettextundercolor(CResRef drw_wnd);
|
||||
String f_drawgetvectorgraphics(CResRef drw_wnd);
|
||||
void f_drawline(CResRef drw_wnd, double sx, double sy, double ex, double ey);
|
||||
void f_drawmatte(CResRef drw_wnd, double x, double y, int paint_method);
|
||||
void f_drawpathclose(CResRef drw_wnd);
|
||||
void f_drawpathcurvetoabsolute(CResRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbezierabsolute(CResRef drw_wnd, double x1, double y1, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbezierrelative(CResRef drw_wnd, double x1, double y1, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbeziersmoothabsolute(CResRef drw_wnd, double x, double y);
|
||||
void f_drawpathcurvetoquadraticbeziersmoothrelative(CResRef drw_wnd, double x, double y);
|
||||
void f_drawpathcurvetorelative(CResRef drw_wnd, double x1, double y1, double x2, double y2, double x, double y);
|
||||
void f_drawpathcurvetosmoothabsolute(CResRef drw_wnd, double x2, double y2, double x, double y);
|
||||
void f_drawpathcurvetosmoothrelative(CResRef drw_wnd, double x2, double y2, double x, double y);
|
||||
void f_drawpathellipticarcabsolute(CResRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y);
|
||||
void f_drawpathellipticarcrelative(CResRef drw_wnd, double rx, double ry, double x_axis_rotation, bool large_arc_flag, bool sweep_flag, double x, double y);
|
||||
void f_drawpathfinish(CResRef drw_wnd);
|
||||
void f_drawpathlinetoabsolute(CResRef drw_wnd, double x, double y);
|
||||
void f_drawpathlinetohorizontalabsolute(CResRef drw_wnd, double x);
|
||||
void f_drawpathlinetohorizontalrelative(CResRef drw_wnd, double x);
|
||||
void f_drawpathlinetorelative(CResRef drw_wnd, double x, double y);
|
||||
void f_drawpathlinetoverticalabsolute(CResRef drw_wnd, double y);
|
||||
void f_drawpathlinetoverticalrelative(CResRef drw_wnd, double y);
|
||||
void f_drawpathmovetoabsolute(CResRef drw_wnd, double x, double y);
|
||||
void f_drawpathmovetorelative(CResRef drw_wnd, double x, double y);
|
||||
void f_drawpathstart(CResRef drw_wnd);
|
||||
void f_drawpoint(CResRef drw_wnd, double x, double y);
|
||||
void f_drawpolygon(CResRef drw_wnd, CArrRef x_y_points_array);
|
||||
void f_drawpolyline(CResRef drw_wnd, CArrRef x_y_points_array);
|
||||
void f_drawrectangle(CResRef drw_wnd, double x1, double y1, double x2, double y2);
|
||||
bool f_drawrender(CResRef drw_wnd);
|
||||
void f_drawrotate(CResRef drw_wnd, double degrees);
|
||||
void f_drawroundrectangle(CResRef drw_wnd, double x1, double y1, double x2, double y2, double rx, double ry);
|
||||
void f_drawscale(CResRef drw_wnd, double x, double y);
|
||||
bool f_drawsetclippath(CResRef drw_wnd, CStrRef clip_path);
|
||||
void f_drawsetcliprule(CResRef drw_wnd, int fill_rule);
|
||||
void f_drawsetclipunits(CResRef drw_wnd, int clip_path_units);
|
||||
void f_drawsetfillalpha(CResRef drw_wnd, double fill_opacity);
|
||||
void f_drawsetfillcolor(CResRef drw_wnd, CResRef fill_pxl_wnd);
|
||||
void f_drawsetfillopacity(CResRef drw_wnd, double fill_opacity);
|
||||
bool f_drawsetfillpatternurl(CResRef drw_wnd, CStrRef fill_url);
|
||||
void f_drawsetfillrule(CResRef drw_wnd, int fill_rule);
|
||||
bool f_drawsetfont(CResRef drw_wnd, CStrRef font_file);
|
||||
bool f_drawsetfontfamily(CResRef drw_wnd, CStrRef font_family);
|
||||
void f_drawsetfontsize(CResRef drw_wnd, double pointsize);
|
||||
void f_drawsetfontstretch(CResRef drw_wnd, int stretch_type);
|
||||
void f_drawsetfontstyle(CResRef drw_wnd, int style_type);
|
||||
void f_drawsetfontweight(CResRef drw_wnd, double font_weight);
|
||||
void f_drawsetgravity(CResRef drw_wnd, int gravity_type);
|
||||
void f_drawsetstrokealpha(CResRef drw_wnd, double stroke_opacity);
|
||||
void f_drawsetstrokeantialias(CResRef drw_wnd, bool stroke_antialias = true);
|
||||
void f_drawsetstrokecolor(CResRef drw_wnd, CResRef strokecolor_pxl_wnd);
|
||||
void f_drawsetstrokedasharray(CResRef drw_wnd, CArrRef dash_array = null_array);
|
||||
void f_drawsetstrokedashoffset(CResRef drw_wnd, double dash_offset);
|
||||
void f_drawsetstrokelinecap(CResRef drw_wnd, int line_cap);
|
||||
void f_drawsetstrokelinejoin(CResRef drw_wnd, int line_join);
|
||||
void f_drawsetstrokemiterlimit(CResRef drw_wnd, double miterlimit);
|
||||
void f_drawsetstrokeopacity(CResRef drw_wnd, double stroke_opacity);
|
||||
bool f_drawsetstrokepatternurl(CResRef drw_wnd, CStrRef stroke_url);
|
||||
void f_drawsetstrokewidth(CResRef drw_wnd, double stroke_width);
|
||||
void f_drawsettextalignment(CResRef drw_wnd, int align_type);
|
||||
void f_drawsettextantialias(CResRef drw_wnd, bool text_antialias = true);
|
||||
void f_drawsettextdecoration(CResRef drw_wnd, int decoration_type);
|
||||
void f_drawsettextencoding(CResRef drw_wnd, CStrRef encoding);
|
||||
void f_drawsettextundercolor(CResRef drw_wnd, CResRef undercolor_pxl_wnd);
|
||||
bool f_drawsetvectorgraphics(CResRef drw_wnd, CStrRef vector_graphics);
|
||||
void f_drawsetviewbox(CResRef drw_wnd, double x1, double y1, double x2, double y2);
|
||||
void f_drawskewx(CResRef drw_wnd, double degrees);
|
||||
void f_drawskewy(CResRef drw_wnd, double degrees);
|
||||
void f_drawtranslate(CResRef drw_wnd, double x, double y);
|
||||
void f_pushdrawingwand(CResRef drw_wnd);
|
||||
void f_drawpushclippath(CResRef drw_wnd, CStrRef clip_path_id);
|
||||
void f_drawpushdefs(CResRef drw_wnd);
|
||||
void f_drawpushpattern(CResRef drw_wnd, CStrRef pattern_id, double x, double y, double width, double height);
|
||||
void f_popdrawingwand(CResRef drw_wnd);
|
||||
void f_drawpopclippath(CResRef drw_wnd);
|
||||
void f_drawpopdefs(CResRef drw_wnd);
|
||||
void f_drawpoppattern(CResRef drw_wnd);
|
||||
bool f_magickadaptivethresholdimage(CResRef mgck_wnd, double width, double height, double offset);
|
||||
bool f_magickaddimage(CResRef mgck_wnd, CResRef add_wand);
|
||||
bool f_magickaddnoiseimage(CResRef mgck_wnd, int noise_type);
|
||||
bool f_magickaffinetransformimage(CResRef mgck_wnd, CResRef drw_wnd);
|
||||
bool f_magickannotateimage(CResRef mgck_wnd, CResRef drw_wnd, double x, double y, double angle, CStrRef text);
|
||||
Resource f_magickappendimages(CResRef mgck_wnd, bool stack_vertical = false);
|
||||
Resource f_magickaverageimages(CResRef mgck_wnd);
|
||||
bool f_magickblackthresholdimage(CResRef mgck_wnd, CResRef threshold_pxl_wnd);
|
||||
bool f_magickblurimage(CResRef mgck_wnd, double radius, double sigma, int channel_type = 0);
|
||||
bool f_magickborderimage(CResRef mgck_wnd, CResRef bordercolor, double width, double height);
|
||||
bool f_magickcharcoalimage(CResRef mgck_wnd, double radius, double sigma);
|
||||
bool f_magickchopimage(CResRef mgck_wnd, double width, double height, int x, int y);
|
||||
bool f_magickclipimage(CResRef mgck_wnd);
|
||||
bool f_magickclippathimage(CResRef mgck_wnd, CStrRef pathname, bool inside);
|
||||
Resource f_magickcoalesceimages(CResRef mgck_wnd);
|
||||
bool f_magickcolorfloodfillimage(CResRef mgck_wnd, CResRef fillcolor_pxl_wnd, double fuzz, CResRef bordercolor_pxl_wnd, int x, int y);
|
||||
bool f_magickcolorizeimage(CResRef mgck_wnd, CResRef colorize, CResRef opacity_pxl_wnd);
|
||||
Resource f_magickcombineimages(CResRef mgck_wnd, int channel_type);
|
||||
bool f_magickcommentimage(CResRef mgck_wnd, CStrRef comment);
|
||||
Array f_magickcompareimages(CResRef mgck_wnd, CResRef reference_wnd, int metric_type, int channel_type = 0);
|
||||
bool f_magickcompositeimage(CResRef mgck_wnd, CResRef composite_wnd, int composite_operator, int x, int y);
|
||||
bool f_magickconstituteimage(CResRef mgck_wnd, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array);
|
||||
bool f_magickcontrastimage(CResRef mgck_wnd, bool sharpen);
|
||||
bool f_magickconvolveimage(CResRef mgck_wnd, CArrRef kernel_array, int channel_type = 0);
|
||||
bool f_magickcropimage(CResRef mgck_wnd, double width, double height, int x, int y);
|
||||
bool f_magickcyclecolormapimage(CResRef mgck_wnd, int num_positions);
|
||||
Resource f_magickdeconstructimages(CResRef mgck_wnd);
|
||||
String f_magickdescribeimage(CResRef mgck_wnd);
|
||||
bool f_magickdespeckleimage(CResRef mgck_wnd);
|
||||
bool f_magickdrawimage(CResRef mgck_wnd, CResRef drw_wnd);
|
||||
bool f_magickechoimageblob(CResRef mgck_wnd);
|
||||
bool f_magickechoimagesblob(CResRef mgck_wnd);
|
||||
bool f_magickedgeimage(CResRef mgck_wnd, double radius);
|
||||
bool f_magickembossimage(CResRef mgck_wnd, double radius, double sigma);
|
||||
bool f_magickenhanceimage(CResRef mgck_wnd);
|
||||
bool f_magickequalizeimage(CResRef mgck_wnd);
|
||||
bool f_magickevaluateimage(CResRef mgck_wnd, int evaluate_op, double constant, int channel_type = 0);
|
||||
Resource f_magickflattenimages(CResRef mgck_wnd);
|
||||
bool f_magickflipimage(CResRef mgck_wnd);
|
||||
bool f_magickflopimage(CResRef mgck_wnd);
|
||||
bool f_magickframeimage(CResRef mgck_wnd, CResRef matte_color, double width, double height, int inner_bevel, int outer_bevel);
|
||||
Resource f_magickfximage(CResRef mgck_wnd, CStrRef expression, int channel_type = 0);
|
||||
bool f_magickgammaimage(CResRef mgck_wnd, double gamma, int channel_type = 0);
|
||||
bool f_magickgaussianblurimage(CResRef mgck_wnd, double radius, double sigma, int channel_type = 0);
|
||||
double f_magickgetcharheight(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgetcharwidth(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
Array f_magickgetexception(CResRef mgck_wnd);
|
||||
String f_magickgetexceptionstring(CResRef mgck_wnd);
|
||||
int64_t f_magickgetexceptiontype(CResRef mgck_wnd);
|
||||
String f_magickgetfilename(CResRef mgck_wnd);
|
||||
String f_magickgetformat(CResRef mgck_wnd);
|
||||
Resource f_magickgetimage(CResRef mgck_wnd);
|
||||
Resource f_magickgetimagebackgroundcolor(CResRef mgck_wnd);
|
||||
String f_magickgetimageblob(CResRef mgck_wnd);
|
||||
Array f_magickgetimageblueprimary(CResRef mgck_wnd);
|
||||
Resource f_magickgetimagebordercolor(CResRef mgck_wnd);
|
||||
Array f_magickgetimagechannelmean(CResRef mgck_wnd, int channel_type);
|
||||
Resource f_magickgetimagecolormapcolor(CResRef mgck_wnd, double index);
|
||||
double f_magickgetimagecolors(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimagecolorspace(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimagecompose(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimagecompression(CResRef mgck_wnd);
|
||||
double f_magickgetimagecompressionquality(CResRef mgck_wnd);
|
||||
double f_magickgetimagedelay(CResRef mgck_wnd);
|
||||
double f_magickgetimagedepth(CResRef mgck_wnd, int channel_type = 0);
|
||||
int64_t f_magickgetimagedispose(CResRef mgck_wnd);
|
||||
Array f_magickgetimageextrema(CResRef mgck_wnd, int channel_type = 0);
|
||||
String f_magickgetimagefilename(CResRef mgck_wnd);
|
||||
String f_magickgetimageformat(CResRef mgck_wnd);
|
||||
double f_magickgetimagegamma(CResRef mgck_wnd);
|
||||
Array f_magickgetimagegreenprimary(CResRef mgck_wnd);
|
||||
double f_magickgetimageheight(CResRef mgck_wnd);
|
||||
Array f_magickgetimagehistogram(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimageindex(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimageinterlacescheme(CResRef mgck_wnd);
|
||||
double f_magickgetimageiterations(CResRef mgck_wnd);
|
||||
Resource f_magickgetimagemattecolor(CResRef mgck_wnd);
|
||||
String f_magickgetimagemimetype(CResRef mgck_wnd);
|
||||
Array f_magickgetimagepixels(CResRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type);
|
||||
String f_magickgetimageprofile(CResRef mgck_wnd, CStrRef name);
|
||||
Array f_magickgetimageredprimary(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimagerenderingintent(CResRef mgck_wnd);
|
||||
Array f_magickgetimageresolution(CResRef mgck_wnd);
|
||||
double f_magickgetimagescene(CResRef mgck_wnd);
|
||||
String f_magickgetimagesignature(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimagesize(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimagetype(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimageunits(CResRef mgck_wnd);
|
||||
int64_t f_magickgetimagevirtualpixelmethod(CResRef mgck_wnd);
|
||||
Array f_magickgetimagewhitepoint(CResRef mgck_wnd);
|
||||
double f_magickgetimagewidth(CResRef mgck_wnd);
|
||||
String f_magickgetimagesblob(CResRef mgck_wnd);
|
||||
int64_t f_magickgetinterlacescheme(CResRef mgck_wnd);
|
||||
double f_magickgetmaxtextadvance(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
String f_magickgetmimetype(CResRef mgck_wnd);
|
||||
double f_magickgetnumberimages(CResRef mgck_wnd);
|
||||
Array f_magickgetsamplingfactors(CResRef mgck_wnd);
|
||||
Array f_magickgetsize(CResRef mgck_wnd);
|
||||
double f_magickgetstringheight(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgetstringwidth(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgettextascent(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
double f_magickgettextdescent(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
Array f_magickgetwandsize(CResRef mgck_wnd);
|
||||
bool f_magickhasnextimage(CResRef mgck_wnd);
|
||||
bool f_magickhaspreviousimage(CResRef mgck_wnd);
|
||||
bool f_magickimplodeimage(CResRef mgck_wnd, double amount);
|
||||
bool f_magicklabelimage(CResRef mgck_wnd, CStrRef label);
|
||||
bool f_magicklevelimage(CResRef mgck_wnd, double black_point, double gamma, double white_point, int channel_type = 0);
|
||||
bool f_magickmagnifyimage(CResRef mgck_wnd);
|
||||
bool f_magickmapimage(CResRef mgck_wnd, CResRef map_wand, bool dither);
|
||||
bool f_magickmattefloodfillimage(CResRef mgck_wnd, double opacity, double fuzz, CResRef bordercolor_pxl_wnd, int x, int y);
|
||||
bool f_magickmedianfilterimage(CResRef mgck_wnd, double radius);
|
||||
bool f_magickminifyimage(CResRef mgck_wnd);
|
||||
bool f_magickmodulateimage(CResRef mgck_wnd, double brightness, double saturation, double hue);
|
||||
Resource f_magickmontageimage(CResRef mgck_wnd, CResRef drw_wnd, CStrRef tile_geometry, CStrRef thumbnail_geometry, int montage_mode, CStrRef frame);
|
||||
Resource f_magickmorphimages(CResRef mgck_wnd, double number_frames);
|
||||
Resource f_magickmosaicimages(CResRef mgck_wnd);
|
||||
bool f_magickmotionblurimage(CResRef mgck_wnd, double radius, double sigma, double angle);
|
||||
bool f_magicknegateimage(CResRef mgck_wnd, bool only_the_gray = false, int channel_type = 0);
|
||||
bool f_magicknewimage(CResRef mgck_wnd, double width, double height, CStrRef imagemagick_col_str = null_string);
|
||||
bool f_magicknextimage(CResRef mgck_wnd);
|
||||
bool f_magicknormalizeimage(CResRef mgck_wnd);
|
||||
bool f_magickoilpaintimage(CResRef mgck_wnd, double radius);
|
||||
bool f_magickpaintopaqueimage(CResRef mgck_wnd, CResRef target_pxl_wnd, CResRef fill_pxl_wnd, double fuzz = 0.0);
|
||||
bool f_magickpainttransparentimage(CResRef mgck_wnd, CResRef target, double opacity = k_MW_TransparentOpacity, double fuzz = 0.0);
|
||||
bool f_magickpingimage(CResRef mgck_wnd, CStrRef filename);
|
||||
bool f_magickposterizeimage(CResRef mgck_wnd, double levels, bool dither);
|
||||
Resource f_magickpreviewimages(CResRef mgck_wnd, int preview);
|
||||
bool f_magickpreviousimage(CResRef mgck_wnd);
|
||||
bool f_magickprofileimage(CResRef mgck_wnd, CStrRef name, CStrRef profile = null_string);
|
||||
bool f_magickquantizeimage(CResRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error);
|
||||
bool f_magickquantizeimages(CResRef mgck_wnd, double number_colors, int colorspace_type, double treedepth, bool dither, bool measure_error);
|
||||
Array f_magickqueryfontmetrics(CResRef mgck_wnd, CResRef drw_wnd, CStrRef txt, bool multiline = false);
|
||||
bool f_magickradialblurimage(CResRef mgck_wnd, double angle);
|
||||
bool f_magickraiseimage(CResRef mgck_wnd, double width, double height, int x, int y, bool raise);
|
||||
bool f_magickreadimage(CResRef mgck_wnd, CStrRef filename);
|
||||
bool f_magickreadimageblob(CResRef mgck_wnd, CStrRef blob);
|
||||
bool f_magickreadimagefile(CResRef mgck_wnd, CResRef handle);
|
||||
bool f_magickreadimages(CResRef mgck_wnd, CArrRef img_filenames_array);
|
||||
bool f_magickreducenoiseimage(CResRef mgck_wnd, double radius);
|
||||
bool f_magickremoveimage(CResRef mgck_wnd);
|
||||
String f_magickremoveimageprofile(CResRef mgck_wnd, CStrRef name);
|
||||
bool f_magickremoveimageprofiles(CResRef mgck_wnd);
|
||||
bool f_magickresampleimage(CResRef mgck_wnd, double x_resolution, double y_resolution, int filter_type, double blur);
|
||||
void f_magickresetiterator(CResRef mgck_wnd);
|
||||
bool f_magickresizeimage(CResRef mgck_wnd, double columns, double rows, int filter_type, double blur);
|
||||
bool f_magickrollimage(CResRef mgck_wnd, int x_offset, int y_offset);
|
||||
bool f_magickrotateimage(CResRef mgck_wnd, CResRef background, double degrees);
|
||||
bool f_magicksampleimage(CResRef mgck_wnd, double columns, double rows);
|
||||
bool f_magickscaleimage(CResRef mgck_wnd, double columns, double rows);
|
||||
bool f_magickseparateimagechannel(CResRef mgck_wnd, int channel_type);
|
||||
bool f_magicksetcompressionquality(CResRef mgck_wnd, double quality);
|
||||
bool f_magicksetfilename(CResRef mgck_wnd, CStrRef filename = null_string);
|
||||
void f_magicksetfirstiterator(CResRef mgck_wnd);
|
||||
bool f_magicksetformat(CResRef mgck_wnd, CStrRef format);
|
||||
bool f_magicksetimage(CResRef mgck_wnd, CResRef replace_wand);
|
||||
bool f_magicksetimagebackgroundcolor(CResRef mgck_wnd, CResRef background_pxl_wnd);
|
||||
bool f_magicksetimagebias(CResRef mgck_wnd, double bias);
|
||||
bool f_magicksetimageblueprimary(CResRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetimagebordercolor(CResRef mgck_wnd, CResRef border_pxl_wnd);
|
||||
bool f_magicksetimagecolormapcolor(CResRef mgck_wnd, double index, CResRef mapcolor_pxl_wnd);
|
||||
bool f_magicksetimagecolorspace(CResRef mgck_wnd, int colorspace_type);
|
||||
bool f_magicksetimagecompose(CResRef mgck_wnd, int composite_operator);
|
||||
bool f_magicksetimagecompression(CResRef mgck_wnd, int compression_type);
|
||||
bool f_magicksetimagecompressionquality(CResRef mgck_wnd, double quality);
|
||||
bool f_magicksetimagedelay(CResRef mgck_wnd, double delay);
|
||||
bool f_magicksetimagedepth(CResRef mgck_wnd, int depth, int channel_type = 0);
|
||||
bool f_magicksetimagedispose(CResRef mgck_wnd, int dispose_type);
|
||||
bool f_magicksetimagefilename(CResRef mgck_wnd, CStrRef filename = null_string);
|
||||
bool f_magicksetimageformat(CResRef mgck_wnd, CStrRef format);
|
||||
bool f_magicksetimagegamma(CResRef mgck_wnd, double gamma);
|
||||
bool f_magicksetimagegreenprimary(CResRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetimageindex(CResRef mgck_wnd, int index);
|
||||
bool f_magicksetimageinterlacescheme(CResRef mgck_wnd, int interlace_type);
|
||||
bool f_magicksetimageiterations(CResRef mgck_wnd, double iterations);
|
||||
bool f_magicksetimagemattecolor(CResRef mgck_wnd, CResRef matte_pxl_wnd);
|
||||
bool f_magicksetimageoption(CResRef mgck_wnd, CStrRef format, CStrRef key, CStrRef value);
|
||||
bool f_magicksetimagepixels(CResRef mgck_wnd, int x_offset, int y_offset, double columns, double rows, CStrRef smap, int storage_type, CArrRef pixel_array);
|
||||
bool f_magicksetimageprofile(CResRef mgck_wnd, CStrRef name, CStrRef profile);
|
||||
bool f_magicksetimageredprimary(CResRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetimagerenderingintent(CResRef mgck_wnd, int rendering_intent);
|
||||
bool f_magicksetimageresolution(CResRef mgck_wnd, double x_resolution, double y_resolution);
|
||||
bool f_magicksetimagescene(CResRef mgck_wnd, double scene);
|
||||
bool f_magicksetimagetype(CResRef mgck_wnd, int image_type);
|
||||
bool f_magicksetimageunits(CResRef mgck_wnd, int resolution_type);
|
||||
bool f_magicksetimagevirtualpixelmethod(CResRef mgck_wnd, int virtual_pixel_method);
|
||||
bool f_magicksetimagewhitepoint(CResRef mgck_wnd, double x, double y);
|
||||
bool f_magicksetinterlacescheme(CResRef mgck_wnd, int interlace_type);
|
||||
void f_magicksetlastiterator(CResRef mgck_wnd);
|
||||
bool f_magicksetpassphrase(CResRef mgck_wnd, CStrRef passphrase);
|
||||
bool f_magicksetresolution(CResRef mgck_wnd, double x_resolution, double y_resolution);
|
||||
bool f_magicksetsamplingfactors(CResRef mgck_wnd, double number_factors, CArrRef sampling_factors);
|
||||
bool f_magicksetsize(CResRef mgck_wnd, int columns, int rows);
|
||||
bool f_magicksetwandsize(CResRef mgck_wnd, int columns, int rows);
|
||||
bool f_magicksharpenimage(CResRef mgck_wnd, double radius, double sigma, int channel_type = 0);
|
||||
bool f_magickshaveimage(CResRef mgck_wnd, int columns, int rows);
|
||||
bool f_magickshearimage(CResRef mgck_wnd, CResRef background, double x_shear, double y_shear);
|
||||
bool f_magicksolarizeimage(CResRef mgck_wnd, double threshold);
|
||||
bool f_magickspliceimage(CResRef mgck_wnd, double width, double height, int x, int y);
|
||||
bool f_magickspreadimage(CResRef mgck_wnd, double radius);
|
||||
Resource f_magicksteganoimage(CResRef mgck_wnd, CResRef watermark_wand, int offset);
|
||||
bool f_magickstereoimage(CResRef mgck_wnd, CResRef offset_wand);
|
||||
bool f_magickstripimage(CResRef mgck_wnd);
|
||||
bool f_magickswirlimage(CResRef mgck_wnd, double degrees);
|
||||
Resource f_magicktextureimage(CResRef mgck_wnd, CResRef texture_wand);
|
||||
bool f_magickthresholdimage(CResRef mgck_wnd, double threshold, int channel_type = 0);
|
||||
bool f_magicktintimage(CResRef mgck_wnd, int tint_pxl_wnd, CResRef opacity_pxl_wnd);
|
||||
Resource f_magicktransformimage(CResRef mgck_wnd, CStrRef crop, CStrRef geometry);
|
||||
bool f_magicktrimimage(CResRef mgck_wnd, double fuzz);
|
||||
bool f_magickunsharpmaskimage(CResRef mgck_wnd, double radius, double sigma, double amount, double threshold, int channel_type = 0);
|
||||
bool f_magickwaveimage(CResRef mgck_wnd, double amplitude, double wave_length);
|
||||
bool f_magickwhitethresholdimage(CResRef mgck_wnd, CResRef threshold_pxl_wnd);
|
||||
bool f_magickwriteimage(CResRef mgck_wnd, CStrRef filename);
|
||||
bool f_magickwriteimagefile(CResRef mgck_wnd, CResRef handle);
|
||||
bool f_magickwriteimages(CResRef mgck_wnd, CStrRef filename = "", bool join_images = false);
|
||||
bool f_magickwriteimagesfile(CResRef mgck_wnd, CResRef handle);
|
||||
double f_pixelgetalpha(CResRef pxl_wnd);
|
||||
double f_pixelgetalphaquantum(CResRef pxl_wnd);
|
||||
double f_pixelgetblack(CResRef pxl_wnd);
|
||||
double f_pixelgetblackquantum(CResRef pxl_wnd);
|
||||
double f_pixelgetblue(CResRef pxl_wnd);
|
||||
double f_pixelgetbluequantum(CResRef pxl_wnd);
|
||||
String f_pixelgetcolorasstring(CResRef pxl_wnd);
|
||||
double f_pixelgetcolorcount(CResRef pxl_wnd);
|
||||
double f_pixelgetcyan(CResRef pxl_wnd);
|
||||
double f_pixelgetcyanquantum(CResRef pxl_wnd);
|
||||
Array f_pixelgetexception(CResRef pxl_wnd);
|
||||
String f_pixelgetexceptionstring(CResRef pxl_wnd);
|
||||
int64_t f_pixelgetexceptiontype(CResRef pxl_wnd);
|
||||
double f_pixelgetgreen(CResRef pxl_wnd);
|
||||
double f_pixelgetgreenquantum(CResRef pxl_wnd);
|
||||
double f_pixelgetindex(CResRef pxl_wnd);
|
||||
double f_pixelgetmagenta(CResRef pxl_wnd);
|
||||
double f_pixelgetmagentaquantum(CResRef pxl_wnd);
|
||||
double f_pixelgetopacity(CResRef pxl_wnd);
|
||||
double f_pixelgetopacityquantum(CResRef pxl_wnd);
|
||||
Array f_pixelgetquantumcolor(CResRef pxl_wnd);
|
||||
double f_pixelgetred(CResRef pxl_wnd);
|
||||
double f_pixelgetredquantum(CResRef pxl_wnd);
|
||||
double f_pixelgetyellow(CResRef pxl_wnd);
|
||||
double f_pixelgetyellowquantum(CResRef pxl_wnd);
|
||||
void f_pixelsetalpha(CResRef pxl_wnd, double alpha);
|
||||
void f_pixelsetalphaquantum(CResRef pxl_wnd, double alpha);
|
||||
void f_pixelsetblack(CResRef pxl_wnd, double black);
|
||||
void f_pixelsetblackquantum(CResRef pxl_wnd, double black);
|
||||
void f_pixelsetblue(CResRef pxl_wnd, double blue);
|
||||
void f_pixelsetbluequantum(CResRef pxl_wnd, double blue);
|
||||
void f_pixelsetcolor(CResRef pxl_wnd, CStrRef imagemagick_col_str);
|
||||
void f_pixelsetcolorcount(CResRef pxl_wnd, int count);
|
||||
void f_pixelsetcyan(CResRef pxl_wnd, double cyan);
|
||||
void f_pixelsetcyanquantum(CResRef pxl_wnd, double cyan);
|
||||
void f_pixelsetgreen(CResRef pxl_wnd, double green);
|
||||
void f_pixelsetgreenquantum(CResRef pxl_wnd, double green);
|
||||
void f_pixelsetindex(CResRef pxl_wnd, double index);
|
||||
void f_pixelsetmagenta(CResRef pxl_wnd, double magenta);
|
||||
void f_pixelsetmagentaquantum(CResRef pxl_wnd, double magenta);
|
||||
void f_pixelsetopacity(CResRef pxl_wnd, double opacity);
|
||||
void f_pixelsetopacityquantum(CResRef pxl_wnd, double opacity);
|
||||
void f_pixelsetquantumcolor(CResRef pxl_wnd, double red, double green, double blue, double opacity = 0.0);
|
||||
void f_pixelsetred(CResRef pxl_wnd, double red);
|
||||
void f_pixelsetredquantum(CResRef pxl_wnd, double red);
|
||||
void f_pixelsetyellow(CResRef pxl_wnd, double yellow);
|
||||
void f_pixelsetyellowquantum(CResRef pxl_wnd, double yellow);
|
||||
Array f_pixelgetiteratorexception(CResRef pxl_iter);
|
||||
String f_pixelgetiteratorexceptionstring(CResRef pxl_iter);
|
||||
int64_t f_pixelgetiteratorexceptiontype(CResRef pxl_iter);
|
||||
Array f_pixelgetnextiteratorrow(CResRef pxl_iter);
|
||||
void f_pixelresetiterator(CResRef pxl_iter);
|
||||
bool f_pixelsetiteratorrow(CResRef pxl_iter, int row);
|
||||
bool f_pixelsynciterator(CResRef pxl_iter);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -127,21 +127,21 @@ int64_t f_ezmlm_hash(CStrRef addr) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// mailparse
|
||||
|
||||
Object f_mailparse_msg_create() {
|
||||
Resource f_mailparse_msg_create() {
|
||||
return NEWOBJ(MimePart)();
|
||||
}
|
||||
|
||||
bool f_mailparse_msg_free(CObjRef mimemail) {
|
||||
bool f_mailparse_msg_free(CResRef mimemail) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Variant f_mailparse_msg_parse_file(CStrRef filename) {
|
||||
Variant stream = File::Open(filename, "rb");
|
||||
if (same(stream, false)) return false;
|
||||
File *f = stream.toObject().getTyped<File>();
|
||||
File *f = stream.toResource().getTyped<File>();
|
||||
|
||||
MimePart *p = NEWOBJ(MimePart)();
|
||||
Object ret(p);
|
||||
Resource ret(p);
|
||||
while (!f->eof()) {
|
||||
String line = f->readLine();
|
||||
if (!line.isNull()) {
|
||||
@@ -153,37 +153,38 @@ Variant f_mailparse_msg_parse_file(CStrRef filename) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_mailparse_msg_parse(CObjRef mimemail, CStrRef data) {
|
||||
bool f_mailparse_msg_parse(CResRef mimemail, CStrRef data) {
|
||||
return mimemail.getTyped<MimePart>()->parse(data.data(), data.size());
|
||||
}
|
||||
|
||||
Variant f_mailparse_msg_extract_part_file(CObjRef mimemail, CVarRef filename,
|
||||
Variant f_mailparse_msg_extract_part_file(CResRef mimemail, CVarRef filename,
|
||||
CVarRef callbackfunc /* = "" */) {
|
||||
return mimemail.getTyped<MimePart>()->
|
||||
extract(filename, callbackfunc,
|
||||
MimePart::Decode8Bit | MimePart::DecodeNoHeaders, true);
|
||||
}
|
||||
|
||||
Variant f_mailparse_msg_extract_whole_part_file(CObjRef mimemail,
|
||||
Variant f_mailparse_msg_extract_whole_part_file(CResRef mimemail,
|
||||
CVarRef filename,
|
||||
CVarRef callbackfunc /* = "" */) {
|
||||
return mimemail.getTyped<MimePart>()->
|
||||
extract(filename, callbackfunc, MimePart::DecodeNone, true);
|
||||
}
|
||||
|
||||
Variant f_mailparse_msg_extract_part(CObjRef mimemail, CVarRef msgbody,
|
||||
Variant f_mailparse_msg_extract_part(CResRef mimemail, CVarRef msgbody,
|
||||
CVarRef callbackfunc /* = "" */) {
|
||||
return mimemail.getTyped<MimePart>()->
|
||||
extract(msgbody, callbackfunc,
|
||||
MimePart::Decode8Bit | MimePart::DecodeNoHeaders, false);
|
||||
}
|
||||
|
||||
Array f_mailparse_msg_get_part_data(CObjRef mimemail) {
|
||||
Array f_mailparse_msg_get_part_data(CResRef mimemail) {
|
||||
return mimemail.getTyped<MimePart>()->getPartData().toArray();
|
||||
}
|
||||
|
||||
Variant f_mailparse_msg_get_part(CObjRef mimemail, CStrRef mimesection) {
|
||||
Object part = mimemail.getTyped<MimePart>()->findByName(mimesection.c_str());
|
||||
Variant f_mailparse_msg_get_part(CResRef mimemail, CStrRef mimesection) {
|
||||
Resource part =
|
||||
mimemail.getTyped<MimePart>()->findByName(mimesection.c_str());
|
||||
if (part.isNull()) {
|
||||
raise_warning("cannot find section %s in message", mimesection.data());
|
||||
return false;
|
||||
@@ -191,7 +192,7 @@ Variant f_mailparse_msg_get_part(CObjRef mimemail, CStrRef mimesection) {
|
||||
return part;
|
||||
}
|
||||
|
||||
Array f_mailparse_msg_get_structure(CObjRef mimemail) {
|
||||
Array f_mailparse_msg_get_structure(CResRef mimemail) {
|
||||
return mimemail.getTyped<MimePart>()->getStructure();
|
||||
}
|
||||
|
||||
@@ -233,7 +234,7 @@ static int mailparse_stream_flush(void *stream) {
|
||||
return ((File*)stream)->flush() ? 1 : 0;
|
||||
}
|
||||
|
||||
bool f_mailparse_stream_encode(CObjRef sourcefp, CObjRef destfp,
|
||||
bool f_mailparse_stream_encode(CResRef sourcefp, CResRef destfp,
|
||||
CStrRef encoding) {
|
||||
File *srcstream = sourcefp.getTyped<File>(true, true);
|
||||
File *deststream = destfp.getTyped<File>(true, true);
|
||||
@@ -349,12 +350,12 @@ const StaticString
|
||||
s_filename("filename"),
|
||||
s_origfilename("origfilename");
|
||||
|
||||
Variant f_mailparse_uudecode_all(CObjRef fp) {
|
||||
Variant f_mailparse_uudecode_all(CResRef fp) {
|
||||
File *instream = fp.getTyped<File>();
|
||||
instream->rewind();
|
||||
|
||||
File *outstream = NEWOBJ(TempFile)(false);
|
||||
Object deleter(outstream);
|
||||
Resource deleter(outstream);
|
||||
|
||||
Array return_value;
|
||||
int nparts = 0;
|
||||
@@ -390,7 +391,7 @@ Variant f_mailparse_uudecode_all(CObjRef fp) {
|
||||
|
||||
/* create a temp file for the data */
|
||||
File *partstream = NEWOBJ(TempFile)(false);
|
||||
Object deleter(partstream);
|
||||
Resource deleter(partstream);
|
||||
if (partstream) {
|
||||
nparts++;
|
||||
item.set(s_filename, String(((TempFile*)partstream)->getName()));
|
||||
@@ -412,7 +413,7 @@ Variant f_mailparse_uudecode_all(CObjRef fp) {
|
||||
return return_value;
|
||||
}
|
||||
|
||||
Variant f_mailparse_determine_best_xfer_encoding(CObjRef fp) {
|
||||
Variant f_mailparse_determine_best_xfer_encoding(CResRef fp) {
|
||||
File *stream = fp.getTyped<File>();
|
||||
stream->rewind();
|
||||
|
||||
|
||||
@@ -27,20 +27,20 @@ namespace HPHP {
|
||||
|
||||
bool f_mail(CStrRef to, CStrRef subject, CStrRef message, CStrRef additional_headers = null_string, CStrRef additional_parameters = null_string);
|
||||
int64_t f_ezmlm_hash(CStrRef addr);
|
||||
Object f_mailparse_msg_create();
|
||||
bool f_mailparse_msg_free(CObjRef mimemail);
|
||||
Resource f_mailparse_msg_create();
|
||||
bool f_mailparse_msg_free(CResRef mimemail);
|
||||
Variant f_mailparse_msg_parse_file(CStrRef filename);
|
||||
bool f_mailparse_msg_parse(CObjRef mimemail, CStrRef data);
|
||||
Variant f_mailparse_msg_extract_part_file(CObjRef mimemail, CVarRef filename, CVarRef callbackfunc = "");
|
||||
Variant f_mailparse_msg_extract_whole_part_file(CObjRef mimemail, CVarRef filename, CVarRef callbackfunc = "");
|
||||
Variant f_mailparse_msg_extract_part(CObjRef mimemail, CVarRef msgbody, CVarRef callbackfunc = "");
|
||||
Array f_mailparse_msg_get_part_data(CObjRef mimemail);
|
||||
Variant f_mailparse_msg_get_part(CObjRef mimemail, CStrRef mimesection);
|
||||
Array f_mailparse_msg_get_structure(CObjRef mimemail);
|
||||
bool f_mailparse_msg_parse(CResRef mimemail, CStrRef data);
|
||||
Variant f_mailparse_msg_extract_part_file(CResRef mimemail, CVarRef filename, CVarRef callbackfunc = "");
|
||||
Variant f_mailparse_msg_extract_whole_part_file(CResRef mimemail, CVarRef filename, CVarRef callbackfunc = "");
|
||||
Variant f_mailparse_msg_extract_part(CResRef mimemail, CVarRef msgbody, CVarRef callbackfunc = "");
|
||||
Array f_mailparse_msg_get_part_data(CResRef mimemail);
|
||||
Variant f_mailparse_msg_get_part(CResRef mimemail, CStrRef mimesection);
|
||||
Array f_mailparse_msg_get_structure(CResRef mimemail);
|
||||
Array f_mailparse_rfc822_parse_addresses(CStrRef addresses);
|
||||
bool f_mailparse_stream_encode(CObjRef sourcefp, CObjRef destfp, CStrRef encoding);
|
||||
Variant f_mailparse_uudecode_all(CObjRef fp);
|
||||
Variant f_mailparse_determine_best_xfer_encoding(CObjRef fp);
|
||||
bool f_mailparse_stream_encode(CResRef sourcefp, CResRef destfp, CStrRef encoding);
|
||||
Variant f_mailparse_uudecode_all(CResRef fp);
|
||||
Variant f_mailparse_determine_best_xfer_encoding(CResRef fp);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -177,7 +177,7 @@ static Variant php_mcrypt_do_crypt(CStrRef cipher, CStrRef key, CStrRef data,
|
||||
return s.setSize(data_size);
|
||||
}
|
||||
|
||||
static Variant mcrypt_generic(CObjRef td, CStrRef data, bool dencrypt) {
|
||||
static Variant mcrypt_generic(CResRef td, CStrRef data, bool dencrypt) {
|
||||
MCrypt *pm = td.getTyped<MCrypt>();
|
||||
if (!pm->m_init) {
|
||||
raise_warning("Operation disallowed prior to mcrypt_generic_init().");
|
||||
@@ -232,10 +232,10 @@ Variant f_mcrypt_module_open(CStrRef algorithm, CStrRef algorithm_directory,
|
||||
return false;
|
||||
}
|
||||
|
||||
return Object(new MCrypt(td));
|
||||
return Resource(new MCrypt(td));
|
||||
}
|
||||
|
||||
bool f_mcrypt_module_close(CObjRef td) {
|
||||
bool f_mcrypt_module_close(CResRef td) {
|
||||
td.getTyped<MCrypt>()->close();
|
||||
return true;
|
||||
}
|
||||
@@ -464,33 +464,33 @@ int64_t f_mcrypt_get_key_size(CStrRef cipher, CStrRef module) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
String f_mcrypt_enc_get_algorithms_name(CObjRef td) {
|
||||
String f_mcrypt_enc_get_algorithms_name(CResRef td) {
|
||||
char *name = mcrypt_enc_get_algorithms_name(td.getTyped<MCrypt>()->m_td);
|
||||
String ret(name, CopyString);
|
||||
mcrypt_free(name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
int64_t f_mcrypt_enc_get_block_size(CObjRef td) {
|
||||
int64_t f_mcrypt_enc_get_block_size(CResRef td) {
|
||||
return mcrypt_enc_get_block_size(td.getTyped<MCrypt>()->m_td);
|
||||
}
|
||||
|
||||
int64_t f_mcrypt_enc_get_iv_size(CObjRef td) {
|
||||
int64_t f_mcrypt_enc_get_iv_size(CResRef td) {
|
||||
return mcrypt_enc_get_iv_size(td.getTyped<MCrypt>()->m_td);
|
||||
}
|
||||
|
||||
int64_t f_mcrypt_enc_get_key_size(CObjRef td) {
|
||||
int64_t f_mcrypt_enc_get_key_size(CResRef td) {
|
||||
return mcrypt_enc_get_key_size(td.getTyped<MCrypt>()->m_td);
|
||||
}
|
||||
|
||||
String f_mcrypt_enc_get_modes_name(CObjRef td) {
|
||||
String f_mcrypt_enc_get_modes_name(CResRef td) {
|
||||
char *name = mcrypt_enc_get_modes_name(td.getTyped<MCrypt>()->m_td);
|
||||
String ret(name, CopyString);
|
||||
mcrypt_free(name);
|
||||
return ret;
|
||||
}
|
||||
|
||||
Array f_mcrypt_enc_get_supported_key_sizes(CObjRef td) {
|
||||
Array f_mcrypt_enc_get_supported_key_sizes(CResRef td) {
|
||||
int count = 0;
|
||||
int *key_sizes =
|
||||
mcrypt_enc_get_supported_key_sizes(td.getTyped<MCrypt>()->m_td, &count);
|
||||
@@ -503,23 +503,23 @@ Array f_mcrypt_enc_get_supported_key_sizes(CObjRef td) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_mcrypt_enc_is_block_algorithm_mode(CObjRef td) {
|
||||
bool f_mcrypt_enc_is_block_algorithm_mode(CResRef td) {
|
||||
return mcrypt_enc_is_block_algorithm_mode(td.getTyped<MCrypt>()->m_td) == 1;
|
||||
}
|
||||
|
||||
bool f_mcrypt_enc_is_block_algorithm(CObjRef td) {
|
||||
bool f_mcrypt_enc_is_block_algorithm(CResRef td) {
|
||||
return mcrypt_enc_is_block_algorithm(td.getTyped<MCrypt>()->m_td) == 1;
|
||||
}
|
||||
|
||||
bool f_mcrypt_enc_is_block_mode(CObjRef td) {
|
||||
bool f_mcrypt_enc_is_block_mode(CResRef td) {
|
||||
return mcrypt_enc_is_block_mode(td.getTyped<MCrypt>()->m_td) == 1;
|
||||
}
|
||||
|
||||
int64_t f_mcrypt_enc_self_test(CObjRef td) {
|
||||
int64_t f_mcrypt_enc_self_test(CResRef td) {
|
||||
return mcrypt_enc_self_test(td.getTyped<MCrypt>()->m_td);
|
||||
}
|
||||
|
||||
int64_t f_mcrypt_generic_init(CObjRef td, CStrRef key, CStrRef iv) {
|
||||
int64_t f_mcrypt_generic_init(CResRef td, CStrRef key, CStrRef iv) {
|
||||
MCrypt *pm = td.getTyped<MCrypt>();
|
||||
int max_key_size = mcrypt_enc_get_key_size(pm->m_td);
|
||||
int iv_size = mcrypt_enc_get_iv_size(pm->m_td);
|
||||
@@ -576,15 +576,15 @@ int64_t f_mcrypt_generic_init(CObjRef td, CStrRef key, CStrRef iv) {
|
||||
return result;
|
||||
}
|
||||
|
||||
Variant f_mcrypt_generic(CObjRef td, CStrRef data) {
|
||||
Variant f_mcrypt_generic(CResRef td, CStrRef data) {
|
||||
return mcrypt_generic(td, data, false);
|
||||
}
|
||||
|
||||
Variant f_mdecrypt_generic(CObjRef td, CStrRef data) {
|
||||
Variant f_mdecrypt_generic(CResRef td, CStrRef data) {
|
||||
return mcrypt_generic(td, data, true);
|
||||
}
|
||||
|
||||
bool f_mcrypt_generic_deinit(CObjRef td) {
|
||||
bool f_mcrypt_generic_deinit(CResRef td) {
|
||||
MCrypt *pm = td.getTyped<MCrypt>();
|
||||
if (mcrypt_generic_deinit(pm->m_td) < 0) {
|
||||
raise_warning("Could not terminate encryption specifier");
|
||||
@@ -594,7 +594,7 @@ bool f_mcrypt_generic_deinit(CObjRef td) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_mcrypt_generic_end(CObjRef td) {
|
||||
bool f_mcrypt_generic_end(CResRef td) {
|
||||
return f_mcrypt_generic_deinit(td);
|
||||
}
|
||||
|
||||
|
||||
@@ -26,7 +26,7 @@ namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Variant f_mcrypt_module_open(CStrRef algorithm, CStrRef algorithm_directory, CStrRef mode, CStrRef mode_directory);
|
||||
bool f_mcrypt_module_close(CObjRef td);
|
||||
bool f_mcrypt_module_close(CResRef td);
|
||||
Array f_mcrypt_list_algorithms(CStrRef lib_dir = null_string);
|
||||
Array f_mcrypt_list_modes(CStrRef lib_dir = null_string);
|
||||
int64_t f_mcrypt_module_get_algo_block_size(CStrRef algorithm, CStrRef lib_dir = null_string);
|
||||
@@ -47,21 +47,21 @@ Variant f_mcrypt_get_block_size(CStrRef cipher, CStrRef module = null_string);
|
||||
Variant f_mcrypt_get_cipher_name(CStrRef cipher);
|
||||
Variant f_mcrypt_get_iv_size(CStrRef cipher, CStrRef mode);
|
||||
int64_t f_mcrypt_get_key_size(CStrRef cipher, CStrRef module);
|
||||
String f_mcrypt_enc_get_algorithms_name(CObjRef td);
|
||||
int64_t f_mcrypt_enc_get_block_size(CObjRef td);
|
||||
int64_t f_mcrypt_enc_get_iv_size(CObjRef td);
|
||||
int64_t f_mcrypt_enc_get_key_size(CObjRef td);
|
||||
String f_mcrypt_enc_get_modes_name(CObjRef td);
|
||||
Array f_mcrypt_enc_get_supported_key_sizes(CObjRef td);
|
||||
bool f_mcrypt_enc_is_block_algorithm_mode(CObjRef td);
|
||||
bool f_mcrypt_enc_is_block_algorithm(CObjRef td);
|
||||
bool f_mcrypt_enc_is_block_mode(CObjRef td);
|
||||
int64_t f_mcrypt_enc_self_test(CObjRef td);
|
||||
Variant f_mcrypt_generic(CObjRef td, CStrRef data);
|
||||
int64_t f_mcrypt_generic_init(CObjRef td, CStrRef key, CStrRef iv);
|
||||
Variant f_mdecrypt_generic(CObjRef td, CStrRef data);
|
||||
bool f_mcrypt_generic_deinit(CObjRef td);
|
||||
bool f_mcrypt_generic_end(CObjRef td);
|
||||
String f_mcrypt_enc_get_algorithms_name(CResRef td);
|
||||
int64_t f_mcrypt_enc_get_block_size(CResRef td);
|
||||
int64_t f_mcrypt_enc_get_iv_size(CResRef td);
|
||||
int64_t f_mcrypt_enc_get_key_size(CResRef td);
|
||||
String f_mcrypt_enc_get_modes_name(CResRef td);
|
||||
Array f_mcrypt_enc_get_supported_key_sizes(CResRef td);
|
||||
bool f_mcrypt_enc_is_block_algorithm_mode(CResRef td);
|
||||
bool f_mcrypt_enc_is_block_algorithm(CResRef td);
|
||||
bool f_mcrypt_enc_is_block_mode(CResRef td);
|
||||
int64_t f_mcrypt_enc_self_test(CResRef td);
|
||||
Variant f_mcrypt_generic(CResRef td, CStrRef data);
|
||||
int64_t f_mcrypt_generic_init(CResRef td, CStrRef key, CStrRef iv);
|
||||
Variant f_mdecrypt_generic(CResRef td, CStrRef data);
|
||||
bool f_mcrypt_generic_deinit(CResRef td);
|
||||
bool f_mcrypt_generic_end(CResRef td);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -101,7 +101,7 @@ public:
|
||||
totalRowCount = 0;
|
||||
}
|
||||
|
||||
Object defaultConn;
|
||||
Resource defaultConn;
|
||||
int readTimeout;
|
||||
int totalRowCount; // from all queries in current request
|
||||
};
|
||||
@@ -116,7 +116,7 @@ MySQL *MySQL::Get(CVarRef link_identifier) {
|
||||
if (link_identifier.isNull()) {
|
||||
return GetDefaultConn();
|
||||
}
|
||||
MySQL *mysql = link_identifier.toObject().getTyped<MySQL>
|
||||
MySQL *mysql = link_identifier.toResource().getTyped<MySQL>
|
||||
(!RuntimeOption::ThrowBadTypeExceptions,
|
||||
!RuntimeOption::ThrowBadTypeExceptions);
|
||||
return mysql;
|
||||
@@ -332,7 +332,7 @@ bool MySQL::reconnect(CStrRef host, int port, CStrRef socket, CStrRef username,
|
||||
// helpers
|
||||
|
||||
static MySQLResult *get_result(CVarRef result) {
|
||||
MySQLResult *res = result.toObject().getTyped<MySQLResult>
|
||||
MySQLResult *res = result.toResource().getTyped<MySQLResult>
|
||||
(!RuntimeOption::ThrowBadTypeExceptions,
|
||||
!RuntimeOption::ThrowBadTypeExceptions);
|
||||
if (res == NULL || (res->get() == NULL && !res->isLocalized())) {
|
||||
@@ -533,7 +533,7 @@ static Variant php_mysql_do_connect(String server, String username,
|
||||
socket = MySQL::GetDefaultSocket();
|
||||
}
|
||||
|
||||
Object ret;
|
||||
Resource ret;
|
||||
MySQL *mySQL = NULL;
|
||||
if (persistent) {
|
||||
mySQL = MySQL::GetPersistent(host, port, socket, username, password,
|
||||
@@ -872,7 +872,7 @@ static Variant php_mysql_localize_result(MYSQL *mysql) {
|
||||
return true;
|
||||
}
|
||||
mysql->status = MYSQL_STATUS_READY;
|
||||
Variant result = Object(NEWOBJ(MySQLResult)(NULL, true));
|
||||
Variant result = Resource(NEWOBJ(MySQLResult)(nullptr, true));
|
||||
if (!php_mysql_read_rows(mysql, result)) {
|
||||
return false;
|
||||
}
|
||||
@@ -1045,7 +1045,7 @@ static Variant php_mysql_do_query_general(CStrRef query, CVarRef link_id,
|
||||
}
|
||||
|
||||
MySQLResult *r = NEWOBJ(MySQLResult)(mysql_result);
|
||||
Object ret(r);
|
||||
Resource ret(r);
|
||||
|
||||
if (RuntimeOption::MaxSQLRowCount > 0 &&
|
||||
(s_mysql_data->totalRowCount += r->getRowCount())
|
||||
@@ -1111,7 +1111,7 @@ Variant f_mysql_fetch_result(CVarRef link_identifier /* = null */) {
|
||||
return true;
|
||||
}
|
||||
|
||||
return Object(NEWOBJ(MySQLResult)(mysql_result));
|
||||
return Resource(NEWOBJ(MySQLResult)(mysql_result));
|
||||
}
|
||||
|
||||
Variant f_mysql_unbuffered_query(CStrRef query,
|
||||
@@ -1133,7 +1133,7 @@ Variant f_mysql_list_dbs(CVarRef link_identifier /* = null */) {
|
||||
raise_warning("Unable to save MySQL query result");
|
||||
return false;
|
||||
}
|
||||
return Object(NEWOBJ(MySQLResult)(res));
|
||||
return Resource(NEWOBJ(MySQLResult)(res));
|
||||
}
|
||||
|
||||
Variant f_mysql_list_tables(CStrRef database,
|
||||
@@ -1148,7 +1148,7 @@ Variant f_mysql_list_tables(CStrRef database,
|
||||
raise_warning("Unable to save MySQL query result");
|
||||
return false;
|
||||
}
|
||||
return Object(NEWOBJ(MySQLResult)(res));
|
||||
return Resource(NEWOBJ(MySQLResult)(res));
|
||||
}
|
||||
|
||||
Variant f_mysql_list_fields(CStrRef database_name, CStrRef table_name,
|
||||
@@ -1166,7 +1166,7 @@ Variant f_mysql_list_processes(CVarRef link_identifier /* = null */) {
|
||||
raise_warning("Unable to save MySQL query result");
|
||||
return false;
|
||||
}
|
||||
return Object(NEWOBJ(MySQLResult)(res));
|
||||
return Resource(NEWOBJ(MySQLResult)(res));
|
||||
}
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -1347,12 +1347,12 @@ Variant f_mysql_async_query_result(CVarRef link_identifier) {
|
||||
MYSQL_RES* mysql_result = mysql_use_result(conn);
|
||||
MySQLResult *r = NEWOBJ(MySQLResult)(mysql_result);
|
||||
r->setAsyncConnection(mySQL);
|
||||
Object ret(r);
|
||||
Resource ret(r);
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_mysql_async_query_completed(CVarRef result) {
|
||||
MySQLResult *res = result.toObject().getTyped<MySQLResult>
|
||||
MySQLResult *res = result.toResource().getTyped<MySQLResult>
|
||||
(!RuntimeOption::ThrowBadTypeExceptions,
|
||||
!RuntimeOption::ThrowBadTypeExceptions);
|
||||
return !res || res->get() == NULL;
|
||||
@@ -1450,7 +1450,7 @@ Variant f_mysql_async_wait_actionable(CVarRef items, double timeout) {
|
||||
return Array::Create();
|
||||
}
|
||||
|
||||
MySQL* mySQL = entry.rvalAt(0).toObject().getTyped<MySQL>();
|
||||
MySQL* mySQL = entry.rvalAt(0).toResource().getTyped<MySQL>();
|
||||
MYSQL* conn = mySQL->get();
|
||||
if (conn->async_op_status == ASYNC_OP_UNSET) {
|
||||
raise_warning("runtime/ext_mysql: no pending async operation in "
|
||||
@@ -1489,7 +1489,7 @@ Variant f_mysql_async_wait_actionable(CVarRef items, double timeout) {
|
||||
nfds);
|
||||
return Array::Create();
|
||||
}
|
||||
MySQL* mySQL = entry.rvalAt(0).toObject().getTyped<MySQL>();
|
||||
MySQL* mySQL = entry.rvalAt(0).toResource().getTyped<MySQL>();
|
||||
MYSQL* conn = mySQL->get();
|
||||
|
||||
pollfd* fd = &fds[nfds++];
|
||||
@@ -1637,7 +1637,7 @@ Variant f_mysql_result(CVarRef result, int row,
|
||||
mysql_result = res->get();
|
||||
if (row < 0 || row >= (int)mysql_num_rows(mysql_result)) {
|
||||
raise_warning("Unable to jump to row %d on MySQL result index %d",
|
||||
row, result.toObject()->o_getId());
|
||||
row, result.toResource()->o_getId());
|
||||
return false;
|
||||
}
|
||||
mysql_data_seek(mysql_result, row);
|
||||
@@ -1682,7 +1682,7 @@ Variant f_mysql_result(CVarRef result, int row,
|
||||
if (!found) { /* no match found */
|
||||
raise_warning("%s%s%s not found in MySQL result index %d",
|
||||
table_name.data(), (table_name.empty() ? "" : "."),
|
||||
field_name.data(), result.toObject()->o_getId());
|
||||
field_name.data(), result.toResource()->o_getId());
|
||||
return false;
|
||||
}
|
||||
} else {
|
||||
|
||||
@@ -890,15 +890,15 @@ bool f_getmxrr(CStrRef hostname, VRefParam mxhosts,
|
||||
* f_fsockopen() and f_pfsockopen() are implemented in ext_socket.cpp.
|
||||
*/
|
||||
|
||||
Variant f_socket_get_status(CObjRef stream) {
|
||||
Variant f_socket_get_status(CResRef stream) {
|
||||
return f_stream_get_meta_data(stream);
|
||||
}
|
||||
|
||||
bool f_socket_set_blocking(CObjRef stream, int mode) {
|
||||
bool f_socket_set_blocking(CResRef stream, int mode) {
|
||||
return f_stream_set_blocking(stream, mode);
|
||||
}
|
||||
|
||||
bool f_socket_set_timeout(CObjRef stream, int seconds,
|
||||
bool f_socket_set_timeout(CResRef stream, int seconds,
|
||||
int microseconds /* = 0 */) {
|
||||
return f_stream_set_timeout(stream, seconds, microseconds);
|
||||
}
|
||||
|
||||
@@ -59,11 +59,11 @@ Variant f_fsockopen(CStrRef hostname, int port = -1, VRefParam errnum = uninit_n
|
||||
Variant f_pfsockopen(CStrRef hostname, int port = -1, VRefParam errnum = uninit_null(),
|
||||
VRefParam errstr = uninit_null(), double timeout = 0.0);
|
||||
|
||||
Variant f_socket_get_status(CObjRef stream);
|
||||
Variant f_socket_get_status(CResRef stream);
|
||||
|
||||
bool f_socket_set_blocking(CObjRef stream, int mode);
|
||||
bool f_socket_set_blocking(CResRef stream, int mode);
|
||||
|
||||
bool f_socket_set_timeout(CObjRef stream, int seconds,
|
||||
bool f_socket_set_timeout(CResRef stream, int seconds,
|
||||
int microseconds = 0);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -179,14 +179,14 @@ public:
|
||||
* passphrase - NULL causes a passphrase prompt to be emitted in
|
||||
* the Apache error log!
|
||||
*/
|
||||
static Object Get(CVarRef var, bool public_key,
|
||||
const char *passphrase = NULL) {
|
||||
static Resource Get(CVarRef var, bool public_key,
|
||||
const char *passphrase = nullptr) {
|
||||
if (var.is(KindOfArray)) {
|
||||
Array arr = var.toArray();
|
||||
if (!arr.exists(int64_t(0)) || !arr.exists(int64_t(1))) {
|
||||
raise_warning("key array must be of the form "
|
||||
"array(0 => key, 1 => phrase)");
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
|
||||
String zphrase = arr[1].toString();
|
||||
@@ -195,29 +195,29 @@ public:
|
||||
return GetHelper(var, public_key, passphrase);
|
||||
}
|
||||
|
||||
static Object GetHelper(CVarRef var, bool public_key,
|
||||
const char *passphrase) {
|
||||
Object ocert;
|
||||
static Resource GetHelper(CVarRef var, bool public_key,
|
||||
const char *passphrase) {
|
||||
Resource ocert;
|
||||
EVP_PKEY *key = NULL;
|
||||
|
||||
if (var.isResource()) {
|
||||
Certificate *cert = var.toObject().getTyped<Certificate>(true, true);
|
||||
Key *key = var.toObject().getTyped<Key>(true, true);
|
||||
Certificate *cert = var.toResource().getTyped<Certificate>(true, true);
|
||||
Key *key = var.toResource().getTyped<Key>(true, true);
|
||||
if (cert == NULL && key == NULL) {
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
if (key) {
|
||||
bool is_priv = key->isPrivate();
|
||||
if (!public_key && !is_priv) {
|
||||
raise_warning("supplied key param is a public key");
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
if (public_key && is_priv) {
|
||||
raise_warning("Don't know how to get public key from "
|
||||
"this private key");
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
return var.toObject();
|
||||
return var.toResource();
|
||||
}
|
||||
ocert = cert;
|
||||
} else {
|
||||
@@ -228,14 +228,14 @@ public:
|
||||
if (ocert.isNull()) {
|
||||
/* not a X509 certificate, try to retrieve public key */
|
||||
BIO *in = Certificate::ReadData(var);
|
||||
if (in == NULL) return Object();
|
||||
if (in == nullptr) return Resource();
|
||||
key = PEM_read_bio_PUBKEY(in, NULL,NULL, NULL);
|
||||
BIO_free(in);
|
||||
}
|
||||
} else {
|
||||
/* we want the private key */
|
||||
BIO *in = Certificate::ReadData(var);
|
||||
if (in == NULL) return Object();
|
||||
if (in == nullptr) return Resource();
|
||||
key = PEM_read_bio_PrivateKey(in, NULL,NULL, (void*)passphrase);
|
||||
BIO_free(in);
|
||||
}
|
||||
@@ -247,9 +247,10 @@ public:
|
||||
}
|
||||
|
||||
if (key) {
|
||||
return Object(new Key(key));
|
||||
return Resource(new Key(key));
|
||||
}
|
||||
return Object();
|
||||
// Is it okay to return a "null" resource?
|
||||
return Resource();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -268,7 +269,7 @@ public:
|
||||
// overriding ResourceData
|
||||
virtual CStrRef o_getClassNameHook() const { return s_class_name; }
|
||||
|
||||
static X509_REQ *Get(CVarRef var, Object &ocsr) {
|
||||
static X509_REQ *Get(CVarRef var, Resource &ocsr) {
|
||||
ocsr = Get(var);
|
||||
CSRequest *csr = ocsr.getTyped<CSRequest>(true);
|
||||
if (csr == NULL || csr->m_csr == NULL) {
|
||||
@@ -278,21 +279,21 @@ public:
|
||||
return csr->m_csr;
|
||||
}
|
||||
|
||||
static Object Get(CVarRef var) {
|
||||
static Resource Get(CVarRef var) {
|
||||
if (var.isResource()) {
|
||||
return var.toObject();
|
||||
return var.toResource();
|
||||
}
|
||||
if (var.isString() || var.isObject()) {
|
||||
BIO *in = Certificate::ReadData(var);
|
||||
if (in == NULL) return Object();
|
||||
if (in == nullptr) return Resource();
|
||||
|
||||
X509_REQ *csr = PEM_read_bio_X509_REQ(in, NULL,NULL,NULL);
|
||||
BIO_free(in);
|
||||
if (csr) {
|
||||
return Object(new CSRequest(csr));
|
||||
return Resource(new CSRequest(csr));
|
||||
}
|
||||
}
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -887,7 +888,7 @@ static bool php_openssl_make_REQ(struct php_x509_request *req, X509_REQ *csr,
|
||||
|
||||
bool f_openssl_csr_export_to_file(CVarRef csr, CStrRef outfilename,
|
||||
bool notext /* = true */) {
|
||||
Object ocsr;
|
||||
Resource ocsr;
|
||||
X509_REQ *pcsr = CSRequest::Get(csr, ocsr);
|
||||
if (pcsr == NULL) return false;
|
||||
|
||||
@@ -906,7 +907,7 @@ bool f_openssl_csr_export_to_file(CVarRef csr, CStrRef outfilename,
|
||||
}
|
||||
|
||||
bool f_openssl_csr_export(CVarRef csr, VRefParam out, bool notext /* = true */) {
|
||||
Object ocsr;
|
||||
Resource ocsr;
|
||||
X509_REQ *pcsr = CSRequest::Get(csr, ocsr);
|
||||
if (pcsr == NULL) return false;
|
||||
|
||||
@@ -928,16 +929,16 @@ bool f_openssl_csr_export(CVarRef csr, VRefParam out, bool notext /* = true */)
|
||||
}
|
||||
|
||||
Variant f_openssl_csr_get_public_key(CVarRef csr) {
|
||||
Object ocsr;
|
||||
Resource ocsr;
|
||||
X509_REQ *pcsr = CSRequest::Get(csr, ocsr);
|
||||
if (pcsr == NULL) return false;
|
||||
|
||||
return Object(new Key(X509_REQ_get_pubkey(pcsr)));
|
||||
return Resource(new Key(X509_REQ_get_pubkey(pcsr)));
|
||||
}
|
||||
|
||||
Variant f_openssl_csr_get_subject(CVarRef csr,
|
||||
bool use_shortnames /* = true */) {
|
||||
Object ocsr;
|
||||
Resource ocsr;
|
||||
X509_REQ *pcsr = CSRequest::Get(csr, ocsr);
|
||||
if (pcsr == NULL) return false;
|
||||
|
||||
@@ -954,7 +955,7 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey,
|
||||
struct php_x509_request req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
Object okey;
|
||||
Resource okey;
|
||||
X509_REQ *csr = NULL;
|
||||
vector<String> strings;
|
||||
if (php_openssl_parse_config(&req, configargs.toArray(), strings)) {
|
||||
@@ -968,7 +969,7 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey,
|
||||
if (req.priv_key == NULL) {
|
||||
req.generatePrivateKey();
|
||||
if (req.priv_key) {
|
||||
okey = Object(new Key(req.priv_key));
|
||||
okey = Resource(new Key(req.priv_key));
|
||||
}
|
||||
}
|
||||
if (req.priv_key == NULL) {
|
||||
@@ -989,7 +990,7 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey,
|
||||
} else {
|
||||
ret = true;
|
||||
if (X509_REQ_sign(csr, req.priv_key, req.digest)) {
|
||||
ret = Object(new CSRequest(csr));
|
||||
ret = Resource(new CSRequest(csr));
|
||||
csr = NULL;
|
||||
} else {
|
||||
raise_warning("Error signing request");
|
||||
@@ -1010,11 +1011,11 @@ Variant f_openssl_csr_new(CArrRef dn, VRefParam privkey,
|
||||
Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key,
|
||||
int days, CVarRef configargs /* = null_variant */,
|
||||
int serial /* = 0 */) {
|
||||
Object ocsr;
|
||||
Resource ocsr;
|
||||
X509_REQ *pcsr = CSRequest::Get(csr, ocsr);
|
||||
if (pcsr == NULL) return false;
|
||||
|
||||
Object ocert;
|
||||
Resource ocert;
|
||||
if (!cacert.isNull()) {
|
||||
ocert = Certificate::Get(cacert);
|
||||
if (ocert.isNull()) {
|
||||
@@ -1022,7 +1023,7 @@ Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key,
|
||||
return false;
|
||||
}
|
||||
}
|
||||
Object okey = Key::Get(priv_key, false);
|
||||
Resource okey = Key::Get(priv_key, false);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("cannot get private key from parameter 3");
|
||||
return false;
|
||||
@@ -1037,7 +1038,7 @@ Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key,
|
||||
return false;
|
||||
}
|
||||
|
||||
Object onewcert;
|
||||
Resource onewcert;
|
||||
struct php_x509_request req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
Variant ret = false;
|
||||
@@ -1071,7 +1072,7 @@ Variant f_openssl_csr_sign(CVarRef csr, CVarRef cacert, CVarRef priv_key,
|
||||
raise_warning("No memory");
|
||||
goto cleanup;
|
||||
}
|
||||
onewcert = Object(new Certificate(new_cert));
|
||||
onewcert = Resource(new Certificate(new_cert));
|
||||
/* Version 3 cert */
|
||||
if (!X509_set_version(new_cert, 2)) {
|
||||
goto cleanup;
|
||||
@@ -1124,13 +1125,13 @@ Variant f_openssl_error_string() {
|
||||
return false;
|
||||
}
|
||||
|
||||
void f_openssl_free_key(CObjRef key) {
|
||||
void f_openssl_free_key(CResRef key) {
|
||||
return f_openssl_pkey_free(key);
|
||||
}
|
||||
|
||||
bool f_openssl_open(CStrRef sealed_data, VRefParam open_data, CStrRef env_key,
|
||||
CVarRef priv_key_id) {
|
||||
Object okey = Key::Get(priv_key_id, false);
|
||||
Resource okey = Key::Get(priv_key_id, false);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("unable to coerce parameter 4 into a private key");
|
||||
return false;
|
||||
@@ -1163,7 +1164,7 @@ static STACK_OF(X509) *php_array_to_X509_sk(CVarRef certs) {
|
||||
arrCerts.append(certs);
|
||||
}
|
||||
for (ArrayIter iter(arrCerts); iter; ++iter) {
|
||||
Object ocert = Certificate::Get(iter.second());
|
||||
Resource ocert = Certificate::Get(iter.second());
|
||||
if (ocert.isNull()) {
|
||||
break;
|
||||
}
|
||||
@@ -1178,12 +1179,12 @@ static const StaticString s_extracerts("extracerts");
|
||||
static bool openssl_pkcs12_export_impl(CVarRef x509, BIO *bio_out,
|
||||
CVarRef priv_key, CStrRef pass,
|
||||
CVarRef args /* = null_variant */) {
|
||||
Object ocert = Certificate::Get(x509);
|
||||
Resource ocert = Certificate::Get(x509);
|
||||
if (ocert.isNull()) {
|
||||
raise_warning("cannot get cert from parameter 1");
|
||||
return false;
|
||||
}
|
||||
Object okey = Key::Get(priv_key, false);
|
||||
Resource okey = Key::Get(priv_key, false);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("cannot get private key from parameter 3");
|
||||
return false;
|
||||
@@ -1317,9 +1318,9 @@ bool f_openssl_pkcs7_decrypt(CStrRef infilename, CStrRef outfilename,
|
||||
bool ret = false;
|
||||
BIO *in = NULL, *out = NULL, *datain = NULL;
|
||||
PKCS7 *p7 = NULL;
|
||||
Object okey;
|
||||
Resource okey;
|
||||
|
||||
Object ocert = Certificate::Get(recipcert);
|
||||
Resource ocert = Certificate::Get(recipcert);
|
||||
if (ocert.isNull()) {
|
||||
raise_warning("unable to coerce parameter 3 to x509 cert");
|
||||
goto clean_exit;
|
||||
@@ -1445,7 +1446,7 @@ bool f_openssl_pkcs7_sign(CStrRef infilename, CStrRef outfilename,
|
||||
STACK_OF(X509) *others = NULL;
|
||||
BIO *infile = NULL, *outfile = NULL;
|
||||
PKCS7 *p7 = NULL;
|
||||
Object okey, ocert;
|
||||
Resource okey, ocert;
|
||||
|
||||
if (!extracerts.empty()) {
|
||||
others = load_all_certs_from_file(extracerts.data());
|
||||
@@ -1586,7 +1587,7 @@ Variant f_openssl_pkcs7_verify(CStrRef filename, int flags,
|
||||
static bool openssl_pkey_export_impl(CVarRef key, BIO *bio_out,
|
||||
CStrRef passphrase /* = null_string */,
|
||||
CVarRef configargs /* = null_variant */) {
|
||||
Object okey = Key::Get(key, false, passphrase.data());
|
||||
Resource okey = Key::Get(key, false, passphrase.data());
|
||||
if (okey.isNull()) {
|
||||
raise_warning("cannot get key from parameter 1");
|
||||
return false;
|
||||
@@ -1641,7 +1642,7 @@ bool f_openssl_pkey_export(CVarRef key, VRefParam out,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void f_openssl_pkey_free(CObjRef key) {
|
||||
void f_openssl_pkey_free(CResRef key) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -1689,7 +1690,7 @@ static void add_bignum_as_string(Array &arr,
|
||||
smart_free(out);
|
||||
}
|
||||
|
||||
Array f_openssl_pkey_get_details(CObjRef key) {
|
||||
Array f_openssl_pkey_get_details(CResRef key) {
|
||||
EVP_PKEY *pkey = key.getTyped<Key>()->m_key;
|
||||
BIO *out = BIO_new(BIO_s_mem());
|
||||
PEM_write_bio_PUBKEY(out, pkey);
|
||||
@@ -1753,7 +1754,7 @@ Array f_openssl_pkey_get_details(CObjRef key) {
|
||||
|
||||
Variant f_openssl_pkey_get_private(CVarRef key,
|
||||
CStrRef passphrase /* = null_string */) {
|
||||
Object okey = Key::Get(key, false, passphrase.data());
|
||||
Resource okey = Key::Get(key, false, passphrase.data());
|
||||
if (okey.isNull()) {
|
||||
return false;
|
||||
}
|
||||
@@ -1766,7 +1767,7 @@ Variant f_openssl_get_privatekey(CVarRef key,
|
||||
}
|
||||
|
||||
Variant f_openssl_pkey_get_public(CVarRef certificate) {
|
||||
Object okey = Key::Get(certificate, true);
|
||||
Resource okey = Key::Get(certificate, true);
|
||||
if (okey.isNull()) {
|
||||
return false;
|
||||
}
|
||||
@@ -1777,15 +1778,15 @@ Variant f_openssl_get_publickey(CVarRef certificate) {
|
||||
return f_openssl_pkey_get_public(certificate);
|
||||
}
|
||||
|
||||
Object f_openssl_pkey_new(CVarRef configargs /* = null_variant */) {
|
||||
Resource f_openssl_pkey_new(CVarRef configargs /* = null_variant */) {
|
||||
struct php_x509_request req;
|
||||
memset(&req, 0, sizeof(req));
|
||||
|
||||
Object ret;
|
||||
Resource ret;
|
||||
vector<String> strings;
|
||||
if (php_openssl_parse_config(&req, configargs.toArray(), strings) &&
|
||||
req.generatePrivateKey()) {
|
||||
ret = Object(new Key(req.priv_key));
|
||||
ret = Resource(new Key(req.priv_key));
|
||||
}
|
||||
|
||||
php_openssl_dispose_config(&req);
|
||||
@@ -1794,7 +1795,7 @@ Object f_openssl_pkey_new(CVarRef configargs /* = null_variant */) {
|
||||
|
||||
bool f_openssl_private_decrypt(CStrRef data, VRefParam decrypted, CVarRef key,
|
||||
int padding /* = k_OPENSSL_PKCS1_PADDING */) {
|
||||
Object okey = Key::Get(key, false);
|
||||
Resource okey = Key::Get(key, false);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("key parameter is not a valid private key");
|
||||
return false;
|
||||
@@ -1832,7 +1833,7 @@ bool f_openssl_private_decrypt(CStrRef data, VRefParam decrypted, CVarRef key,
|
||||
|
||||
bool f_openssl_private_encrypt(CStrRef data, VRefParam crypted, CVarRef key,
|
||||
int padding /* = k_OPENSSL_PKCS1_PADDING */) {
|
||||
Object okey = Key::Get(key, false);
|
||||
Resource okey = Key::Get(key, false);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("key param is not a valid private key");
|
||||
return false;
|
||||
@@ -1866,7 +1867,7 @@ bool f_openssl_private_encrypt(CStrRef data, VRefParam crypted, CVarRef key,
|
||||
|
||||
bool f_openssl_public_decrypt(CStrRef data, VRefParam decrypted, CVarRef key,
|
||||
int padding /* = k_OPENSSL_PKCS1_PADDING */) {
|
||||
Object okey = Key::Get(key, true);
|
||||
Resource okey = Key::Get(key, true);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("key parameter is not a valid public key");
|
||||
return false;
|
||||
@@ -1904,7 +1905,7 @@ bool f_openssl_public_decrypt(CStrRef data, VRefParam decrypted, CVarRef key,
|
||||
|
||||
bool f_openssl_public_encrypt(CStrRef data, VRefParam crypted, CVarRef key,
|
||||
int padding /* = k_OPENSSL_PKCS1_PADDING */) {
|
||||
Object okey = Key::Get(key, true);
|
||||
Resource okey = Key::Get(key, true);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("key parameter is not a valid public key");
|
||||
return false;
|
||||
@@ -1949,7 +1950,7 @@ Variant f_openssl_seal(CStrRef data, VRefParam sealed_data, VRefParam env_keys,
|
||||
int *eksl = (int*)malloc(nkeys * sizeof(*eksl));
|
||||
unsigned char **eks = (unsigned char **)malloc(nkeys * sizeof(*eks));
|
||||
memset(eks, 0, sizeof(*eks) * nkeys);
|
||||
vector<Object> holder;
|
||||
vector<Resource> holder;
|
||||
|
||||
/* get the public keys we are using to seal this data */
|
||||
bool ret = true;
|
||||
@@ -1957,7 +1958,7 @@ Variant f_openssl_seal(CStrRef data, VRefParam sealed_data, VRefParam env_keys,
|
||||
String s;
|
||||
unsigned char *buf = NULL;
|
||||
for (ArrayIter iter(pub_key_ids); iter; ++iter, ++i) {
|
||||
Object okey = Key::Get(iter.second(), true);
|
||||
Resource okey = Key::Get(iter.second(), true);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("not a public key (%dth member of pubkeys)", i + 1);
|
||||
ret = false;
|
||||
@@ -2032,7 +2033,7 @@ static const EVP_MD *php_openssl_get_evp_md_from_algo(long algo) {
|
||||
|
||||
bool f_openssl_sign(CStrRef data, VRefParam signature, CVarRef priv_key_id,
|
||||
int signature_alg /* = k_OPENSSL_ALGO_SHA1 */) {
|
||||
Object okey = Key::Get(priv_key_id, false);
|
||||
Resource okey = Key::Get(priv_key_id, false);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("supplied key param cannot be coerced into a private key");
|
||||
return false;
|
||||
@@ -2075,7 +2076,7 @@ Variant f_openssl_verify(CStrRef data, CStrRef signature, CVarRef pub_key_id,
|
||||
return false;
|
||||
}
|
||||
|
||||
Object okey = Key::Get(pub_key_id, true);
|
||||
Resource okey = Key::Get(pub_key_id, true);
|
||||
if (okey.isNull()) {
|
||||
raise_warning("supplied key param cannot be coerced into a public key");
|
||||
return false;
|
||||
@@ -2093,11 +2094,11 @@ Variant f_openssl_verify(CStrRef data, CStrRef signature, CVarRef pub_key_id,
|
||||
}
|
||||
|
||||
bool f_openssl_x509_check_private_key(CVarRef cert, CVarRef key) {
|
||||
Object ocert = Certificate::Get(cert);
|
||||
Resource ocert = Certificate::Get(cert);
|
||||
if (ocert.isNull()) {
|
||||
return false;
|
||||
}
|
||||
Object okey = Key::Get(key, false);
|
||||
Resource okey = Key::Get(key, false);
|
||||
if (okey.isNull()) {
|
||||
return false;
|
||||
}
|
||||
@@ -2129,7 +2130,7 @@ int64_t f_openssl_x509_checkpurpose(CVarRef x509cert, int purpose,
|
||||
int ret = -1;
|
||||
STACK_OF(X509) *untrustedchain = NULL;
|
||||
X509_STORE *pcainfo = NULL;
|
||||
Object ocert;
|
||||
Resource ocert;
|
||||
|
||||
if (!untrustedfile.empty()) {
|
||||
untrustedchain = load_all_certs_from_file(untrustedfile.data());
|
||||
@@ -2166,7 +2167,7 @@ int64_t f_openssl_x509_checkpurpose(CVarRef x509cert, int purpose,
|
||||
|
||||
static bool openssl_x509_export_impl(CVarRef x509, BIO *bio_out,
|
||||
bool notext /* = true */) {
|
||||
Object ocert = Certificate::Get(x509);
|
||||
Resource ocert = Certificate::Get(x509);
|
||||
if (ocert.isNull()) {
|
||||
raise_warning("cannot get cert from parameter 1");
|
||||
return false;
|
||||
@@ -2206,7 +2207,7 @@ bool f_openssl_x509_export(CVarRef x509, VRefParam output,
|
||||
return ret;
|
||||
}
|
||||
|
||||
void f_openssl_x509_free(CObjRef x509cert) {
|
||||
void f_openssl_x509_free(CResRef x509cert) {
|
||||
// do nothing
|
||||
}
|
||||
|
||||
@@ -2261,7 +2262,7 @@ static time_t asn1_time_to_time_t(ASN1_UTCTIME *timestr) {
|
||||
}
|
||||
|
||||
Variant f_openssl_x509_parse(CVarRef x509cert, bool shortnames /* = true */) {
|
||||
Object ocert = Certificate::Get(x509cert);
|
||||
Resource ocert = Certificate::Get(x509cert);
|
||||
if (ocert.isNull()) {
|
||||
return false;
|
||||
}
|
||||
@@ -2353,7 +2354,7 @@ Variant f_openssl_x509_parse(CVarRef x509cert, bool shortnames /* = true */) {
|
||||
}
|
||||
|
||||
Variant f_openssl_x509_read(CVarRef x509certdata) {
|
||||
Object ocert = Certificate::Get(x509certdata);
|
||||
Resource ocert = Certificate::Get(x509certdata);
|
||||
if (ocert.isNull()) {
|
||||
raise_warning("supplied parameter cannot be coerced into "
|
||||
"an X509 certificate!");
|
||||
|
||||
@@ -42,14 +42,14 @@ bool f_openssl_pkcs7_sign(CStrRef infilename, CStrRef outfilename, CVarRef signc
|
||||
Variant f_openssl_pkcs7_verify(CStrRef filename, int flags, CStrRef outfilename = null_string, CArrRef cainfo = null_array, CStrRef extracerts = null_string, CStrRef content = null_string);
|
||||
bool f_openssl_pkey_export_to_file(CVarRef key, CStrRef outfilename, CStrRef passphrase = null_string, CVarRef configargs = null_variant);
|
||||
bool f_openssl_pkey_export(CVarRef key, VRefParam out, CStrRef passphrase = null_string, CVarRef configargs = null_variant);
|
||||
void f_openssl_pkey_free(CObjRef key);
|
||||
void f_openssl_free_key(CObjRef key);
|
||||
Array f_openssl_pkey_get_details(CObjRef key);
|
||||
void f_openssl_pkey_free(CResRef key);
|
||||
void f_openssl_free_key(CResRef key);
|
||||
Array f_openssl_pkey_get_details(CResRef key);
|
||||
Variant f_openssl_pkey_get_private(CVarRef key, CStrRef passphrase = null_string);
|
||||
Variant f_openssl_get_privatekey(CVarRef key, CStrRef passphrase = null_string);
|
||||
Variant f_openssl_pkey_get_public(CVarRef certificate);
|
||||
Variant f_openssl_get_publickey(CVarRef certificate);
|
||||
Object f_openssl_pkey_new(CVarRef configargs = null_variant);
|
||||
Resource f_openssl_pkey_new(CVarRef configargs = null_variant);
|
||||
bool f_openssl_private_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING);
|
||||
bool f_openssl_private_encrypt(CStrRef data, VRefParam crypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING);
|
||||
bool f_openssl_public_decrypt(CStrRef data, VRefParam decrypted, CVarRef key, int padding = k_OPENSSL_PKCS1_PADDING);
|
||||
@@ -61,7 +61,7 @@ bool f_openssl_x509_check_private_key(CVarRef cert, CVarRef key);
|
||||
int64_t f_openssl_x509_checkpurpose(CVarRef x509cert, int purpose, CArrRef cainfo = null_array, CStrRef untrustedfile = null_string);
|
||||
bool f_openssl_x509_export_to_file(CVarRef x509, CStrRef outfilename, bool notext = true);
|
||||
bool f_openssl_x509_export(CVarRef x509, VRefParam output, bool notext = true);
|
||||
void f_openssl_x509_free(CObjRef x509cert);
|
||||
void f_openssl_x509_free(CResRef x509cert);
|
||||
Variant f_openssl_x509_parse(CVarRef x509cert, bool shortnames = true);
|
||||
Variant f_openssl_x509_read(CVarRef x509certdata);
|
||||
Variant f_openssl_random_pseudo_bytes(int length, VRefParam crypto_strong = false);
|
||||
|
||||
@@ -645,7 +645,7 @@ static bool pdo_stmt_describe_columns(sp_PDOStatement stmt) {
|
||||
return false;
|
||||
}
|
||||
|
||||
String &name = stmt->columns[col].toObject().getTyped<PDOColumn>()->name;
|
||||
String &name = stmt->columns[col].toResource().getTyped<PDOColumn>()->name;
|
||||
|
||||
/* if we are applying case conversions on column names, do so now */
|
||||
if (stmt->dbh->native_case != stmt->dbh->desired_case &&
|
||||
@@ -663,7 +663,7 @@ static bool pdo_stmt_describe_columns(sp_PDOStatement stmt) {
|
||||
|
||||
if (stmt->bound_columns.exists(name)) {
|
||||
PDOBoundParam *param =
|
||||
stmt->bound_columns[name].toObject().getTyped<PDOBoundParam>();
|
||||
stmt->bound_columns[name].toResource().getTyped<PDOBoundParam>();
|
||||
param->paramno = col;
|
||||
}
|
||||
}
|
||||
@@ -951,7 +951,7 @@ void c_PDO::t___construct(CStrRef dsn, CStrRef username /* = null_string */,
|
||||
if (same(stream, false)) {
|
||||
throw_pdo_exception(uninit_null(), uninit_null(), "invalid data source URI");
|
||||
}
|
||||
data_source = stream.toObject().getTyped<File>()->readLine(1024);
|
||||
data_source = stream.toResource().getTyped<File>()->readLine(1024);
|
||||
colon = strchr(data_source.data(), ':');
|
||||
if (!colon) {
|
||||
throw_pdo_exception(uninit_null(), uninit_null(), "invalid data source name (via URI)");
|
||||
@@ -1545,13 +1545,13 @@ static bool dispatch_param_event(sp_PDOStatement stmt,
|
||||
return true;
|
||||
}
|
||||
for (ArrayIter iter(stmt->bound_params); iter; ++iter) {
|
||||
PDOBoundParam *param = iter.second().toObject().getTyped<PDOBoundParam>();
|
||||
PDOBoundParam *param = iter.second().toResource().getTyped<PDOBoundParam>();
|
||||
if (!stmt->paramHook(param, event_type)) {
|
||||
return false;
|
||||
}
|
||||
}
|
||||
for (ArrayIter iter(stmt->bound_columns); iter; ++iter) {
|
||||
PDOBoundParam *param = iter.second().toObject().getTyped<PDOBoundParam>();
|
||||
PDOBoundParam *param = iter.second().toResource().getTyped<PDOBoundParam>();
|
||||
if (!stmt->paramHook(param, event_type)) {
|
||||
return false;
|
||||
}
|
||||
@@ -1586,7 +1586,7 @@ static bool really_register_bound_param(PDOBoundParam *param,
|
||||
if (!is_param && !param->name.empty() && !stmt->columns.empty()) {
|
||||
/* try to map the name to the column */
|
||||
for (int i = 0; i < stmt->column_count; i++) {
|
||||
if (stmt->columns[i].toObject().getTyped<PDOColumn>()->name ==
|
||||
if (stmt->columns[i].toResource().getTyped<PDOColumn>()->name ==
|
||||
param->name) {
|
||||
param->paramno = i;
|
||||
break;
|
||||
@@ -1655,7 +1655,7 @@ static bool really_register_bound_param(PDOBoundParam *param,
|
||||
|
||||
static inline void fetch_value(sp_PDOStatement stmt, Variant &dest, int colno,
|
||||
int *type_override) {
|
||||
PDOColumn *col = stmt->columns[colno].toObject().getTyped<PDOColumn>();
|
||||
PDOColumn *col = stmt->columns[colno].toResource().getTyped<PDOColumn>();
|
||||
int type = PDO_PARAM_TYPE(col->param_type);
|
||||
int new_type = type_override ? PDO_PARAM_TYPE(*type_override) : type;
|
||||
|
||||
@@ -1700,7 +1700,7 @@ static bool do_fetch_common(sp_PDOStatement stmt, PDOFetchOrientation ori,
|
||||
/* update those bound column variables now */
|
||||
for (ArrayIter iter(stmt->bound_columns); iter; ++iter) {
|
||||
PDOBoundParam *param =
|
||||
iter.second().toObject().getTyped<PDOBoundParam>();
|
||||
iter.second().toResource().getTyped<PDOBoundParam>();
|
||||
if (param->paramno >= 0) {
|
||||
param->parameter.reset();
|
||||
/* set new value */
|
||||
@@ -1888,7 +1888,7 @@ static bool do_fetch(sp_PDOStatement stmt, bool do_bind, Variant &ret,
|
||||
}
|
||||
|
||||
for (int idx = 0; i < stmt->column_count; i++, idx++) {
|
||||
String name = stmt->columns[i].toObject().getTyped<PDOColumn>()->name;
|
||||
String name = stmt->columns[i].toResource().getTyped<PDOColumn>()->name;
|
||||
Variant val;
|
||||
fetch_value(stmt, val, i, NULL);
|
||||
|
||||
@@ -2005,7 +2005,7 @@ static bool do_fetch(sp_PDOStatement stmt, bool do_bind, Variant &ret,
|
||||
static int register_bound_param(CVarRef paramno, VRefParam param, int64_t type,
|
||||
int64_t max_value_len, CVarRef driver_params,
|
||||
sp_PDOStatement stmt, bool is_param) {
|
||||
SmartObject<PDOBoundParam> p(new PDOBoundParam);
|
||||
SmartResource<PDOBoundParam> p(new PDOBoundParam);
|
||||
// need to make sure this is NULL, in case a fatal errors occurs before its set
|
||||
// inside really_register_bound_param
|
||||
p->stmt = NULL;
|
||||
@@ -2455,11 +2455,11 @@ safe:
|
||||
"parameter was not defined");
|
||||
goto clean_up;
|
||||
}
|
||||
param = vparam.toObject().getTyped<PDOBoundParam>();
|
||||
param = vparam.toResource().getTyped<PDOBoundParam>();
|
||||
if (stmt->dbh->support(PDOConnection::MethodQuoter)) {
|
||||
if (param->param_type == PDO_PARAM_LOB &&
|
||||
param->parameter.isResource()) {
|
||||
Variant buf = f_stream_get_contents(param->parameter.toObject());
|
||||
Variant buf = f_stream_get_contents(param->parameter.toResource());
|
||||
if (!same(buf, false)) {
|
||||
if (!stmt->dbh->quoter(buf.toString(), plc->quoted,
|
||||
param->param_type)) {
|
||||
@@ -2623,7 +2623,7 @@ Variant c_PDOStatement::t_execute(CArrRef params /* = null_array */) {
|
||||
if (!params.empty()) {
|
||||
m_stmt->bound_params.reset();
|
||||
for (ArrayIter iter(params); iter; ++iter) {
|
||||
SmartObject<PDOBoundParam> param(new PDOBoundParam);
|
||||
SmartResource<PDOBoundParam> param(new PDOBoundParam);
|
||||
param->param_type = PDO_PARAM_STR;
|
||||
param->parameter = iter.second();
|
||||
param->stmt = NULL;
|
||||
@@ -3010,7 +3010,7 @@ Variant c_PDOStatement::t_getcolumnmeta(int64_t column) {
|
||||
}
|
||||
|
||||
/* add stock items */
|
||||
PDOColumn *col = m_stmt->columns[column].toObject().getTyped<PDOColumn>();
|
||||
PDOColumn *col = m_stmt->columns[column].toResource().getTyped<PDOColumn>();
|
||||
ret.set(s_name, col->name);
|
||||
ret.set(s_len, (int64_t)col->maxlen); /* FIXME: unsigned ? */
|
||||
ret.set(s_precision, (int64_t)col->precision);
|
||||
@@ -3077,7 +3077,7 @@ Variant c_PDOStatement::t_debugdumpparams() {
|
||||
if (same(fobj, false)) {
|
||||
return false;
|
||||
}
|
||||
File *f = fobj.toObject().getTyped<File>();
|
||||
File *f = fobj.toResource().getTyped<File>();
|
||||
|
||||
Array params;
|
||||
params.append(m_stmt->query_string.size());
|
||||
@@ -3096,7 +3096,7 @@ Variant c_PDOStatement::t_debugdumpparams() {
|
||||
CREATE_VECTOR1(iter.first().toInt64()));
|
||||
}
|
||||
|
||||
PDOBoundParam *param = iter.second().toObject().getTyped<PDOBoundParam>();
|
||||
PDOBoundParam *param = iter.second().toResource().getTyped<PDOBoundParam>();
|
||||
params.clear();
|
||||
params.append(param->paramno);
|
||||
params.append(param->name.size());
|
||||
|
||||
@@ -295,7 +295,7 @@ bool f_posix_initgroups(CStrRef name, int base_group_id) {
|
||||
static int php_posix_get_fd(CVarRef fd) {
|
||||
int nfd;
|
||||
if (fd.isResource()) {
|
||||
File *f = fd.toObject().getTyped<File>();
|
||||
File *f = fd.toResource().getTyped<File>();
|
||||
if (!f) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -527,7 +527,7 @@ public:
|
||||
// explicitly pclose()'ed, it seems that Zend is implicitly closing the
|
||||
// pipes when proc_close() is called.
|
||||
for (ArrayIter iter(pipes); iter; ++iter) {
|
||||
iter.second().toObject().getTyped<PlainFile>()->close();
|
||||
iter.second().toResource().getTyped<PlainFile>()->close();
|
||||
}
|
||||
pipes.clear();
|
||||
|
||||
@@ -641,17 +641,17 @@ public:
|
||||
|
||||
/* clean up all the child ends and then open streams on the parent
|
||||
* ends, where appropriate */
|
||||
Object dupParent() {
|
||||
Resource dupParent() {
|
||||
close(childend); childend = -1;
|
||||
|
||||
if ((mode & ~DESC_PARENT_MODE_WRITE) == DESC_PIPE) {
|
||||
/* mark the descriptor close-on-exec, so that it won't be inherited
|
||||
by potential other children */
|
||||
fcntl(parentend, F_SETFD, FD_CLOEXEC);
|
||||
return Object(NEWOBJ(PlainFile)(parentend, true));
|
||||
return Resource(NEWOBJ(PlainFile)(parentend, true));
|
||||
}
|
||||
|
||||
return Object();
|
||||
return Resource();
|
||||
}
|
||||
};
|
||||
|
||||
@@ -678,7 +678,7 @@ static bool pre_proc_open(CArrRef descriptorspec,
|
||||
|
||||
Variant descitem = iter.second();
|
||||
if (descitem.isResource()) {
|
||||
File *file = descitem.toObject().getTyped<File>();
|
||||
File *file = descitem.toResource().getTyped<File>();
|
||||
if (!item.readFile(file)) break;
|
||||
} else if (!descitem.is(KindOfArray)) {
|
||||
raise_warning("Descriptor must be either an array or a File-Handle");
|
||||
@@ -740,13 +740,13 @@ static Variant post_proc_open(CStrRef cmd, Variant &pipes,
|
||||
proc->child = child;
|
||||
proc->env = env;
|
||||
for (int i = 0; i < (int)items.size(); i++) {
|
||||
Object f = items[i].dupParent();
|
||||
Resource f = items[i].dupParent();
|
||||
if (!f.isNull()) {
|
||||
proc->pipes.append(f);
|
||||
}
|
||||
pipes.set(items[i].index, f);
|
||||
}
|
||||
return Object(proc);
|
||||
return Resource(proc);
|
||||
}
|
||||
|
||||
Variant f_proc_open(CStrRef cmd, CArrRef descriptorspec, VRefParam pipes,
|
||||
@@ -858,12 +858,12 @@ Variant f_proc_open(CStrRef cmd, CArrRef descriptorspec, VRefParam pipes,
|
||||
_exit(127);
|
||||
}
|
||||
|
||||
bool f_proc_terminate(CObjRef process, int signal /* = 0 */) {
|
||||
bool f_proc_terminate(CResRef process, int signal /* = 0 */) {
|
||||
ChildProcess *proc = process.getTyped<ChildProcess>();
|
||||
return kill(proc->child, signal <= 0 ? SIGTERM : signal) == 0;
|
||||
}
|
||||
|
||||
int64_t f_proc_close(CObjRef process) {
|
||||
int64_t f_proc_close(CResRef process) {
|
||||
return process.getTyped<ChildProcess>()->close();
|
||||
}
|
||||
|
||||
@@ -876,7 +876,7 @@ static const StaticString s_exitcode("exitcode");
|
||||
static const StaticString s_termsig("termsig");
|
||||
static const StaticString s_stopsig("stopsig");
|
||||
|
||||
Array f_proc_get_status(CObjRef process) {
|
||||
Array f_proc_get_status(CResRef process) {
|
||||
ChildProcess *proc = process.getTyped<ChildProcess>();
|
||||
|
||||
errno = 0;
|
||||
|
||||
@@ -63,9 +63,9 @@ String f_system(CStrRef command, VRefParam return_var = uninit_null());
|
||||
Variant f_proc_open(CStrRef cmd, CArrRef descriptorspec, VRefParam pipes,
|
||||
CStrRef cwd = null_string, CVarRef env = null_variant,
|
||||
CVarRef other_options = null_variant);
|
||||
bool f_proc_terminate(CObjRef process, int signal = 0);
|
||||
int64_t f_proc_close(CObjRef process);
|
||||
Array f_proc_get_status(CObjRef process);
|
||||
bool f_proc_terminate(CResRef process, int signal = 0);
|
||||
int64_t f_proc_close(CResRef process);
|
||||
Array f_proc_get_status(CResRef process);
|
||||
bool f_proc_nice(int increment);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
@@ -113,10 +113,10 @@ bool f_pagelet_server_is_enabled() {
|
||||
|
||||
static const StaticString s_Host("Host");
|
||||
|
||||
Object f_pagelet_server_task_start(CStrRef url,
|
||||
CArrRef headers /* = null_array */,
|
||||
CStrRef post_data /* = null_string */,
|
||||
CArrRef files /* = null_array */) {
|
||||
Resource f_pagelet_server_task_start(CStrRef url,
|
||||
CArrRef headers /* = null_array */,
|
||||
CStrRef post_data /* = null_string */,
|
||||
CArrRef files /* = null_array */) {
|
||||
String remote_host;
|
||||
Transport *transport = g_context->getTransport();
|
||||
if (transport) {
|
||||
@@ -130,11 +130,11 @@ Object f_pagelet_server_task_start(CStrRef url,
|
||||
return PageletServer::TaskStart(url, headers, remote_host, post_data);
|
||||
}
|
||||
|
||||
int64_t f_pagelet_server_task_status(CObjRef task) {
|
||||
int64_t f_pagelet_server_task_status(CResRef task) {
|
||||
return PageletServer::TaskStatus(task);
|
||||
}
|
||||
|
||||
String f_pagelet_server_task_result(CObjRef task, VRefParam headers,
|
||||
String f_pagelet_server_task_result(CResRef task, VRefParam headers,
|
||||
VRefParam code, int64_t timeout_ms /* = 0 */) {
|
||||
Array rheaders;
|
||||
int rcode;
|
||||
@@ -172,15 +172,15 @@ bool f_xbox_post_message(CStrRef msg, CStrRef host /* = "localhost" */) {
|
||||
return XboxServer::PostMessage(msg, host);
|
||||
}
|
||||
|
||||
Object f_xbox_task_start(CStrRef message) {
|
||||
Resource f_xbox_task_start(CStrRef message) {
|
||||
return XboxServer::TaskStart(message);
|
||||
}
|
||||
|
||||
bool f_xbox_task_status(CObjRef task) {
|
||||
bool f_xbox_task_status(CResRef task) {
|
||||
return XboxServer::TaskStatus(task);
|
||||
}
|
||||
|
||||
int64_t f_xbox_task_result(CObjRef task, int64_t timeout_ms, VRefParam ret) {
|
||||
int64_t f_xbox_task_result(CResRef task, int64_t timeout_ms, VRefParam ret) {
|
||||
return XboxServer::TaskResult(task, timeout_ms, ret);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,15 +40,15 @@ enum PageletStatusType {
|
||||
bool f_dangling_server_proxy_old_request();
|
||||
bool f_dangling_server_proxy_new_request(CStrRef host);
|
||||
bool f_pagelet_server_is_enabled();
|
||||
Object f_pagelet_server_task_start(CStrRef url, CArrRef headers = null_array, CStrRef post_data = null_string, CArrRef files = null_array);
|
||||
int64_t f_pagelet_server_task_status(CObjRef task);
|
||||
String f_pagelet_server_task_result(CObjRef task, VRefParam headers, VRefParam code, int64_t timeout_ms);
|
||||
Resource f_pagelet_server_task_start(CStrRef url, CArrRef headers = null_array, CStrRef post_data = null_string, CArrRef files = null_array);
|
||||
int64_t f_pagelet_server_task_status(CResRef task);
|
||||
String f_pagelet_server_task_result(CResRef task, VRefParam headers, VRefParam code, int64_t timeout_ms);
|
||||
void f_pagelet_server_flush();
|
||||
bool f_xbox_send_message(CStrRef msg, VRefParam ret, int64_t timeout_ms, CStrRef host = "localhost");
|
||||
bool f_xbox_post_message(CStrRef msg, CStrRef host = "localhost");
|
||||
Object f_xbox_task_start(CStrRef message);
|
||||
bool f_xbox_task_status(CObjRef task);
|
||||
int64_t f_xbox_task_result(CObjRef task, int64_t timeout_ms, VRefParam ret);
|
||||
Resource f_xbox_task_start(CStrRef message);
|
||||
bool f_xbox_task_status(CResRef task);
|
||||
int64_t f_xbox_task_result(CResRef task, int64_t timeout_ms, VRefParam ret);
|
||||
Variant f_xbox_process_call_message(CStrRef msg);
|
||||
int64_t f_xbox_get_thread_timeout();
|
||||
void f_xbox_set_thread_timeout(int timeout);
|
||||
|
||||
@@ -260,7 +260,7 @@ String SessionModule::create_sid() {
|
||||
Logger::Error("Invalid session hash function: %s", PS(hash_func).c_str());
|
||||
return String();
|
||||
}
|
||||
if (!f_hash_update(context.toObject(), buf.detach())) {
|
||||
if (!f_hash_update(context.toResource(), buf.detach())) {
|
||||
Logger::Error("hash_update() failed");
|
||||
return String();
|
||||
}
|
||||
@@ -275,7 +275,7 @@ String SessionModule::create_sid() {
|
||||
n = ::read(fd, rbuf, (to_read < (int)sizeof(rbuf) ?
|
||||
to_read : (int)sizeof(buf)));
|
||||
if (n <= 0) break;
|
||||
if (!f_hash_update(context.toObject(),
|
||||
if (!f_hash_update(context.toResource(),
|
||||
String((const char *)rbuf, n, AttachLiteral))) {
|
||||
Logger::Error("hash_update() failed");
|
||||
::close(fd);
|
||||
@@ -287,7 +287,7 @@ String SessionModule::create_sid() {
|
||||
}
|
||||
}
|
||||
|
||||
String hashed = f_hash_final(context.toObject());
|
||||
String hashed = f_hash_final(context.toResource());
|
||||
|
||||
if (PS(hash_bits_per_character) < 4 || PS(hash_bits_per_character) > 6) {
|
||||
PS(hash_bits_per_character) = 4;
|
||||
|
||||
@@ -129,7 +129,7 @@ static void add_property(Array &properties, xmlNodePtr node, Object value) {
|
||||
}
|
||||
}
|
||||
|
||||
static Object create_text(CObjRef doc, xmlNodePtr node,
|
||||
static Object create_text(CResRef doc, xmlNodePtr node,
|
||||
CStrRef value, CStrRef ns,
|
||||
bool is_prefix, bool free_text) {
|
||||
Object obj = create_object(doc.getTyped<XmlDocWrapper>()->
|
||||
@@ -144,10 +144,10 @@ static Object create_text(CObjRef doc, xmlNodePtr node,
|
||||
return obj;
|
||||
}
|
||||
|
||||
static Array create_children(CObjRef doc, xmlNodePtr root,
|
||||
static Array create_children(CResRef doc, xmlNodePtr root,
|
||||
CStrRef ns, bool is_prefix);
|
||||
|
||||
static Object create_element(CObjRef doc, xmlNodePtr node,
|
||||
static Object create_element(CResRef doc, xmlNodePtr node,
|
||||
CStrRef ns, bool is_prefix) {
|
||||
Object obj = create_object(doc.getTyped<XmlDocWrapper>()->
|
||||
getClass(), Array(), false);
|
||||
@@ -161,7 +161,7 @@ static Object create_element(CObjRef doc, xmlNodePtr node,
|
||||
return obj;
|
||||
}
|
||||
|
||||
static Array create_children(CObjRef doc, xmlNodePtr root,
|
||||
static Array create_children(CResRef doc, xmlNodePtr root,
|
||||
CStrRef ns, bool is_prefix) {
|
||||
Array properties = Array::Create();
|
||||
for (xmlNodePtr node = root->children; node; node = node->next) {
|
||||
@@ -260,7 +260,8 @@ Variant f_simplexml_import_dom(CObjRef node,
|
||||
}
|
||||
|
||||
if (nodep && nodep->type == XML_ELEMENT_NODE) {
|
||||
Object obj = Object(NEWOBJ(XmlDocWrapper)(nodep->doc, class_name, node));
|
||||
Resource obj =
|
||||
Resource(NEWOBJ(XmlDocWrapper)(nodep->doc, class_name, node));
|
||||
return create_element(obj, nodep, String(), false);
|
||||
} else {
|
||||
raise_warning("Invalid Nodetype to import");
|
||||
@@ -297,7 +298,7 @@ Variant f_simplexml_load_string(CStrRef data,
|
||||
return false;
|
||||
}
|
||||
|
||||
return create_element(Object(NEWOBJ(XmlDocWrapper)(doc, cls->nameRef())),
|
||||
return create_element(Resource(NEWOBJ(XmlDocWrapper)(doc, cls->nameRef())),
|
||||
root, ns, is_prefix);
|
||||
}
|
||||
|
||||
@@ -351,7 +352,7 @@ void c_SimpleXMLElement::t___construct(CStrRef data, int64_t options /* = 0 */,
|
||||
xmlDocPtr doc = xmlReadMemory(xml.data(), xml.size(), NULL, NULL, options);
|
||||
if (doc) {
|
||||
m_doc =
|
||||
Object(NEWOBJ(XmlDocWrapper)(doc, c_SimpleXMLElement::s_class_name));
|
||||
Resource(NEWOBJ(XmlDocWrapper)(doc, c_SimpleXMLElement::s_class_name));
|
||||
m_node = xmlDocGetRootElement(doc);
|
||||
if (m_node) {
|
||||
m_children = create_children(m_doc, m_node, ns, is_prefix);
|
||||
@@ -1274,7 +1275,7 @@ bool f_libxml_use_internal_errors(CVarRef use_errors /* = null_variant */) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
void f_libxml_set_streams_context(CObjRef streams_context) {
|
||||
void f_libxml_set_streams_context(CResRef streams_context) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
|
||||
@@ -33,7 +33,7 @@ Variant f_libxml_get_errors();
|
||||
Variant f_libxml_get_last_error();
|
||||
void f_libxml_clear_errors();
|
||||
bool f_libxml_use_internal_errors(CVarRef use_errors = null_variant);
|
||||
void f_libxml_set_streams_context(CObjRef streams_context);
|
||||
void f_libxml_set_streams_context(CResRef streams_context);
|
||||
bool f_libxml_disable_entity_loader(bool disable = true);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
@@ -78,7 +78,7 @@ class c_SimpleXMLElement :
|
||||
|
||||
|
||||
public:
|
||||
Object m_doc;
|
||||
Resource m_doc;
|
||||
xmlNodePtr m_node;
|
||||
Variant m_children;
|
||||
Variant m_attributes;
|
||||
|
||||
@@ -996,7 +996,7 @@ static sdlFunctionPtr deserialize_function_call
|
||||
}
|
||||
}
|
||||
h = NEWOBJ(soapHeader)();
|
||||
Object hobj(h);
|
||||
Resource hobj(h);
|
||||
h->function = find_function(sdl, hdr_func, h->function_name).get();
|
||||
h->mustUnderstand = mustUnderstand;
|
||||
h->hdr = NULL;
|
||||
@@ -1199,7 +1199,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function,
|
||||
encodePtr hdr_enc;
|
||||
int hdr_use = SOAP_LITERAL;
|
||||
Variant hdr_ret = obj->o_get("headerfault");
|
||||
soapHeader *h = headers[0].toObject().getTyped<soapHeader>();
|
||||
soapHeader *h = headers[0].toResource().getTyped<soapHeader>();
|
||||
const char *hdr_ns = h->hdr ? h->hdr->ns.c_str() : NULL;
|
||||
const char *hdr_name = h->function_name.data();
|
||||
|
||||
@@ -1403,7 +1403,7 @@ static xmlDocPtr serialize_response_call(sdlFunctionPtr function,
|
||||
if (!headers.empty()) {
|
||||
head = xmlNewChild(envelope, ns, BAD_CAST("Header"), NULL);
|
||||
for (ArrayIter iter(headers); iter; ++iter) {
|
||||
soapHeader *h = iter.second().toObject().getTyped<soapHeader>();
|
||||
soapHeader *h = iter.second().toResource().getTyped<soapHeader>();
|
||||
if (!h->retval.isNull()) {
|
||||
encodePtr hdr_enc;
|
||||
int hdr_use = SOAP_LITERAL;
|
||||
@@ -1768,7 +1768,7 @@ static void send_soap_server_fault(sdlFunctionPtr function, Variant fault,
|
||||
output_xml_header(SOAP_GLOBAL(soap_version));
|
||||
|
||||
Array headers;
|
||||
if (hdr) headers.append(Object(hdr));
|
||||
if (hdr) headers.append(Resource(hdr));
|
||||
xmlDocPtr doc_return = serialize_response_call
|
||||
(function, NULL, NULL, fault, headers, SOAP_GLOBAL(soap_version));
|
||||
|
||||
@@ -2162,7 +2162,7 @@ void c_SoapServer::t_handle(CStrRef request /* = null_string */) {
|
||||
|
||||
// 4. process soap headers
|
||||
for (ArrayIter iter(m_soap_headers); iter; ++iter) {
|
||||
soapHeader *h = iter.second().toObject().getTyped<soapHeader>();
|
||||
soapHeader *h = iter.second().toResource().getTyped<soapHeader>();
|
||||
if (m_sdl && !h->function && !h->hdr) {
|
||||
if (h->mustUnderstand) {
|
||||
throw_soap_server_fault("MustUnderstand","Header not understood");
|
||||
@@ -2287,7 +2287,7 @@ void c_SoapServer::t_fault(CVarRef code, CStrRef fault,
|
||||
void c_SoapServer::t_addsoapheader(CObjRef fault) {
|
||||
SoapServerScope ss(this);
|
||||
soapHeader *p = NEWOBJ(soapHeader)();
|
||||
Object obj(p);
|
||||
Resource obj(p);
|
||||
p->function = NULL;
|
||||
p->mustUnderstand = false;
|
||||
p->retval = fault;
|
||||
@@ -2351,8 +2351,8 @@ void c_SoapClient::t___construct(CVarRef wsdl,
|
||||
|
||||
if (options.exists(s_stream_context)) {
|
||||
StreamContext *sc = NULL;
|
||||
if (options[s_stream_context].isObject()) {
|
||||
sc = options[s_stream_context].toObject()
|
||||
if (options[s_stream_context].isResource()) {
|
||||
sc = options[s_stream_context].toResource()
|
||||
.getTyped<StreamContext>();
|
||||
}
|
||||
if (!sc) {
|
||||
|
||||
@@ -203,7 +203,7 @@ static void sock_array_to_fd_set(CArrRef sockets, pollfd *fds, int &nfds,
|
||||
short flag) {
|
||||
assert(fds);
|
||||
for (ArrayIter iter(sockets); iter; ++iter) {
|
||||
File *sock = iter.second().toObject().getTyped<File>();
|
||||
File *sock = iter.second().toResource().getTyped<File>();
|
||||
pollfd &fd = fds[nfds++];
|
||||
fd.fd = sock->fd();
|
||||
fd.events = flag;
|
||||
@@ -218,7 +218,7 @@ static void sock_array_from_fd_set(Variant &sockets, pollfd *fds, int &nfds,
|
||||
Array ret;
|
||||
for (ArrayIter iter(sock_array); iter; ++iter) {
|
||||
pollfd &fd = fds[nfds++];
|
||||
assert(fd.fd == iter.second().toObject().getTyped<File>()->fd());
|
||||
assert(fd.fd == iter.second().toResource().getTyped<File>()->fd());
|
||||
if (fd.revents & flag) {
|
||||
ret.append(iter.second());
|
||||
count++;
|
||||
@@ -281,7 +281,7 @@ static int php_read(Socket *sock, void *buf, int maxlen, int flags) {
|
||||
}
|
||||
|
||||
static bool create_new_socket(const char *&name, int port, Variant &errnum,
|
||||
Variant &errstr, Object &ret, Socket *&sock,
|
||||
Variant &errstr, Resource &ret, Socket *&sock,
|
||||
double timeout) {
|
||||
int domain = AF_INET;
|
||||
int type = SOCK_STREAM;
|
||||
@@ -296,7 +296,7 @@ static bool create_new_socket(const char *&name, int port, Variant &errnum,
|
||||
}
|
||||
|
||||
sock = new Socket(socket(domain, type, 0), domain, name, port, timeout);
|
||||
ret = Object(sock);
|
||||
ret = Resource(sock);
|
||||
if (!sock->valid()) {
|
||||
SOCKET_ERROR(sock, "unable to create socket", errno);
|
||||
errnum = sock->getError();
|
||||
@@ -317,7 +317,7 @@ Variant f_socket_create(int domain, int type, int protocol) {
|
||||
return false;
|
||||
}
|
||||
Socket *sock = new Socket(socketId, domain);
|
||||
Object ret(sock);
|
||||
Resource ret(sock);
|
||||
return ret;
|
||||
}
|
||||
|
||||
@@ -335,7 +335,7 @@ Variant f_socket_create_listen(int port, int backlog /* = 128 */) {
|
||||
|
||||
Socket *sock = new Socket(socket(PF_INET, SOCK_STREAM, 0), PF_INET,
|
||||
"0.0.0.0", port);
|
||||
Object ret(sock);
|
||||
Resource ret(sock);
|
||||
if (!sock->valid()) {
|
||||
SOCKET_ERROR(sock, "unable to create listening socket", errno);
|
||||
return false;
|
||||
@@ -365,8 +365,8 @@ bool f_socket_create_pair(int domain, int type, int protocol, VRefParam fd) {
|
||||
}
|
||||
|
||||
Array ret;
|
||||
ret.set(0, Object(new Socket(fds_array[0], domain)));
|
||||
ret.set(1, Object(new Socket(fds_array[1], domain)));
|
||||
ret.set(0, Resource(new Socket(fds_array[0], domain)));
|
||||
ret.set(1, Resource(new Socket(fds_array[1], domain)));
|
||||
fd = ret;
|
||||
return true;
|
||||
}
|
||||
@@ -376,7 +376,7 @@ static const StaticString s_l_linger("l_linger");
|
||||
static const StaticString s_sec("sec");
|
||||
static const StaticString s_usec("usec");
|
||||
|
||||
Variant f_socket_get_option(CObjRef socket, int level, int optname) {
|
||||
Variant f_socket_get_option(CResRef socket, int level, int optname) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
Array ret;
|
||||
socklen_t optlen;
|
||||
@@ -425,7 +425,7 @@ Variant f_socket_get_option(CObjRef socket, int level, int optname) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
bool f_socket_getpeername(CObjRef socket, VRefParam address,
|
||||
bool f_socket_getpeername(CResRef socket, VRefParam address,
|
||||
VRefParam port /* = null */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
|
||||
@@ -439,7 +439,7 @@ bool f_socket_getpeername(CObjRef socket, VRefParam address,
|
||||
return get_sockaddr(sa, address, port);
|
||||
}
|
||||
|
||||
bool f_socket_getsockname(CObjRef socket, VRefParam address,
|
||||
bool f_socket_getsockname(CResRef socket, VRefParam address,
|
||||
VRefParam port /* = null */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
|
||||
@@ -453,17 +453,17 @@ bool f_socket_getsockname(CObjRef socket, VRefParam address,
|
||||
return get_sockaddr(sa, address, port);
|
||||
}
|
||||
|
||||
bool f_socket_set_block(CObjRef socket) {
|
||||
bool f_socket_set_block(CResRef socket) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
return sock->setBlocking(true);
|
||||
}
|
||||
|
||||
bool f_socket_set_nonblock(CObjRef socket) {
|
||||
bool f_socket_set_nonblock(CResRef socket) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
return sock->setBlocking(false);
|
||||
}
|
||||
|
||||
bool f_socket_set_option(CObjRef socket, int level, int optname,
|
||||
bool f_socket_set_option(CResRef socket, int level, int optname,
|
||||
CVarRef optval) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
|
||||
@@ -532,7 +532,7 @@ bool f_socket_set_option(CObjRef socket, int level, int optname,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_socket_connect(CObjRef socket, CStrRef address, int port /* = 0 */) {
|
||||
bool f_socket_connect(CResRef socket, CStrRef address, int port /* = 0 */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
|
||||
switch (sock->getType()) {
|
||||
@@ -569,7 +569,7 @@ bool f_socket_connect(CObjRef socket, CStrRef address, int port /* = 0 */) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_socket_bind(CObjRef socket, CStrRef address, int port /* = 0 */) {
|
||||
bool f_socket_bind(CResRef socket, CStrRef address, int port /* = 0 */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
|
||||
const char *addr = address.data();
|
||||
@@ -593,7 +593,7 @@ bool f_socket_bind(CObjRef socket, CStrRef address, int port /* = 0 */) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_socket_listen(CObjRef socket, int backlog /* = 0 */) {
|
||||
bool f_socket_listen(CResRef socket, int backlog /* = 0 */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
if (listen(sock->fd(), backlog) != 0) {
|
||||
SOCKET_ERROR(sock, "unable to listen on socket", errno);
|
||||
@@ -662,7 +662,7 @@ Variant f_socket_select(VRefParam read, VRefParam write, VRefParam except,
|
||||
Variant f_socket_server(CStrRef hostname, int port /* = -1 */,
|
||||
VRefParam errnum /* = null */,
|
||||
VRefParam errstr /* = null */) {
|
||||
Object ret;
|
||||
Resource ret;
|
||||
Socket *sock = NULL;
|
||||
const char *name = hostname.data();
|
||||
if (!create_new_socket(name, port, errnum, errstr, ret, sock, 0.0)) {
|
||||
@@ -688,7 +688,7 @@ Variant f_socket_server(CStrRef hostname, int port /* = -1 */,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_socket_accept(CObjRef socket) {
|
||||
Variant f_socket_accept(CResRef socket) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
struct sockaddr sa;
|
||||
socklen_t salen = sizeof(sa);
|
||||
@@ -699,10 +699,10 @@ Variant f_socket_accept(CObjRef socket) {
|
||||
delete new_sock;
|
||||
return false;
|
||||
}
|
||||
return Object(new_sock);
|
||||
return Resource(new_sock);
|
||||
}
|
||||
|
||||
Variant f_socket_read(CObjRef socket, int length, int type /* = 0 */) {
|
||||
Variant f_socket_read(CResRef socket, int length, int type /* = 0 */) {
|
||||
if (length <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -733,7 +733,7 @@ Variant f_socket_read(CObjRef socket, int length, int type /* = 0 */) {
|
||||
return String(tmpbuf, retval, AttachString);
|
||||
}
|
||||
|
||||
Variant f_socket_write(CObjRef socket, CStrRef buffer, int length /* = 0 */) {
|
||||
Variant f_socket_write(CResRef socket, CStrRef buffer, int length /* = 0 */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
if (length == 0 || length > buffer.size()) {
|
||||
length = buffer.size();
|
||||
@@ -746,7 +746,7 @@ Variant f_socket_write(CObjRef socket, CStrRef buffer, int length /* = 0 */) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
Variant f_socket_send(CObjRef socket, CStrRef buf, int len, int flags) {
|
||||
Variant f_socket_send(CResRef socket, CStrRef buf, int len, int flags) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
if (len > buf.size()) {
|
||||
len = buf.size();
|
||||
@@ -759,7 +759,7 @@ Variant f_socket_send(CObjRef socket, CStrRef buf, int len, int flags) {
|
||||
return retval;
|
||||
}
|
||||
|
||||
Variant f_socket_sendto(CObjRef socket, CStrRef buf, int len, int flags,
|
||||
Variant f_socket_sendto(CResRef socket, CStrRef buf, int len, int flags,
|
||||
CStrRef addr, int port /* = 0 */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
if (len > buf.size()) {
|
||||
@@ -820,7 +820,7 @@ Variant f_socket_sendto(CObjRef socket, CStrRef buf, int len, int flags,
|
||||
return retval;
|
||||
}
|
||||
|
||||
Variant f_socket_recv(CObjRef socket, VRefParam buf, int len, int flags) {
|
||||
Variant f_socket_recv(CResRef socket, VRefParam buf, int len, int flags) {
|
||||
if (len <= 0) {
|
||||
return false;
|
||||
}
|
||||
@@ -847,7 +847,7 @@ static const StaticString
|
||||
s_2colons("::"),
|
||||
s_0_0_0_0("0.0.0.0");
|
||||
|
||||
Variant f_socket_recvfrom(CObjRef socket, VRefParam buf, int len, int flags,
|
||||
Variant f_socket_recvfrom(CResRef socket, VRefParam buf, int len, int flags,
|
||||
VRefParam name, VRefParam port /* = 0 */) {
|
||||
if (len <= 0) {
|
||||
return false;
|
||||
@@ -940,7 +940,7 @@ Variant f_socket_recvfrom(CObjRef socket, VRefParam buf, int len, int flags,
|
||||
return retval;
|
||||
}
|
||||
|
||||
bool f_socket_shutdown(CObjRef socket, int how /* = 0 */) {
|
||||
bool f_socket_shutdown(CResRef socket, int how /* = 0 */) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
if (shutdown(sock->fd(), how) != 0) {
|
||||
SOCKET_ERROR(sock, "unable to shutdown socket", errno);
|
||||
@@ -949,7 +949,7 @@ bool f_socket_shutdown(CObjRef socket, int how /* = 0 */) {
|
||||
return true;
|
||||
}
|
||||
|
||||
void f_socket_close(CObjRef socket) {
|
||||
void f_socket_close(CResRef socket) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
sock->close();
|
||||
}
|
||||
@@ -958,7 +958,7 @@ String f_socket_strerror(int errnum) {
|
||||
return String(Util::safe_strerror(errnum));
|
||||
}
|
||||
|
||||
int64_t f_socket_last_error(CObjRef socket /* = null_object */) {
|
||||
int64_t f_socket_last_error(CResRef socket /* = null_object */) {
|
||||
if (!socket.isNull()) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
return sock->getError();
|
||||
@@ -966,7 +966,7 @@ int64_t f_socket_last_error(CObjRef socket /* = null_object */) {
|
||||
return Socket::getLastError();
|
||||
}
|
||||
|
||||
void f_socket_clear_error(CObjRef socket /* = null_object */) {
|
||||
void f_socket_clear_error(CResRef socket /* = null_object */) {
|
||||
if (!socket.isNull()) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
sock->setError(0);
|
||||
@@ -988,7 +988,7 @@ static Variant sockopen_impl(CStrRef hostname, int port, Variant &errnum,
|
||||
dynamic_cast<Socket*>(g_persistentObjects->get("socket", key.c_str()));
|
||||
if (sock) {
|
||||
if (sock->getError() == 0 && sock->checkLiveness()) {
|
||||
return Object(sock);
|
||||
return Resource(sock);
|
||||
}
|
||||
|
||||
// socket had an error earlier, we need to remove it from persistent
|
||||
@@ -997,7 +997,7 @@ static Variant sockopen_impl(CStrRef hostname, int port, Variant &errnum,
|
||||
}
|
||||
}
|
||||
|
||||
Object ret;
|
||||
Resource ret;
|
||||
const char *name = hostname.data();
|
||||
Socket *sock = NULL;
|
||||
|
||||
|
||||
@@ -26,36 +26,36 @@ namespace HPHP {
|
||||
Variant f_socket_create(int domain, int type, int protocol);
|
||||
Variant f_socket_create_listen(int port, int backlog = 128);
|
||||
bool f_socket_create_pair(int domain, int type, int protocol, VRefParam fd);
|
||||
Variant f_socket_get_option(CObjRef socket, int level, int optname);
|
||||
bool f_socket_getpeername(CObjRef socket, VRefParam address,
|
||||
Variant f_socket_get_option(CResRef socket, int level, int optname);
|
||||
bool f_socket_getpeername(CResRef socket, VRefParam address,
|
||||
VRefParam port = uninit_null());
|
||||
bool f_socket_getsockname(CObjRef socket, VRefParam address,
|
||||
bool f_socket_getsockname(CResRef socket, VRefParam address,
|
||||
VRefParam port = uninit_null());
|
||||
bool f_socket_set_block(CObjRef socket);
|
||||
bool f_socket_set_nonblock(CObjRef socket);
|
||||
bool f_socket_set_option(CObjRef socket, int level, int optname,
|
||||
bool f_socket_set_block(CResRef socket);
|
||||
bool f_socket_set_nonblock(CResRef socket);
|
||||
bool f_socket_set_option(CResRef socket, int level, int optname,
|
||||
CVarRef optval);
|
||||
bool f_socket_connect(CObjRef socket, CStrRef address, int port = 0);
|
||||
bool f_socket_bind(CObjRef socket, CStrRef address, int port = 0);
|
||||
bool f_socket_listen(CObjRef socket, int backlog = 0);
|
||||
bool f_socket_connect(CResRef socket, CStrRef address, int port = 0);
|
||||
bool f_socket_bind(CResRef socket, CStrRef address, int port = 0);
|
||||
bool f_socket_listen(CResRef socket, int backlog = 0);
|
||||
Variant f_socket_select(VRefParam read, VRefParam write, VRefParam except,
|
||||
CVarRef vtv_sec, int tv_usec = 0);
|
||||
Variant f_socket_server(CStrRef hostname, int port = -1, VRefParam errnum = uninit_null(),
|
||||
VRefParam errstr = uninit_null());
|
||||
Variant f_socket_accept(CObjRef socket);
|
||||
Variant f_socket_read(CObjRef socket, int length, int type = 0);
|
||||
Variant f_socket_write(CObjRef socket, CStrRef buffer, int length = 0);
|
||||
Variant f_socket_send(CObjRef socket, CStrRef buf, int len, int flags);
|
||||
Variant f_socket_sendto(CObjRef socket, CStrRef buf, int len, int flags,
|
||||
Variant f_socket_accept(CResRef socket);
|
||||
Variant f_socket_read(CResRef socket, int length, int type = 0);
|
||||
Variant f_socket_write(CResRef socket, CStrRef buffer, int length = 0);
|
||||
Variant f_socket_send(CResRef socket, CStrRef buf, int len, int flags);
|
||||
Variant f_socket_sendto(CResRef socket, CStrRef buf, int len, int flags,
|
||||
CStrRef addr, int port = 0);
|
||||
Variant f_socket_recv(CObjRef socket, VRefParam buf, int len, int flags);
|
||||
Variant f_socket_recvfrom(CObjRef socket, VRefParam buf, int len, int flags,
|
||||
Variant f_socket_recv(CResRef socket, VRefParam buf, int len, int flags);
|
||||
Variant f_socket_recvfrom(CResRef socket, VRefParam buf, int len, int flags,
|
||||
VRefParam name, VRefParam port = 0);
|
||||
bool f_socket_shutdown(CObjRef socket, int how = 0);
|
||||
void f_socket_close(CObjRef socket);
|
||||
bool f_socket_shutdown(CResRef socket, int how = 0);
|
||||
void f_socket_close(CResRef socket);
|
||||
String f_socket_strerror(int errnum);
|
||||
int64_t f_socket_last_error(CObjRef socket = null_object);
|
||||
void f_socket_clear_error(CObjRef socket = null_object);
|
||||
int64_t f_socket_last_error(CResRef socket = null_resource);
|
||||
void f_socket_clear_error(CResRef socket = null_resource);
|
||||
Variant f_getaddrinfo(CStrRef host, CStrRef port, int family = 0,
|
||||
int socktype = 0, int protocol = 0, int flags = 0);
|
||||
|
||||
|
||||
@@ -548,7 +548,7 @@ Variant c_SQLite3Stmt::t_execute() {
|
||||
{
|
||||
String sblob;
|
||||
if (p.value.isResource()) {
|
||||
Variant blob = f_stream_get_contents(p.value.toObject());
|
||||
Variant blob = f_stream_get_contents(p.value.toResource());
|
||||
if (same(blob, false)) {
|
||||
raise_warning("Unable to read stream for parameter %d",
|
||||
p.index);
|
||||
|
||||
@@ -50,32 +50,32 @@ StaticString StreamContext::s_class_name("StreamContext");
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Object f_stream_context_create(CArrRef options /* = null_array */,
|
||||
CArrRef params /* = null_array */) {
|
||||
return Object(NEWOBJ(StreamContext)(options, params));
|
||||
Resource f_stream_context_create(CArrRef options /* = null_array */,
|
||||
CArrRef params /* = null_array */) {
|
||||
return Resource(NEWOBJ(StreamContext)(options, params));
|
||||
}
|
||||
|
||||
Object f_stream_context_get_default(CArrRef options /* = null_array */) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_stream_context_get_options(CObjRef stream_or_context) {
|
||||
Variant f_stream_context_get_options(CResRef stream_or_context) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_stream_context_set_option(CObjRef stream_or_context,
|
||||
bool f_stream_context_set_option(CResRef stream_or_context,
|
||||
CVarRef wrapper,
|
||||
CStrRef option /* = null_string */,
|
||||
CVarRef value /* = null_variant */) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
bool f_stream_context_set_param(CObjRef stream_or_context,
|
||||
bool f_stream_context_set_param(CResRef stream_or_context,
|
||||
CArrRef params) {
|
||||
throw NotImplementedException(__func__);
|
||||
}
|
||||
|
||||
Variant f_stream_copy_to_stream(CObjRef source, CObjRef dest,
|
||||
Variant f_stream_copy_to_stream(CResRef source, CResRef dest,
|
||||
int maxlength /* = -1 */,
|
||||
int offset /* = 0 */) {
|
||||
if (maxlength == 0) return 0;
|
||||
@@ -113,23 +113,23 @@ Variant f_stream_copy_to_stream(CObjRef source, CObjRef dest,
|
||||
return cbytes;
|
||||
}
|
||||
|
||||
bool f_stream_encoding(CObjRef stream, CStrRef encoding /* = null_string */) {
|
||||
bool f_stream_encoding(CResRef stream, CStrRef encoding /* = null_string */) {
|
||||
throw NotSupportedException(__func__, "stream filter is not supported");
|
||||
}
|
||||
|
||||
void f_stream_bucket_append(CObjRef brigade, CObjRef bucket) {
|
||||
void f_stream_bucket_append(CResRef brigade, CResRef bucket) {
|
||||
throw NotSupportedException(__func__, "stream bucket is not supported");
|
||||
}
|
||||
|
||||
void f_stream_bucket_prepend(CObjRef brigade, CObjRef bucket) {
|
||||
void f_stream_bucket_prepend(CResRef brigade, CResRef bucket) {
|
||||
throw NotSupportedException(__func__, "stream bucket is not supported");
|
||||
}
|
||||
|
||||
Object f_stream_bucket_make_writeable(CObjRef brigade) {
|
||||
Object f_stream_bucket_make_writeable(CResRef brigade) {
|
||||
throw NotSupportedException(__func__, "stream bucket is not supported");
|
||||
}
|
||||
|
||||
Object f_stream_bucket_new(CObjRef stream, CStrRef buffer) {
|
||||
Object f_stream_bucket_new(CResRef stream, CStrRef buffer) {
|
||||
throw NotSupportedException(__func__, "stream bucket is not supported");
|
||||
}
|
||||
|
||||
@@ -137,23 +137,23 @@ bool f_stream_filter_register(CStrRef filtername, CStrRef classname) {
|
||||
throw NotSupportedException(__func__, "stream filter is not supported");
|
||||
}
|
||||
|
||||
bool f_stream_filter_remove(CObjRef stream_filter) {
|
||||
bool f_stream_filter_remove(CResRef stream_filter) {
|
||||
throw NotSupportedException(__func__, "stream filter is not supported");
|
||||
}
|
||||
|
||||
Object f_stream_filter_append(CObjRef stream, CStrRef filtername,
|
||||
Object f_stream_filter_append(CResRef stream, CStrRef filtername,
|
||||
int read_write /* = 0 */,
|
||||
CVarRef params /* = null_variant */) {
|
||||
throw NotSupportedException(__func__, "stream filter is not supported");
|
||||
}
|
||||
|
||||
Object f_stream_filter_prepend(CObjRef stream, CStrRef filtername,
|
||||
Object f_stream_filter_prepend(CResRef stream, CStrRef filtername,
|
||||
int read_write /* = 0 */,
|
||||
CVarRef params /* = null_variant */) {
|
||||
throw NotSupportedException(__func__, "stream filter is not supported");
|
||||
}
|
||||
|
||||
Variant f_stream_get_contents(CObjRef handle, int maxlen /* = 0 */,
|
||||
Variant f_stream_get_contents(CResRef handle, int maxlen /* = 0 */,
|
||||
int offset /* = 0 */) {
|
||||
if (maxlen < 0) {
|
||||
throw_invalid_argument("maxlen: %d", maxlen);
|
||||
@@ -187,13 +187,13 @@ Array f_stream_get_filters() {
|
||||
throw NotSupportedException(__func__, "stream filter is not supported");
|
||||
}
|
||||
|
||||
Variant f_stream_get_line(CObjRef handle, int length /* = 0 */,
|
||||
Variant f_stream_get_line(CResRef handle, int length /* = 0 */,
|
||||
CStrRef ending /* = null_string */) {
|
||||
File *file = handle.getTyped<File>();
|
||||
return file->readRecord(ending, length);
|
||||
}
|
||||
|
||||
Variant f_stream_get_meta_data(CObjRef stream) {
|
||||
Variant f_stream_get_meta_data(CResRef stream) {
|
||||
File *f = stream.getTyped<File>(true, true);
|
||||
if (f) return f->getMetaData();
|
||||
return false;
|
||||
@@ -204,7 +204,7 @@ Array f_stream_get_transports() {
|
||||
}
|
||||
|
||||
String f_stream_resolve_include_path(CStrRef filename,
|
||||
CObjRef context /* = null_object */) {
|
||||
CResRef context /* = null_object */) {
|
||||
struct stat s;
|
||||
return Eval::resolveVmInclude(filename.get(), "", &s);
|
||||
}
|
||||
@@ -214,7 +214,7 @@ Variant f_stream_select(VRefParam read, VRefParam write, VRefParam except,
|
||||
return f_socket_select(ref(read), ref(write), ref(except), vtv_sec, tv_usec);
|
||||
}
|
||||
|
||||
bool f_stream_set_blocking(CObjRef stream, int mode) {
|
||||
bool f_stream_set_blocking(CResRef stream, int mode) {
|
||||
File *file = stream.getTyped<File>();
|
||||
int flags = fcntl(file->fd(), F_GETFL, 0);
|
||||
if (mode) {
|
||||
@@ -228,7 +228,7 @@ bool f_stream_set_blocking(CObjRef stream, int mode) {
|
||||
static const StaticString s_sec("sec");
|
||||
static const StaticString s_usec("usec");
|
||||
|
||||
bool f_stream_set_timeout(CObjRef stream, int seconds,
|
||||
bool f_stream_set_timeout(CResRef stream, int seconds,
|
||||
int microseconds /* = 0 */) {
|
||||
if (stream.getTyped<Socket>(false, true)) {
|
||||
return f_socket_set_option
|
||||
@@ -238,7 +238,7 @@ bool f_stream_set_timeout(CObjRef stream, int seconds,
|
||||
return false;
|
||||
}
|
||||
|
||||
int64_t f_stream_set_write_buffer(CObjRef stream, int buffer) {
|
||||
int64_t f_stream_set_write_buffer(CResRef stream, int buffer) {
|
||||
PlainFile *file = stream.getTyped<PlainFile>(false, true);
|
||||
if (file) {
|
||||
switch (buffer) {
|
||||
@@ -255,7 +255,7 @@ int64_t f_stream_set_write_buffer(CObjRef stream, int buffer) {
|
||||
return -1;
|
||||
}
|
||||
|
||||
int64_t f_set_file_buffer(CObjRef stream, int buffer) {
|
||||
int64_t f_set_file_buffer(CResRef stream, int buffer) {
|
||||
return f_stream_set_write_buffer(stream, buffer);
|
||||
}
|
||||
|
||||
@@ -323,7 +323,7 @@ static void parse_socket(CStrRef socket, String &protocol, String &host,
|
||||
parse_host(address, host, port);
|
||||
}
|
||||
|
||||
static Socket *socket_accept_impl(CObjRef socket, struct sockaddr *addr,
|
||||
static Socket *socket_accept_impl(CResRef socket, struct sockaddr *addr,
|
||||
socklen_t *addrlen) {
|
||||
Socket *sock = socket.getTyped<Socket>();
|
||||
Socket *new_sock = new Socket(accept(sock->fd(), addr, addrlen),
|
||||
@@ -389,7 +389,7 @@ static String get_sockaddr_name(struct sockaddr *sa, socklen_t sl) {
|
||||
return String();
|
||||
}
|
||||
|
||||
Variant f_stream_socket_accept(CObjRef server_socket,
|
||||
Variant f_stream_socket_accept(CResRef server_socket,
|
||||
double timeout /* = 0.0 */,
|
||||
VRefParam peername /* = null */) {
|
||||
Socket *sock = server_socket.getTyped<Socket>();
|
||||
@@ -406,7 +406,7 @@ Variant f_stream_socket_accept(CObjRef server_socket,
|
||||
socklen_t salen = sizeof(sa);
|
||||
Socket *new_sock = socket_accept_impl(server_socket, &sa, &salen);
|
||||
peername = get_sockaddr_name(&sa, salen);
|
||||
if (new_sock) return Object(new_sock);
|
||||
if (new_sock) return Resource(new_sock);
|
||||
} else if (n < 0) {
|
||||
sock->setError(errno);
|
||||
} else {
|
||||
@@ -419,7 +419,7 @@ Variant f_stream_socket_server(CStrRef local_socket,
|
||||
VRefParam errnum /* = null */,
|
||||
VRefParam errstr /* = null */,
|
||||
int flags /* = 0 */,
|
||||
CObjRef context /* = null_object */) {
|
||||
CResRef context /* = null_object */) {
|
||||
String protocol, host; int port;
|
||||
parse_socket(local_socket, protocol, host, port);
|
||||
return f_socket_server(protocol + "://" + host, port, errnum, errstr);
|
||||
@@ -430,19 +430,19 @@ Variant f_stream_socket_client(CStrRef remote_socket,
|
||||
VRefParam errstr /* = null */,
|
||||
double timeout /* = 0.0 */,
|
||||
int flags /* = 0 */,
|
||||
CObjRef context /* = null_object */) {
|
||||
CResRef context /* = null_object */) {
|
||||
String protocol, host; int port;
|
||||
parse_socket(remote_socket, protocol, host, port);
|
||||
return f_fsockopen(protocol + "://" + host, port, errnum, errstr, timeout);
|
||||
}
|
||||
|
||||
Variant f_stream_socket_enable_crypto(CObjRef stream, bool enable,
|
||||
Variant f_stream_socket_enable_crypto(CResRef stream, bool enable,
|
||||
int crypto_type /* = 0 */,
|
||||
CObjRef session_stream /* = null_object */) {
|
||||
CResRef session_stream /* = null_object */) {
|
||||
throw NotSupportedException(__func__, "no crypto support on sockets");
|
||||
}
|
||||
|
||||
Variant f_stream_socket_get_name(CObjRef handle, bool want_peer) {
|
||||
Variant f_stream_socket_get_name(CResRef handle, bool want_peer) {
|
||||
Variant address, port;
|
||||
bool ret;
|
||||
if (want_peer) {
|
||||
@@ -464,7 +464,7 @@ Variant f_stream_socket_pair(int domain, int type, int protocol) {
|
||||
return fd;
|
||||
}
|
||||
|
||||
Variant f_stream_socket_recvfrom(CObjRef socket, int length,
|
||||
Variant f_stream_socket_recvfrom(CResRef socket, int length,
|
||||
int flags /* = 0 */,
|
||||
CStrRef address /* = null_string */) {
|
||||
String host; int port;
|
||||
@@ -478,7 +478,7 @@ Variant f_stream_socket_recvfrom(CObjRef socket, int length,
|
||||
return false;
|
||||
}
|
||||
|
||||
Variant f_stream_socket_sendto(CObjRef socket, CStrRef data,
|
||||
Variant f_stream_socket_sendto(CResRef socket, CStrRef data,
|
||||
int flags /* = 0 */,
|
||||
CStrRef address /* = null_string */) {
|
||||
String host; int port;
|
||||
@@ -494,7 +494,7 @@ Variant f_stream_socket_sendto(CObjRef socket, CStrRef data,
|
||||
return f_socket_sendto(socket, data, data.size(), flags, host, port);
|
||||
}
|
||||
|
||||
bool f_stream_socket_shutdown(CObjRef stream, int how) {
|
||||
bool f_stream_socket_shutdown(CResRef stream, int how) {
|
||||
return f_socket_shutdown(stream, how);
|
||||
}
|
||||
|
||||
|
||||
@@ -40,57 +40,57 @@ public:
|
||||
Array m_params;
|
||||
};
|
||||
|
||||
Object f_stream_context_create(CArrRef options = null_array,
|
||||
CArrRef params = null_array);
|
||||
Resource f_stream_context_create(CArrRef options = null_array,
|
||||
CArrRef params = null_array);
|
||||
|
||||
Object f_stream_context_get_default(CArrRef options = null_array);
|
||||
|
||||
Variant f_stream_context_get_options(CObjRef stream_or_context);
|
||||
Variant f_stream_context_get_options(CResRef stream_or_context);
|
||||
|
||||
bool f_stream_context_set_option(CObjRef stream_or_context,
|
||||
bool f_stream_context_set_option(CResRef stream_or_context,
|
||||
CVarRef wrapper,
|
||||
CStrRef option = null_string,
|
||||
CVarRef value = null_variant);
|
||||
|
||||
bool f_stream_context_set_param(CObjRef stream_or_context,
|
||||
bool f_stream_context_set_param(CResRef stream_or_context,
|
||||
CArrRef params);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Variant f_stream_copy_to_stream(CObjRef source, CObjRef dest,
|
||||
Variant f_stream_copy_to_stream(CResRef source, CResRef dest,
|
||||
int maxlength = -1, int offset = 0);
|
||||
|
||||
bool f_stream_encoding(CObjRef stream, CStrRef encoding = null_string);
|
||||
bool f_stream_encoding(CResRef stream, CStrRef encoding = null_string);
|
||||
|
||||
void f_stream_bucket_append(CObjRef brigade, CObjRef bucket);
|
||||
void f_stream_bucket_append(CResRef brigade, CResRef bucket);
|
||||
|
||||
void f_stream_bucket_prepend(CObjRef brigade, CObjRef bucket);
|
||||
void f_stream_bucket_prepend(CResRef brigade, CResRef bucket);
|
||||
|
||||
Object f_stream_bucket_make_writeable(CObjRef brigade);
|
||||
Object f_stream_bucket_make_writeable(CResRef brigade);
|
||||
|
||||
Object f_stream_bucket_new(CObjRef stream, CStrRef buffer);
|
||||
Object f_stream_bucket_new(CResRef stream, CStrRef buffer);
|
||||
|
||||
bool f_stream_filter_register(CStrRef filtername, CStrRef classname);
|
||||
|
||||
bool f_stream_filter_remove(CObjRef stream_filter);
|
||||
bool f_stream_filter_remove(CResRef stream_filter);
|
||||
|
||||
Object f_stream_filter_append(CObjRef stream, CStrRef filtername,
|
||||
Object f_stream_filter_append(CResRef stream, CStrRef filtername,
|
||||
int read_write = 0,
|
||||
CVarRef params = null_variant);
|
||||
|
||||
Object f_stream_filter_prepend(CObjRef stream, CStrRef filtername,
|
||||
Object f_stream_filter_prepend(CResRef stream, CStrRef filtername,
|
||||
int read_write = 0,
|
||||
CVarRef params = null_variant);
|
||||
|
||||
Variant f_stream_get_contents(CObjRef handle, int maxlen = 0,
|
||||
Variant f_stream_get_contents(CResRef handle, int maxlen = 0,
|
||||
int offset = 0);
|
||||
|
||||
Array f_stream_get_filters();
|
||||
|
||||
Variant f_stream_get_line(CObjRef handle, int length = 0,
|
||||
Variant f_stream_get_line(CResRef handle, int length = 0,
|
||||
CStrRef ending = null_string);
|
||||
|
||||
Variant f_stream_get_meta_data(CObjRef stream);
|
||||
Variant f_stream_get_meta_data(CResRef stream);
|
||||
|
||||
Array f_stream_get_transports();
|
||||
|
||||
@@ -101,48 +101,48 @@ bool f_stream_wrapper_restore(CStrRef protocol);
|
||||
bool f_stream_wrapper_unregister(CStrRef protocol);
|
||||
|
||||
String f_stream_resolve_include_path(CStrRef filename,
|
||||
CObjRef context = null_object);
|
||||
CResRef context = null_resource);
|
||||
|
||||
Variant f_stream_select(VRefParam read, VRefParam write, VRefParam except,
|
||||
CVarRef vtv_sec, int tv_usec = 0);
|
||||
|
||||
bool f_stream_set_blocking(CObjRef stream, int mode);
|
||||
bool f_stream_set_blocking(CResRef stream, int mode);
|
||||
|
||||
bool f_stream_set_timeout(CObjRef stream, int seconds, int microseconds = 0);
|
||||
bool f_stream_set_timeout(CResRef stream, int seconds, int microseconds = 0);
|
||||
|
||||
int64_t f_stream_set_write_buffer(CObjRef stream, int buffer);
|
||||
int64_t f_stream_set_write_buffer(CResRef stream, int buffer);
|
||||
|
||||
int64_t f_set_file_buffer(CObjRef stream, int buffer);
|
||||
int64_t f_set_file_buffer(CResRef stream, int buffer);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// stream sockets: ext_socket has better implementation of socket functions
|
||||
|
||||
Variant f_stream_socket_accept(CObjRef server_socket, double timeout = 0.0,
|
||||
VRefParam peername = uninit_null());
|
||||
Variant f_stream_socket_accept(CResRef server_socket, double timeout = 0.0,
|
||||
VRefParam peername = uninit_null());
|
||||
|
||||
Variant f_stream_socket_server(CStrRef local_socket, VRefParam errnum = uninit_null(),
|
||||
VRefParam errstr = uninit_null(),
|
||||
int flags = 0, CObjRef context = null_object);
|
||||
int flags = 0, CResRef context = null_resource);
|
||||
|
||||
Variant f_stream_socket_client(CStrRef remote_socket, VRefParam errnum = uninit_null(),
|
||||
VRefParam errstr = uninit_null(), double timeout = 0.0,
|
||||
int flags = 0, CObjRef context = null_object);
|
||||
int flags = 0, CResRef context = null_resource);
|
||||
|
||||
Variant f_stream_socket_enable_crypto(CObjRef stream, bool enable,
|
||||
Variant f_stream_socket_enable_crypto(CResRef stream, bool enable,
|
||||
int crypto_type = 0,
|
||||
CObjRef session_stream = null_object);
|
||||
CResRef session_stream = null_resource);
|
||||
|
||||
Variant f_stream_socket_get_name(CObjRef handle, bool want_peer);
|
||||
Variant f_stream_socket_get_name(CResRef handle, bool want_peer);
|
||||
|
||||
Variant f_stream_socket_pair(int domain, int type, int protocol);
|
||||
|
||||
Variant f_stream_socket_recvfrom(CObjRef socket, int length, int flags = 0,
|
||||
Variant f_stream_socket_recvfrom(CResRef socket, int length, int flags = 0,
|
||||
CStrRef address = null_string);
|
||||
|
||||
Variant f_stream_socket_sendto(CObjRef socket, CStrRef data, int flags = 0,
|
||||
Variant f_stream_socket_sendto(CResRef socket, CStrRef data, int flags = 0,
|
||||
CStrRef address = null_string);
|
||||
|
||||
bool f_stream_socket_shutdown(CObjRef stream, int how);
|
||||
bool f_stream_socket_shutdown(CResRef stream, int how);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -46,10 +46,10 @@ String f_base64_encode(CStrRef data) {
|
||||
|
||||
Variant f_get_headers(CStrRef url, int format /* = 0 */) {
|
||||
Variant c = f_curl_init();
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_URL, url);
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_HEADER, 1);
|
||||
Variant res = f_curl_exec(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_URL, url);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_HEADER, 1);
|
||||
Variant res = f_curl_exec(c.toResource());
|
||||
if (same(res, false)) {
|
||||
return false;
|
||||
}
|
||||
|
||||
@@ -28,7 +28,7 @@ String f_gettype(CVarRef v) {
|
||||
return getDataTypeString(v.getType());
|
||||
}
|
||||
|
||||
String f_get_resource_type(CObjRef handle) {
|
||||
String f_get_resource_type(CResRef handle) {
|
||||
if (handle.isResource()) {
|
||||
return handle->o_getClassName();
|
||||
}
|
||||
|
||||
@@ -40,7 +40,7 @@ bool f_is_resource(CVarRef v);
|
||||
bool f_is_null(CVarRef v);
|
||||
|
||||
String f_gettype(CVarRef v);
|
||||
String f_get_resource_type(CObjRef handle);
|
||||
String f_get_resource_type(CResRef handle);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// type conversion
|
||||
|
||||
@@ -320,7 +320,7 @@ static Variant php_xml_parser_create_impl(CStrRef encoding_param,
|
||||
|
||||
XML_SetUserData(parser->parser, parser);
|
||||
|
||||
return Object(parser);
|
||||
return Resource(parser);
|
||||
}
|
||||
|
||||
static String _xml_string_zval(const char *str) {
|
||||
@@ -689,7 +689,7 @@ Object f_xml_parser_create_ns(CStrRef encoding /* = null_string */,
|
||||
return php_xml_parser_create_impl(encoding, separator, 1).toObject();
|
||||
}
|
||||
|
||||
bool f_xml_parser_free(CObjRef parser) {
|
||||
bool f_xml_parser_free(CResRef parser) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
if (p->isparsing == 1) {
|
||||
raise_warning("Parser cannot be freed while it is parsing.");
|
||||
@@ -698,7 +698,7 @@ bool f_xml_parser_free(CObjRef parser) {
|
||||
return true;
|
||||
}
|
||||
|
||||
int64_t f_xml_parse(CObjRef parser, CStrRef data, bool is_final /* = true */) {
|
||||
int64_t f_xml_parse(CResRef parser, CStrRef data, bool is_final /* = true */) {
|
||||
// XML_Parse can reenter the VM, and it will do so after we've lost
|
||||
// the frame pointer by calling through the system's copy of XML_Parse
|
||||
// in libexpat.so.
|
||||
@@ -713,7 +713,7 @@ int64_t f_xml_parse(CObjRef parser, CStrRef data, bool is_final /* = true */) {
|
||||
return ret;
|
||||
}
|
||||
|
||||
int64_t f_xml_parse_into_struct(CObjRef parser, CStrRef data, VRefParam values,
|
||||
int64_t f_xml_parse_into_struct(CResRef parser, CStrRef data, VRefParam values,
|
||||
VRefParam index /* = null */) {
|
||||
int ret;
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
@@ -736,7 +736,7 @@ int64_t f_xml_parse_into_struct(CObjRef parser, CStrRef data, VRefParam values,
|
||||
return ret;
|
||||
}
|
||||
|
||||
Variant f_xml_parser_get_option(CObjRef parser, int option) {
|
||||
Variant f_xml_parser_get_option(CResRef parser, int option) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
switch (option) {
|
||||
case PHP_XML_OPTION_CASE_FOLDING:
|
||||
@@ -750,7 +750,7 @@ Variant f_xml_parser_get_option(CObjRef parser, int option) {
|
||||
return false;
|
||||
}
|
||||
|
||||
bool f_xml_parser_set_option(CObjRef parser, int option, CVarRef value) {
|
||||
bool f_xml_parser_set_option(CResRef parser, int option, CVarRef value) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
switch (option) {
|
||||
case PHP_XML_OPTION_CASE_FOLDING:
|
||||
@@ -780,21 +780,21 @@ bool f_xml_parser_set_option(CObjRef parser, int option, CVarRef value) {
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_character_data_handler(CObjRef parser, CVarRef handler) {
|
||||
bool f_xml_set_character_data_handler(CResRef parser, CVarRef handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->characterDataHandler, handler);
|
||||
XML_SetCharacterDataHandler(p->parser, _xml_characterDataHandler);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_default_handler(CObjRef parser, CVarRef handler) {
|
||||
bool f_xml_set_default_handler(CResRef parser, CVarRef handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->defaultHandler, handler);
|
||||
XML_SetDefaultHandler(p->parser, _xml_defaultHandler);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_element_handler(CObjRef parser, CVarRef start_element_handler,
|
||||
bool f_xml_set_element_handler(CResRef parser, CVarRef start_element_handler,
|
||||
CVarRef end_element_handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->startElementHandler, start_element_handler);
|
||||
@@ -804,7 +804,7 @@ bool f_xml_set_element_handler(CObjRef parser, CVarRef start_element_handler,
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_processing_instruction_handler(CObjRef parser, CVarRef handler){
|
||||
bool f_xml_set_processing_instruction_handler(CResRef parser, CVarRef handler){
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->processingInstructionHandler, handler);
|
||||
XML_SetProcessingInstructionHandler(p->parser,
|
||||
@@ -812,63 +812,63 @@ bool f_xml_set_processing_instruction_handler(CObjRef parser, CVarRef handler){
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_start_namespace_decl_handler(CObjRef parser, CVarRef handler) {
|
||||
bool f_xml_set_start_namespace_decl_handler(CResRef parser, CVarRef handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->startNamespaceDeclHandler, handler);
|
||||
XML_SetStartNamespaceDeclHandler(p->parser, _xml_startNamespaceDeclHandler);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_end_namespace_decl_handler(CObjRef parser, CVarRef handler) {
|
||||
bool f_xml_set_end_namespace_decl_handler(CResRef parser, CVarRef handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->endNamespaceDeclHandler, handler);
|
||||
XML_SetEndNamespaceDeclHandler(p->parser, _xml_endNamespaceDeclHandler);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_unparsed_entity_decl_handler(CObjRef parser, CVarRef handler) {
|
||||
bool f_xml_set_unparsed_entity_decl_handler(CResRef parser, CVarRef handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->unparsedEntityDeclHandler, handler);
|
||||
XML_SetUnparsedEntityDeclHandler(p->parser, _xml_unparsedEntityDeclHandler);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_external_entity_ref_handler(CObjRef parser, CVarRef handler) {
|
||||
bool f_xml_set_external_entity_ref_handler(CResRef parser, CVarRef handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->externalEntityRefHandler, handler);
|
||||
XML_SetExternalEntityRefHandler(p->parser, _xml_externalEntityRefHandler);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_notation_decl_handler(CObjRef parser, CVarRef handler) {
|
||||
bool f_xml_set_notation_decl_handler(CResRef parser, CVarRef handler) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
xml_set_handler(&p->notationDeclHandler, handler);
|
||||
XML_SetNotationDeclHandler(p->parser, _xml_notationDeclHandler);
|
||||
return true;
|
||||
}
|
||||
|
||||
bool f_xml_set_object(CObjRef parser, VRefParam object) {
|
||||
bool f_xml_set_object(CResRef parser, VRefParam object) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
p->object.assignRef(object);
|
||||
return true;
|
||||
}
|
||||
|
||||
int64_t f_xml_get_current_byte_index(CObjRef parser) {
|
||||
int64_t f_xml_get_current_byte_index(CResRef parser) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
return XML_GetCurrentByteIndex(p->parser);
|
||||
}
|
||||
|
||||
int64_t f_xml_get_current_column_number(CObjRef parser) {
|
||||
int64_t f_xml_get_current_column_number(CResRef parser) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
return XML_GetCurrentColumnNumber(p->parser);
|
||||
}
|
||||
|
||||
int64_t f_xml_get_current_line_number(CObjRef parser) {
|
||||
int64_t f_xml_get_current_line_number(CResRef parser) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
return XML_GetCurrentLineNumber(p->parser);
|
||||
}
|
||||
|
||||
int64_t f_xml_get_error_code(CObjRef parser) {
|
||||
int64_t f_xml_get_error_code(CResRef parser) {
|
||||
XmlParser * p = parser.getTyped<XmlParser>();
|
||||
return XML_GetErrorCode(p->parser);
|
||||
}
|
||||
|
||||
@@ -26,26 +26,26 @@ namespace HPHP {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Object f_xml_parser_create(CStrRef encoding = null_string);
|
||||
bool f_xml_parser_free(CObjRef parser);
|
||||
int64_t f_xml_parse(CObjRef parser, CStrRef data, bool is_final = true);
|
||||
int64_t f_xml_parse_into_struct(CObjRef parser, CStrRef data, VRefParam values, VRefParam index = uninit_null());
|
||||
bool f_xml_parser_free(CResRef parser);
|
||||
int64_t f_xml_parse(CResRef parser, CStrRef data, bool is_final = true);
|
||||
int64_t f_xml_parse_into_struct(CResRef parser, CStrRef data, VRefParam values, VRefParam index = uninit_null());
|
||||
Object f_xml_parser_create_ns(CStrRef encoding = null_string, CStrRef separator = null_string);
|
||||
Variant f_xml_parser_get_option(CObjRef parser, int option);
|
||||
bool f_xml_parser_set_option(CObjRef parser, int option, CVarRef value);
|
||||
bool f_xml_set_character_data_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_default_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_element_handler(CObjRef parser, CVarRef start_element_handler, CVarRef end_element_handler);
|
||||
bool f_xml_set_processing_instruction_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_start_namespace_decl_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_end_namespace_decl_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_unparsed_entity_decl_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_external_entity_ref_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_notation_decl_handler(CObjRef parser, CVarRef handler);
|
||||
bool f_xml_set_object(CObjRef parser, VRefParam object);
|
||||
int64_t f_xml_get_current_byte_index(CObjRef parser);
|
||||
int64_t f_xml_get_current_column_number(CObjRef parser);
|
||||
int64_t f_xml_get_current_line_number(CObjRef parser);
|
||||
int64_t f_xml_get_error_code(CObjRef parser);
|
||||
Variant f_xml_parser_get_option(CResRef parser, int option);
|
||||
bool f_xml_parser_set_option(CResRef parser, int option, CVarRef value);
|
||||
bool f_xml_set_character_data_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_default_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_element_handler(CResRef parser, CVarRef start_element_handler, CVarRef end_element_handler);
|
||||
bool f_xml_set_processing_instruction_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_start_namespace_decl_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_end_namespace_decl_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_unparsed_entity_decl_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_external_entity_ref_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_notation_decl_handler(CResRef parser, CVarRef handler);
|
||||
bool f_xml_set_object(CResRef parser, VRefParam object);
|
||||
int64_t f_xml_get_current_byte_index(CResRef parser);
|
||||
int64_t f_xml_get_current_column_number(CResRef parser);
|
||||
int64_t f_xml_get_current_line_number(CResRef parser);
|
||||
int64_t f_xml_get_error_code(CResRef parser);
|
||||
String f_xml_error_string(int code);
|
||||
String f_utf8_decode(CStrRef data);
|
||||
String f_utf8_encode(CStrRef data);
|
||||
|
||||
@@ -102,7 +102,7 @@ class c_XMLReader : public ExtObjectDataFlags<ObjectData::UseGet>, public Sweepa
|
||||
private: bool set_relaxng_schema(String source, int type);
|
||||
|
||||
public:
|
||||
SmartObject<File> m_uri;
|
||||
SmartResource<File> m_uri;
|
||||
private:
|
||||
xmlTextReaderPtr m_ptr;
|
||||
xmlParserInputBufferPtr m_input;
|
||||
|
||||
@@ -315,7 +315,7 @@ bool c_XMLWriter::t_openuri(CStrRef uri) {
|
||||
if (same(file, false)) {
|
||||
return false;
|
||||
}
|
||||
m_uri = file.toObject().getTyped<File>();
|
||||
m_uri = file.toResource().getTyped<File>();
|
||||
|
||||
m_uri_output = xmlOutputBufferCreateIO(write_file, close_file, this, NULL);
|
||||
if (m_uri_output == NULL) {
|
||||
|
||||
@@ -129,7 +129,7 @@ class c_XMLWriter : public ExtObjectData, public Sweepable {
|
||||
|
||||
|
||||
public:
|
||||
SmartObject<File> m_uri;
|
||||
SmartResource<File> m_uri;
|
||||
private:
|
||||
xmlTextWriterPtr m_ptr;
|
||||
xmlBufferPtr m_output;
|
||||
|
||||
@@ -252,7 +252,7 @@ static Variant gzinflate(const char *data, int len, int limit /* = 0 */) {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
Variant f_readgzfile(CStrRef filename, bool use_include_path /* = false */) {
|
||||
Object stream = f_gzopen(filename, "rb", use_include_path);
|
||||
Resource stream = f_gzopen(filename, "rb", use_include_path);
|
||||
if (stream.isNull()) {
|
||||
return false;
|
||||
}
|
||||
@@ -260,7 +260,7 @@ Variant f_readgzfile(CStrRef filename, bool use_include_path /* = false */) {
|
||||
}
|
||||
|
||||
Variant f_gzfile(CStrRef filename, bool use_include_path /* = false */) {
|
||||
Object stream = f_gzopen(filename, "rb", use_include_path);
|
||||
Resource stream = f_gzopen(filename, "rb", use_include_path);
|
||||
if (stream.isNull()) {
|
||||
return false;
|
||||
}
|
||||
@@ -315,10 +315,10 @@ String f_zlib_get_coding_type() {
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// stream functions
|
||||
|
||||
Object f_gzopen(CStrRef filename, CStrRef mode,
|
||||
bool use_include_path /* = false */) {
|
||||
Resource f_gzopen(CStrRef filename, CStrRef mode,
|
||||
bool use_include_path /* = false */) {
|
||||
File *file = NEWOBJ(ZipFile)();
|
||||
Object handle(file);
|
||||
Resource handle(file);
|
||||
bool ret = file->open(File::TranslatePath(filename), mode);
|
||||
if (!ret) {
|
||||
raise_warning("%s",Util::safe_strerror(errno).c_str());
|
||||
@@ -327,41 +327,41 @@ Object f_gzopen(CStrRef filename, CStrRef mode,
|
||||
return handle;
|
||||
}
|
||||
|
||||
bool f_gzclose(CObjRef zp) {
|
||||
bool f_gzclose(CResRef zp) {
|
||||
return f_fclose(zp);
|
||||
}
|
||||
Variant f_gzread(CObjRef zp, int64_t length /* = 0 */) {
|
||||
Variant f_gzread(CResRef zp, int64_t length /* = 0 */) {
|
||||
return f_fread(zp, length);
|
||||
}
|
||||
Variant f_gzseek(CObjRef zp, int64_t offset, int64_t whence /* = k_SEEK_SET */) {
|
||||
Variant f_gzseek(CResRef zp, int64_t offset, int64_t whence /* = k_SEEK_SET */) {
|
||||
return f_fseek(zp, offset, whence);
|
||||
}
|
||||
Variant f_gztell(CObjRef zp) {
|
||||
Variant f_gztell(CResRef zp) {
|
||||
return f_ftell(zp);
|
||||
}
|
||||
bool f_gzeof(CObjRef zp) {
|
||||
bool f_gzeof(CResRef zp) {
|
||||
return f_feof(zp);
|
||||
}
|
||||
bool f_gzrewind(CObjRef zp) {
|
||||
bool f_gzrewind(CResRef zp) {
|
||||
return f_rewind(zp);
|
||||
}
|
||||
Variant f_gzgetc(CObjRef zp) {
|
||||
Variant f_gzgetc(CResRef zp) {
|
||||
return f_fgetc(zp);
|
||||
}
|
||||
Variant f_gzgets(CObjRef zp, int64_t length /* = 1024 */) {
|
||||
Variant f_gzgets(CResRef zp, int64_t length /* = 1024 */) {
|
||||
return f_fgets(zp, length);
|
||||
}
|
||||
Variant f_gzgetss(CObjRef zp, int64_t length /* = 0 */,
|
||||
Variant f_gzgetss(CResRef zp, int64_t length /* = 0 */,
|
||||
CStrRef allowable_tags /* = null_string */) {
|
||||
return f_fgetss(zp, length, allowable_tags);
|
||||
}
|
||||
Variant f_gzpassthru(CObjRef zp) {
|
||||
Variant f_gzpassthru(CResRef zp) {
|
||||
return f_fpassthru(zp);
|
||||
}
|
||||
Variant f_gzputs(CObjRef zp, CStrRef str, int64_t length /* = 0 */) {
|
||||
Variant f_gzputs(CResRef zp, CStrRef str, int64_t length /* = 0 */) {
|
||||
return f_fwrite(zp, str, length);
|
||||
}
|
||||
Variant f_gzwrite(CObjRef zp, CStrRef str, int64_t length /* = 0 */) {
|
||||
Variant f_gzwrite(CResRef zp, CStrRef str, int64_t length /* = 0 */) {
|
||||
return f_fwrite(zp, str, length);
|
||||
}
|
||||
|
||||
|
||||
@@ -48,21 +48,22 @@ Variant f_lz4uncompress(CStrRef compressed);
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
// stream functions
|
||||
|
||||
Object f_gzopen(CStrRef filename, CStrRef mode, bool use_include_path = false);
|
||||
Resource f_gzopen(CStrRef filename, CStrRef mode,
|
||||
bool use_include_path = false);
|
||||
|
||||
bool f_gzclose(CObjRef zp);
|
||||
Variant f_gzread(CObjRef zp, int64_t length = 0);
|
||||
Variant f_gzseek(CObjRef zp, int64_t offset, int64_t whence = k_SEEK_SET);
|
||||
Variant f_gztell(CObjRef zp);
|
||||
bool f_gzeof(CObjRef zp);
|
||||
bool f_gzrewind(CObjRef zp);
|
||||
Variant f_gzgetc(CObjRef zp);
|
||||
Variant f_gzgets(CObjRef zp, int64_t length = 1024);
|
||||
Variant f_gzgetss(CObjRef zp, int64_t length = 0,
|
||||
bool f_gzclose(CResRef zp);
|
||||
Variant f_gzread(CResRef zp, int64_t length = 0);
|
||||
Variant f_gzseek(CResRef zp, int64_t offset, int64_t whence = k_SEEK_SET);
|
||||
Variant f_gztell(CResRef zp);
|
||||
bool f_gzeof(CResRef zp);
|
||||
bool f_gzrewind(CResRef zp);
|
||||
Variant f_gzgetc(CResRef zp);
|
||||
Variant f_gzgets(CResRef zp, int64_t length = 1024);
|
||||
Variant f_gzgetss(CResRef zp, int64_t length = 0,
|
||||
CStrRef allowable_tags = null_string);
|
||||
Variant f_gzpassthru(CObjRef zp);
|
||||
Variant f_gzputs(CObjRef zp, CStrRef str, int64_t length = 0);
|
||||
Variant f_gzwrite(CObjRef zp, CStrRef str, int64_t length = 0);
|
||||
Variant f_gzpassthru(CResRef zp);
|
||||
Variant f_gzputs(CResRef zp, CStrRef str, int64_t length = 0);
|
||||
Variant f_gzwrite(CResRef zp, CStrRef str, int64_t length = 0);
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
}
|
||||
|
||||
@@ -330,7 +330,7 @@ bool MimePart::enumeratePartsImpl(Enumerator *top, Enumerator **child,
|
||||
|
||||
for (ArrayIter iter(m_children); iter; ++iter) {
|
||||
if (next.id) {
|
||||
MimePart *childpart = iter.second().toObject().getTyped<MimePart>();
|
||||
MimePart *childpart = iter.second().toResource().getTyped<MimePart>();
|
||||
if (!childpart->enumeratePartsImpl(top, &next.next, callback, ptr)) {
|
||||
return false;
|
||||
}
|
||||
@@ -411,7 +411,7 @@ bool MimePart::findPart(Enumerator *id, void *ptr) {
|
||||
return true;
|
||||
}
|
||||
|
||||
Object MimePart::findByName(const char *name) {
|
||||
Resource MimePart::findByName(const char *name) {
|
||||
struct find_part_struct find;
|
||||
find.searchfor = name;
|
||||
find.foundpart = NULL;
|
||||
@@ -623,7 +623,7 @@ MimePart *MimePart::createChild(int startpos, bool inherit) {
|
||||
m_parsedata.lastpart = child;
|
||||
child->m_parent = this;
|
||||
|
||||
m_children.append(Object(child));
|
||||
m_children.append(Resource(child));
|
||||
child->m_startpos = child->m_endpos = child->m_bodystart =
|
||||
child->m_bodyend = startpos;
|
||||
|
||||
@@ -905,21 +905,21 @@ void MimePart::UpdatePositions(MimePart *part, int newendpos,
|
||||
Variant MimePart::extract(CVarRef filename, CVarRef callbackfunc, int decode,
|
||||
bool isfile) {
|
||||
/* filename can be a filename or a stream */
|
||||
Object file;
|
||||
Resource file;
|
||||
File *f = NULL;
|
||||
if (filename.isResource()) {
|
||||
f = filename.toObject().getTyped<File>();
|
||||
f = filename.toResource().getTyped<File>();
|
||||
} else if (isfile) {
|
||||
Variant stream = File::Open(filename.toString(), "rb");
|
||||
if (!same(stream, false)) {
|
||||
file = stream.toObject();
|
||||
file = stream.toResource();
|
||||
f = file.getTyped<File>();
|
||||
}
|
||||
} else {
|
||||
/* filename is the actual data */
|
||||
String data = filename.toString();
|
||||
f = NEWOBJ(MemFile)(data.data(), data.size());
|
||||
file = Object(f);
|
||||
file = Resource(f);
|
||||
}
|
||||
|
||||
if (f == NULL) {
|
||||
@@ -944,7 +944,7 @@ Variant MimePart::extract(CVarRef filename, CVarRef callbackfunc, int decode,
|
||||
return m_extract_context;
|
||||
}
|
||||
if (callbackfunc.isResource()) {
|
||||
return f_stream_get_contents(callbackfunc.toObject());
|
||||
return f_stream_get_contents(callbackfunc.toResource());
|
||||
}
|
||||
return true;
|
||||
}
|
||||
@@ -990,7 +990,7 @@ void MimePart::outputToStdout(CStrRef s) {
|
||||
}
|
||||
|
||||
void MimePart::outputToFile(CStrRef s) {
|
||||
m_extract_context.toObject().getTyped<File>()->write(s);
|
||||
m_extract_context.toResource().getTyped<File>()->write(s);
|
||||
}
|
||||
|
||||
void MimePart::outputToString(CStrRef s) {
|
||||
|
||||
@@ -55,7 +55,7 @@ public:
|
||||
bool isfile);
|
||||
Variant getPartData();
|
||||
Array getStructure();
|
||||
Object findByName(const char *name);
|
||||
Resource findByName(const char *name);
|
||||
|
||||
bool isVersion1();
|
||||
int filter(int c);
|
||||
@@ -65,7 +65,7 @@ private:
|
||||
public:
|
||||
MimeHeader();
|
||||
explicit MimeHeader(const char *value);
|
||||
MimeHeader(php_rfc822_tokenized_t *toks);
|
||||
explicit MimeHeader(php_rfc822_tokenized_t *toks);
|
||||
|
||||
bool empty() const { return m_empty;}
|
||||
void clear();
|
||||
@@ -86,7 +86,7 @@ private:
|
||||
static void UpdatePositions(MimePart *part, int newendpos,
|
||||
int newbodyend, int deltanlines);
|
||||
|
||||
Object m_parent;
|
||||
Resource m_parent;
|
||||
Array m_children; /* child parts */
|
||||
|
||||
int m_startpos, m_endpos; /* offsets of this part in the message */
|
||||
@@ -119,7 +119,7 @@ private:
|
||||
|
||||
String workbuf;
|
||||
String headerbuf;
|
||||
Object lastpart;
|
||||
Resource lastpart;
|
||||
} m_parsedata;
|
||||
|
||||
int extractImpl(int decode, File *src);
|
||||
|
||||
@@ -232,7 +232,7 @@ private:
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
class PDOStatement;
|
||||
typedef SmartObject<PDOStatement> sp_PDOStatement;
|
||||
typedef SmartResource<PDOStatement> sp_PDOStatement;
|
||||
|
||||
/* represents a connection to a database */
|
||||
class PDOConnection : public ResourceData {
|
||||
@@ -383,7 +383,7 @@ public:
|
||||
/* defaults for fetches */
|
||||
PDOFetchType default_fetch_type;
|
||||
};
|
||||
typedef SmartObject<PDOConnection> sp_PDOConnection;
|
||||
typedef SmartResource<PDOConnection> sp_PDOConnection;
|
||||
|
||||
///////////////////////////////////////////////////////////////////////////////
|
||||
|
||||
|
||||
@@ -987,17 +987,17 @@ bool PDOMySqlStatement::describer(int colno) {
|
||||
|
||||
if (columns.empty()) {
|
||||
for (int i = 0; i < column_count; i++) {
|
||||
columns.set(i, Object(new PDOColumn()));
|
||||
columns.set(i, Resource(new PDOColumn()));
|
||||
}
|
||||
}
|
||||
|
||||
// fetch all on demand, this seems easiest if we've been here before bail out
|
||||
PDOColumn *col = columns[0].toObject().getTyped<PDOColumn>();
|
||||
PDOColumn *col = columns[0].toResource().getTyped<PDOColumn>();
|
||||
if (!col->name.empty()) {
|
||||
return true;
|
||||
}
|
||||
for (int i = 0; i < column_count; i++) {
|
||||
col = columns[i].toObject().getTyped<PDOColumn>();
|
||||
col = columns[i].toResource().getTyped<PDOColumn>();
|
||||
|
||||
if (m_conn->fetch_table_names()) {
|
||||
col->name = String(m_fields[i].table) + "." +
|
||||
@@ -1096,7 +1096,7 @@ bool PDOMySqlStatement::paramHook(PDOBoundParam *param,
|
||||
return false;
|
||||
case PDO_PARAM_LOB:
|
||||
if (param->parameter.isResource()) {
|
||||
Variant buf = f_stream_get_contents(param->parameter.toObject());
|
||||
Variant buf = f_stream_get_contents(param->parameter.toResource());
|
||||
if (!same(buf, false)) {
|
||||
param->parameter = buf;
|
||||
} else {
|
||||
|
||||
@@ -401,11 +401,11 @@ bool PDOSqliteStatement::describer(int colno) {
|
||||
|
||||
if (columns.empty()) {
|
||||
for (int i = 0; i < column_count; i++) {
|
||||
columns.set(i, Object(new PDOColumn()));
|
||||
columns.set(i, Resource(new PDOColumn()));
|
||||
}
|
||||
}
|
||||
|
||||
PDOColumn *col = columns[colno].toObject().getTyped<PDOColumn>();
|
||||
PDOColumn *col = columns[colno].toResource().getTyped<PDOColumn>();
|
||||
col->name = String(sqlite3_column_name(m_stmt, colno), CopyString);
|
||||
col->maxlen = 0xffffffff;
|
||||
col->precision = 0;
|
||||
@@ -499,7 +499,7 @@ bool PDOSqliteStatement::paramHook(PDOBoundParam *param,
|
||||
|
||||
case PDO_PARAM_LOB:
|
||||
if (param->parameter.isResource()) {
|
||||
Variant buf = f_stream_get_contents(param->parameter.toObject());
|
||||
Variant buf = f_stream_get_contents(param->parameter.toResource());
|
||||
if (!same(buf, false)) {
|
||||
param->parameter = buf;
|
||||
} else {
|
||||
|
||||
@@ -81,7 +81,7 @@ xmlDocPtr soap_xmlParseFile(const char *filename) {
|
||||
Variant stream = File::Open(filename, "rb", 0, f_stream_context_create(
|
||||
CREATE_MAP1(s_http, CREATE_MAP1(s_timeout, 1000))));
|
||||
if (!same(stream, false)) {
|
||||
content = f_stream_get_contents(stream.toObject());
|
||||
content = f_stream_get_contents(stream.toResource());
|
||||
if (!same(content, false)) {
|
||||
f_apc_store(cache_key, content);
|
||||
}
|
||||
|
||||
@@ -364,6 +364,7 @@ class Class : public AtomicCountable {
|
||||
public:
|
||||
friend class ExecutionContext;
|
||||
friend class ObjectData;
|
||||
friend class ResourceData;
|
||||
friend class Unit;
|
||||
|
||||
enum class Avail {
|
||||
|
||||
@@ -626,7 +626,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "handle",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "The object created by calling evhttp_async_get() or evhttp_async_post()."
|
||||
}
|
||||
]
|
||||
@@ -634,4 +634,4 @@
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -47,7 +47,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -117,7 +117,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -146,7 +146,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -174,7 +174,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
}
|
||||
]
|
||||
@@ -192,7 +192,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -226,7 +226,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -250,7 +250,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -273,7 +273,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -302,7 +302,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -338,7 +338,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
}
|
||||
]
|
||||
@@ -356,7 +356,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -385,7 +385,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -419,7 +419,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -447,7 +447,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -476,7 +476,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -499,7 +499,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -522,7 +522,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -545,7 +545,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -568,7 +568,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -596,7 +596,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -623,7 +623,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -662,7 +662,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -702,7 +702,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
}
|
||||
]
|
||||
@@ -733,7 +733,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -761,7 +761,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -789,7 +789,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -822,7 +822,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -850,7 +850,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -901,7 +901,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -935,7 +935,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1020,7 +1020,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
}
|
||||
]
|
||||
@@ -1056,7 +1056,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1079,7 +1079,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
}
|
||||
]
|
||||
@@ -1097,7 +1097,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
}
|
||||
]
|
||||
@@ -1155,7 +1155,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
}
|
||||
]
|
||||
@@ -1191,7 +1191,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1219,7 +1219,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1329,7 +1329,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1369,7 +1369,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1402,7 +1402,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1436,7 +1436,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1464,7 +1464,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1497,7 +1497,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1531,7 +1531,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1575,7 +1575,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1604,7 +1604,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1627,7 +1627,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1674,7 +1674,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1697,7 +1697,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1725,7 +1725,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "imap_stream",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "An IMAP stream returned by imap_open()."
|
||||
},
|
||||
{
|
||||
@@ -1792,4 +1792,4 @@
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -8377,4 +8377,4 @@
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -580,7 +580,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "Resource holding the key."
|
||||
}
|
||||
]
|
||||
@@ -598,7 +598,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": "Object"
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -615,7 +615,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "key",
|
||||
"type": "Object",
|
||||
"type": "Resource",
|
||||
"desc": "Resource holding the key."
|
||||
}
|
||||
]
|
||||
@@ -1073,7 +1073,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "x509cert",
|
||||
"type": "Object"
|
||||
"type": "Resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -1310,4 +1310,4 @@
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -705,7 +705,7 @@
|
||||
{
|
||||
"name": "socket",
|
||||
"type": "Resource",
|
||||
"value": "null_object",
|
||||
"value": "null_resource",
|
||||
"desc": "A valid socket resource created with socket_create()."
|
||||
}
|
||||
]
|
||||
@@ -724,7 +724,7 @@
|
||||
{
|
||||
"name": "socket",
|
||||
"type": "Resource",
|
||||
"value": "null_object",
|
||||
"value": "null_resource",
|
||||
"desc": "A valid socket resource created with socket_create()."
|
||||
}
|
||||
]
|
||||
@@ -771,4 +771,4 @@
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -562,7 +562,7 @@
|
||||
{
|
||||
"name": "context",
|
||||
"type": "Resource",
|
||||
"value": "null_object",
|
||||
"value": "null_resource",
|
||||
"desc": "A valid context resource created with stream_context_create()."
|
||||
}
|
||||
]
|
||||
@@ -773,7 +773,7 @@
|
||||
{
|
||||
"name": "context",
|
||||
"type": "Resource",
|
||||
"value": "null_object"
|
||||
"value": "null_resource"
|
||||
}
|
||||
]
|
||||
},
|
||||
@@ -822,7 +822,7 @@
|
||||
{
|
||||
"name": "context",
|
||||
"type": "Resource",
|
||||
"value": "null_object",
|
||||
"value": "null_resource",
|
||||
"desc": "A valid context resource created with stream_context_create()."
|
||||
}
|
||||
]
|
||||
@@ -856,7 +856,7 @@
|
||||
{
|
||||
"name": "session_stream",
|
||||
"type": "Resource",
|
||||
"value": "null_object",
|
||||
"value": "null_resource",
|
||||
"desc": "Seed the stream with settings from session_stream."
|
||||
}
|
||||
]
|
||||
@@ -1008,4 +1008,4 @@
|
||||
],
|
||||
"classes": [
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -23,7 +23,7 @@
|
||||
"HasDocComment"
|
||||
],
|
||||
"return": {
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Object oriented style: Returns TRUE on success or FALSE on failure.\n\nProcedural style: Returns a new xmlwriter resource for later use with the xmlwriter functions on success, FALSE on error."
|
||||
},
|
||||
"args": [
|
||||
@@ -47,7 +47,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -70,7 +70,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -93,7 +93,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -129,7 +129,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -152,7 +152,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -185,7 +185,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -224,7 +224,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -253,7 +253,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -271,7 +271,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -289,7 +289,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -322,7 +322,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -345,7 +345,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -383,7 +383,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -411,7 +411,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -429,7 +429,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -447,7 +447,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -470,7 +470,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -488,7 +488,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -506,7 +506,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -529,7 +529,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -547,7 +547,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -565,7 +565,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -588,7 +588,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -616,7 +616,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -634,7 +634,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -657,7 +657,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -680,7 +680,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -715,7 +715,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -756,7 +756,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -779,7 +779,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -807,7 +807,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -825,7 +825,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -848,7 +848,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -876,7 +876,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -894,7 +894,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -921,7 +921,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -969,7 +969,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -987,7 +987,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
}
|
||||
]
|
||||
@@ -1005,7 +1005,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -1029,7 +1029,7 @@
|
||||
"args": [
|
||||
{
|
||||
"name": "xmlwriter",
|
||||
"type": "Resource",
|
||||
"type": "Object",
|
||||
"desc": "Only for procedural calls. The XMLWriter resource that is being modified. This resource comes from a call to xmlwriter_open_uri() or xmlwriter_open_memory()."
|
||||
},
|
||||
{
|
||||
@@ -1771,4 +1771,4 @@
|
||||
]
|
||||
}
|
||||
]
|
||||
}
|
||||
}
|
||||
|
||||
@@ -616,7 +616,7 @@ bool TestCppBase::TestObject() {
|
||||
auto os = f_serialize(o);
|
||||
VS(os, "O:1:\"B\":1:{s:3:\"obj\";O:1:\"A\":1:{s:1:\"a\";i:10;}}");
|
||||
}
|
||||
VERIFY(!equal(Object(new TestResource()), Object(new TestResource()) ));
|
||||
VERIFY(!equal(Resource(new TestResource()), Resource(new TestResource()) ));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
|
||||
@@ -94,10 +94,10 @@ bool TestDebugger::getResponse(const string& path, string& result,
|
||||
server += "/" + path;
|
||||
printf("\n Getting URL '%s'...\n", server.get()->data());
|
||||
Variant c = f_curl_init();
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_URL, server);
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c.toObject(), CURLOPT_TIMEOUT, 120);
|
||||
Variant res = f_curl_exec(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_URL, server);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c.toResource(), CURLOPT_TIMEOUT, 120);
|
||||
Variant res = f_curl_exec(c.toResource());
|
||||
if (same(res, false)) {
|
||||
printf(" Request failed\n");
|
||||
return false;
|
||||
|
||||
@@ -116,18 +116,18 @@ bool TestExtCurl::RunTests(const std::string &which) {
|
||||
|
||||
bool TestExtCurl::test_curl_init() {
|
||||
Variant c = f_curl_init();
|
||||
VS(f_curl_errno(c.toObject()), 0);
|
||||
VS(f_curl_error(c.toObject()), "");
|
||||
VS(f_curl_errno(c.toResource()), 0);
|
||||
VS(f_curl_error(c.toResource()), "");
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_copy_handle() {
|
||||
Variant c = f_curl_init();
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_URL, String(get_request_uri()));
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant cpy = f_curl_copy_handle(c.toObject());
|
||||
f_curl_close(c.toObject()); // to test cpy is still working fine
|
||||
Variant res = f_curl_exec(cpy.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_URL, String(get_request_uri()));
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant cpy = f_curl_copy_handle(c.toResource());
|
||||
f_curl_close(c.toResource()); // to test cpy is still working fine
|
||||
Variant res = f_curl_exec(cpy.toResource());
|
||||
if (res.toString() != "OK") {
|
||||
// XXX: t1782098
|
||||
return CountSkip();
|
||||
@@ -151,9 +151,9 @@ bool TestExtCurl::test_curl_version() {
|
||||
|
||||
bool TestExtCurl::test_curl_setopt() {
|
||||
Variant c = f_curl_init();
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_URL, String(get_request_uri()));
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant res = f_curl_exec(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_URL, String(get_request_uri()));
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant res = f_curl_exec(c.toResource());
|
||||
VS(res, "OK");
|
||||
return Count(true);
|
||||
}
|
||||
@@ -161,10 +161,10 @@ bool TestExtCurl::test_curl_setopt() {
|
||||
bool TestExtCurl::test_curl_setopt_array() {
|
||||
Variant c = f_curl_init();
|
||||
f_curl_setopt_array
|
||||
(c.toObject(),
|
||||
(c.toResource(),
|
||||
CREATE_MAP2(k_CURLOPT_URL, String(get_request_uri()),
|
||||
k_CURLOPT_RETURNTRANSFER, true));
|
||||
Variant res = f_curl_exec(c.toObject());
|
||||
Variant res = f_curl_exec(c.toResource());
|
||||
VS(res, "OK");
|
||||
return Count(true);
|
||||
}
|
||||
@@ -172,15 +172,15 @@ bool TestExtCurl::test_curl_setopt_array() {
|
||||
bool TestExtCurl::test_curl_exec() {
|
||||
{
|
||||
Variant c = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant res = f_curl_exec(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant res = f_curl_exec(c.toResource());
|
||||
VS(res, "OK");
|
||||
}
|
||||
{
|
||||
Variant c = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_WRITEFUNCTION, "curl_write_func");
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_WRITEFUNCTION, "curl_write_func");
|
||||
f_ob_start();
|
||||
f_curl_exec(c.toObject());
|
||||
f_curl_exec(c.toResource());
|
||||
String res = f_ob_get_contents();
|
||||
VS(res, "curl_write_func called with OK");
|
||||
f_ob_end_clean();
|
||||
@@ -190,29 +190,29 @@ bool TestExtCurl::test_curl_exec() {
|
||||
|
||||
bool TestExtCurl::test_curl_getinfo() {
|
||||
Variant c = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toObject());
|
||||
Variant ret = f_curl_getinfo(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toResource());
|
||||
Variant ret = f_curl_getinfo(c.toResource());
|
||||
VS(ret[s_url], String(get_request_uri()));
|
||||
ret = f_curl_getinfo(c.toObject(), k_CURLINFO_EFFECTIVE_URL);
|
||||
ret = f_curl_getinfo(c.toResource(), k_CURLINFO_EFFECTIVE_URL);
|
||||
VS(ret, String(get_request_uri()));
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_errno() {
|
||||
Variant c = f_curl_init("http://www.thereisnosuchanurl");
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toObject());
|
||||
Variant err = f_curl_errno(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toResource());
|
||||
Variant err = f_curl_errno(c.toResource());
|
||||
VS(err, k_CURLE_COULDNT_RESOLVE_HOST);
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_error() {
|
||||
Variant c = f_curl_init("http://www.thereisnosuchanurl");
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toObject());
|
||||
Variant err = f_curl_error(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toResource());
|
||||
Variant err = f_curl_error(c.toResource());
|
||||
VERIFY(equal(err, String("Couldn't resolve host 'www.thereisnosuchanurl'")) ||
|
||||
equal(err, String("Could not resolve host: www.thereisnosuchanurl"
|
||||
" (Domain name not found)")));
|
||||
@@ -221,9 +221,9 @@ bool TestExtCurl::test_curl_error() {
|
||||
|
||||
bool TestExtCurl::test_curl_close() {
|
||||
Variant c = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toObject());
|
||||
f_curl_close(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_exec(c.toResource());
|
||||
f_curl_close(c.toResource());
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
@@ -233,32 +233,32 @@ bool TestExtCurl::test_curl_multi_init() {
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_multi_add_handle() {
|
||||
Object mh = f_curl_multi_init();
|
||||
Resource mh = f_curl_multi_init();
|
||||
Variant c1 = f_curl_init(String(get_request_uri()));
|
||||
Variant c2 = f_curl_init(String(get_request_uri()));
|
||||
f_curl_multi_add_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c2.toObject());
|
||||
f_curl_multi_add_handle(mh, c1.toResource());
|
||||
f_curl_multi_add_handle(mh, c2.toResource());
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_multi_remove_handle() {
|
||||
Object mh = f_curl_multi_init();
|
||||
Resource mh = f_curl_multi_init();
|
||||
Variant c1 = f_curl_init(String(get_request_uri()));
|
||||
Variant c2 = f_curl_init(String(get_request_uri()));
|
||||
f_curl_multi_add_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c2.toObject());
|
||||
f_curl_multi_remove_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c1.toResource());
|
||||
f_curl_multi_add_handle(mh, c2.toResource());
|
||||
f_curl_multi_remove_handle(mh, c1.toResource());
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_multi_exec() {
|
||||
Object mh = f_curl_multi_init();
|
||||
Resource mh = f_curl_multi_init();
|
||||
Variant c1 = f_curl_init(String(get_request_uri()));
|
||||
Variant c2 = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c2.toObject());
|
||||
f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toResource());
|
||||
f_curl_multi_add_handle(mh, c2.toResource());
|
||||
|
||||
Variant still_running;
|
||||
do {
|
||||
@@ -269,44 +269,44 @@ bool TestExtCurl::test_curl_multi_exec() {
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_multi_select() {
|
||||
Object mh = f_curl_multi_init();
|
||||
Resource mh = f_curl_multi_init();
|
||||
Variant c1 = f_curl_init(String(get_request_uri()));
|
||||
Variant c2 = f_curl_init(String(get_request_uri()));
|
||||
f_curl_multi_add_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c2.toObject());
|
||||
f_curl_multi_add_handle(mh, c1.toResource());
|
||||
f_curl_multi_add_handle(mh, c2.toResource());
|
||||
VS(f_curl_multi_select(mh), 0);
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_multi_getcontent() {
|
||||
Object mh = f_curl_multi_init();
|
||||
Resource mh = f_curl_multi_init();
|
||||
Variant c1 = f_curl_init(String(get_request_uri()));
|
||||
Variant c2 = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c2.toObject());
|
||||
f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toResource());
|
||||
f_curl_multi_add_handle(mh, c2.toResource());
|
||||
|
||||
Variant still_running;
|
||||
do {
|
||||
f_curl_multi_exec(mh, ref(still_running));
|
||||
} while (more(still_running, 0));
|
||||
|
||||
VS(f_curl_multi_getcontent(c1.toObject()), "OK");
|
||||
VS(f_curl_multi_getcontent(c1.toObject()), "OK");
|
||||
VS(f_curl_multi_getcontent(c2.toObject()), "OK");
|
||||
VS(f_curl_multi_getcontent(c2.toObject()), "OK");
|
||||
VS(f_curl_multi_getcontent(c1.toResource()), "OK");
|
||||
VS(f_curl_multi_getcontent(c1.toResource()), "OK");
|
||||
VS(f_curl_multi_getcontent(c2.toResource()), "OK");
|
||||
VS(f_curl_multi_getcontent(c2.toResource()), "OK");
|
||||
return Count(true);
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_multi_info_read() {
|
||||
Object mh = f_curl_multi_init();
|
||||
Resource mh = f_curl_multi_init();
|
||||
Variant c1 = f_curl_init(String(get_request_uri()));
|
||||
Variant c2 = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c2.toObject());
|
||||
f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toResource());
|
||||
f_curl_multi_add_handle(mh, c2.toResource());
|
||||
|
||||
Variant still_running;
|
||||
do {
|
||||
@@ -319,13 +319,13 @@ bool TestExtCurl::test_curl_multi_info_read() {
|
||||
}
|
||||
|
||||
bool TestExtCurl::test_curl_multi_close() {
|
||||
Object mh = f_curl_multi_init();
|
||||
Resource mh = f_curl_multi_init();
|
||||
Variant c1 = f_curl_init(String(get_request_uri()));
|
||||
Variant c2 = f_curl_init(String(get_request_uri()));
|
||||
f_curl_setopt(c1.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toObject());
|
||||
f_curl_multi_add_handle(mh, c2.toObject());
|
||||
f_curl_setopt(c1.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c2.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_multi_add_handle(mh, c1.toResource());
|
||||
f_curl_multi_add_handle(mh, c2.toResource());
|
||||
|
||||
Variant still_running;
|
||||
do {
|
||||
@@ -391,7 +391,7 @@ bool TestExtCurl::test_evhttp_post_gzip() {
|
||||
bool TestExtCurl::test_evhttp_async_get() {
|
||||
Variant ret = f_evhttp_async_get(String(get_request_uri()),
|
||||
CREATE_VECTOR1("ECHO: foo"));
|
||||
ret = f_evhttp_recv(ret.toObject());
|
||||
ret = f_evhttp_recv(ret.toResource());
|
||||
VS(ret[s_code], 200);
|
||||
VS(ret[s_response], "OK");
|
||||
VS(ret[s_headers][0], "ECHOED: foo");
|
||||
@@ -402,7 +402,7 @@ bool TestExtCurl::test_evhttp_async_get() {
|
||||
bool TestExtCurl::test_evhttp_async_post() {
|
||||
Variant ret = f_evhttp_async_post(String(get_request_uri()), "echo",
|
||||
CREATE_VECTOR1("ECHO: foo"));
|
||||
ret = f_evhttp_recv(ret.toObject());
|
||||
ret = f_evhttp_recv(ret.toResource());
|
||||
VS(ret[s_code], 200);
|
||||
VS(ret[s_response], "POST: echo");
|
||||
VS(ret[s_headers][0], "ECHOED: foo");
|
||||
|
||||
@@ -82,13 +82,13 @@ bool TestExtServer::test_pagelet_server_task_result() {
|
||||
String baseheader("MyHeader: ");
|
||||
String basepost("postparam=");
|
||||
|
||||
std::vector<Object> tasks;
|
||||
std::vector<Resource> tasks;
|
||||
for (int i = 0; i < TEST_SIZE; ++i) {
|
||||
String url = baseurl + String(i);
|
||||
String header = baseheader + String(i);
|
||||
String post = basepost + String(i);
|
||||
Object task = f_pagelet_server_task_start(url, CREATE_VECTOR1(header),
|
||||
post);
|
||||
Resource task = f_pagelet_server_task_start(url, CREATE_VECTOR1(header),
|
||||
post);
|
||||
tasks.push_back(task);
|
||||
}
|
||||
|
||||
@@ -155,7 +155,7 @@ bool TestExtServer::test_xbox_task_status() {
|
||||
}
|
||||
|
||||
bool TestExtServer::test_xbox_task_result() {
|
||||
Object task = f_xbox_task_start("hello");
|
||||
Resource task = f_xbox_task_start("hello");
|
||||
f_xbox_task_status(task);
|
||||
Variant ret;
|
||||
VS(f_xbox_task_result(task, 0, ref(ret)), 200);
|
||||
|
||||
@@ -86,20 +86,21 @@ bool TestServer::VerifyServerResponse(const char *input, const char **outputs,
|
||||
string err;
|
||||
for (int i = 0; i < 10; i++) {
|
||||
Variant c = f_curl_init();
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_URL, server);
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_URL, server);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
if (postdata) {
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_POSTFIELDS, postdata);
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_POST, true);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_POSTFIELDS, postdata);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_POST, true);
|
||||
}
|
||||
if (header) {
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_HTTPHEADER, CREATE_VECTOR1(header));
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_HTTPHEADER,
|
||||
CREATE_VECTOR1(header));
|
||||
}
|
||||
if (responseHeader) {
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_HEADER, 1);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_HEADER, 1);
|
||||
}
|
||||
|
||||
Variant res = f_curl_exec(c.toObject());
|
||||
Variant res = f_curl_exec(c.toResource());
|
||||
if (!same(res, false)) {
|
||||
actual = (std::string) res.toString();
|
||||
break;
|
||||
@@ -166,9 +167,9 @@ void TestServer::StopServer() {
|
||||
String url = "http://";
|
||||
url += f_php_uname("n");
|
||||
url += ":" + lexical_cast<string>(s_admin_port) + "/stop";
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_URL, url);
|
||||
f_curl_setopt(c.toObject(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant res = f_curl_exec(c.toObject());
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_URL, url);
|
||||
f_curl_setopt(c.toResource(), k_CURLOPT_RETURNTRANSFER, true);
|
||||
Variant res = f_curl_exec(c.toResource());
|
||||
if (!same(res, false)) {
|
||||
break;
|
||||
}
|
||||
|
||||
@@ -217,6 +217,7 @@ static const std::unordered_map<fbstring,fbstring> g_serializedDefaults = {
|
||||
{"null_string", "N;"},
|
||||
{"null_array", "N;"},
|
||||
{"null_object", "N;"},
|
||||
{"null_resource", "N;"},
|
||||
{"null_variant", "N;"},
|
||||
{"INT_MAX", "i:2147483647;"}, // (1 << 31) - 1
|
||||
};
|
||||
@@ -229,6 +230,7 @@ static const std::unordered_map<fbstring,fbstring> g_phpDefaults = {
|
||||
{"null_string", "null"},
|
||||
{"null_array", "null"},
|
||||
{"null_object", "null"},
|
||||
{"null_resource", "null"},
|
||||
{"null_variant", "null"},
|
||||
{"INT_MAX", "null"},
|
||||
};
|
||||
@@ -566,7 +568,8 @@ bool PhpParam::defValueNeedsVariable() const {
|
||||
if ((cppKindOf == KindOfArray) && (defVal == "null_array")) {
|
||||
return false;
|
||||
}
|
||||
if ((cppKindOf == KindOfObject) && (defVal == "null_object")) {
|
||||
if ((cppKindOf == KindOfObject) &&
|
||||
(defVal == "null_object" || defVal == "null_resource")) {
|
||||
return false;
|
||||
}
|
||||
if ((cppKindOf == KindOfAny) && (defVal == "null_variant")) {
|
||||
|
||||
Referência em uma Nova Issue
Bloquear um usuário