summaryrefslogtreecommitdiff
path: root/sapi/activescript/php5activescript.c
diff options
context:
space:
mode:
authorWez Furlong <wez@php.net>2004-07-27 22:36:56 +0000
committerWez Furlong <wez@php.net>2004-07-27 22:36:56 +0000
commit20eac88e58e256cd2e55015cdd8610dcceaeeccb (patch)
tree13933b8492930fe4673089e88abc2d9f672b090c /sapi/activescript/php5activescript.c
parenta783891e768fbe42a64410ee61054c129086d9f5 (diff)
downloadphp-git-20eac88e58e256cd2e55015cdd8610dcceaeeccb.tar.gz
Tidy up a few loose ends.
Override normal php.ini behaviour so that only the launching applications folder is searched; this avoids picking up a default php.ini with an execution time limit set.
Diffstat (limited to 'sapi/activescript/php5activescript.c')
-rw-r--r--sapi/activescript/php5activescript.c22
1 files changed, 19 insertions, 3 deletions
diff --git a/sapi/activescript/php5activescript.c b/sapi/activescript/php5activescript.c
index 6e83b99d5c..237887ac6d 100644
--- a/sapi/activescript/php5activescript.c
+++ b/sapi/activescript/php5activescript.c
@@ -41,7 +41,7 @@ static int sapi_activescript_ub_write(const char *str, uint str_length TSRMLS_DC
{
/* In theory, this is a blackhole. In practice, I want to see the output
* in the debugger! */
-
+#if ZEND_DEBUG
char buf[1024];
uint l, a = str_length;
@@ -54,7 +54,7 @@ static int sapi_activescript_ub_write(const char *str, uint str_length TSRMLS_DC
OutputDebugString(buf);
a -= l;
}
-
+#endif
return str_length;
}
@@ -93,7 +93,7 @@ zend_module_entry php_activescript_module = {
sapi_module_struct activescript_sapi_module = {
"activescript", /* name */
- "Active Script", /* pretty name */
+ "ActiveScript", /* pretty name */
php_activescript_startup, /* startup */
php_module_shutdown_wrapper, /* shutdown */
@@ -129,6 +129,22 @@ BOOL WINAPI DllMain(HINSTANCE hinstDLL, DWORD fdwReason, LPVOID lpvReserved)
tsrm_startup(128, 32, TSRM_ERROR_LEVEL_CORE, "C:\\TSRM.log");
+ /* useful behaviour for the host: we take the application path
+ * and use that dir as the override for the php.ini, so that
+ * we don't pick up a global .ini file */
+ {
+ char module_dir[MAXPATHLEN];
+ char *slash;
+
+ GetModuleFileName(0, module_dir, sizeof(module_dir));
+ slash = strrchr(module_dir, '\\');
+ if (slash) {
+ slash[1] = '\0';
+ }
+
+ activescript_sapi_module.php_ini_path_override = strdup(module_dir);
+ }
+
sapi_startup(&activescript_sapi_module);
if (activescript_sapi_module.startup) {
activescript_sapi_module.startup(&sapi_module);