diff options
| author | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
|---|---|---|
| committer | Mark A. Hershberger <mah@debian.(none)> | 2009-03-25 00:39:08 -0400 |
| commit | 993e1866df547532a05ab6db76c9ff5aefc9a3df (patch) | |
| tree | 169d3bde0974235d3cde164786ef6f381a4749a7 /sapi/embed/php_embed.c | |
| parent | 1f589a2bd44ba835ad1b009a5d83abd453724829 (diff) | |
| download | php-upstream/5.2.6.tar.gz | |
Imported Upstream version 5.2.6upstream/5.2.6
Diffstat (limited to 'sapi/embed/php_embed.c')
| -rw-r--r-- | sapi/embed/php_embed.c | 41 |
1 files changed, 19 insertions, 22 deletions
diff --git a/sapi/embed/php_embed.c b/sapi/embed/php_embed.c index cb50b219d..93cd41ccd 100644 --- a/sapi/embed/php_embed.c +++ b/sapi/embed/php_embed.c @@ -2,7 +2,7 @@ +----------------------------------------------------------------------+ | PHP Version 5 | +----------------------------------------------------------------------+ - | Copyright (c) 1997-2007 The PHP Group | + | Copyright (c) 1997-2008 The PHP Group | +----------------------------------------------------------------------+ | This source file is subject to version 3.01 of the PHP license, | | that is bundled with this package in the file LICENSE, and is | @@ -15,7 +15,7 @@ | Author: Edin Kadribasic <edink@php.net> | +----------------------------------------------------------------------+ */ -/* $Id: php_embed.c,v 1.11.2.1.2.5 2007/08/08 21:57:30 stas Exp $ */ +/* $Id: php_embed.c,v 1.11.2.1.2.7 2008/03/26 13:21:57 helly Exp $ */ #include "php_embed.h" @@ -24,13 +24,13 @@ #include <fcntl.h> #endif -#define HARDCODED_INI \ - "html_errors=0\n" \ - "register_argc_argv=1\n" \ - "implicit_flush=1\n" \ - "output_buffering=0\n" \ - "max_execution_time=0\n" \ - "max_input_time=-1\n" +const char HARDCODED_INI[] = + "html_errors=0\n" + "register_argc_argv=1\n" + "implicit_flush=1\n" + "output_buffering=0\n" + "max_execution_time=0\n" + "max_input_time=-1\n\0"; static char* php_embed_read_cookies(TSRMLS_D) { @@ -145,7 +145,6 @@ int php_embed_init(int argc, char **argv PTSRMLS_DC) #ifdef ZTS void ***tsrm_ls = NULL; #endif - int ini_entries_len = 0; #ifdef HAVE_SIGNAL_H #if defined(SIGPIPE) && defined(SIG_IGN) @@ -158,26 +157,24 @@ int php_embed_init(int argc, char **argv PTSRMLS_DC) #endif #endif -#ifdef PHP_WIN32 - _fmode = _O_BINARY; /*sets default for file streams to binary */ - setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ - setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ -#endif - #ifdef ZTS tsrm_startup(1, 1, 0, NULL); tsrm_ls = ts_resource(0); *ptsrm_ls = tsrm_ls; #endif - ini_entries_len = strlen(HARDCODED_INI); - php_embed_module.ini_entries = malloc(ini_entries_len+2); - memcpy(php_embed_module.ini_entries, HARDCODED_INI, ini_entries_len+1); - php_embed_module.ini_entries[ini_entries_len+1] = 0; - sapi_startup(&php_embed_module); +#ifdef PHP_WIN32 + _fmode = _O_BINARY; /*sets default for file streams to binary */ + setmode(_fileno(stdin), O_BINARY); /* make the stdio mode be binary */ + setmode(_fileno(stdout), O_BINARY); /* make the stdio mode be binary */ + setmode(_fileno(stderr), O_BINARY); /* make the stdio mode be binary */ +#endif + + php_embed_module.ini_entries = malloc(sizeof(HARDCODED_INI)); + memcpy(php_embed_module.ini_entries, HARDCODED_INI, sizeof(HARDCODED_INI)); + if (argv) { php_embed_module.executable_location = argv[0]; } |
