Changed php_error to php_error_docref.

This commit is contained in:
Ilia Alshanetsky 2003-01-19 00:45:53 +00:00
parent add3ec4e0b
commit 3d8e54f3a2
26 changed files with 344 additions and 389 deletions

View File

@ -136,7 +136,7 @@ void pack_dbf(dbhead_t *dbh)
/* Try to truncate the file to the right size. */
if (ftruncate(dbh->db_fd, out_off) != 0) {
php_error(E_WARNING, "dbase_pack() couldn't truncate the file to the right size. Some deleted records may still be left in there.");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "dbase_pack() couldn't truncate the file to the right size. Some deleted records may still be left in there.");
}
if (rec_cnt == 0)

View File

@ -161,8 +161,7 @@ PHP_FUNCTION(dio_open)
}
if (fd == -1) {
php_error(E_WARNING, "%s(): cannot open file %s with flags %d and permissions %d: %s",
get_active_function_name(TSRMLS_C), file_name, flags, mode, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot open file %s with flags %d and permissions %d: %s", file_name, flags, mode, strerror(errno));
RETURN_FALSE;
}
@ -218,8 +217,7 @@ PHP_FUNCTION(dio_write)
res = write(f->fd, data, trunc_len ? trunc_len : data_len);
if (res == -1) {
php_error(E_WARNING, "%s(): cannot write data to file descriptor %d, %s",
get_active_function_name(TSRMLS_C), f->fd, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write data to file descriptor %d, %s", f->fd, strerror(errno));
}
RETURN_LONG(res);
@ -240,8 +238,7 @@ PHP_FUNCTION(dio_truncate)
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
if (ftruncate(f->fd, offset) == -1) {
php_error(E_WARNING, "%s(): couldn't truncate %d to %d bytes: %s",
get_active_function_name(TSRMLS_C), f->fd, offset, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "couldn't truncate %d to %d bytes: %s", f->fd, offset, strerror(errno));
RETURN_FALSE;
}
@ -265,8 +262,7 @@ PHP_FUNCTION(dio_stat)
ZEND_FETCH_RESOURCE(f, php_fd_t *, &r_fd, -1, le_fd_name, le_fd);
if (fstat(f->fd, &s) == -1) {
php_error(E_WARNING, "%s(): cannot stat %d: %s",
get_active_function_name(TSRMLS_C), f->fd, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot stat %d: %s", f->fd, strerror(errno));
RETURN_FALSE;
}
@ -327,8 +323,7 @@ PHP_FUNCTION(dio_fcntl)
HashTable *fh;
if (!arg) {
php_error(E_WARNING, "%s() expects argument 3 to be array or int, none given",
get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, none given");
RETURN_FALSE;
}
if (Z_TYPE_P(arg) == IS_ARRAY) {
@ -366,8 +361,7 @@ PHP_FUNCTION(dio_fcntl)
lk.l_whence = SEEK_SET;
lk.l_type = Z_LVAL_P(arg);
} else {
php_error(E_WARNING, "%s() expects argument 3 to be array or int, %s given",
get_active_function_name(TSRMLS_C), zend_zval_type_name(arg));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be array or int, %s given", zend_zval_type_name(arg));
RETURN_FALSE;
}
@ -392,8 +386,7 @@ PHP_FUNCTION(dio_fcntl)
php_fd_t *new_f;
if (!arg || Z_TYPE_P(arg) != IS_LONG) {
php_error(E_WARNING, "%s() expects argument 3 to be int",
get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
RETURN_FALSE;
}
@ -403,8 +396,7 @@ PHP_FUNCTION(dio_fcntl)
}
default:
if (!arg || Z_TYPE_P(arg) != IS_LONG) {
php_error(E_WARNING, "%s() expects argument 3 to be int",
get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "expects argument 3 to be int");
RETURN_FALSE;
}

View File

@ -341,15 +341,15 @@ static void *php_hwapi_get_object(zval *wrapper, int rsrc_type1) {
int type;
if (Z_TYPE_P(wrapper) != IS_OBJECT) {
php_error(E_ERROR, "Wrapper is not an object");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Wrapper is not an object");
}
if (zend_hash_find(Z_OBJPROP_P(wrapper), "this", sizeof("this"), (void **)&handle) == FAILURE) {
php_error(E_ERROR, "Underlying object missing");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Underlying object missing");
}
obj = zend_list_find(Z_LVAL_PP(handle), &type);
if (!obj || (type != rsrc_type1)) {
php_error(E_ERROR, "Underlying object missing or of invalid type");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Underlying object missing or of invalid type");
}
return obj;
}
@ -4255,7 +4255,7 @@ PHP_FUNCTION(hwapi_object_attribute) {
error = objp->attribute(HW_API_String(Z_STRVAL_PP(arg1)), attr);
break;
default:
php_error(E_WARNING, "HW_API_Object::attribute() needs string or long as parameter");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "HW_API_Object::attribute() needs string or long as parameter");
RETURN_FALSE;
}
@ -4643,7 +4643,7 @@ PHP_FUNCTION(hwapi_error_reason) {
RETURN_FALSE;
}
if(!objp->error())
php_error(E_WARNING, "This is not an error");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "This is not an error");
error = objp->reason(Z_LVAL_PP(arg1), reason);
if(error) {

View File

@ -120,12 +120,12 @@ static int _close_statement(II_LINK *link)
/* rolls back transaction in given link
after closing the active transaction (if any)
*/
static int _rollback_transaction(II_LINK *link)
static int _rollback_transaction(II_LINK *link TSRMLS_DC)
{
IIAPI_ROLLBACKPARM rollbackParm;
if (link->stmtHandle && _close_statement(link)) {
php_error(E_WARNING, "Ingres II: Unable to close statement !!");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
return 1;
}
@ -149,8 +149,8 @@ static void _close_ii_link(II_LINK *link TSRMLS_DC)
{
IIAPI_DISCONNPARM disconnParm;
if (link->tranHandle && _rollback_transaction(link)) {
php_error(E_WARNING, "Ingres II: Unable to rollback transaction !!");
if (link->tranHandle && _rollback_transaction(link TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to rollback transaction !!");
}
disconnParm.dc_genParm.gp_callback = NULL;
@ -197,7 +197,7 @@ static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
if (link->autocommit) {
if (link->stmtHandle && _close_statement(link)) {
php_error(E_WARNING, "Ingres II: Unable to close statement !!");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
}
autoParm.ac_genParm.gp_callback = NULL;
@ -209,15 +209,15 @@ static void _clean_ii_plink(zend_rsrc_list_entry *rsrc TSRMLS_DC)
ii_sync(&(autoParm.ac_genParm));
if (ii_success(&(autoParm.ac_genParm)) == II_FAIL) {
php_error(E_WARNING, "Ingres II: Unable to disable autocommit");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to disable autocommit");
}
link->autocommit = 0;
link->tranHandle = NULL;
}
if (link->tranHandle && _rollback_transaction(link)) {
php_error(E_WARNING, "Ingres II: Unable to rollback transaction !!");
if (link->tranHandle && _rollback_transaction(link TSRMLS_CC)) {
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to rollback transaction !!");
}
}
@ -348,7 +348,8 @@ static int ii_sync(IIAPI_GENPARM *genParm)
}
if (waitParm.wt_status != IIAPI_ST_SUCCESS) {
php_error(E_WARNING, "Ingres II: Unexpected failure of IIapi_wait()");
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unexpected failure of IIapi_wait()");
return 0;
}
return 1;
@ -368,14 +369,15 @@ static int ii_success(IIAPI_GENPARM *genParm)
default:
if (genParm->gp_errorHandle == NULL) { /* no error message available */
php_error(E_WARNING, "Ingres II: Server or API error - no error message available");
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Server or API error - no error message available");
} else {
IIAPI_GETEINFOPARM getEInfoParm;
getEInfoParm.ge_errorHandle = genParm->gp_errorHandle;
IIapi_getErrorInfo(&getEInfoParm);
php_error(E_WARNING, "Ingres II: Server or API error : %s", getEInfoParm.ge_message);
php_error(E_WARNING, "Ingres II: SQLSTATE : %s", getEInfoParm.ge_SQLSTATE);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Server or API error : %s", getEInfoParm.ge_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: SQLSTATE : %s", getEInfoParm.ge_SQLSTATE);
}
return II_FAIL;
}
@ -399,7 +401,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (PG(sql_safe_mode)) { /* sql_safe_mode */
if (argc > 0) {
php_error(E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "SQL safe mode in effect - ignoring host/user/password information");
}
db = pass = NULL;
@ -451,7 +453,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
/* if asked for unauthorized persistency, issue a warning
and go for a non-persistent link */
if (persistent && !IIG(allow_persistent)) {
php_error(E_WARNING, "Ingres II: Persistent links disabled !");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Persistent links disabled !");
persistent = 0;
}
@ -463,12 +465,12 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
list_entry new_le;
if (IIG(max_links) != -1 && IIG(num_links) >= IIG(max_links)) {
php_error(E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
if (IIG(max_persistent) != -1 && IIG(num_persistent) >= IIG(max_persistent)) {
php_error(E_WARNING, "Ingres II: Too many open persistent links (%d)", IIG(num_persistent));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Too many open persistent links (%d)", IIG(num_persistent));
efree(hashed_details);
RETURN_FALSE;
}
@ -487,7 +489,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (!ii_sync(&(connParm.co_genParm)) || ii_success(&(connParm.co_genParm)) == II_FAIL) {
efree(hashed_details);
php_error(E_WARNING, "Ingres II: Unable to connect to database (%s)", db);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to connect to database (%s)", db);
RETURN_FALSE;
}
@ -503,7 +505,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
Z_TYPE(new_le) = le_ii_plink;
new_le.ptr = link;
if (zend_hash_update(&EG(persistent_list), hashed_details, hashed_details_length + 1, (void *) &new_le, sizeof(list_entry), NULL) == FAILURE) {
php_error(E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details);
free(link);
efree(hashed_details);
RETURN_FALSE;
@ -554,7 +556,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (IIG(max_links) != -1 && IIG(num_links) >= IIG(max_links)) {
php_error(E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Too many open links (%d)", IIG(num_links));
efree(hashed_details);
RETURN_FALSE;
}
@ -573,7 +575,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
if (!ii_sync(&(connParm.co_genParm)) || ii_success(&(connParm.co_genParm)) == II_FAIL) {
efree(hashed_details);
php_error(E_WARNING, "Ingres II: Unable to connect to database (%s)", db);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to connect to database (%s)", db);
RETURN_FALSE;
}
@ -592,7 +594,7 @@ static void php_ii_do_connect(INTERNAL_FUNCTION_PARAMETERS, int persistent)
new_index_ptr.ptr = (void *) Z_LVAL_P(return_value);
Z_TYPE(new_index_ptr) = le_index_ptr;
if (zend_hash_update(&EG(regular_list), hashed_details, hashed_details_length + 1, (void *) &new_index_ptr, sizeof(list_entry), NULL) == FAILURE) {
php_error(E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to hash (%s)", hashed_details);
free(link);
efree(hashed_details);
RETURN_FALSE;
@ -684,7 +686,7 @@ PHP_FUNCTION(ingres_query)
/* if there's already an active statement, close it */
if (ii_link->stmtHandle && _close_statement(ii_link)) {
php_error(E_WARNING, "Ingres II: Unable to close statement !!");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
RETURN_FALSE;
}
@ -861,7 +863,7 @@ static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type)
fun_name = "foobar";
break;
}
php_error(E_WARNING, "Ingres II: %s() called with wrong index (%d)", fun_name, index);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: %s() called with wrong index (%d)", fun_name, index);
RETURN_FALSE;
}
@ -924,7 +926,7 @@ static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type)
RETURN_STRING("IIAPI_VCH_TYPE", 1);
default:
php_error(E_WARNING, "Ingres II: Unknown Ingres data type");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unknown Ingres data type");
RETURN_FALSE;
break;
}
@ -960,7 +962,7 @@ static void php_ii_field_info(INTERNAL_FUNCTION_PARAMETERS, int info_type)
static char *php_ii_field_name(II_LINK *ii_link, int index)
{
if (index < 1 || index > ii_link->fieldCount) {
php_error(E_WARNING, "Ingres II: php_ii_field_name() called with wrong index (%d)", index);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: php_ii_field_name() called with wrong index (%d)", index);
return NULL;
}
@ -1115,7 +1117,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res
if (more) { /* more segments of LBYTE or LVCH element to come */
/* Multi segment LBYTE and LVCH elements not supported yet */
php_error(E_ERROR, "Ingres II: Multi segment LBYTE and LVCH elements not supported yet");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Ingres II: Multi segment LBYTE and LVCH elements not supported yet");
} else {
@ -1152,7 +1154,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res
break;
default:
php_error(E_WARNING, "Ingres II: Invalid size for IIAPI_FLT_TYPE data (%d)", columnData[k - 1].dv_length);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Invalid size for IIAPI_FLT_TYPE data (%d)", columnData[k - 1].dv_length);
break;
}
@ -1181,7 +1183,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res
break;
default:
php_error(E_WARNING, "Ingres II: Invalid size for IIAPI_INT_TYPE data (%d)", columnData[k - 1].dv_length);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Invalid size for IIAPI_INT_TYPE data (%d)", columnData[k - 1].dv_length);
break;
}
@ -1242,7 +1244,7 @@ static void php_ii_fetch(INTERNAL_FUNCTION_PARAMETERS, II_LINK *ii_link, int res
break;
default:
php_error(E_WARNING, "Ingres II: Invalid SQL data type in fetched field (%d -- length : %d)", (ii_link->descriptor[i + k - 2]).ds_dataType, columnData[k - 1].dv_length);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Invalid SQL data type in fetched field (%d -- length : %d)", (ii_link->descriptor[i + k - 2]).ds_dataType, columnData[k - 1].dv_length);
break;
}
}
@ -1364,7 +1366,7 @@ PHP_FUNCTION(ingres_rollback)
}
ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
if (_rollback_transaction(ii_link)) {
if (_rollback_transaction(ii_link TSRMLS_CC)) {
RETURN_FALSE;
}
RETURN_TRUE;
@ -1393,7 +1395,7 @@ PHP_FUNCTION(ingres_commit)
ZEND_FETCH_RESOURCE2(ii_link, II_LINK *, link, link_id, "Ingres II Link", le_ii_link, le_ii_plink);
if (ii_link->stmtHandle && _close_statement(ii_link)) {
php_error(E_WARNING, "Ingres II: Unable to close statement !!");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ingres II: Unable to close statement !!");
RETURN_FALSE;
}

View File

@ -168,8 +168,6 @@
#define PHP_MIME_MAGIC_FILE_PATH PHP_PREFIX "\\magic.mime"
#endif
#define MODNAME "mime_magic"
static int apprentice(void);
static int ascmagic(unsigned char *, int);
static int is_tar(unsigned char *, int);
@ -313,12 +311,12 @@ PHP_FUNCTION(mime_content_type)
}
if (conf->magic == (struct magic *)-1) {
php_error(E_ERROR, MODNAME " could not be initialized, magic file %s is not avaliable", conf->magicfile);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "mime_magic could not be initialized, magic file %s is not avaliable", conf->magicfile);
RETURN_FALSE;
}
if(!conf->magic) {
php_error(E_WARNING, MODNAME " not initialized");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mime_magic not initialized");
RETURN_FALSE;
}
@ -428,10 +426,12 @@ static unsigned long signextend(struct magic *m, unsigned long v)
break;
case STRING:
break;
default:
php_error(E_WARNING,
MODNAME ": can't happen: m->type=%d", m->type);
default:
{
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, ": can't happen: m->type=%d", m->type);
return -1;
}
}
return v;
}
@ -444,6 +444,7 @@ static int parse(char *l, int lineno)
struct magic *m;
char *t, *s;
magic_server_config_rec *conf = &mime_global;
TSRMLS_FETCH();
/* allocate magic structure entry */
m = (struct magic *) calloc(1, sizeof(struct magic));
@ -476,8 +477,7 @@ static int parse(char *l, int lineno)
/* get offset, then skip over it */
m->offset = (int) strtol(l, &t, 0);
if (l == t) {
php_error(E_WARNING,
MODNAME ": (line %d) offset `%s' invalid", lineno, l);
php_error_docref(NULL TSRMLS_CC, E_WARNING, ": (line %d) offset `%s' invalid", lineno, l);
}
l = t;
@ -499,8 +499,7 @@ static int parse(char *l, int lineno)
m->in.type = BYTE;
break;
default:
php_error(E_WARNING,
MODNAME ": indirect offset type %c invalid", *l);
php_error_docref(NULL TSRMLS_CC, E_WARNING, ": indirect offset type %c invalid", *l);
break;
}
l++;
@ -516,8 +515,7 @@ static int parse(char *l, int lineno)
else
t = l;
if (*t++ != ')') {
php_error(E_WARNING,
MODNAME ": missing ')' in indirect offset");
php_error_docref(NULL TSRMLS_CC, E_WARNING, ": missing ')' in indirect offset");
}
l = t;
}
@ -590,8 +588,7 @@ static int parse(char *l, int lineno)
l += NLEDATE;
}
else {
php_error(E_WARNING,
MODNAME ": type %s invalid", l);
php_error_docref(NULL TSRMLS_CC, E_WARNING, ": type %s invalid", l);
return -1;
}
/* New-style anding: "0 byte&0x80 =0x80 dynamically linked" */
@ -690,8 +687,8 @@ static char *getstr(register char *s, register char *p,
if (isspace((unsigned char) c))
break;
if (p >= pmax) {
php_error(E_WARNING,
MODNAME ": string too long: %s", origs);
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "string too long: %s", origs);
break;
}
if (c == '\\') {
@ -849,8 +846,7 @@ static int magic_rsl_add(char *str)
/* make sure we have a list to put it in */
if (!req_dat) {
php_error(E_WARNING,
MODNAME ": request config should not be NULL");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "request config should not be NULL");
if (!(req_dat = magic_set_config())) {
/* failure */
return -1;
@ -986,8 +982,7 @@ static int magic_process(char *filename TSRMLS_DC)
if (stream == NULL) {
/* We can't open it, but we were able to stat it. */
php_error(E_WARNING,
MODNAME ": can't read `%s'", filename);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "can't read `%s'", filename);
/* let some other handler decide what the problem is */
return MIME_MAGIC_DECLINED;
}
@ -996,8 +991,7 @@ static int magic_process(char *filename TSRMLS_DC)
* try looking at the first HOWMANY bytes
*/
if ((nbytes = php_stream_read(stream, (char *) buf, sizeof(buf) - 1)) == -1) {
php_error(E_WARNING,
MODNAME ": read failed: %s", filename);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s", filename);
return MIME_MAGIC_ERROR;
}
@ -1092,8 +1086,7 @@ static int fsmagic(char *filename TSRMLS_DC)
/* We used stat(), the only possible reason for this is that the
* symlink is broken.
*/
php_error(E_WARNING,
MODNAME ": broken symlink (%s)", filename);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "broken symlink (%s)", filename);
return MIME_MAGIC_ERROR;
#endif
#ifdef S_IFSOCK
@ -1108,8 +1101,7 @@ static int fsmagic(char *filename TSRMLS_DC)
case 0:
break;
default:
php_error(E_WARNING,
MODNAME ": invalid mode 0%o.", (unsigned int)stat_ssb.sb.st_mode);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid mode 0%o.", (unsigned int)stat_ssb.sb.st_mode);
return MIME_MAGIC_ERROR;
}
@ -1463,11 +1455,12 @@ static int mcheck(union VALUETYPE *p, struct magic *m)
register unsigned long l = m->value.l;
register unsigned long v;
int matched;
TSRMLS_FETCH();
if ((m->value.s[0] == 'x') && (m->value.s[1] == '\0')) {
php_error(E_WARNING,
MODNAME ": BOINK");
return 1;
php_error_docref(NULL TSRMLS_CC, E_WARNING, "BOINK");
return 1;
}
switch (m->type) {
@ -1510,8 +1503,7 @@ static int mcheck(union VALUETYPE *p, struct magic *m)
break;
default:
/* bogosity, pretend that it just wasn't a match */
php_error(E_WARNING,
MODNAME ": invalid type %d in mcheck().", m->type);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid type %d in mcheck().", m->type);
return 0;
}
@ -1559,9 +1551,7 @@ static int mcheck(union VALUETYPE *p, struct magic *m)
default:
/* bogosity, pretend it didn't match */
matched = 0;
php_error(E_WARNING,
MODNAME ": mcheck: can't happen: invalid relation %d.",
m->reln);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "mcheck: can't happen: invalid relation %d.", m->reln);
break;
}
@ -1643,10 +1633,11 @@ static void mprint(union VALUETYPE *p, struct magic *m)
(void) magic_rsl_printf(m->desc, pp);
return;
default:
php_error(E_WARNING,
MODNAME ": invalid m->type (%d) in mprint().",
m->type);
{
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid m->type (%d) in mprint().", m->type);
return;
}
}
v = signextend(m, v) & m->mask;
@ -1689,9 +1680,11 @@ static int mconvert(union VALUETYPE *p, struct magic *m)
((p->hl[3] << 24) | (p->hl[2] << 16) | (p->hl[1] << 8) | (p->hl[0]));
return 1;
default:
php_error(E_WARNING,
MODNAME ": invalid type %d in mconvert().", m->type);
{
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_WARNING, "invalid type %d in mconvert().", m->type);
return 0;
}
}
}
@ -1765,8 +1758,7 @@ static int magic_rsl_get(char **content_type, char **content_encoding)
else {
/* should not be possible */
/* abandon malfunctioning module */
php_error(E_WARNING,
MODNAME ": bad state %d (ws)", state);
php_error_docref(NULL TSRMLS_CC, E_WARNING, ": bad state %d (ws)", state);
return MIME_MAGIC_DECLINED;
}
/* NOTREACHED */
@ -1809,8 +1801,7 @@ static int magic_rsl_get(char **content_type, char **content_encoding)
else {
/* should not be possible */
/* abandon malfunctioning module */
php_error(E_WARNING,
MODNAME ": bad state %d (ns)", state);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "bad state %d (ns)", state);
return MIME_MAGIC_DECLINED;
}
/* NOTREACHED */

View File

@ -101,7 +101,7 @@ static zend_class_entry *oci_coll_class_entry_ptr;
#define CALL_OCI(call) \
{ \
if (OCI(in_call)) { \
php_error(E_WARNING, "OCI8 Recursive call!\n"); \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI8 Recursive call!\n"); \
exit(-1); \
} else { \
OCI(in_call)=1; \
@ -114,7 +114,7 @@ static zend_class_entry *oci_coll_class_entry_ptr;
{ \
if (OCI(in_call)) { \
retcode=-1; \
php_error(E_WARNING, "OCI8 Recursive call!\n"); \
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCI8 Recursive call!\n"); \
exit(-1); \
} else { \
OCI(in_call)=1; \
@ -968,21 +968,21 @@ oci_error(OCIError *err_p, char *what, sword status)
{
text errbuf[512];
sb4 errcode = 0;
TSRMLS_FETCH();
switch (status) {
case OCI_SUCCESS:
break;
case OCI_SUCCESS_WITH_INFO:
php_error(E_WARNING, "%s: OCI_SUCCESS_WITH_INFO", what);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: OCI_SUCCESS_WITH_INFO", what);
break;
case OCI_NEED_DATA:
php_error(E_WARNING, "%s: OCI_NEED_DATA", what);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: OCI_NEED_DATA", what);
break;
case OCI_NO_DATA:
php_error(E_WARNING, "%s: OCI_NO_DATA", what);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: OCI_NO_DATA", what);
break;
case OCI_ERROR: {
TSRMLS_FETCH();
CALL_OCI(OCIErrorGet(
err_p,
(ub4)1,
@ -992,17 +992,17 @@ oci_error(OCIError *err_p, char *what, sword status)
(ub4)sizeof(errbuf),
(ub4)OCI_HTYPE_ERROR));
php_error(E_WARNING, "%s: %s", what, errbuf);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: %s", what, errbuf);
break;
}
case OCI_INVALID_HANDLE:
php_error(E_WARNING, "%s: OCI_INVALID_HANDLE", what);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: OCI_INVALID_HANDLE", what);
break;
case OCI_STILL_EXECUTING:
php_error(E_WARNING, "%s: OCI_STILL_EXECUTING", what);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: OCI_STILL_EXECUTING", what);
break;
case OCI_CONTINUE:
php_error(E_WARNING, "%s: OCI_CONTINUE", what);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s: OCI_CONTINUE", what);
break;
default:
break;
@ -1135,7 +1135,7 @@ oci_get_col(oci_statement *statement, int col, zval **value)
}
} else if (col != -1) {
if (zend_hash_index_find(statement->columns, col, (void **)&outcol) == FAILURE) {
php_error(E_WARNING, "Invalid column %d", col);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid column %d", col);
return NULL;
}
return outcol;
@ -1164,7 +1164,7 @@ oci_new_desc(int type,oci_connection *connection)
break;
default:
php_error(E_WARNING, "Unknown descriptor type %d.",Z_TYPE_P(descr));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown descriptor type %d.",Z_TYPE_P(descr));
return 0;
}
@ -1201,11 +1201,11 @@ _oci_get_ocicoll(zval *id,oci_collection **collection TSRMLS_DC)
zval **coll;
if (zend_hash_find(Z_OBJPROP_P(id), "collection", sizeof("collection"), (void **)&coll) == FAILURE) {
php_error(E_WARNING, "cannot find collection");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot find collection");
return 0;
}
if ((*collection = oci_get_coll(Z_LVAL_PP(coll) TSRMLS_CC)) == NULL) {
php_error(E_WARNING, "collection not found");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "collection not found");
return 0;
}
@ -1225,12 +1225,12 @@ _oci_get_ocidesc(zval *id,oci_descriptor **descriptor TSRMLS_DC)
zval **desc;
if (zend_hash_find(Z_OBJPROP_P(id), "descriptor", sizeof("descriptor"), (void **)&desc) == FAILURE) {
php_error(E_WARNING, "cannot find descriptor");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot find descriptor");
return 0;
}
if ((*descriptor = oci_get_desc(Z_LVAL_PP(desc) TSRMLS_CC)) == NULL) {
php_error(E_WARNING, "descriptor not found");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "descriptor not found");
return 0;
}
@ -1267,7 +1267,7 @@ _oci_make_zval(zval *value,oci_statement *statement,oci_out_column *column, char
descr = oci_get_desc(column->descid TSRMLS_CC);
if (! descr) {
php_error(E_WARNING, "unable to find my descriptor %d",column->data);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to find my descriptor %d",column->data);
return -1;
}
@ -2050,9 +2050,10 @@ oci_bind_in_callback(dvoid *ictxp, /* context pointer */
{
oci_bind *phpbind;
zval *val;
TSRMLS_FETCH();
if (!(phpbind=(oci_bind *)ictxp) || !(val = phpbind->zval)) {
php_error(E_WARNING, "!phpbind || !phpbind->val");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "!phpbind || !phpbind->val");
return OCI_ERROR;
}
@ -2103,9 +2104,10 @@ oci_bind_out_callback(dvoid *octxp, /* context pointer */
oci_bind *phpbind;
zval *val;
sb4 retval = OCI_ERROR;
TSRMLS_FETCH();
if (!(phpbind=(oci_bind *)octxp) || !(val = phpbind->zval)) {
php_error(E_WARNING, "!phpbind || !phpbind->val");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "!phpbind || !phpbind->val");
return retval;
}
@ -2870,15 +2872,15 @@ PHP_FUNCTION(ocibindbyname)
#ifdef WITH_COLLECTIONS
case SQLT_NTY:
if(Z_TYPE_PP(var) != IS_OBJECT) {
php_error(E_WARNING,"Variable must be allocated using OCINewCollection()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable must be allocated using OCINewCollection()");
RETURN_FALSE;
}
if ((inx = _oci_get_ocicoll(*var,&coll TSRMLS_CC)) == 0) {
php_error(E_WARNING,"Variable must be allocated using OCINewCollection()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable must be allocated using OCINewCollection()");
RETURN_FALSE;
}
if (! (mycoll = (dvoid *) coll->coll)) {
php_error(E_WARNING,"Collection empty");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Collection empty");
RETURN_FALSE;
}
value_sz = sizeof(void*);
@ -2891,17 +2893,17 @@ break;
case SQLT_BLOB:
case SQLT_RDD:
if (Z_TYPE_PP(var) != IS_OBJECT) {
php_error(E_WARNING,"Variable must be allocated using OCINewDescriptor()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable must be allocated using OCINewDescriptor()");
RETURN_FALSE;
}
if ((inx = _oci_get_ocidesc(*var,&descr TSRMLS_CC)) == 0) {
php_error(E_WARNING,"Variable must be allocated using OCINewDescriptor()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Variable must be allocated using OCINewDescriptor()");
RETURN_FALSE;
}
if (! (mydescr = (dvoid *) descr->ocidescr)) {
php_error(E_WARNING,"Descriptor empty");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Descriptor empty");
RETURN_FALSE;
}
value_sz = sizeof(void*);
@ -3022,7 +3024,7 @@ PHP_FUNCTION(ocifreedesc)
}
}
php_error(E_NOTICE, "OCIFreeDesc() should not be called like this. Use $somelob->free() to free a LOB");
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "OCIFreeDesc() should not be called like this. Use $somelob->free() to free a LOB");
RETURN_FALSE;
}
@ -3071,7 +3073,7 @@ PHP_FUNCTION(ocisavelob)
if (offparam == -1) {
offset = curloblen;
} else if ((ub4) offparam >= curloblen) {
php_error(E_WARNING, "Offset smaller than current LOB-Size - appending");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Offset smaller than current LOB-Size - appending");
offset = curloblen;
} else {
offset = offparam;
@ -3085,7 +3087,7 @@ PHP_FUNCTION(ocisavelob)
loblen = Z_STRLEN_PP(arg);
if (loblen < 1) {
php_error(E_WARNING, "Cannot save a lob which size is less than 1 byte");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot save a lob which size is less than 1 byte");
RETURN_FALSE;
}
@ -3160,7 +3162,7 @@ PHP_FUNCTION(ocisavelobfile)
filename = Z_STRVAL_PP(arg);
if ((fp = VCWD_OPEN(filename, O_RDONLY|O_BINARY)) == -1) {
php_error(E_WARNING, "Can't open file %s", filename);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't open file %s", filename);
RETURN_FALSE;
}
@ -3278,7 +3280,7 @@ PHP_FUNCTION(ociwritelobtofile)
}
if ((fp = VCWD_OPEN_MODE(filename,O_CREAT | O_RDWR | O_BINARY | O_TRUNC, 0600)) == -1) {
php_error(E_WARNING, "Can't create file %s", filename);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't create file %s", filename);
goto bail;
}
}
@ -3363,7 +3365,7 @@ PHP_FUNCTION(ociwritelobtofile)
if (fp != -1) {
if ((ub4) write(fp,buffer,toread) != toread) {
php_error(E_WARNING, "cannot write file!");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "cannot write file!");
goto bail;
}
} else {
@ -3479,7 +3481,7 @@ PHP_FUNCTION(ociwritetemporarylob)
loblen = Z_STRLEN_PP(var);
if (loblen < 1) {
php_error(E_WARNING, "Cannot save a lob that is less than 1 byte");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot save a lob that is less than 1 byte");
RETURN_FALSE;
}
@ -3568,7 +3570,7 @@ PHP_FUNCTION(ocicloselob)
}
}
php_error(E_NOTICE, "OCICloselob() should not be called like this. Use $somelob->close() to close a LOB");
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "OCICloselob() should not be called like this. Use $somelob->close() to close a LOB");
RETURN_FALSE;
}
@ -4359,7 +4361,7 @@ PHP_FUNCTION(ocierror)
}
if (! errh) {
php_error(E_WARNING, "OCIError: unable to find Error handle");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCIError: unable to find Error handle");
RETURN_FALSE;
}
@ -4468,7 +4470,7 @@ PHP_FUNCTION(ocipasswordchange)
/* Disable in Safe Mode */
if (PG(safe_mode)) {
php_error(E_WARNING, "%s is disabled in Safe Mode", get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "is disabled in Safe Mode");
RETURN_FALSE;
}
@ -4941,7 +4943,7 @@ PHP_FUNCTION(ocicollgetelem)
/* Return false if value does not exist at that location */
if(exists == 0) {
php_error(E_WARNING, "OCICollGetElem - Invalid index %d", ndx);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCICollGetElem - Invalid index %d", ndx);
RETURN_FALSE;
}
@ -5455,7 +5457,7 @@ PHP_FUNCTION(ocinewcollection)
}
break;
default:
php_error(E_WARNING, "OCINewCollection - Unknown Type %d", coll->coll_typecode);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "OCINewCollection - Unknown Type %d", coll->coll_typecode);
break;
}

View File

@ -448,12 +448,12 @@ void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)
list_entry new_le;
if (ORA(max_links)!=-1 && ORA(num_links)>=ORA(max_links)) {
php_error(E_WARNING,"Oracle: Too many open links (%d)",ORA(num_links));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Too many open links (%d)",ORA(num_links));
efree(hashed_details);
RETURN_FALSE;
}
if (ORA(max_persistent)!=-1 && ORA(num_persistent)>=ORA(max_persistent)) {
php_error(E_WARNING,"Oracle: Too many open persistent links (%d)",ORA(num_persistent));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Too many open persistent links (%d)",ORA(num_persistent));
efree(hashed_details);
RETURN_FALSE;
}
@ -470,7 +470,7 @@ void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
) {
ORA(db_err_conn) = *db_conn;
php_error(E_WARNING, "Unable to connect to ORACLE (%s)",ora_error(&db_conn->lda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to connect to ORACLE (%s)",ora_error(&db_conn->lda));
if (persistent) {
free(db_conn);
@ -511,7 +511,7 @@ void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
) {
ORA(db_err_conn) = *db_conn;
php_error(E_WARNING, "Oracle: Link to server lost, unable to reconnect",ora_error(&db_conn->lda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Link to server lost, unable to reconnect",ora_error(&db_conn->lda));
zend_hash_del(&EG(persistent_list), hashed_details, hashed_details_length+1);
efree(hashed_details);
RETURN_FALSE;
@ -547,7 +547,7 @@ void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)
}
}
if (ORA(max_links)!=-1 && ORA(num_links)>=ORA(max_links)) {
php_error(E_WARNING,"Oracle: Too many open links (%d)",ORA(num_links));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Too many open links (%d)",ORA(num_links));
efree(hashed_details);
RETURN_FALSE;
}
@ -564,7 +564,7 @@ void ora_do_logon(INTERNAL_FUNCTION_PARAMETERS, int persistent)
#endif
) {
ORA(db_err_conn) = *db_conn;
php_error(E_WARNING,"Oracle: Connection Failed: %s\n",ora_error(&db_conn->lda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Oracle: Connection Failed: %s\n",ora_error(&db_conn->lda));
efree(hashed_details);
efree(db_conn);
RETURN_FALSE;
@ -622,7 +622,7 @@ PHP_FUNCTION(ora_open)
cursor = (oraCursor *)emalloc(sizeof(oraCursor);
memset(cursor, 0, sizeof(oraCursor));
if (oopen(&cursor->cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) {
php_error(E_WARNING, "Unable to open new cursor (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open new cursor (%s)",
ora_error(&cursor->cda));
efree(cursor);
RETURN_FALSE;
@ -666,7 +666,7 @@ PHP_FUNCTION(ora_commitoff)
ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (ocof(&conn->lda)) {
php_error(E_WARNING, "Unable to turn off auto-commit (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to turn off auto-commit (%s)",
ora_error(&conn->lda));
RETURN_FALSE;
}
@ -687,7 +687,7 @@ PHP_FUNCTION(ora_commiton)
ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (ocon(&conn->lda)) {
php_error(E_WARNING, "Unable to turn on auto-commit (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to turn on auto-commit (%s)",
ora_error(&conn->lda));
RETURN_FALSE;
}
@ -708,7 +708,7 @@ PHP_FUNCTION(ora_commit)
ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (ocom(&conn->lda)) {
php_error(E_WARNING, "Unable to commit transaction (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to commit transaction (%s)",
ora_error(&conn->lda));
RETURN_FALSE;
}
@ -729,7 +729,7 @@ PHP_FUNCTION(ora_rollback)
ZEND_FETCH_RESOURCE2(conn, oraConnection *, arg, -1, "Oracle-Connection", le_conn, le_pconn);
if (orol(&conn->lda)) {
php_error(E_WARNING, "Unable to roll back transaction (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to roll back transaction (%s)",
ora_error(&conn->lda));
RETURN_FALSE;
}
@ -765,7 +765,7 @@ PHP_FUNCTION(ora_parse)
query = (text *) estrndup(Z_STRVAL_PP(sql),Z_STRLEN_PP(sql));
if (query == NULL) {
php_error(E_WARNING, "Invalid query");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid query");
RETURN_FALSE;
}
@ -789,7 +789,7 @@ PHP_FUNCTION(ora_parse)
}
if (oparse(&cursor->cda, query, (sb4) - 1, defer, VERSION_7)) {
php_error(E_WARNING, "Ora_Parse failed (%s)",ora_error(&cursor->cda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Parse failed (%s)",ora_error(&cursor->cda));
RETURN_FALSE;
}
RETURN_TRUE;
@ -833,14 +833,14 @@ PHP_FUNCTION(ora_bind)
if (!cursor->params ||
zend_hash_init(cursor->params, 19, NULL,
HASH_DTOR pval_ora_param_destructor, 0) == FAILURE) {
php_error(E_ERROR, "Unable to initialize parameter list");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to initialize parameter list");
RETURN_FALSE;
}
}
newparam = (oraParam *)emalloc(sizeof(oraParam);
if ((paramname = estrndup(Z_STRVAL_PP(pvar), Z_STRLEN_PP(pvar))) == NULL) {
php_error(E_WARNING, "Out of memory for parametername");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Out of memory for parametername");
efree(newparam);
RETURN_FALSE;
}
@ -850,7 +850,7 @@ PHP_FUNCTION(ora_bind)
/* XXX zend_hash_destroy */
efree(paramname);
efree(newparam);
php_error(E_ERROR, "Could not make parameter placeholder");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not make parameter placeholder");
RETURN_FALSE;
}
@ -880,7 +880,7 @@ PHP_FUNCTION(ora_bind)
0,
-1,
-1)) {
php_error(E_WARNING, "Ora_Bind failed (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Bind failed (%s)",
ora_error(&cursor->cda));
RETURN_FALSE;
}
@ -921,7 +921,7 @@ PHP_FUNCTION(ora_exec)
}
if (oexec(&cursor->cda)) {
php_error(E_WARNING, "Ora_Exec failed (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Exec failed (%s)",
ora_error(&cursor->cda));
RETURN_FALSE;
}
@ -995,14 +995,14 @@ PHP_FUNCTION(ora_do)
query = (text *) estrndup(Z_STRVAL_PP(sql),Z_STRLEN_PP(sql));
if (query == NULL) {
php_error(E_WARNING, "Invalid query in Ora_Do");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Invalid query in Ora_Do");
RETURN_FALSE;
}
cursor->query = query;
if (oopen(&cursor->cda, &conn->lda, (text *) 0, -1, -1, (text *) 0, -1)) {
php_error(E_WARNING, "Unable to open new cursor (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to open new cursor (%s)",
ora_error(&cursor->cda));
efree(cursor);
RETURN_FALSE;
@ -1014,7 +1014,7 @@ PHP_FUNCTION(ora_do)
/* Prepare stmt */
if (oparse(&cursor->cda, query, (sb4) - 1, 1, VERSION_7)){
php_error(E_WARNING, "Ora_Do failed (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Do failed (%s)",
ora_error(&cursor->cda));
_close_oracur(cursor TSRMLS_CC);
RETURN_FALSE;
@ -1028,7 +1028,7 @@ PHP_FUNCTION(ora_do)
RETURN_FALSE;
}
if (oexfet(&cursor->cda, 1, 0, 0)) {
php_error(E_WARNING, "Ora_Do failed (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Do failed (%s)",
ora_error(&cursor->cda));
_close_oracur(cursor TSRMLS_CC);
RETURN_FALSE;
@ -1036,7 +1036,7 @@ PHP_FUNCTION(ora_do)
cursor->fetched = 1;
} else {
if (oexec(&cursor->cda)) {
php_error(E_WARNING, "Ora_Do failed (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Do failed (%s)",
ora_error(&cursor->cda));
_close_oracur(cursor TSRMLS_CC);
RETURN_FALSE;
@ -1063,14 +1063,14 @@ PHP_FUNCTION(ora_fetch)
}
if (cursor->ncols == 0){
php_error(E_WARNING, "No tuples available on this cursor");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available on this cursor");
RETURN_FALSE;
}
/* Get data from Oracle */
if (ofetch(&cursor->cda)) {
if (cursor->cda.rc != NO_DATA_FOUND) {
php_error(E_WARNING, "Ora_Fetch failed (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Fetch failed (%s)",
ora_error(&cursor->cda));
}
RETURN_FALSE;
@ -1111,13 +1111,13 @@ PHP_FUNCTION(ora_fetch_into)
}
if (cursor->ncols == 0){
php_error(E_WARNING, "No tuples available on this cursor");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available on this cursor");
RETURN_FALSE;
}
if (ofetch(&cursor->cda)) {
if (cursor->cda.rc != NO_DATA_FOUND) {
php_error(E_WARNING, "Ora_Fetch_Into failed (%s)",ora_error(&cursor->cda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Fetch_Into failed (%s)",ora_error(&cursor->cda));
}
RETURN_FALSE;
}
@ -1232,17 +1232,17 @@ PHP_FUNCTION(ora_columnname)
convert_to_long_ex(col);
if (cursor->ncols == 0){
php_error(E_WARNING, "No tuples available at this cursor index");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
RETURN_FALSE;
}
if (Z_LVAL_PP(col) >= cursor->ncols){
php_error(E_WARNING, "Column index larger than number of columns");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
RETURN_FALSE;
}
if (Z_LVAL_PP(col) < 0){
php_error(E_WARNING, "Column numbering starts at 0");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
RETURN_FALSE;
}
@ -1271,17 +1271,17 @@ PHP_FUNCTION(ora_columntype)
colno = Z_LVAL_PP(col);
if (cursor->ncols == 0){
php_error(E_WARNING, "No tuples available at this cursor index");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
RETURN_FALSE;
}
if (colno >= cursor->ncols){
php_error(E_WARNING, "Column index larger than number of columns");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
RETURN_FALSE;
}
if (colno < 0){
php_error(E_WARNING, "Column numbering starts at 0");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
RETURN_FALSE;
}
@ -1338,17 +1338,17 @@ PHP_FUNCTION(ora_columnsize)
convert_to_long_ex(col);
if (cursor->ncols == 0){
php_error(E_WARNING, "No tuples available at this cursor index");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
RETURN_FALSE;
}
if (Z_LVAL_PP(col) >= cursor->ncols){
php_error(E_WARNING, "Column index larger than number of columns");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
RETURN_FALSE;
}
if (Z_LVAL_PP(col) < 0){
php_error(E_WARNING, "Column numbering starts at 0");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
RETURN_FALSE;
}
@ -1376,7 +1376,7 @@ PHP_FUNCTION(ora_getcolumn)
}
if (cursor->ncols == 0){
php_error(E_WARNING, "No tuples available at this cursor index");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No tuples available at this cursor index");
RETURN_FALSE;
}
@ -1384,19 +1384,19 @@ PHP_FUNCTION(ora_getcolumn)
colno = Z_LVAL_PP(col);
if (colno >= cursor->ncols){
php_error(E_WARNING, "Column index larger than number of columns");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column index larger than number of columns");
RETURN_FALSE;
}
if (colno < 0){
php_error(E_WARNING, "Column numbering starts at 0");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Column numbering starts at 0");
RETURN_FALSE;
}
if (cursor->fetched == 0){
if (ofetch(&cursor->cda)) {
if (cursor->cda.rc != NO_DATA_FOUND) {
php_error(E_WARNING, "Ora_Fetch failed (%s)",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_Fetch failed (%s)",
ora_error(&cursor->cda));
}
RETURN_FALSE;
@ -1476,7 +1476,7 @@ PHP_FUNCTION(ora_getcolumn)
}
}
default:
php_error(E_WARNING,"Ora_GetColumn found invalid type (%d)", type);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Ora_GetColumn found invalid type (%d)", type);
RETURN_FALSE;
}
}
@ -1580,7 +1580,7 @@ ora_get_cursor(HashTable *list, pval **ind TSRMLS_DC)
}
if (zend_hash_find(ORA(conns),(void*)&(cursor->conn_ptr),sizeof(void*),(void **)&db_conn) == FAILURE) {
php_error(E_WARNING, "Connection already closed for cursor index %d", ind);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Connection already closed for cursor index %d", ind);
return NULL;
}
@ -1642,7 +1642,7 @@ ora_describe_define(oraCursor * cursor)
if (cursor->cda.rc == VAR_NOT_IN_LIST) {
break;
} else {
php_error(E_WARNING, "%s", ora_error(&cursor->cda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_error(&cursor->cda));
cursor->ncols = 0;
return -1;
}
@ -1666,7 +1666,7 @@ ora_describe_define(oraCursor * cursor)
if (cursor->cda.rc == VAR_NOT_IN_LIST) {
break;
} else {
php_error(E_WARNING, "%s", ora_error(&cursor->cda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_error(&cursor->cda));
return -1;
}
}
@ -1692,7 +1692,7 @@ ora_describe_define(oraCursor * cursor)
cursor->columns[col].dsize + 1, type, -1, &cursor->columns[col].indp,
(text *) 0, -1, -1, &cursor->columns[col].col_retlen,
&cursor->columns[col].col_retcode)) {
php_error(E_WARNING, "%s", ora_error(&cursor->cda));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", ora_error(&cursor->cda));
return -1;
}
}
@ -1712,18 +1712,18 @@ int ora_set_param_values(oraCursor *cursor, int isout TSRMLS_DC)
zend_hash_internal_pointer_reset(cursor->params);
if(zend_hash_num_elements(cursor->params) != cursor->nparams){
php_error(E_WARNING, "Mismatch in number of parameters");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Mismatch in number of parameters");
return 0;
}
for(i = 0; i < cursor->nparams; i++, zend_hash_move_forward(cursor->params)){
if(zend_hash_get_current_key(cursor->params, &paramname, NULL, 0) != HASH_KEY_IS_STRING){
php_error(E_WARNING, "Can't get parameter name");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get parameter name");
return 0;
}
if(zend_hash_get_current_data(cursor->params, (void **)&param) == FAILURE){
php_error(E_WARNING, "Can't get parameter data");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't get parameter data");
return 0;
}
@ -1735,7 +1735,7 @@ int ora_set_param_values(oraCursor *cursor, int isout TSRMLS_DC)
/* doing the in-loop */
if (zend_hash_find(&EG(symbol_table), paramname, strlen(paramname) + 1, (void **)&pdata) == FAILURE){
php_error(E_WARNING, "Can't find variable for parameter");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Can't find variable for parameter");
return 0;
}
@ -1743,7 +1743,7 @@ int ora_set_param_values(oraCursor *cursor, int isout TSRMLS_DC)
plen = Z_STRLEN_PP(pdata);
if (param->progvl <= plen){
php_error(E_NOTICE, "Input value will be truncated");
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Input value will be truncated");
}
len = min(param->progvl - 1, plen);

View File

@ -304,15 +304,12 @@ PHP_FUNCTION(ovrimos_execute)
int arr_elem;
if (Z_TYPE_P(arg2) != IS_ARRAY) {
php_error(E_WARNING,
"Not an array in call to ovrimos_execute()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not an array in call to ovrimos_execute()");
RETURN_FALSE;
}
arr_elem = zend_hash_num_elements(Z_ARRVAL_P(arg2));
if (arr_elem < colnb) {
php_error(E_WARNING,
"Not enough parameters in call to ovrimos_execute(): %d instead of %d",
arr_elem, colnb);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Not enough parameters in call to ovrimos_execute(): %d instead of %d", arr_elem, colnb);
RETURN_FALSE;
}
@ -329,16 +326,12 @@ PHP_FUNCTION(ovrimos_execute)
if (zend_hash_get_current_data
(Z_ARRVAL_P(arg2), (void **) &tmp) == FAILURE) {
php_error(E_WARNING,
"Error getting parameter %d in call to ovrimos_execute()",
icol);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error getting parameter %d in call to ovrimos_execute()", icol);
RETURN_FALSE;
}
convert_to_string(*tmp);
if (Z_TYPE_PP(tmp) != IS_STRING) {
php_error(E_WARNING,
"Error converting parameter %d to string in call to ovrimos_execute()",
icol);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error converting parameter %d to string in call to ovrimos_execute()", icol);
RETURN_FALSE;
}
@ -376,17 +369,13 @@ PHP_FUNCTION(ovrimos_execute)
break;
}
if (!ret) {
php_error(E_WARNING,
"Error converting parameter %d: %s in call to ovrimos_execute()",
icol, msg);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error converting parameter %d: %s in call to ovrimos_execute()", icol, msg);
RETURN_FALSE;
}
len = sql_type_size(to_type) - 1;
if (!sqlPutParam(stmt, icol, buffer + 1, len)) {
php_error(E_WARNING,
"Could send parameter %d (%d bytes) in call to ovrimos_execute()",
icol, len);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could send parameter %d (%d bytes) in call to ovrimos_execute()", icol, len);
RETURN_FALSE;
}
}
@ -655,8 +644,7 @@ PHP_FUNCTION(ovrimos_fetch_into)
if (arg_how != 0) {
if (Z_TYPE_P(arg_how) != IS_STRING) {
php_error(E_WARNING,
"Third argument not string in ovrimos_fetch_into()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third argument not string in ovrimos_fetch_into()");
RETURN_FALSE;
}
s_how = Z_STRVAL_P(arg_how);
@ -671,13 +659,11 @@ PHP_FUNCTION(ovrimos_fetch_into)
} else if (stricmp(s_how, "absolute") == 0) {
how = h_absolute;
} else {
php_error(E_WARNING,
"Third argument not valid in ovrimos_fetch_into()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third argument not valid in ovrimos_fetch_into()");
RETURN_FALSE;
}
if (arg_row == 0 && how == h_absolute) {
php_error(E_WARNING,
"Fourth argument is required for ABSOLUTE in ovrimos_fetch_into()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Fourth argument is required for ABSOLUTE in ovrimos_fetch_into()");
RETURN_FALSE;
}
if (arg_row != 0) {
@ -781,8 +767,7 @@ PHP_FUNCTION(ovrimos_fetch_row)
if (arg_how != 0) {
if (Z_TYPE_P(arg_how) != IS_STRING) {
php_error(E_WARNING,
"Second argument not string in ovrimos_fetch_row()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument not string in ovrimos_fetch_row()");
RETURN_FALSE;
}
s_how = Z_STRVAL_P(arg_how);
@ -797,13 +782,11 @@ PHP_FUNCTION(ovrimos_fetch_row)
} else if (stricmp(s_how, "absolute") == 0) {
how = h_absolute;
} else {
php_error(E_WARNING,
"Second argument not valid in ovrimos_fetch_row()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument not valid in ovrimos_fetch_row()");
RETURN_FALSE;
}
if (arg_row == 0 && how == 4) {
php_error(E_WARNING,
"Third argument is required for ABSOLUTE in ovrimos_fetch_row()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Third argument is required for ABSOLUTE in ovrimos_fetch_row()");
RETURN_FALSE;
}
if (arg_row != 0) {
@ -878,12 +861,11 @@ PHP_FUNCTION(ovrimos_result)
} else if (Z_TYPE_P(arg_field) == IS_LONG) {
icol = Z_LVAL_P(arg_field) - 1;
} else {
php_error(E_WARNING,
"Second argument neither number nor string in ovrimos_result()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Second argument neither number nor string in ovrimos_result()");
RETURN_FALSE;
}
if (icol < 0 || icol > colnb) {
php_error(E_WARNING, "Unknown column in ovrimos_result()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown column in ovrimos_result()");
RETURN_FALSE;
}
column_to_string(stmt, icol, buffer, &len, pstmt);
@ -1042,17 +1024,14 @@ PHP_FUNCTION(ovrimos_field_name)
if (Z_LVAL_P(arg2) < 1) {
php_error(E_WARNING,
"Field numbering starts at 1! in call to ovrimos_field_name()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1! in call to ovrimos_field_name()");
RETURN_FALSE;
}
field = Z_LVAL_P(arg2) - 1;
if (field >= sqlGetOutputColNb(stmt)) {
php_error(E_WARNING,
"No field at this index (%d) in call to ovrimos_field_name()",
field);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No field at this index (%d) in call to ovrimos_field_name()", field);
RETURN_FALSE;
}
@ -1081,17 +1060,14 @@ PHP_FUNCTION(ovrimos_field_type)
stmt = (SQLS) pstmt->statement;
if (Z_LVAL_P(arg2) < 1) {
php_error(E_WARNING,
"Field numbering starts at 1! in call to ovrimos_field_type()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1! in call to ovrimos_field_type()");
RETURN_FALSE;
}
field = Z_LVAL_P(arg2) - 1;
if (field >= sqlGetOutputColNb(stmt)) {
php_error(E_WARNING,
"No field at this index (%d) in call to ovrimos_field_type()",
field);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No field at this index (%d) in call to ovrimos_field_type()", field);
RETURN_FALSE;
}
@ -1123,17 +1099,14 @@ PHP_FUNCTION(ovrimos_field_len)
stmt = (SQLS) pstmt->statement;
if (Z_LVAL_P(arg2) < 1) {
php_error(E_WARNING,
"Field numbering starts at 1! in call to ovrimos_field_len()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Field numbering starts at 1! in call to ovrimos_field_len()");
RETURN_FALSE;
}
field = Z_LVAL_P(arg2) - 1;
if (field >= sqlGetOutputColNb(stmt)) {
php_error(E_WARNING,
"No field at this index (%d) in call to ovrimos_field_len()",
field);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No field at this index (%d) in call to ovrimos_field_len()", field);
RETURN_FALSE;
}

View File

@ -633,7 +633,7 @@ static int preg_do_repl_func(zval *function, char *subject, int *offsets, int co
result_len = Z_STRLEN_P(retval_ptr);
zval_ptr_dtor(&retval_ptr);
} else {
php_error(E_WARNING, "Unable to call custom replacement function");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to call custom replacement function");
result_len = offsets[1] - offsets[0];
*result = estrndup(&subject[offsets[0]], result_len);
}
@ -776,7 +776,7 @@ PHPAPI char *php_pcre_replace(char *regex, int regex_len,
eval = preg_options & PREG_REPLACE_EVAL;
if (is_callable_replace) {
if (eval) {
php_error(E_WARNING, "/e modifier cannot be used with replacement callback");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "/e modifier cannot be used with replacement callback");
return NULL;
}
} else {
@ -1054,8 +1054,7 @@ static void preg_replace_impl(INTERNAL_FUNCTION_PARAMETERS, zend_bool is_callabl
convert_to_string_ex(replace);
if (is_callable_replace) {
if (!zend_is_callable(*replace, 0, &callback_name)) {
php_error(E_WARNING, "%s() requires argument 2, '%s', to be a valid callback",
get_active_function_name(TSRMLS_C), callback_name);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "requires argument 2, '%s', to be a valid callback", callback_name);
efree(callback_name);
*return_value = **subject;
zval_copy_ctor(return_value);

View File

@ -253,6 +253,7 @@ static void _free_pdf_doc(zend_rsrc_list_entry *rsrc TSRMLS_DC)
*/
static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
{
TSRMLS_FETCH();
switch (type){
case PDF_NonfatalError:
/*
@ -262,7 +263,7 @@ static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
* pdf_set_parameter($p, "warning" 0) to switch off
* the warnings inside PDFlib.
*/
php_error(E_WARNING,"Internal PDFlib warning: %s", shortmsg);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal PDFlib warning: %s", shortmsg);
return;
case PDF_MemoryError: /* give up in all other cases */
case PDF_IOError:
@ -276,7 +277,7 @@ static void custom_errorhandler(PDF *p, int type, const char *shortmsg)
case PDF_SystemError:
case PDF_UnknownError:
default:
php_error(E_ERROR,"PDFlib error: %s", shortmsg);
php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: %s", shortmsg);
}
}
/* }}} */
@ -343,7 +344,7 @@ PHP_MINIT_FUNCTION(pdf)
{
if ((PDF_get_majorversion() != PDFLIB_MAJORVERSION) ||
(PDF_get_minorversion() != PDFLIB_MINORVERSION)) {
php_error(E_ERROR,"PDFlib error: Version mismatch in wrapper code");
php_error_docref(NULL TSRMLS_CC, E_ERROR,"PDFlib error: Version mismatch in wrapper code");
}
le_pdf = zend_register_list_destructors_ex(_free_pdf_doc, NULL, "pdf object", module_number);
@ -659,7 +660,7 @@ PHP_FUNCTION(pdf_set_font)
font = PDF_findfont(pdf, Z_STRVAL_PP(arg2), Z_STRVAL_PP(arg4), embed);
if (font == -1) {
php_error(E_WARNING,"Font %s not found", Z_STRVAL_PP(arg2));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Font %s not found", Z_STRVAL_PP(arg2));
RETURN_FALSE;
}
@ -1083,7 +1084,7 @@ PHP_FUNCTION(pdf_setflat)
convert_to_double_ex(arg2);
/* pdflib will do this for you, will throw some exception
if((Z_LVAL_PP(arg2) > 100) && (Z_LVAL_PP(arg2) < 0)) {
php_error(E_WARNING,"Parameter of pdf_setflat() has to between 0 and 100");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter of pdf_setflat() has to between 0 and 100");
RETURN_FALSE;
}
*/
@ -1109,7 +1110,7 @@ PHP_FUNCTION(pdf_setlinejoin)
convert_to_long_ex(arg2);
/* pdflib will do this for you, will throw some exception
if((Z_LVAL_PP(arg2) > 2) && (Z_LVAL_PP(arg2) < 0)) {
php_error(E_WARNING,"Parameter of pdf_setlinejoin() must be between 0 and 2");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter of pdf_setlinejoin() must be between 0 and 2");
RETURN_FALSE;
}
*/
@ -1135,7 +1136,7 @@ PHP_FUNCTION(pdf_setlinecap)
convert_to_long_ex(arg2);
/* pdflib will do this for you, will throw some exception
if((Z_LVAL_PP(arg2) > 2) && (Z_LVAL_PP(arg2) < 0)) {
php_error(E_WARNING,"Parameter of pdf_setlinecap() must be > 0 and <= 2");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter of pdf_setlinecap() must be > 0 and <= 2");
RETURN_FALSE;
}
*/
@ -1161,7 +1162,7 @@ PHP_FUNCTION(pdf_setmiterlimit)
convert_to_double_ex(arg2);
/* pdflib will do this for you, will throw some exception
if(Z_DVAL_PP(arg2) < 1) {
php_error(E_WARNING,"Parameter of pdf_setmiterlimit() must be >= 1");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Parameter of pdf_setmiterlimit() must be >= 1");
RETURN_FALSE;
}
*/
@ -1929,7 +1930,7 @@ PHP_FUNCTION(pdf_open_image_file)
if (pdf_image == -1) {
/* pdflib will do this for you, will throw some exception
php_error(E_WARNING, "Could not open image: %s", image);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open image: %s", image);
*/
RETURN_FALSE;
}
@ -1958,7 +1959,7 @@ PHP_FUNCTION(pdf_open_memory_image)
ZEND_GET_RESOURCE_TYPE_ID(le_gd,"gd");
if(!le_gd)
{
php_error(E_ERROR, "Unable to find handle for GD image stream. Please check the GD extension is loaded.");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to find handle for GD image stream. Please check the GD extension is loaded.");
}
ZEND_FETCH_RESOURCE(im, gdImagePtr, arg2, -1, "Image", le_gd);
@ -1995,7 +1996,7 @@ PHP_FUNCTION(pdf_open_memory_image)
if(pdf_image == -1) {
/* pdflib will do this for you, will throw some exception
php_error(E_WARNING, "Could not open image");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not open image");
*/
efree(buffer);
RETURN_FALSE;
@ -2401,7 +2402,7 @@ PHP_FUNCTION(pdf_findfont)
font = PDF_findfont(pdf, fontname, encoding, embed);
if (font == -1) {
/* pdflib will do this for you, will throw some exception
php_error(E_WARNING,"Font %s not found", fontname);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Font %s not found", fontname);
*/
RETURN_FALSE;
}
@ -2471,7 +2472,7 @@ PHP_FUNCTION(pdf_setpolydash)
} else if (Z_TYPE_P(keydata) == IS_LONG) {
darray[i] = (float) Z_LVAL_P(keydata);
} else {
php_error(E_WARNING,"PDFlib set_polydash: illegal darray value");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PDFlib set_polydash: illegal darray value");
}
zend_hash_move_forward(array);
}

View File

@ -211,7 +211,7 @@ PHP_FUNCTION(pfpro_process_raw)
args = (zval ***) emalloc(sizeof(zval **) * ZEND_NUM_ARGS());
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
php_error(E_WARNING, "Unable to read parameters in pfpro_process_raw()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to read parameters in pfpro_process_raw()");
efree(args);
RETURN_FALSE;
}
@ -328,13 +328,13 @@ PHP_FUNCTION(pfpro_process)
args = (zval ***) emalloc(sizeof(zval **) * ZEND_NUM_ARGS());
if (zend_get_parameters_array_ex(ZEND_NUM_ARGS(), args) == FAILURE) {
php_error(E_ERROR, "Unable to read parameters in pfpro_process()");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to read parameters in pfpro_process()");
efree(args);
RETURN_FALSE;
}
if (Z_TYPE_PP(args[0]) != IS_ARRAY) {
php_error(E_ERROR, "First parameter to pfpro_process() must be an array");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "First parameter to pfpro_process() must be an array");
efree(args);
RETURN_FALSE;
}
@ -418,7 +418,7 @@ PHP_FUNCTION(pfpro_process)
break;
default:
php_error(E_ERROR, "pfpro_process() array keys must be strings or integers");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array keys must be strings or integers");
if (parmlist) {
efree(parmlist);
}
@ -464,7 +464,7 @@ PHP_FUNCTION(pfpro_process)
break;
default:
php_error(E_ERROR, "pfpro_process() array values must be strings, ints or floats");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "pfpro_process() array values must be strings, ints or floats");
if (parmlist) {
efree(parmlist);
}

View File

@ -766,8 +766,7 @@ PHP_FUNCTION(posix_getgrnam)
array_init(return_value);
if (!php_posix_group_to_array(g, return_value)) {
php_error(E_WARNING, "%s() unable to convert posix group to array",
get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group to array");
RETURN_FALSE;
}
}
@ -791,8 +790,7 @@ PHP_FUNCTION(posix_getgrgid)
array_init(return_value);
if (!php_posix_group_to_array(g, return_value)) {
php_error(E_WARNING, "%s() unable to convert posix group struct to array",
get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix group struct to array");
RETURN_FALSE;
}
}
@ -833,8 +831,7 @@ PHP_FUNCTION(posix_getpwnam)
array_init(return_value);
if (!php_posix_passwd_to_array(pw, return_value)) {
php_error(E_WARNING, "%s() unable to convert posix passwd struct to array",
get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
RETURN_FALSE;
}
@ -859,8 +856,7 @@ PHP_FUNCTION(posix_getpwuid)
array_init(return_value);
if (!php_posix_passwd_to_array(pw, return_value)) {
php_error(E_WARNING, "%s() unable to convert posix passwd struct to array",
get_active_function_name(TSRMLS_C));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "unable to convert posix passwd struct to array");
RETURN_FALSE;
}
}

View File

@ -175,7 +175,7 @@ PHP_FUNCTION(pspell_new)
delete_pspell_config(config);
if(pspell_error_number(ret) != 0){
php_error(E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret));
RETURN_FALSE;
}
@ -257,7 +257,7 @@ PHP_FUNCTION(pspell_new_personal)
delete_pspell_config(config);
if(pspell_error_number(ret) != 0){
php_error(E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret));
RETURN_FALSE;
}
@ -291,7 +291,7 @@ PHP_FUNCTION(pspell_new_config)
ret = new_pspell_manager(config);
if(pspell_error_number(ret) != 0){
php_error(E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL couldn't open the dictionary. reason: %s ", pspell_error_message(ret));
RETURN_FALSE;
}
@ -319,7 +319,7 @@ PHP_FUNCTION(pspell_check)
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@ -351,7 +351,7 @@ PHP_FUNCTION(pspell_suggest)
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@ -365,7 +365,7 @@ PHP_FUNCTION(pspell_suggest)
}
delete_pspell_string_emulation(els);
}else{
php_error(E_WARNING, "PSPELL had a problem. details: %s ", pspell_manager_error_message(manager));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "PSPELL had a problem. details: %s ", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@ -390,7 +390,7 @@ PHP_FUNCTION(pspell_store_replacement)
convert_to_string_ex(corr);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@ -398,7 +398,7 @@ PHP_FUNCTION(pspell_store_replacement)
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
php_error(E_WARNING, "pspell_store_replacement() gave error: %s", pspell_manager_error_message(manager));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_store_replacement() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@ -422,7 +422,7 @@ PHP_FUNCTION(pspell_add_to_personal)
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@ -435,7 +435,7 @@ PHP_FUNCTION(pspell_add_to_personal)
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
php_error(E_WARNING, "pspell_add_to_personal() gave error: %s", pspell_manager_error_message(manager));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_personal() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@ -459,7 +459,7 @@ PHP_FUNCTION(pspell_add_to_session)
convert_to_string_ex(word);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@ -472,7 +472,7 @@ PHP_FUNCTION(pspell_add_to_session)
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
php_error(E_WARNING, "pspell_add_to_session() gave error: %s", pspell_manager_error_message(manager));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_add_to_session() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@ -495,7 +495,7 @@ PHP_FUNCTION(pspell_clear_session)
convert_to_long_ex(scin);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@ -503,7 +503,7 @@ PHP_FUNCTION(pspell_clear_session)
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
php_error(E_WARNING, "pspell_clear_session() gave error: %s", pspell_manager_error_message(manager));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_clear_session() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
}
@ -526,7 +526,7 @@ PHP_FUNCTION(pspell_save_wordlist)
convert_to_long_ex(scin);
manager = (PspellManager *) zend_list_find(Z_LVAL_PP(scin), &type);
if(!manager){
php_error(E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL result index",Z_LVAL_PP(scin));
RETURN_FALSE;
}
@ -535,7 +535,7 @@ PHP_FUNCTION(pspell_save_wordlist)
if(pspell_manager_error_number(manager) == 0){
RETURN_TRUE;
}else{
php_error(E_WARNING, "pspell_save_wordlist() gave error: %s", pspell_manager_error_message(manager));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "pspell_save_wordlist() gave error: %s", pspell_manager_error_message(manager));
RETURN_FALSE;
}
@ -609,7 +609,7 @@ PHP_FUNCTION(pspell_config_runtogether)
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@ -638,7 +638,7 @@ PHP_FUNCTION(pspell_config_mode)
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@ -680,7 +680,7 @@ PHP_FUNCTION(pspell_config_ignore)
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@ -726,7 +726,7 @@ PHP_FUNCTION(pspell_config_personal)
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@ -755,7 +755,7 @@ PHP_FUNCTION(pspell_config_repl)
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}
@ -786,7 +786,7 @@ PHP_FUNCTION(pspell_config_save_repl)
convert_to_long_ex(sccin);
config = (PspellConfig *) zend_list_find(Z_LVAL_PP(sccin), &type);
if(!config){
php_error(E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not an PSPELL config index",Z_LVAL_PP(sccin));
RETURN_FALSE;
}

View File

@ -143,19 +143,19 @@ PHP_FUNCTION(recode_string)
request = recode_new_request(ReSG(outer));
if (request == NULL) {
php_error(E_WARNING, "Cannot allocate request structure");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure");
RETURN_FALSE;
}
success = recode_scan_request(request, Z_STRVAL_PP(req));
if (!success) {
php_error(E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req));
goto error_exit;
}
recode_buffer_to_buffer(request, Z_STRVAL_PP(str), Z_STRLEN_PP(str), &r, &r_len, &r_alen);
if (!r) {
php_error(E_WARNING, "Recoding failed.");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
goto error_exit;
}
@ -204,19 +204,19 @@ PHP_FUNCTION(recode_file)
request = recode_new_request(ReSG(outer));
if (request == NULL) {
php_error(E_WARNING, "Cannot allocate request structure");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot allocate request structure");
RETURN_FALSE;
}
success = recode_scan_request(request, Z_STRVAL_PP(req));
if (!success) {
php_error(E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Illegal recode request '%s'", Z_STRVAL_PP(req));
goto error_exit;
}
success = recode_file_to_file(request, in_fp, out_fp);
if (!success) {
php_error(E_WARNING, "Recoding failed.");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Recoding failed.");
goto error_exit;
}

View File

@ -503,7 +503,7 @@ static int com_call(rpc_string method_name, void **data, zval *return_value, int
char *error_message;
error_message = php_COM_error_message(hr);
php_error(E_WARNING,"Unable to lookup %s: %s", method_name.str, error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to lookup %s: %s", method_name.str, error_message);
LocalFree(error_message);
efree(funcname);
@ -544,10 +544,10 @@ static int com_call(rpc_string method_name, void **data, zval *return_value, int
efree(result);
error_message = php_COM_error_message(hr);
if (ErrString) {
php_error(E_WARNING,"Invoke() failed: %s %s", error_message, ErrString);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invoke() failed: %s %s", error_message, ErrString);
efree(ErrString);
} else {
php_error(E_WARNING,"Invoke() failed: %s", error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Invoke() failed: %s", error_message);
}
LocalFree(error_message);
return FAILURE;
@ -625,7 +625,7 @@ static int com_set(rpc_string property_name, zval *value, void **data)
if (FAILED(hr = php_COM_get_ids_of_names((comval *) *data, propname, &dispid))) {
error_message = php_COM_error_message(hr);
php_error(E_WARNING,"Unable to lookup %s: %s", property_name.str, error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"Unable to lookup %s: %s", property_name.str, error_message);
LocalFree(error_message);
efree(propname);
@ -646,10 +646,10 @@ static int com_set(rpc_string property_name, zval *value, void **data)
if (FAILED(hr = php_COM_invoke((comval *) *data, dispid, DISPATCH_PROPERTYPUT, &dispparams, NULL, &ErrString))) {
error_message = php_COM_error_message(hr);
if (ErrString) {
php_error(E_WARNING,"PropPut() failed: %s %s", error_message, ErrString);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"PropPut() failed: %s %s", error_message, ErrString);
efree(ErrString);
} else {
php_error(E_WARNING,"PropPut() failed: %s", error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"PropPut() failed: %s", error_message);
}
LocalFree(error_message);
VariantClear(var);
@ -794,7 +794,7 @@ PHP_FUNCTION(com_next)
efree(result);
error_message = php_COM_error_message(hr);
php_error(E_WARNING,"IEnumVariant::Next() failed: %s", error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"IEnumVariant::Next() failed: %s", error_message);
efree(error_message);
RETURN_NULL();
@ -862,7 +862,7 @@ PHP_FUNCTION(com_reset)
if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Reset(C_ENUMVARIANT(obj)))) {
char *error_message = php_COM_error_message(hr);
php_error(E_WARNING,"IEnumVariant::Next() failed: %s", error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"IEnumVariant::Next() failed: %s", error_message);
efree(error_message);
RETURN_FALSE;
@ -899,7 +899,7 @@ PHP_FUNCTION(com_skip)
if (FAILED(hr = C_ENUMVARIANT_VT(obj)->Skip(C_ENUMVARIANT(obj), count))) {
char *error_message = php_COM_error_message(hr);
php_error(E_WARNING,"IEnumVariant::Next() failed: %s", error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING,"IEnumVariant::Next() failed: %s", error_message);
efree(error_message);
RETURN_FALSE;
}

View File

@ -876,7 +876,7 @@ ZEND_API int php_COM_load_typelib(ITypeLib *TypeLib, int mode)
/* Oops, it already exists. No problem if it is defined as the same value */
/* Check to see if they are the same */
if (!compare_function(&results, &c.value, &exists TSRMLS_CC) && INI_INT("com.autoregister_verbose")) {
php_error(E_WARNING,"Type library value %s is already defined and has a different value", c.name);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Type library value %s is already defined and has a different value", c.name);
}
free(c.name);
j++;

View File

@ -124,7 +124,7 @@ PHPAPI void php_zval_to_variant_ex(zval *zval_arg, VARIANT *var_arg, int type, i
safeArray = SafeArrayCreate(VT_VARIANT, 1, bounds);
if (NULL == safeArray) {
php_error( E_WARNING,"Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to convert php array to VARIANT array - %s", numberOfElements ? "" : "(Empty input array)");
ZVAL_FALSE(zval_arg);
} else {
V_ARRAY(var_arg) = safeArray;
@ -143,14 +143,14 @@ PHPAPI void php_zval_to_variant_ex(zval *zval_arg, VARIANT *var_arg, int type, i
php_zval_to_variant(*entry, v, codepage); /* Do the required conversion */
}
} else {
php_error( E_WARNING,"phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "phpArrayToSafeArray() - Unable to retrieve pointer to output element number (%d)", i);
}
}
zend_hash_move_forward(ht);
}
SafeArrayUnlock( safeArray);
} else {
php_error( E_WARNING,"phpArrayToSafeArray() - Unable to lock safeArray");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "phpArrayToSafeArray() - Unable to lock safeArray");
}
}
} else {
@ -365,7 +365,7 @@ PHPAPI void php_zval_to_variant_ex(zval *zval_arg, VARIANT *var_arg, int type, i
break;
case VT_VARIANT:
php_error(E_WARNING,"VT_VARIANT is invalid. Use VT_VARIANT|VT_BYREF instead.");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "VT_VARIANT is invalid. Use VT_VARIANT|VT_BYREF instead.");
/* break missing intentionally */
case VT_VARIANT|VT_BYREF: {
variantval *var;
@ -430,7 +430,7 @@ PHPAPI void php_zval_to_variant_ex(zval *zval_arg, VARIANT *var_arg, int type, i
break;
default:
php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg));
}
if (unicode_str != NULL) {
@ -463,7 +463,7 @@ PHPAPI int php_variant_to_zval(VARIANT *var_arg, zval *zval_arg, int codepage)
/* TODO: Add support for multi-dimensional SafeArrays */
/* For now just validate that the SafeArray has one dimension */
if (1 != (Dims = SafeArrayGetDim(array))) {
php_error(E_WARNING,"Unsupported: multi-dimensional (%d) SafeArrays", Dims);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported: multi-dimensional (%d) SafeArrays", Dims);
ZVAL_NULL(zval_arg);
return FAILURE;
}
@ -584,7 +584,7 @@ PHPAPI int php_variant_to_zval(VARIANT *var_arg, zval *zval_arg, int codepage)
default:
ZVAL_NULL(zval_arg);
ret = FAILURE;
php_error(E_WARNING, "Error converting DECIMAL value to PHP string");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error converting DECIMAL value to PHP string");
break;
}
}
@ -687,7 +687,7 @@ PHPAPI int php_variant_to_zval(VARIANT *var_arg, zval *zval_arg, int codepage)
char *error_message;
error_message = php_COM_error_message(hr);
php_error(E_WARNING,"Unable to obtain IDispatch interface: %s", error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to obtain IDispatch interface: %s", error_message);
LocalFree(error_message);
V_DISPATCH(var_arg) = NULL;
@ -752,7 +752,7 @@ PHPAPI int php_variant_to_zval(VARIANT *var_arg, zval *zval_arg, int codepage)
break;
default:
php_error(E_WARNING,"Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unsupported variant type: %d (0x%X)", V_VT(var_arg), V_VT(var_arg));
ZVAL_NULL(zval_arg);
ret = FAILURE;
break;
@ -790,13 +790,13 @@ PHPAPI OLECHAR *php_char_to_OLECHAR(char *C_str, uint strlen, int codepage, int
if (error) {
switch (GetLastError()) {
case ERROR_NO_UNICODE_TRANSLATION:
php_error(E_WARNING, "No unicode translation available for the specified string");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "No unicode translation available for the specified string");
break;
case ERROR_INSUFFICIENT_BUFFER:
php_error(E_WARNING, "Internal Error: Insufficient Buffer");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Internal Error: Insufficient Buffer");
break;
default:
php_error(E_WARNING, "Unknown error in php_char_to_OLECHAR()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown error in php_char_to_OLECHAR()");
}
}
@ -821,7 +821,7 @@ PHPAPI char *php_OLECHAR_to_char(OLECHAR *unicode_str, uint *out_length, int cod
C_str = (char *) pemalloc(sizeof(char), persist);
*C_str = 0;
php_error(E_WARNING,"Error in php_OLECHAR_to_char()");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error in php_OLECHAR_to_char()");
}
if (out_length) {

View File

@ -260,7 +260,7 @@ static zval* variant_read(zval *object, zval *member, int type TSRMLS_DC)
ZVAL_LONG(result, V_VT(var->var));
} else {
ZVAL_FALSE(result);
php_error(E_WARNING, "Unknown member.");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown member.");
}
return result;
@ -280,7 +280,7 @@ static void variant_write(zval *object, zval *member, zval *value TSRMLS_DC)
} else if (zend_hash_find(&types, Z_STRVAL_P(member), Z_STRLEN_P(member) + 1, (void **) &type) == SUCCESS) {
php_zval_to_variant_ex(value, var->var, *type, var->codepage);
} else {
php_error(E_WARNING, "Unknown member.");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown member.");
}
}

View File

@ -143,13 +143,13 @@ PHP_FUNCTION(dotnet_load)
if (FAILED(hr)) {
char *error_message;
error_message = php_COM_error_message(hr TSRMLS_CC);
php_error(E_WARNING, "Error obtaining .Net class for %s in assembly %s: %s", datatype_name->value.str.val, assembly_name->value.str.val, error_message);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error obtaining .Net class for %s in assembly %s: %s", datatype_name->value.str.val, assembly_name->value.str.val, error_message);
LocalFree(error_message);
efree(obj);
RETURN_FALSE;
}
if (C_DISPATCH(obj) == NULL) {
php_error(E_WARNING, "Unable to locate %s in assembly %s", datatype_name->value.str.val, assembly_name->value.str.val);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unable to locate %s in assembly %s", datatype_name->value.str.val, assembly_name->value.str.val);
efree(obj);
RETURN_FALSE;
}

View File

@ -192,8 +192,7 @@ static int jvm_create(TSRMLS_D)
dl_handle = DL_LOAD(javalib);
if (!dl_handle) {
php_error(E_ERROR, "Unable to load Java Library %s, error: %s",
javalib, DL_ERROR());
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to load Java Library %s, error: %s", javalib, DL_ERROR());
return -1;
}
}
@ -208,7 +207,7 @@ static int jvm_create(TSRMLS_D)
DL_FETCH_SYMBOL(dl_handle, "JNI_CreateJavaVM");
if (!JNI_CreateVM) {
php_error(E_ERROR, "Unable to locate CreateJavaVM function");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to locate CreateJavaVM function");
return -1;
}
@ -235,7 +234,7 @@ static int jvm_create(TSRMLS_D)
DL_FETCH_SYMBOL(dl_handle, "JNI_GetDefaultJavaVMInitArgs");
if (!JNI_DefaultArgs) {
php_error(E_ERROR, "Unable to locate GetDefaultJavaVMInitArgs function");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to locate GetDefaultJavaVMInitArgs function");
return -1;
}
@ -254,7 +253,7 @@ static int jvm_create(TSRMLS_D)
rc = (*JNI_CreateVM)(&JG(jvm), &JG(jenv), &vm_args);
if (rc) {
php_error(E_ERROR, "Unable to create Java Virtual Machine");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unable to create Java Virtual Machine");
return rc;
}
@ -273,7 +272,7 @@ static int jvm_create(TSRMLS_D)
"()Ljava/lang/String;");
errString = (*jenv)->CallObjectMethod(jenv, error, toString);
errAsUTF = (*jenv)->GetStringUTFChars(jenv, errString, &isCopy);
php_error(E_ERROR, "%s", errAsUTF);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "%s", errAsUTF);
if (isCopy) (*jenv)->ReleaseStringUTFChars(jenv, error, errAsUTF);
jvm_destroy(TSRMLS_C);
return -1;
@ -411,7 +410,7 @@ static jobjectArray _java_makeArray(int argc, pval** argv TSRMLS_DC)
static int checkError(pval *value)
{
if (Z_TYPE_P(value) == IS_EXCEPTION) {
php_error(E_WARNING, "%s", Z_STRVAL_P(value));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%s", Z_STRVAL_P(value));
efree(Z_STRVAL_P(value));
ZVAL_FALSE(value);
return 1;
@ -458,7 +457,7 @@ void java_call_function_handler(INTERNAL_FUNCTION_PARAMETERS, zend_property_refe
result = (jlong)(long)object;
if (ZEND_NUM_ARGS() < 1) {
php_error(E_ERROR, "Missing classname in new Java() call");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Missing classname in new Java() call");
return;
}
@ -571,8 +570,7 @@ static pval _java_getset_property
Z_TYPE(presult) = IS_NULL;
if (!obj || (type!=le_jobject)) {
php_error(E_ERROR,
"Attempt to access a Java property on a non-Java object");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Attempt to access a Java property on a non-Java object");
} else {
/* invoke the method */
jmethodID gsp = (*jenv)->GetMethodID(jenv, JG(reflect_class), "GetSetProp",

View File

@ -631,7 +631,7 @@ char *php_session_create_id(PS_CREATE_SID_ARGS)
digest_len = 20;
break;
default:
php_error(E_ERROR, "Invalid session hash function");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Invalid session hash function");
efree(buf);
return NULL;
}
@ -676,7 +676,7 @@ char *php_session_create_id(PS_CREATE_SID_ARGS)
|| PS(hash_bits_per_character) > 6) {
PS(hash_bits_per_character) = 4;
php_error(E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The ini setting hash_bits_per_character is out of range (should be 4, 5, or 6) - using 4 for now");
}
j = bin_to_readable(digest, digest_len, buf, PS(hash_bits_per_character)) - buf;

View File

@ -102,7 +102,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
for the session are also required.
*/
if ((session = SnmpMgrOpen(agent, community, timeout, retries)) == NULL){
php_error(E_WARNING,"error on SnmpMgrOpen %d\n", GetLastError());
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrOpen %d\n", GetLastError());
}
/* Determine and perform the requested operation.*/
@ -121,12 +121,12 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
if (!SnmpMgrRequest(session, requestType, &variableBindings,
&errorStatus, &errorIndex)){
/* The API is indicating an error. */
php_error(E_WARNING,"error on SnmpMgrRequest %d\n", GetLastError());
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d\n", GetLastError());
} else {
/* The API succeeded, errors may be indicated from the remote
agent. */
if (errorStatus > 0){
php_error(E_WARNING,"Error: errorStatus=%d, errorIndex=%d\n",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Error: errorStatus=%d, errorIndex=%d\n",
errorStatus, errorIndex);
} else {
/* Display the resulting variable bindings.*/
@ -167,7 +167,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
if (!SnmpMgrRequest(session, requestType, &variableBindings,
&errorStatus, &errorIndex)){
/* The API is indicating an error.*/
php_error(E_WARNING,"error on SnmpMgrRequest %d\n", GetLastError());
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrRequest %d\n", GetLastError());
break;
}
else
@ -185,8 +185,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
/* Test for general error conditions or sucesss. */
if (errorStatus > 0){
php_error(E_ERROR,"Error: errorStatus=%d, errorIndex=%d \n",
errorStatus, errorIndex);
php_error_docref(NULL TSRMLS_CC, E_ERROR,"Error: errorStatus=%d, errorIndex=%d \n", errorStatus, errorIndex);
break;
}
else
@ -221,7 +220,7 @@ void _php_snmp(INTERNAL_FUNCTION_PARAMETERS, int st) {
/* Close SNMP session with the remote agent.*/
if (!SnmpMgrClose(session)){
php_error(E_WARNING,"error on SnmpMgrClose %d\n", GetLastError());
php_error_docref(NULL TSRMLS_CC, E_WARNING, "error on SnmpMgrClose %d\n", GetLastError());
}
}
/* }}} */

View File

@ -1428,15 +1428,15 @@ static size_t strfilter_convert_write(php_stream *stream, php_stream_filter *thi
break;
case PHP_CONV_ERR_UNKNOWN:
php_error(E_WARNING, "stream filter (%s): unknown error", inst->filtername, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername, err);
return 0;
case PHP_CONV_ERR_INVALID_SEQ:
php_error(E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername, err);
return 0;
case PHP_CONV_ERR_UNEXPECTED_EOS:
php_error(E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername, err);
return 0;
default:
@ -1482,15 +1482,15 @@ static size_t strfilter_convert_read(php_stream *stream, php_stream_filter *this
switch (err) {
case PHP_CONV_ERR_UNKNOWN:
php_error(E_WARNING, "stream filter (%s): unknown error", inst->filtername, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername, err);
return 0;
case PHP_CONV_ERR_INVALID_SEQ:
php_error(E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid base64 sequence", inst->filtername, err);
return 0;
case PHP_CONV_ERR_UNEXPECTED_EOS:
php_error(E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername, err);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unexpected end of stream", inst->filtername, err);
return 0;
default:
@ -1527,7 +1527,7 @@ static int strfilter_convert_flush(php_stream *stream, php_stream_filter *thisfi
out_p = bucket_buf;
out_left = sizeof(bucket_buf);
} else {
php_error(E_WARNING, "stream filter (%s): unknown error", inst->filtername);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): unknown error", inst->filtername);
return 0;
}
}
@ -1764,7 +1764,7 @@ static php_stream_filter *strfilter_convert_create(const char *filtername, const
if (filterparams != NULL) {
options = strfilter_convert_parse_parameters(filterparams);
if (options == NULL) {
php_error(E_WARNING, "stream filter (%s): invalid filter parameter \"%s\"", filtername, filterparams);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "stream filter (%s): invalid filter parameter \"%s\"", filtername, filterparams);
}
}

View File

@ -126,7 +126,7 @@ static void release_sysvsem_sem(zend_rsrc_list_entry *rsrc TSRMLS_DC)
/* Release the semaphore if it has been acquired but not released. */
if (sem_ptr->count) {
php_error(E_WARNING, "Releasing SysV semaphore id %d key 0x%x in request cleanup", sem_ptr->id, sem_ptr->key);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Releasing SysV semaphore id %d key 0x%x in request cleanup", sem_ptr->id, sem_ptr->key);
sop[1].sem_num = SYSVSEM_SEM;
sop[1].sem_op = sem_ptr->count;
@ -135,7 +135,7 @@ static void release_sysvsem_sem(zend_rsrc_list_entry *rsrc TSRMLS_DC)
opcount++;
}
if (semop(sem_ptr->semid, sop, opcount) == -1) {
php_error(E_WARNING, "semop() failed in release_sysvsem_sem for key 0x%x: %s", sem_ptr->key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed in release_sysvsem_sem for key 0x%x: %s", sem_ptr->key, strerror(errno));
}
efree(sem_ptr);
@ -185,7 +185,7 @@ PHP_FUNCTION(sem_get)
semid = semget(key, 3, perm|IPC_CREAT);
if (semid == -1) {
php_error(E_WARNING, "semget() failed for key 0x%x: %s", key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
RETURN_FALSE;
}
@ -217,7 +217,7 @@ PHP_FUNCTION(sem_get)
sop[2].sem_flg = SEM_UNDO;
while (semop(semid, sop, 3) == -1) {
if (errno != EINTR) {
php_error(E_WARNING, "semop() failed acquiring SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed acquiring SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
break;
}
}
@ -229,7 +229,7 @@ PHP_FUNCTION(sem_get)
count = semctl(semid, SYSVSEM_USAGE, GETVAL, NULL);
#endif
if (count == -1) {
php_error(E_WARNING, "semctl(GETVAL) failed for key 0x%x: %s", key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
}
/* If we are the only user, then take this opportunity to set the max. */
@ -240,17 +240,17 @@ PHP_FUNCTION(sem_get)
union semun semarg;
semarg.val = max_acquire;
if (semctl(semid, SYSVSEM_SEM, SETVAL, semarg) == -1) {
php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
}
#elif defined(SETVAL_WANTS_PTR)
/* This is correct for Solaris 2.6 which does not have union semun. */
if (semctl(semid, SYSVSEM_SEM, SETVAL, &max_acquire) == -1) {
php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
}
#else
/* This works for i.e. AIX */
if (semctl(semid, SYSVSEM_SEM, SETVAL, max_acquire) == -1) {
php_error(E_WARNING, "semctl(SETVAL) failed for key 0x%x: %s", key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", key, strerror(errno));
}
#endif
}
@ -262,7 +262,7 @@ PHP_FUNCTION(sem_get)
sop[0].sem_flg = SEM_UNDO;
while (semop(semid, sop, 1) == -1) {
if (errno != EINTR) {
php_error(E_WARNING, "semop() failed releasing SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed releasing SYSVSEM_SETVAL for key 0x%x: %s", key, strerror(errno));
break;
}
}
@ -309,7 +309,7 @@ static void php_sysvsem_semop(INTERNAL_FUNCTION_PARAMETERS, int acquire)
while (semop(sem_ptr->semid, &sop, 1) == -1) {
if (errno != EINTR) {
php_error(E_WARNING, "semop(%s) failed for key 0x%x: %s",
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s",
acquire ? "acquire" : "release", sem_ptr->key, strerror(errno));
RETURN_FALSE;
}

View File

@ -128,24 +128,24 @@ PHP_FUNCTION(shm_attach)
}
if((shm_list_ptr = (sysvshm_shm *) emalloc(sizeof(sysvshm_shm)))==NULL) {
php_error(E_WARNING, "shm_attach() failed for key 0x%x: cannot allocate internal listelement", shm_key);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: cannot allocate internal listelement", shm_key);
RETURN_FALSE;
}
/* get the id from a specified key or create new shared memory */
if((shm_id=shmget(shm_key,0,0))<0) {
if(shm_size<sizeof(sysvshm_chunk_head)) {
php_error(E_WARNING, "shm_attach() failed for key 0x%x: memorysize too small", shm_key);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: memorysize too small", shm_key);
RETURN_FALSE;
}
if((shm_id=shmget(shm_key,shm_size,shm_flag|IPC_CREAT|IPC_EXCL))<0) {
php_error(E_WARNING, "shmget() failed for key 0x%x: %s", shm_key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", shm_key, strerror(errno));
RETURN_FALSE;
}
}
if((shm_ptr = shmat(shm_id,NULL,0))==(void *)-1) {
php_error(E_WARNING, "shmget() failed for key 0x%x: %s", shm_key, strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x: %s", shm_key, strerror(errno));
RETURN_FALSE;
}
@ -210,12 +210,12 @@ PHP_FUNCTION(shm_remove)
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
if (!shm_list_ptr) {
php_error(E_WARNING, "The parameter is not a valid shm_indentifier");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "The parameter is not a valid shm_indentifier");
RETURN_FALSE;
}
if(shmctl(shm_list_ptr->id,IPC_RMID,NULL)<0) {
php_error(E_WARNING, "shm_remove() failed for key 0x%x, id %i: %s", shm_list_ptr->key, id,strerror(errno));
php_error_docref(NULL TSRMLS_CC, E_WARNING, "failed for key 0x%x, id %i: %s", shm_list_ptr->key, id,strerror(errno));
RETURN_FALSE;
}
@ -246,7 +246,7 @@ PHP_FUNCTION(shm_put_var)
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
if (type!=php_sysvshm.le_shm) {
php_error(E_WARNING, "%d is not a SysV shared memory index", id);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
RETURN_FALSE;
}
@ -262,7 +262,7 @@ PHP_FUNCTION(shm_put_var)
smart_str_free(&shm_var);
if(ret==-1) {
php_error(E_WARNING, "not enough shared memory left");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "not enough shared memory left");
RETURN_FALSE;
}
RETURN_TRUE;
@ -293,7 +293,7 @@ PHP_FUNCTION(shm_get_var)
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
if (type!=php_sysvshm.le_shm) {
php_error(E_WARNING, "%d is not a SysV shared memory index", id);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
RETURN_FALSE;
}
@ -302,7 +302,7 @@ PHP_FUNCTION(shm_get_var)
shm_varpos=php_check_shm_data((shm_list_ptr->ptr),key);
if(shm_varpos<0) {
php_error(E_WARNING, "variable key %d doesn't exist", key);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %d doesn't exist", key);
RETURN_FALSE;
}
shm_var=(sysvshm_chunk*)((char*)shm_list_ptr->ptr+shm_varpos);
@ -311,7 +311,7 @@ PHP_FUNCTION(shm_get_var)
PHP_VAR_UNSERIALIZE_INIT(var_hash);
if(php_var_unserialize(&return_value, (const char **) &shm_data, shm_data+shm_var->length,&var_hash TSRMLS_CC)!=1) {
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
php_error(E_WARNING, "variable data in shared memory is corruped");
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable data in shared memory is corruped");
RETURN_FALSE;
}
PHP_VAR_UNSERIALIZE_DESTROY(var_hash);
@ -339,14 +339,14 @@ PHP_FUNCTION(shm_remove_var)
shm_list_ptr = (sysvshm_shm *) zend_list_find(id, &type);
if (type!=php_sysvshm.le_shm) {
php_error(E_WARNING, "%d is not a SysV shared memory index", id);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "%d is not a SysV shared memory index", id);
RETURN_FALSE;
}
shm_varpos=php_check_shm_data((shm_list_ptr->ptr),key);
if(shm_varpos<0) {
php_error(E_WARNING, "variable key %d doesn't exist", key);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "variable key %d doesn't exist", key);
RETURN_FALSE;
}
php_remove_shm_data((shm_list_ptr->ptr),shm_varpos);

View File

@ -534,7 +534,7 @@ static int php_w32api_load_function (char *definition, int definition_len, int f
if(zend_hash_exists(&WG(win32_ce)->function_table, (*fh)->function_name, strlen((*fh)->function_name) + 1))
{
php_error( E_WARNING,
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"A function by the name %s already has been registered, cannot redefine function",
(*fh)->function_name);
@ -558,7 +558,7 @@ static int php_w32api_load_function (char *definition, int definition_len, int f
NULL) != SUCCESS)
{
php_error( E_WARNING,
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Loading of function %s failed: Could not insert function handle into hash",
(*fh)->function_name);
@ -576,7 +576,7 @@ static int php_w32api_load_function (char *definition, int definition_len, int f
if(zend_hash_add(&WG(win32_ce)->function_table, (*fh)->function_name,
strlen((*fh)->function_name) + 1, &function, sizeof(zend_function), NULL) == FAILURE)
{
php_error(E_ERROR, "Could not register funciton %s into function table", (*fh)->function_name);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not register funciton %s into function table", (*fh)->function_name);
zend_hash_del(WG(funcs), (*fh)->function_name, strlen((*fh)->function_name) +1);
return FAILURE;;
@ -636,7 +636,7 @@ static int php_w32api_register_type(char *type_definition, int type_definition_l
if((zend_hash_exists(WG(callbacks), (*th)->type_name, strlen((*th)->type_name) +1)) ||
(zend_hash_exists(WG(types), (*th)->type_name, strlen((*th)->type_name) + 1)))
{
php_error( E_WARNING,
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"A type or callback by the name %s already has been registered, cannot redefine type or callback",
(*th)->type_name);
@ -658,7 +658,7 @@ static int php_w32api_register_type(char *type_definition, int type_definition_l
NULL) != SUCCESS)
{
php_error( E_WARNING,
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Loading of type %s failed: Could not insert type handle into hash",
(*th)->type_name);
@ -711,7 +711,7 @@ static int php_w32api_register_callback(char *function_definition, int function_
if(zend_hash_exists(WG(callbacks), (*fh)->function_name, strlen((*fh)->function_name) + 1))
{
php_error( E_WARNING,
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"A callback by the name %s already has been registered, cannot redefine type",
(*fh)->function_name);
@ -734,7 +734,7 @@ static int php_w32api_register_callback(char *function_definition, int function_
NULL) != SUCCESS)
{
php_error( E_WARNING,
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Loading of function %s failed: Could not insert function handle into hash",
(*fh)->function_name);
@ -832,7 +832,7 @@ static int php_w32api_load_library (char *library_name, w32api_lib_handle **lh T
efree(*lh);
efree(lh);
php_error(E_WARNING, "Loading of library failed: %s", message_buffer);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Loading of library failed: %s", message_buffer);
LocalFree(message_buffer);
return FAILURE;
@ -847,7 +847,7 @@ static int php_w32api_load_library (char *library_name, w32api_lib_handle **lh T
NULL) != SUCCESS)
{
php_error( E_WARNING,
php_error_docref(NULL TSRMLS_CC, E_WARNING,
"Loading of library %s failed: Could not insert library handle into hash",
(*lh)->library_name);
@ -947,7 +947,7 @@ static int php_w32api_get_type_size(int type_id, char *type_name, int flags)
if(zend_hash_find(WG(types), type_name, strlen(type_name) +1, (void **)&th) != SUCCESS)
{
php_error(E_ERROR, "Unknown type %s", type_name);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown type %s", type_name);
return -1;
}
@ -957,7 +957,7 @@ static int php_w32api_get_type_size(int type_id, char *type_name, int flags)
break;
case W32API_UNKNOWN:
default:
php_error(E_ERROR, "Unknown type %s", type_name);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown type %s", type_name);
return -1;
}
}
@ -1357,7 +1357,7 @@ void php_w32api_marshall_zval_to_c(argument *arg, w32api_dynamic_param *dp, zval
case W32API_COMPLEX:
if(Z_TYPE_P(pzval) != IS_OBJECT)
{
php_error(E_ERROR, "Variable passed as complex value is not an object");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Variable passed as complex value is not an object");
break;
}
@ -1379,7 +1379,7 @@ void php_w32api_marshall_zval_to_c(argument *arg, w32api_dynamic_param *dp, zval
break;
case W32API_UNKNOWN:
php_error(E_ERROR, "Unknown type when calling function, marshalling failed");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Unknown type when calling function, marshalling failed");
break;
}
@ -1490,7 +1490,7 @@ W32API_CLASS_FUNCTION(win32, registerfunction)
if(php_w32api_load_function(function_definition, function_definition_len, flags TSRMLS_CC) != SUCCESS)
{
php_error(E_ERROR, "Registering Function %s failed", function_definition);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Registering Function %s failed", function_definition);
RETURN_FALSE;
}
@ -1570,7 +1570,7 @@ W32API_CLASS_FUNCTION(win32, definetype)
if(php_w32api_register_type(type_definition, type_definition_len TSRMLS_CC) != SUCCESS)
{
php_error(E_ERROR, "Registering Type %s failed", type_definition);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Registering Type %s failed", type_definition);
RETURN_FALSE;
}
@ -1617,7 +1617,7 @@ W32API_CLASS_FUNCTION(win32, inittype)
if(zend_hash_find(WG(types), type_name, type_name_len +1, (void **)&th) == FAILURE)
{
php_error(E_ERROR, "Could not retrieve type handle for type %s from hash table", type_name);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not retrieve type handle for type %s from hash table", type_name);
RETURN_FALSE;
}
@ -1658,7 +1658,7 @@ W32API_CLASS_FUNCTION(win32, invokefunction)
if(zend_hash_find(WG(funcs), function_name, strlen(function_name) +1, (void **)&fh) == FAILURE)
{
php_error(E_ERROR, "Could not retrieve function handle from hash table");
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not retrieve function handle from hash table");
RETURN_FALSE;
}
@ -1691,7 +1691,7 @@ W32API_CLASS_FUNCTION(win32, invokefunction)
if((*fh)->return_type_id == W32API_COMPLEX)
{
if(zend_hash_find(WG(types), (*fh)->return_type_name, strlen((*fh)->return_type_name) +1, (void **)&th) != SUCCESS)
php_error(E_ERROR, "Could not find type handle for type %s", (*fh)->return_type_name);
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Could not find type handle for type %s", (*fh)->return_type_name);
w32api_return_buffer = emalloc(th->size);
w32api_return_buffer_size = th->size;
@ -1736,7 +1736,7 @@ W32API_CLASS_FUNCTION(win32, invokefunction)
case W32API_COMPLEX:
break;
default:
php_error(E_WARNING, "Unknown return type %s", (*fh)->return_type_name);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Unknown return type %s", (*fh)->return_type_name);
}
}
@ -2141,7 +2141,7 @@ w32api_func_handle *w32api_parser_load_function_ex(char *return_type, char *func
if(!return_value->handle)
{
/* TODO: php_error_docref and GetLastError etc */
php_error(E_WARNING, "Could not load function %s", function_name);
php_error_docref(NULL TSRMLS_CC, E_WARNING, "Could not load function %s", function_name);
efree(return_value);
return NULL;
}
@ -2180,7 +2180,7 @@ arguments *w32api_parser_make_argument(char *arg_type, char *arg_name, int byref
if(argument_value->type_id == W32API_UNKNOWN)
{
php_error(E_NOTICE, "Unknown type %s used as arugment type", arg_type);
php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown type %s used as arugment type", arg_type);
}
return return_value;
@ -2204,7 +2204,8 @@ arguments *w32api_parser_join_arguments(arguments *lval, arguments *rval)
*/
int w32api_function_definition_error(char *s)
{
php_error(E_ERROR, "Function Definition Parse Error: %s", s);
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Function Definition Parse Error: %s", s);
return 0;
}
/* }}} */
@ -2278,7 +2279,8 @@ members *w32api_parser_type_join_values(members *lval, members *rval)
*/
int w32api_type_definition_error(char *s)
{
php_error(E_ERROR, "Type Definition Parse Error: %s", s);
TSRMLS_FETCH();
php_error_docref(NULL TSRMLS_CC, E_ERROR, "Type Definition Parse Error: %s", s);
return 0;
}
/* }}} */