Back to index

php5  5.3.10
Classes | Functions
url_scanner_ex.h File Reference
#include "php_smart_str_public.h"
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  url_adapt_state_ex_t

Functions

 PHP_MINIT_FUNCTION (url_scanner_ex)
 PHP_MSHUTDOWN_FUNCTION (url_scanner_ex)
 PHP_RINIT_FUNCTION (url_scanner_ex)
 PHP_RSHUTDOWN_FUNCTION (url_scanner_ex)
PHPAPI char * php_url_scanner_adapt_single_url (const char *url, size_t urllen, const char *name, const char *value, size_t *newlen TSRMLS_DC)
PHPAPI int php_url_scanner_add_var (char *name, int name_len, char *value, int value_len, int urlencode TSRMLS_DC)
PHPAPI int php_url_scanner_reset_vars (TSRMLS_D)

Class Documentation

struct url_adapt_state_ex_t

Definition at line 36 of file url_scanner_ex.h.

Collaboration diagram for url_adapt_state_ex_t:
Class Members
int active
smart_str arg
smart_str buf
smart_str form_app
char * lookup_data
smart_str result
int state
smart_str tag
HashTable * tags
smart_str url_app
smart_str val

Function Documentation

PHP_MINIT_FUNCTION ( url_scanner_ex  )
PHP_MSHUTDOWN_FUNCTION ( url_scanner_ex  )
PHP_RINIT_FUNCTION ( url_scanner_ex  )
PHP_RSHUTDOWN_FUNCTION ( url_scanner_ex  )
PHPAPI char* php_url_scanner_adapt_single_url ( const char *  url,
size_t  urllen,
const char *  name,
const char *  value,
size_t *newlen  TSRMLS_DC 
)

Definition at line 865 of file url_scanner_ex.c.

{
       smart_str surl = {0};
       smart_str buf = {0};
       smart_str url_app = {0};

       smart_str_setl(&surl, url, urllen);

       smart_str_appends(&url_app, name);
       smart_str_appendc(&url_app, '=');
       smart_str_appends(&url_app, value);

       append_modified_url(&surl, &buf, &url_app, PG(arg_separator).output);

       smart_str_0(&buf);
       if (newlen) *newlen = buf.len;

       smart_str_free(&url_app);

       return buf.c;
}

Here is the call graph for this function:

Here is the caller graph for this function:

PHPAPI int php_url_scanner_add_var ( char *  name,
int  name_len,
char *  value,
int  value_len,
int urlencode  TSRMLS_DC 
)

Definition at line 969 of file url_scanner_ex.c.

{
       char *encoded;
       int encoded_len;
       smart_str val;
       
       if (! BG(url_adapt_state_ex).active) {
              php_url_scanner_ex_activate(TSRMLS_C);
              php_ob_set_internal_handler(php_url_scanner_output_handler, 0, "URL-Rewriter", 1 TSRMLS_CC);
              BG(url_adapt_state_ex).active = 1;
       }


       if (BG(url_adapt_state_ex).url_app.len != 0) {
              smart_str_appends(&BG(url_adapt_state_ex).url_app, PG(arg_separator).output);
       }

       if (urlencode) {
              encoded = php_url_encode(value, value_len, &encoded_len);
              smart_str_setl(&val, encoded, encoded_len);
       } else {
              smart_str_setl(&val, value, value_len);
       }
       
       smart_str_appendl(&BG(url_adapt_state_ex).url_app, name, name_len);
       smart_str_appendc(&BG(url_adapt_state_ex).url_app, '=');
       smart_str_append(&BG(url_adapt_state_ex).url_app, &val);

       smart_str_appends(&BG(url_adapt_state_ex).form_app, "<input type=\"hidden\" name=\""); 
       smart_str_appendl(&BG(url_adapt_state_ex).form_app, name, name_len);
       smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" value=\"");
       smart_str_append(&BG(url_adapt_state_ex).form_app, &val);
       smart_str_appends(&BG(url_adapt_state_ex).form_app, "\" />");

       if (urlencode)
              efree(encoded);

       return SUCCESS;
}

Here is the call graph for this function:

Here is the caller graph for this function:

Definition at line 1009 of file url_scanner_ex.c.

{
       BG(url_adapt_state_ex).form_app.len = 0;
       BG(url_adapt_state_ex).url_app.len = 0;

       return SUCCESS;
}

Here is the caller graph for this function: