cvs: /php4/ext/hyperwave hg_comm.c hw.c
| From: | Uwe Steinmann | Date: | Fri, 10 Mar 2000 11:36:56 +0000 |
| Subject: | cvs: /php4/ext/hyperwave hg_comm.c hw.c | ||
| Groups: | php.version4 | ||
| Request: | Send a blank email to php-version4+get-11862@lists.php.net to get a copy of this message | ||
steinm Fri Mar 10 03:36:56 2000 EDT
Modified files:
/php4/ext/hyperwave hg_comm.c hw.c
Log:
- replaced some old code to access server variables
Index: php4/ext/hyperwave/hg_comm.c
diff -u php4/ext/hyperwave/hg_comm.c:1.26 php4/ext/hyperwave/hg_comm.c:1.27
--- php4/ext/hyperwave/hg_comm.c:1.26 Thu Mar 9 04:45:54 2000
+++ php4/ext/hyperwave/hg_comm.c Fri Mar 10 03:36:26 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hg_comm.c,v 1.26 2000/03/09 12:45:54 steinm Exp $ */
+/* $Id: hg_comm.c,v 1.27 2000/03/10 11:36:26 steinm Exp $ */
/* #define HW_DEBUG */
@@ -590,13 +590,26 @@
int laststart=0;
/* The following is very tricky and depends on how rewriting is setup on your webserver.
- If you skip the scriptname in the url you will have to map each hyperwave name to http://<hwname>.
- This may not always be a good idea. The best solution is probably to provide a prefix for such
- a case which is an optional parameter to hw_gettext hw_pipedocument.
+ If you skip the scriptname in the url you will have to map each hyperwave name
+ to http://<hwname>. This may not always be a good idea.
The best solution is
+ probably to provide a prefix for such
+ a case which is an optional parameter to hw_gettext() or hw_pipedocument().
+ FIXME: Currently, the variable SCRIPT_NAME is empty thouht SCRIPT_URL is
+ not. In our case this is OK, since as mentioned above it is better to have no
+ SCRIPT_NAME than to have if rewriting is on.
*/
if(urlprefix) {
scriptname = urlprefix;
} else {
+ zval **script_name;
+ if (zend_hash_find(&EG(symbol_table), "SCRIPT_NAME",
sizeof("SCRIPT_NAME"), (void **) &script_name)==FAILURE)
+ scriptname = NULL;
+ else {
+ convert_to_string_ex(script_name);
+ scriptname = (*script_name)->value.str.val;
+ }
+
+#if 0
#if APACHE
{
int j;
@@ -604,13 +617,15 @@
table_entry *elts = (table_entry *)arr->elts;
for (j=0; j < arr->nelts; j++) {
- if(0 == strcmp(elts[j].key, "SCRIPT_NAME"))
+ if((0 == strcmp(elts[j].key, "SCRIPT_NAME")) ||
+ (0 == strcmp(elts[j].key, "SCRIPT_URL")))
break;
}
scriptname = elts[j].val;
}
#else
scriptname = getenv("SCRIPT_FILENAME");
+#endif
#endif
}
Index: php4/ext/hyperwave/hw.c
diff -u php4/ext/hyperwave/hw.c:1.46 php4/ext/hyperwave/hw.c:1.47
--- php4/ext/hyperwave/hw.c:1.46 Wed Mar 8 09:51:57 2000
+++ php4/ext/hyperwave/hw.c Fri Mar 10 03:36:26 2000
@@ -16,7 +16,7 @@
+----------------------------------------------------------------------+
*/
-/* $Id: hw.c,v 1.46 2000/03/08 17:51:57 steinm Exp $ */
+/* $Id: hw.c,v 1.47 2000/03/10 11:36:26 steinm Exp $ */
#if COMPILE_DL
#include "dl/phpdl.h"
#endif
@@ -205,9 +205,9 @@
HwSG(le_document) = register_list_destructors(_free_hw_document,NULL);
hw_module_entry.type = type;
-// REGISTER_LONG_CONSTANT("HW_ATTR_LANG", HW_ATTR_LANG, CONST_CS | CONST_PERSISTENT);
-// REGISTER_LONG_CONSTANT("HW_ATTR_NR", HW_ATTR_NR, CONST_CS | CONST_PERSISTENT);
-// REGISTER_LONG_CONSTANT("HW_ATTR_NONE", HW_ATTR_NONE, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("HW_ATTR_LANG", HW_ATTR_LANG, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("HW_ATTR_NR", HW_ATTR_NR, CONST_CS | CONST_PERSISTENT);
+ REGISTER_LONG_CONSTANT("HW_ATTR_NONE", HW_ATTR_NONE, CONST_CS | CONST_PERSISTENT);
return SUCCESS;
}