ps_files_close(data);
if (!ps_files_valid_key(key)) {
- php_error(E_WARNING, "The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "The session id contains illegal characters, valid characters are only a-z, A-Z and 0-9");
return;
}
if (!ps_files_path_create(buf, sizeof(buf), data, key))
#ifdef F_SETFD
if (fcntl(data->fd, F_SETFD, 1)) {
- php_error(E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "fcntl(%d, F_SETFD, 1) failed: %s (%d)", data->fd, strerror(errno), errno);
}
#endif
} else {
- php_error(E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf,
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "open(%s, O_RDWR) failed: %s (%d)", buf,
strerror(errno), errno);
}
}
dir = opendir(dirname);
if (!dir) {
- php_error(E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n", dirname, strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "ps_files_cleanup_dir: opendir(%s) failed: %s (%d)\n", dirname, strerror(errno), errno);
return (0);
}
if (n != sbuf.st_size) {
if (n == -1)
- php_error(E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "read failed: %s (%d)", strerror(errno), errno);
else
- php_error(E_WARNING, "read returned less bytes than requested");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "read returned less bytes than requested");
efree(*val);
return FAILURE;
}
if (n != vallen) {
if (n == -1)
- php_error(E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "write failed: %s (%d)", strerror(errno), errno);
else
- php_error(E_WARNING, "write wrote less bytes than requested");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "write wrote less bytes than requested");
return FAILURE;
}
static PHP_INI_MH(OnUpdateSaveHandler)
{
if (PS(session_status) == php_session_active) {
- php_error(E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
return FAILURE;
}
PS(mod) = _php_find_ps_module(new_value TSRMLS_CC);
#if 0
if(!PS(mod)) {
- php_error(E_ERROR,"Cannot find save handler %s",new_value);
+ php_error_docref(E_ERROR, "Cannot find save handler %s", new_value);
}
#endif
return SUCCESS;
static PHP_INI_MH(OnUpdateSerializer)
{
if (PS(session_status) == php_session_active) {
- php_error(E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "A session is active. You cannot change the session module's ini settings at this time.");
return FAILURE;
}
PS(serializer) = _php_find_ps_serializer(new_value TSRMLS_CC);
#if 0
if(!PS(serializer)) {
- php_error(E_ERROR,"Cannot find serialization handler %s",new_value);
+ php_error_docref(E_ERROR, "Cannot find serialization handler %s", new_value);
}
#endif
return SUCCESS;
{
if (PS(serializer)->decode(val, vallen TSRMLS_CC) == FAILURE) {
php_session_destroy(TSRMLS_C);
- php_error(E_WARNING, "Failed to decode session object. Session has been destroyed.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to decode session object. Session has been destroyed.");
}
}
/* Open session handler first */
if (PS(mod)->open(&PS(mod_data), PS(save_path), PS(session_name) TSRMLS_CC) == FAILURE) {
- php_error(E_ERROR, "Failed to initialize session module");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Failed to initialize session module");
return;
}
}
break;
case HASH_KEY_IS_LONG:
- php_error(E_NOTICE, "The session bug compatibility code will not "
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "The session bug compatibility code will not "
"try to locate the global variable $%d due to its "
"numeric nature.", num_key);
break;
}
if (do_warn && PS(bug_compat_warn)) {
- php_error(E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Your script possibly relies on a session side-effect which existed until PHP 4.2.3. Please be advised that the session extension does not consider global variables as a source of data, unless register_globals is enabled. You can disable this functionality and this warning by setting session.bug_compat_42 or session.bug_compat_warn to off, respectively.");
}
}
}
if (ret == FAILURE)
- php_error(E_WARNING, "Failed to write session data (%s). Please "
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Failed to write session data (%s). Please "
"verify that the current setting of session.save_path "
"is correct (%s)",
PS(mod)->name,
int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
if (output_start_filename) {
- php_error(E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent (output started at %s:%d)",
output_start_filename, output_start_lineno);
} else {
- php_error(E_WARNING, "Cannot send session cache limiter - headers already sent");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cache limiter - headers already sent");
}
return -2;
}
int output_start_lineno = php_get_output_start_lineno(TSRMLS_C);
if (output_start_filename) {
- php_error(E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)",
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent by (output started at %s:%d)",
output_start_filename, output_start_lineno);
} else {
- php_error(E_WARNING, "Cannot send session cookie - headers already sent");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Cannot send session cookie - headers already sent");
}
return;
}
PS(mod)->gc(&PS(mod_data), PS(gc_maxlifetime), &nrdels TSRMLS_CC);
#if 0
if (nrdels != -1)
- php_error(E_NOTICE, "purged %d expired session objects\n", nrdels);
+ php_error_docref(NULL TSRMLS_CC, E_NOTICE, "purged %d expired session objects\n", nrdels);
#endif
}
}
zend_bool retval = SUCCESS;
if (PS(session_status) != php_session_active) {
- php_error(E_WARNING, "Trying to destroy uninitialized session");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Trying to destroy uninitialized session");
return FAILURE;
}
if (PS(mod)->destroy(&PS(mod_data), PS(id) TSRMLS_CC) == FAILURE) {
retval = FAILURE;
- php_error(E_WARNING, "Session object destruction failed");
+ php_error_docref(NULL TSRMLS_CC, E_WARNING, "Session object destruction failed");
}
php_rshutdown_session_globals(TSRMLS_C);
}
if (array_init(return_value) == FAILURE) {
- php_error(E_ERROR, "Cannot initialize return value from session_get_cookie_parameters");
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot initialize return value from session_get_cookie_parameters");
RETURN_FALSE;
}
PS(mod_data) = NULL;
} else {
efree(old);
- php_error(E_ERROR, "Cannot find named PHP session module (%s)",
+ php_error_docref(NULL TSRMLS_CC, E_ERROR, "Cannot find named PHP session module (%s)",
Z_STRVAL_PP(p_name));
RETURN_FALSE;
}