long flags = 0;
char *resolved_path;
zend_string *filename;
- zval *this = getThis();
+ zval *self = getThis();
ze_zip_object *ze_obj = NULL;
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ARG_PATH "|l", &filename, &flags) == FAILURE) {
return;
}
- if (this) {
+ if (self) {
/* We do not use ZIP_FROM_OBJECT, zip init function here */
- ze_obj = Z_ZIP_P(this);
+ ze_obj = Z_ZIP_P(self);
}
if (filename->len == 0) {
static ZIPARCHIVE_METHOD(setPassword)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
char *password;
int password_len;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &password, &password_len) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(close)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
ze_zip_object *ze_obj;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
- ze_obj = Z_ZIP_P(this);
+ ze_obj = Z_ZIP_P(self);
if (zip_close(intern)) {
zip_discard(intern);
static ZIPARCHIVE_METHOD(getStatusString)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
int zep, syp, len;
char error_string[128];
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
zip_error_get(intern, &zep, &syp);
static ZIPARCHIVE_METHOD(addEmptyDir)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
char *dirname;
int dirname_len;
int idx;
struct zip_stat sb;
char *s;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s",
&dirname, &dirname_len) == FAILURE) {
static void php_zip_add_from_pattern(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
char *path = NULL;
char *remove_path = NULL;
char *add_path = NULL;
int found;
zend_string *pattern;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
/* 1 == glob, 2 == pcre */
if (type == 1) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ARG_PATH "|la",
static ZIPARCHIVE_METHOD(addFile)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
char *entry_name = NULL;
int entry_name_len = 0;
long offset_start = 0, offset_len = 0;
zend_string *filename;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ARG_PATH "|sll",
&filename, &entry_name, &entry_name_len, &offset_start, &offset_len) == FAILURE) {
static ZIPARCHIVE_METHOD(addFromString)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
char *buffer, *name;
int buffer_len, name_len;
ze_zip_object *ze_obj;
int pos = 0;
int cur_idx;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
&name, &name_len, &buffer, &buffer_len) == FAILURE) {
return;
}
- ze_obj = Z_ZIP_P(this);
+ ze_obj = Z_ZIP_P(self);
if (ze_obj->buffers_cnt) {
ze_obj->buffers = (char **)erealloc(ze_obj->buffers, sizeof(char *) * (ze_obj->buffers_cnt+1));
pos = ze_obj->buffers_cnt++;
static ZIPARCHIVE_METHOD(statName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long flags = 0;
struct zip_stat sb;
zend_string *name;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ARG_PATH "|l", &name, &flags) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(statIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long index, flags = 0;
struct zip_stat sb;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
&index, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(locateName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long flags = 0;
long idx = -1;
zend_string *name;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ARG_PATH "|l", &name, &flags) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(getNameIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
const char *name;
long flags = 0, index = 0;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
&index, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(setArchiveComment)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
int comment_len;
char * comment;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &comment, &comment_len) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(getArchiveComment)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long flags = 0;
const char * comment;
int comment_len = 0;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "|l", &flags) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(setCommentName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
int comment_len, name_len;
char * comment, *name;
int idx;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss",
&name, &name_len, &comment, &comment_len) == FAILURE) {
static ZIPARCHIVE_METHOD(setCommentIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long index;
int comment_len;
char * comment;
struct zip_stat sb;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls",
&index, &comment, &comment_len) == FAILURE) {
static ZIPARCHIVE_METHOD(setExternalAttributesName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
int name_len;
char *name;
long flags=0, opsys, attr;
zip_int64_t idx;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "sll|l",
&name, &name_len, &opsys, &attr, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(setExternalAttributesIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long index, flags=0, opsys, attr;
struct zip_stat sb;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lll|l",
&index, &opsys, &attr, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(getExternalAttributesName)
{
struct zip *intern;
- zval *this = getThis(), *z_opsys, *z_attr;
+ zval *self = getThis(), *z_opsys, *z_attr;
int name_len;
char *name;
long flags=0;
zip_uint32_t attr;
zip_int64_t idx;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "szz|l",
&name, &name_len, &z_opsys, &z_attr, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(getExternalAttributesIndex)
{
struct zip *intern;
- zval *this = getThis(), *z_opsys, *z_attr;
+ zval *self = getThis(), *z_opsys, *z_attr;
long index, flags=0;
zip_uint8_t opsys;
zip_uint32_t attr;
struct zip_stat sb;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "lzz|l",
&index, &z_opsys, &z_attr, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(getCommentName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
int name_len, idx;
long flags = 0;
int comment_len = 0;
const char * comment;
char *name;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s|l",
&name, &name_len, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(getCommentIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long index, flags = 0;
const char * comment;
int comment_len = 0;
struct zip_stat sb;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l|l",
&index, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(deleteIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long index;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(deleteName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
int name_len;
char *name;
struct zip_stat sb;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(renameIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
char *new_name;
int new_name_len;
long index;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ls", &index, &new_name, &new_name_len) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(renameName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
struct zip_stat sb;
char *name, *new_name;
int name_len, new_name_len;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss", &name, &name_len, &new_name, &new_name_len) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(unchangeIndex)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
long index;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "l", &index) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(unchangeName)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
struct zip_stat sb;
char *name;
int name_len;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "s", &name, &name_len) == FAILURE) {
return;
static ZIPARCHIVE_METHOD(unchangeAll)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zip_unchange_all(intern) != 0) {
RETURN_FALSE;
static ZIPARCHIVE_METHOD(unchangeArchive)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zip_unchange_archive(intern) != 0) {
RETURN_FALSE;
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
zval *zval_files = NULL;
zval *zval_file = NULL;
php_stream_statbuf ssb;
int nelems;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
}
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zval_files && (Z_TYPE_P(zval_files) != IS_NULL)) {
switch (Z_TYPE_P(zval_files)) {
case IS_STRING:
static void php_zip_get_from(INTERNAL_FUNCTION_PARAMETERS, int type) /* {{{ */
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
struct zip_stat sb;
struct zip_file *zf;
int n = 0;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (type == 1) {
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ARG_PATH "|ll", &filename, &len, &flags) == FAILURE) {
static ZIPARCHIVE_METHOD(getStream)
{
struct zip *intern;
- zval *this = getThis();
+ zval *self = getThis();
struct zip_stat sb;
char *mode = "rb";
zend_string *filename;
php_stream *stream;
ze_zip_object *obj;
- if (!this) {
+ if (!self) {
RETURN_FALSE;
}
- ZIP_FROM_OBJECT(intern, this);
+ ZIP_FROM_OBJECT(intern, self);
if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, ARG_PATH, &filename) == FAILURE) {
return;
RETURN_FALSE;
}
- obj = Z_ZIP_P(this);
+ obj = Z_ZIP_P(self);
stream = php_stream_zip_open(obj->filename, filename->val, mode STREAMS_CC TSRMLS_CC);
if (stream) {