-/*
+/*
+----------------------------------------------------------------------+
| PHP Version 5 |
+----------------------------------------------------------------------+
/* {{{ PHP_INI
*/
PHP_INI_BEGIN()
- PHP_INI_ENTRY_EX("define_syslog_variables", "0", PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb)
+ PHP_INI_ENTRY_EX("define_syslog_variables", "0", PHP_INI_ALL, NULL, php_ini_boolean_displayer_cb)
PHP_INI_ENTRY_EX("highlight.bg", HL_BG_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.comment", HL_COMMENT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
PHP_INI_ENTRY_EX("highlight.default", HL_DEFAULT_COLOR, PHP_INI_ALL, NULL, php_ini_color_displayer_cb)
if (PG(open_basedir) && php_check_open_basedir_ex(PG(error_log), 0 TSRMLS_CC)) {
return;
}
-
+
fd = VCWD_OPEN_MODE(PG(error_log), O_CREAT | O_APPEND | O_WRONLY, 0644);
if (fd != -1) {
char *tmp;
ret = PHPWRITE(buffer, size);
efree(buffer);
va_end(args);
-
+
return ret;
}
/* }}} */
} else if (php_during_module_shutdown()) {
function = "PHP Shutdown";
} else if (EG(current_execute_data) &&
- EG(current_execute_data)->opline &&
- EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL) {
+ EG(current_execute_data)->opline &&
+ EG(current_execute_data)->opline->opcode == ZEND_INCLUDE_OR_EVAL
+ ) {
switch (EG(current_execute_data)->opline->op2.u.constant.value.lval) {
case ZEND_EVAL:
function = "eval";
/* if we still have memory then format the origin */
if (is_function) {
- origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, params);
+ origin_len = spprintf(&origin, 0, "%s%s%s(%s)", class_name, space, function, params);
} else {
- origin_len = spprintf(&origin, 0, "%s", function);
+ origin_len = spprintf(&origin, 0, "%s", function);
}
if (PG(html_errors)) {
PHPAPI void php_error_docref0(const char *docref TSRMLS_DC, int type, const char *format, ...)
{
va_list args;
-
+
va_start(args, format);
php_verror(docref, "", type, format, args TSRMLS_CC);
va_end(args);
PHPAPI void php_error_docref1(const char *docref TSRMLS_DC, const char *param1, int type, const char *format, ...)
{
va_list args;
-
+
va_start(args, format);
php_verror(docref, param1, type, format, args TSRMLS_CC);
va_end(args);
{
char *params;
va_list args;
-
+
spprintf(¶ms, 0, "%s,%s", param1, param2);
va_start(args, format);
php_verror(docref, params ? params : "...", type, format, args TSRMLS_CC);
EG(exit_status) = 255;
if (module_initialized) {
if (!SG(headers_sent) &&
- SG(sapi_headers).http_response_code == 200) {
+ SG(sapi_headers).http_response_code == 200
+ ) {
sapi_header_line ctr = {0};
-
+
ctr.line = "HTTP/1.0 500 Internal Server Error";
ctr.line_len = strlen(ctr.line);
sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
}
/* }}} */
+
static void stream_closer_for_zend(void *handle TSRMLS_DC)
{
php_stream_close((php_stream*)handle);
zend_try {
PG(during_request_startup) = 1;
-
+
php_output_activate(TSRMLS_C);
/* initialize global variables */
PG(header_is_being_sent) = 0;
PG(connection_status) = PHP_CONNECTION_NORMAL;
PG(in_user_include) = 0;
-
+
zend_activate(TSRMLS_C);
sapi_activate(TSRMLS_C);
}
# else
int php_request_startup(TSRMLS_D)
-{
+{
int retval = SUCCESS;
#if PHP_SIGCHILD
if (php_start_sapi() == FAILURE) {
return FAILURE;
}
-
+
php_output_activate(TSRMLS_C);
sapi_activate(TSRMLS_C);
php_hash_environment(TSRMLS_C);
if (php_start_sapi(TSRMLS_C) == FAILURE) {
return FAILURE;
}
-
+
php_output_activate(TSRMLS_C);
sapi_activate_headers_only(TSRMLS_C);
php_hash_environment(TSRMLS_C);
TSRMLS_FETCH();
report_memleaks = PG(report_memleaks);
-
+
/* EG(opline_ptr) points into nirvana and therefore cannot be safely accessed
* inside zend_executor callback functions.
*/
if (PG(modules_activated)) zend_try {
php_call_shutdown_functions(TSRMLS_C);
} zend_end_try();
-
+
/* 2. Call all possible __destruct() functions */
zend_try {
zend_call_destructors(TSRMLS_C);
} zend_end_try();
/* 12. Reset max_execution_time */
- zend_try {
+ zend_try {
zend_unset_timeout(TSRMLS_C);
} zend_end_try();
#endif
EG(bailout) = NULL;
EG(error_reporting) = E_ALL & ~E_NOTICE;
-
+
PG(header_is_being_sent) = 0;
SG(request_info).headers_only = 0;
SG(request_info).argv0 = NULL;
php_printf("PHP: Unable to initialize stream url wrappers.\n");
return FAILURE;
}
-
+
/* initialize registry for images to be used in phpinfo()
(this uses configuration parameters from php.ini)
*/
core_globals_dtor(&core_globals TSRMLS_CC);
#else
zend_ini_global_shutdown(TSRMLS_C);
- ts_free_id(core_globals_id);
+ ts_free_id(core_globals_id);
#endif
php_shutdown_temporary_directory();
* otherwise it will get opened and added to the included_files list in zend_execute_scripts
*/
if (primary_file->filename &&
- primary_file->opened_path == NULL &&
- primary_file->type != ZEND_HANDLE_FILENAME) {
+ primary_file->opened_path == NULL &&
+ primary_file->type != ZEND_HANDLE_FILENAME
+ ) {
int realfile_len;
int dummy = 1;
zend_set_timeout(INI_INT("max_execution_time"));
}
retval = (zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, NULL, 3, prepend_file_p, primary_file, append_file_p) == SUCCESS);
-
} zend_end_try();
#if HAVE_BROKEN_GETCWD
#define OLD_CWD_SIZE 4096
old_cwd = do_alloca(OLD_CWD_SIZE);
old_cwd[0] = '\0';
-
+
zend_try {
#ifdef PHP_WIN32
UpdateIniFromRegistry(primary_file->filename TSRMLS_CC);
}
zend_execute_scripts(ZEND_REQUIRE TSRMLS_CC, ret, 1, primary_file);
} zend_end_try();
-
+
if (old_cwd[0] != '\0') {
VCWD_CHDIR(old_cwd);
}
} else {
SG(request_info).auth_digest = NULL;
}
-
+
if (ret == -1 && auth && auth[0] != '\0' && strncmp(auth, "Digest ", 7) == 0) {
SG(request_info).auth_digest = estrdup(auth + 7);
ret = 0;