- add http_log() for cases we don't want to exit
authorMichael Wallner <mike@php.net>
Fri, 26 Aug 2005 09:22:59 +0000 (09:22 +0000)
committerMichael Wallner <mike@php.net>
Fri, 26 Aug 2005 09:22:59 +0000 (09:22 +0000)
- remove clunky auth hooks completely

13 files changed:
Makefile.frag
config.m4
config.w32
http.c
http.dsp
http_api.c
http_auth_api.c [deleted file]
http_functions.c
http_util_object.c
package.xml
php_http_api.h
php_http_auth_api.h [deleted file]
php_http_util_object.h

index 773c9fad298dcfa785ab8f4be8ee46876d851191..24a9e76be9fb0ed12bf3f69644fa63ed94658a8c 100644 (file)
@@ -14,7 +14,6 @@ HTTP_HEADER_FILES= \
        php_http_date_api.h \
        php_http_message_object.h \
        php_http_std_defs.h \
-       php_http_auth_api.h \
        php_http_exception_object.h \
        php_http_request_object.h \
        php_http_requestpool_object.h \
index 25570f4febfb32f2ad53d03fde08660394b04fea..32e288b78232f94b61507dd6dc62751ed7285f63 100644 (file)
--- a/config.m4
+++ b/config.m4
@@ -94,7 +94,7 @@ dnl ----
        PHP_HTTP_SOURCES="missing.c http.c http_functions.c phpstr/phpstr.c \
                http_util_object.c http_message_object.c http_request_object.c http_request_pool_api.c \
                http_response_object.c http_exception_object.c http_requestpool_object.c \
-               http_api.c http_auth_api.c http_cache_api.c http_request_api.c http_date_api.c \
+               http_api.c http_cache_api.c http_request_api.c http_date_api.c \
                http_headers_api.c http_message_api.c http_send_api.c http_url_api.c \
                http_info_api.c"
        PHP_NEW_EXTENSION([http], $PHP_HTTP_SOURCES, [$ext_shared])
index abb1eb58e600599ab07f2d0ad0892a041d04e270..1c8b589ca42861c76f58ebb5c1fcee0e0f37d607 100644 (file)
@@ -19,7 +19,7 @@ if (PHP_HTTP != "no") {
                "missing.c http.c http_functions.c http_exception_object.c "+
                "http_util_object.c http_message_object.c http_requestpool_object.c "+
                "http_request_object.c http_response_object.c "+
-               "http_api.c http_auth_api.c http_cache_api.c http_request_pool_api.c "+
+               "http_api.c http_cache_api.c http_request_pool_api.c "+
                "http_request_api.c http_date_api.c http_headers_api.c "+
                "http_message_api.c http_send_api.c http_url_api.c "+
                "http_info_api.c",
diff --git a/http.c b/http.c
index 2cd87113dee0122a0c962a6c1dbb0a8766546b8e..599cc7e19b6a9fde104b55ef4bae7fa5b5e268d1 100644 (file)
--- a/http.c
+++ b/http.c
@@ -102,8 +102,6 @@ function_entry http_functions[] = {
        PHP_FE(http_request_method_exists, NULL)
        PHP_FE(http_request_method_name, NULL)
 #endif
-       PHP_FE(http_auth_basic, NULL)
-       PHP_FE(http_auth_basic_cb, NULL)
 #ifndef ZEND_ENGINE_2
        PHP_FE(http_build_query, NULL)
 #endif
index b41373e92487b6a5d7f7d43788029765530a0570..bf3978751218c99ad6e99576693948a5dfc182f9 100644 (file)
--- a/http.dsp
+++ b/http.dsp
@@ -110,10 +110,6 @@ SOURCE=.\http_functions.c
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\http_auth_api.c\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\http_cache_api.c\r
 # End Source File\r
 # Begin Source File\r
@@ -162,10 +158,6 @@ SOURCE=.\php_http_request_api.h
 # End Source File\r
 # Begin Source File\r
 \r
-SOURCE=.\php_http_auth_api.h\r
-# End Source File\r
-# Begin Source File\r
-\r
 SOURCE=.\php_http_cache_api.h\r
 # End Source File\r
 # Begin Source File\r
index e12e1eb80228ffe24f309337cb66a051012b49c8..b36a32d3a090abdaeacde9cacbe8be1740f37a80 100644 (file)
@@ -179,53 +179,60 @@ void _http_error_ex(long type, long code, const char *format, ...)
 }
 /* }}} */
 
-/* {{{ STATUS http_exit(int, char*, char*, zend_bool) */
-STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC)
+/* {{{ void http_log(char *, char *, char *) */
+void _http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC)
 {
+       time_t now;
+       struct tm nowtm;
        char datetime[128];
        
-       if (SUCCESS != http_send_status_header(status, send_header ? header : NULL)) {
-               http_error_ex(HE_WARNING, HTTP_E_HEADER, "Failed to exit with status/header: %d - %s", status, header ? header : "");
-               STR_FREE(header);
-               STR_FREE(body);
-               return FAILURE;
-       }
-       if (body) {
-               PHPWRITE(body, strlen(body));
-       }
-       {
-               time_t now;
-               struct tm nowtm;
-               
-               time(&now);
-               strftime(datetime, sizeof(datetime), "%Y-%m-%d %H:%M:%S", php_localtime_r(&now, &nowtm));
-       }
-
-#define HTTP_LOG_WRITE(for, type, header) \
-       HTTP_LOG_WRITE_EX(for, type, header); \
-       HTTP_LOG_WRITE_EX(composite, type, header);
+       time(&now);
+       strftime(datetime, sizeof(datetime), "%Y-%m-%d %H:%M:%S", php_localtime_r(&now, &nowtm));
 
-#define HTTP_LOG_WRITE_EX(for, type, header) \
-       if (HTTP_G(log).for && strlen(HTTP_G(log).for)) { \
-               php_stream *log = php_stream_open_wrapper(HTTP_G(log).for, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); \
+#define HTTP_LOG_WRITE(file, type, msg) \
+       if (file && strlen(file)) { \
+               php_stream *log = php_stream_open_wrapper(file, "ab", REPORT_ERRORS|ENFORCE_SAFE_MODE, NULL); \
                 \
                if (log) { \
-                       php_stream_printf(log TSRMLS_CC, "%s [%12s] %32s <%s>%s", datetime, type, header, SG(request_info).request_uri, PHP_EOL); \
+                       php_stream_printf(log TSRMLS_CC, "%s [%12s] %32s <%s>%s", datetime, type, msg, SG(request_info).request_uri, PHP_EOL); \
                        php_stream_close(log); \
                } \
         \
        }
+       
+       HTTP_LOG_WRITE(file, ident, message);
+       HTTP_LOG_WRITE(HTTP_G(log).composite, ident, message);
+}
+/* }}} */
+
+/* {{{ STATUS http_exit(int, char*, char*) */
+STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC)
+{
+       if (status || send_header) {
+               if (SUCCESS != http_send_status_header(status, send_header ? header : NULL)) {
+                       http_error_ex(HE_WARNING, HTTP_E_HEADER, "Failed to exit with status/header: %d - %s", status, header ? header : "");
+                       STR_FREE(header);
+                       STR_FREE(body);
+                       return FAILURE;
+               }
+       }
+       
+       if (body) {
+               PHPWRITE(body, strlen(body));
+       }
+       
        switch (status)
        {
-               case 301:       HTTP_LOG_WRITE(redirect, "301-REDIRECT", header);                       break;
-               case 302:       HTTP_LOG_WRITE(redirect, "302-REDIRECT", header);                       break;
-               case 304:       HTTP_LOG_WRITE(cache, "304-CACHE", header);                                     break;
-               case 401:       HTTP_LOG_WRITE(auth, "401-AUTH", header);                                       break;
-               case 403:       HTTP_LOG_WRITE(auth, "403-AUTH", header);                                       break;
-               case 405:       HTTP_LOG_WRITE(allowed_methods, "405-ALLOWED", header);         break;
+               case 301:       http_log(HTTP_G(log).redirect, "301-REDIRECT", header);                 break;
+               case 302:       http_log(HTTP_G(log).redirect, "302-REDIRECT", header);                 break;
+               case 304:       http_log(HTTP_G(log).cache, "304-CACHE", header);                               break;
+               case 405:       http_log(HTTP_G(log).allowed_methods, "405-ALLOWED", header);   break;
+               default:        http_log(NULL, header, body);                                                                   break;
        }
+       
        STR_FREE(header);
        STR_FREE(body);
+       
        zend_bailout();
        /* fake */
        return SUCCESS;
diff --git a/http_auth_api.c b/http_auth_api.c
deleted file mode 100644 (file)
index 5e5bafc..0000000
+++ /dev/null
@@ -1,257 +0,0 @@
-/*
-   +----------------------------------------------------------------------+
-   | PECL :: http                                                         |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 3.0 of the PHP license, that  |
-   | is bundled with this package in the file LICENSE, and is available   |
-   | through the world-wide-web at http://www.php.net/license/3_0.txt.    |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@php.net so we can mail you a copy immediately.               |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 2004-2005 Michael Wallner <mike@php.net>               |
-   +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifdef HAVE_CONFIG_H
-#      include "config.h"
-#endif
-#include "php.h"
-
-#include "SAPI.h"
-#include "ext/standard/base64.h"
-
-#include "php_http.h"
-#include "php_http_api.h"
-#include "php_http_std_defs.h"
-#include "php_http_send_api.h"
-
-/*
- * TODO:
- *  - Digest Auth
- */
-
-/* {{{ STATUS http_auth_basic_header(char*) */
-PHP_HTTP_API STATUS _http_auth_basic_header(const char *realm TSRMLS_DC)
-{
-       char realm_header[1024] = {0};
-       snprintf(realm_header, 1023, "WWW-Authenticate: Basic realm=\"%s\"", realm);
-       return http_send_status_header(401, realm_header);
-}
-/* }}} */
-
-/* {{{ STATUS http_auth_credentials(char **, char **) */
-PHP_HTTP_API STATUS _http_auth_basic_credentials(char **user, char **pass TSRMLS_DC)
-{
-       if (strncmp(sapi_module.name, "isapi", 5)) {
-               zval *zuser, *zpass;
-
-               HTTP_GSC(zuser, "PHP_AUTH_USER", FAILURE);
-               HTTP_GSC(zpass, "PHP_AUTH_PW", FAILURE);
-
-               *user = estrndup(Z_STRVAL_P(zuser), Z_STRLEN_P(zuser));
-               *pass = estrndup(Z_STRVAL_P(zpass), Z_STRLEN_P(zpass));
-
-               return SUCCESS;
-       } else {
-               zval *zauth = NULL;
-               HTTP_GSC(zauth, "HTTP_AUTHORIZATION", FAILURE);
-               {
-                       int decoded_len;
-                       char *colon, *decoded = (char *) php_base64_decode((const unsigned char *) Z_STRVAL_P(zauth), Z_STRLEN_P(zauth), &decoded_len);
-
-                       if (colon = strchr(decoded + 6, ':')) {
-                               *user = estrndup(decoded + 6, colon - decoded - 6);
-                               *pass = estrndup(colon + 1, decoded + decoded_len - colon - 6 - 1);
-
-                               return SUCCESS;
-                       } else {
-                               return FAILURE;
-                       }
-               }
-       }
-}
-/* }}} */
-
-
-/* {{{ Digest * /
-
-#include "ext/standard/php_rand.h"
-#include "ext/standard/md5.h"
-
-#define DIGEST_ALGORITHM "MD5"
-#define DIGEST_SECRETLEN 20
-static unsigned char digest_secret[DIGEST_SECRETLEN];
-
-#define DIGEST_BIN_LEN 16
-typedef char http_digest_bin_t[DIGEST_BIN_LEN];
-#define DIGEST_HEX_LEN 32
-typedef char http_digest_hex_t[DIGEST_HEX_LEN+1];
-
-void _http_auth_global_init(TSRMLS_D)
-{
-       int i;
-       // XX this is pretty loose
-       for (i = 0; i < DIGEST_SECRETLEN; ++i) {
-               digest_secret[i] = (unsigned char) ((php_rand(TSRMLS_C) % 254) + 1);
-       }
-}
-
-static void http_digest_line_decoder(const char *encoded, size_t encoded_len, char **decoded, size_t *decoded_len TSRMLS_DC)
-{
-       char l = '\0';
-       size_t i;
-       phpstr s;
-
-       phpstr_init_ex(&s, encoded_len, 1);
-
-       for (i = 0; i < encoded_len; ++i) {
-               if ((encoded[i] != '\\') && (encoded[i] != '"')) {
-                       phpstr_append(&s, encoded+i, 1);
-               }
-       }
-
-       phpstr_fix(&s);
-
-       *decoded = PHPSTR_VAL(&s);
-       *decoded_len = PHPSTR_LEN(&s);
-}
-
-static void http_digest_tohex(http_digest_bin_t bin, http_digest_hex_t hex)
-{
-       unsigned short i;
-       unsigned char j;
-
-       for (i = 0; i < DIGEST_BIN_LEN; i++) {
-               j = (bin[i] >> 4) & 0xf;
-               if (j <= 9) {
-                       hex[i*2] = (j + '0');
-               } else {
-                       hex[i*2] = (j + 'a' - 10);
-               }
-               j = bin[i] & 0xf;
-               if (j <= 9) {
-                       hex[i*2+1] = (j + '0');
-               } else {
-                       hex[i*2+1] = (j + 'a' - 10);
-               }
-       }
-       hex[DIGEST_HEX_LEN] = '\0';
-}
-
-static void http_digest_calc_HA1(
-       const char *alg,        const char *user,
-       const char *realm,      const char *pass,
-       const char *nonce,      const char *cnonce,
-       http_digest_hex_t HA1)
-{
-       PHP_MD5_CTX md5;
-       http_digest_bin_t HA1_bin;
-
-       PHP_MD5Init(&md5);
-       PHP_MD5Update(&md5, user, strlen(user));
-       PHP_MD5Update(&md5, ":", 1);
-       PHP_MD5Update(&md5, realm, strlen(realm));
-       PHP_MD5Update(&md5, ":", 1);
-       PHP_MD5Update(&md5, pass, strlen(pass));
-       PHP_MD5Final(HA1_bin, &md5);
-
-       if (strcasecmp(alg, "md5-sess") == 0) {
-               PHP_MD5Init(&md5);
-               PHP_MD5Update(&md5, HA1_bin, DIGEST_BIN_LEN);
-               PHP_MD5Update(&md5, ":", 1);
-               PHP_MD5Update(&md5, nonce, strlen(nonce));
-               PHP_MD5Update(&md5, ":", 1);
-               PHP_MD5Update(&md5, cnonce, strlen(cnonce));
-               PHP_MD5Final(HA1_bin, &md5);
-       }
-       http_digest_tohex(HA1_bin, HA1);
-}
-
-static void http_digest_calc_response(
-       const http_digest_hex_t HA1,
-       const char *nonce,      const char *noncecount,
-       const char *cnonce,     const char *qop,
-       const char *method,     const char *uri,
-       http_digest_hex_t ent,
-       http_digest_hex_t response)
-{
-       PHP_MD5_CTX md5;
-       http_digest_bin_t HA2;
-       http_digest_bin_t bin;
-       http_digest_hex_t HA2_hex;
-
-       // calculate H(A2)
-       PHP_MD5Init(&md5);
-       PHP_MD5Update(&md5, method, strlen(method));
-       PHP_MD5Update(&md5, ":", 1);
-       PHP_MD5Update(&md5, uri, strlen(uri));
-       if (strcasecmp(qop, "auth-int") == 0) {
-               PHP_MD5Update(&md5, ":", 1);
-               PHP_MD5Update(&md5, HEntity, DIGEST_HEX_LEN);
-       }
-       PHP_MD5Final(HA2, &md5);
-       http_digest_tohex(HA2, HA2_hex);
-
-       // calculate response
-       PHP_MD5Init(&md5);
-       PHP_MD5Update(&md5, HA1, DIGEST_HEX_LEN);
-       PHP_MD5Update(&md5, ":", 1);
-       PHP_MD5Update(&md5, nonce, strlen(nonce));
-       PHP_MD5Update(&md5, ":", 1);
-       if (*qop) {
-               PHP_MD5Update(&md5, noncecount, strlen(noncecount));
-               PHP_MD5Update(&md5, ":", 1);
-               PHP_MD5Update(&md5, cnonce, strlen(cnonce));
-               PHP_MD5Update(&md5, ":", 1);
-               PHP_MD5Update(&md5, qop, strlen(qop));
-               PHP_MD5Update(&md5, ":", 1);
-       }
-       PHP_MD5Update(&md5, HA2_hex, DIGEST_HEX_LEN);
-       PHP_MD5Final(bin, &md5);
-       http_digest_tohex(bin, response);
-}
-
-PHP_HTTP_API STATUS _http_auth_digest_credentials(HashTable *items TSRMLS_DC)
-{
-       char *auth;
-       zval array, *zauth = NULL;
-
-       HTTP_GSC(zauth, "HTTP_AUTHORIZATION", FAILURE);
-       auth = Z_STRVAL_P(zauth);
-
-       if (strncasecmp(auth, "Digest ", sizeof("Digest")) || (!(auth += sizeof("Digest")))) {
-               return FAILURE;
-       }
-       if (SUCCESS != http_parse_key_list(auth, items, ',', http_digest_line_decoder, 0)) {
-               return FAILURE;
-       }
-       if (    !zend_hash_exists(items, "uri", sizeof("uri"))                          ||
-                       !zend_hash_exists(items, "realm", sizeof("realm"))                      ||
-                       !zend_hash_exists(items, "nonce", sizeof("nonce"))                      ||
-                       !zend_hash_exists(items, "username", sizeof("username"))        ||
-                       !zend_hash_exists(items, "response", sizeof("response"))) {
-          zend_hash_clean(items);
-          return FAILURE;
-       }
-       return SUCCESS;
-}
-
-PHP_HTTP_API STATUS _http_auth_digest_header(const char *realm TSRMLS_DC)
-{
-       return FAILURE;
-}
-/* }}} */
-
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: sw=4 ts=4 fdm=marker
- * vim<600: sw=4 ts=4
- */
-
index a6542c2c31db4336fa79e722c44fe6298303b452..28d9be5571fbe45b3fc4ad309eebb8b858d3d17c 100644 (file)
@@ -31,7 +31,6 @@
 #include "php_http.h"
 #include "php_http_std_defs.h"
 #include "php_http_api.h"
-#include "php_http_auth_api.h"
 #include "php_http_request_api.h"
 #include "php_http_cache_api.h"
 #include "php_http_request_api.h"
@@ -1156,116 +1155,6 @@ PHP_FUNCTION(http_request_method_name)
 #endif
 /* }}} HAVE_CURL */
 
-
-/* {{{ proto bool http_auth_basic(string user, string pass[, string realm = "Restricted"])
- *
- * Example:
- * <pre>
- * <?php
- * if (!http_auth_basic('mike', 's3c|r3t')) {
- *     die('<h1>Authorization failed!</h1>');
- * }
- * ?>
- * </pre>
- */
-PHP_FUNCTION(http_auth_basic)
-{
-       char *realm = NULL, *user, *pass, *suser, *spass;
-       int r_len, u_len, p_len;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "ss|s", &user, &u_len, &pass, &p_len, &realm, &r_len) != SUCCESS) {
-               RETURN_FALSE;
-       }
-
-       if (!realm) {
-               realm = "Restricted";
-       }
-
-       if (SUCCESS != http_auth_basic_credentials(&suser, &spass)) {
-               http_auth_basic_header(realm);
-               RETURN_FALSE;
-       }
-
-       if (strcasecmp(suser, user)) {
-               http_auth_basic_header(realm);
-               RETURN_FALSE;
-       }
-
-       if (strcmp(spass, pass)) {
-               http_auth_basic_header(realm);
-               RETURN_FALSE;
-       }
-
-       RETURN_TRUE;
-}
-/* }}} */
-
-/* {{{ proto bool http_auth_basic_cb(mixed callback[, string realm = "Restricted"])
- *
- * Example:
- * <pre>
- * <?php
- * function auth_cb($user, $pass)
- * {
- *     global $db;
- *     $query = 'SELECT pass FROM users WHERE user='. $db->quoteSmart($user);
- *     if (strlen($realpass = $db->getOne($query)) {
- *         return $pass === $realpass;
- *     }
- *     return false;
- * }
- * if (!http_auth_basic_cb('auth_cb')) {
- *     die('<h1>Authorization failed</h1>');
- * }
- * ?>
- * </pre>
- */
-PHP_FUNCTION(http_auth_basic_cb)
-{
-       zval *cb;
-       char *realm = NULL, *user, *pass;
-       int r_len;
-
-       if (zend_parse_parameters(ZEND_NUM_ARGS() TSRMLS_CC, "z|s", &cb, &realm, &r_len) != SUCCESS) {
-               RETURN_FALSE;
-       }
-
-       if (!realm) {
-               realm = "Restricted";
-       }
-
-       if (SUCCESS != http_auth_basic_credentials(&user, &pass)) {
-               http_auth_basic_header(realm);
-               RETURN_FALSE;
-       }
-       {
-               zval *zparams[2] = {NULL, NULL}, retval;
-               int result = 0;
-
-               MAKE_STD_ZVAL(zparams[0]);
-               MAKE_STD_ZVAL(zparams[1]);
-               ZVAL_STRING(zparams[0], user, 0);
-               ZVAL_STRING(zparams[1], pass, 0);
-
-               if (SUCCESS == call_user_function(EG(function_table), NULL, cb,
-                               &retval, 2, zparams TSRMLS_CC)) {
-                       result = Z_LVAL(retval);
-               }
-
-               efree(user);
-               efree(pass);
-               efree(zparams[0]);
-               efree(zparams[1]);
-
-               if (!result) {
-                       http_auth_basic_header(realm);
-               }
-
-               RETURN_BOOL(result);
-       }
-}
-/* }}}*/
-
 /* {{{ Sara Golemons http_build_query() */
 #ifndef ZEND_ENGINE_2
 
index 5f4d4386caf89c90a714d5a7910cb58b983cacfe..6785d59ffa0a3d5e4f3452b26bc84a92f501d1a0 100644 (file)
@@ -81,17 +81,6 @@ HTTP_BEGIN_ARGS(parseHeaders, 1)
        HTTP_ARG_VAL(headers_string, 0)
 HTTP_END_ARGS;
 
-HTTP_BEGIN_ARGS(authBasic, 2)
-       HTTP_ARG_VAL(username, 0)
-       HTTP_ARG_VAL(password, 0)
-       HTTP_ARG_VAL(realm, 0)
-HTTP_END_ARGS;
-
-HTTP_BEGIN_ARGS(authBasicCallback, 1)
-       HTTP_ARG_VAL(callback, 0)
-       HTTP_ARG_VAL(realm, 0)
-HTTP_END_ARGS;
-
 zend_class_entry *http_util_object_ce;
 zend_function_entry http_util_object_fe[] = {
        HTTP_UTIL_ALIAS(date, http_date)
@@ -104,8 +93,6 @@ zend_function_entry http_util_object_fe[] = {
        HTTP_UTIL_ALIAS(chunkedDecode, http_chunked_decode)
        HTTP_UTIL_ALIAS(parseMessage, http_parse_message)
        HTTP_UTIL_ALIAS(parseHeaders, http_parse_headers)
-       HTTP_UTIL_ALIAS(authBasic, http_auth_basic)
-       HTTP_UTIL_ALIAS(authBasicCallback, http_auth_basic_cb)
        {NULL, NULL, NULL}
 };
 
index 3517095606a228043ed17ac58a83141eef8c2490..7050c4df03f9b925da459798b31a4558459af02e 100644 (file)
@@ -1,6 +1,6 @@
 <?xml version="1.0" encoding="iso-8859-1"?>
 <!DOCTYPE package SYSTEM "http://pear.php.net/dtd/package-1.0">
-<!-- $Revision: 1.34 $ -->
+<!-- $Revision: 1.35 $ -->
 <package version="1.0">
   <name>pecl_http</name>
   <summary>Extended HTTP support</summary>
@@ -15,7 +15,6 @@
 * Sending data/files/streams with (multiple) ranges support
 * Negotiating user preferred language/charset
 * Convenient request functions built upon libcurl
-* HTTP auth hooks (Basic)
 * PHP5 classes: HttpUtil, HttpResponse, HttpRequest, HttpRequestPool, HttpMessage
 ]]>
   </description>
@@ -45,6 +44,7 @@
 + Added ZendEngine workaround for internal class' static properties (HttpResponse)
 
 - Removed http_split_response()
+- Removed AuthBasic hooks
 - Removed HttpResponse::sendHeader(), HttpResponse::sendStatus()
 - Removed HttpRequest::unset*() methods, now handled through set*() with empty parameter
 
@@ -80,7 +80,6 @@
       <file role="src">php_http.h</file>
       <file role="src">php_http_std_defs.h</file>
       <file role="src">php_http_api.h</file>
-      <file role="src">php_http_auth_api.h</file>
       <file role="src">php_http_cache_api.h</file>
       <file role="src">php_http_date_api.h</file>
       <file role="src">php_http_headers_api.h</file>
       <file role="src">http.c</file>
       <file role="src">http_functions.c</file>
       <file role="src">http_api.c</file>
-      <file role="src">http_auth_api.c</file>
       <file role="src">http_cache_api.c</file>
       <file role="src">http_date_api.c</file>
       <file role="src">http_headers_api.c</file>
index 25d305cf414ca23a3f3b3b619ad1ac261e8ed5c1..666c33bd36bbba6a140ebee6fda07f72ed1d1759 100644 (file)
@@ -35,6 +35,9 @@ extern STATUS _http_parse_key_list(const char *list, HashTable *items, char sepa
 #define http_error_ex _http_error_ex
 extern void _http_error_ex(long type, long code, const char *format, ...) PHP_ATTRIBUTE_FORMAT(printf, 3, 4);
 
+#define http_log(f, i, m) _http_log_ex((f), (i), (m) TSRMLS_CC)
+extern void http_log_ex(char *file, const char *ident, const char *message TSRMLS_DC);
+
 #define http_exit(s, h) http_exit_ex((s), (h), NULL, 1)
 #define http_exit_ex(s, h, b, e) _http_exit_ex((s), (h), (b), (e) TSRMLS_CC)
 extern STATUS _http_exit_ex(int status, char *header, char *body, zend_bool send_header TSRMLS_DC);
diff --git a/php_http_auth_api.h b/php_http_auth_api.h
deleted file mode 100644 (file)
index 62ffd3e..0000000
+++ /dev/null
@@ -1,47 +0,0 @@
-/*
-   +----------------------------------------------------------------------+
-   | PECL :: http                                                         |
-   +----------------------------------------------------------------------+
-   | This source file is subject to version 3.0 of the PHP license, that  |
-   | is bundled with this package in the file LICENSE, and is available   |
-   | through the world-wide-web at http://www.php.net/license/3_0.txt.    |
-   | If you did not receive a copy of the PHP license and are unable to   |
-   | obtain it through the world-wide-web, please send a note to          |
-   | license@php.net so we can mail you a copy immediately.               |
-   +----------------------------------------------------------------------+
-   | Copyright (c) 2004-2005 Michael Wallner <mike@php.net>               |
-   +----------------------------------------------------------------------+
-*/
-
-/* $Id$ */
-
-#ifndef PHP_HTTP_AUTH_API_H
-#define PHP_HTTP_AUTH_API_H
-
-#include "php_http_std_defs.h"
-
-#define http_auth_basic_credentials(u, p) _http_auth_basic_credentials((u), (p) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_auth_basic_credentials(char **user, char **pass TSRMLS_DC);
-
-#define http_auth_basic_header(r) _http_auth_basic_header((r) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_auth_basic_header(const char *realm TSRMLS_DC);
-
-/*
-#define http_auth_digest_credentials(i) _http_auth_digest_credentials((i) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_auth_digest_credentials(HashTable *items TSRMLS_DC);
-
-#define http_auth_digest_header(r) _http_auth_digest_header((r) TSRMLS_CC)
-PHP_HTTP_API STATUS _http_auth_digest_header(const char *realm TSRMLS_DC);
-*/
-
-#endif
-
-/*
- * Local variables:
- * tab-width: 4
- * c-basic-offset: 4
- * End:
- * vim600: noet sw=4 ts=4 fdm=marker
- * vim<600: noet sw=4 ts=4
- */
-
index 7357287ce2f350228abcb3fde315d9722f671f19..d50850e71a17c3869821c70e4543b449c09d5580 100644 (file)
@@ -33,9 +33,7 @@ PHP_METHOD(HttpUtil, matchModified);
 PHP_METHOD(HttpUtil, matchEtag);
 PHP_METHOD(HttpUtil, chunkedDecode);
 PHP_METHOD(HttpUtil, parseHeaders);
-PHP_METHOD(HttpUril, parseMessage);
-PHP_METHOD(HttpUtil, authBasic);
-PHP_METHOD(HttpUtil, authBasicCallback);
+PHP_METHOD(HttpUtil, parseMessage);
 
 #endif
 #endif