Back to index

php5  5.3.10
Classes | Defines | Typedefs | Functions
pi3web_sapi.h File Reference
This graph shows which files directly or indirectly include this file:

Go to the source code of this file.

Classes

struct  _CONTROL_BLOCK

Defines

#define MODULE_API
#define far
#define PHP_MODE_STANDARD   1
#define PHP_MODE_HIGHLIGHT   2
#define PHP_MODE_INDENT   3
#define PHP_MODE_LINT   4

Typedefs

typedef int BOOL
typedef void farLPVOID
typedef unsigned long DWORD
typedef DWORD farLPDWORD
typedef char CHAR
typedef CHARLPSTR
typedef unsigned char BYTE
typedef BYTE farLPBYTE
typedef LPVOID HCONN
typedef struct _CONTROL_BLOCK CONTROL_BLOCK
typedef struct _CONTROL_BLOCKLPCONTROL_BLOCK
typedef DWORD(* PFN_WRAPPERFUNC )(CONTROL_BLOCK *pCB)

Functions

MODULE_API DWORD PHP5_wrapper (LPCONTROL_BLOCK lpCB)
MODULE_API BOOL PHP5_startup ()
MODULE_API BOOL PHP5_shutdown ()

Define Documentation

#define far

Definition at line 17 of file pi3web_sapi.h.

#define MODULE_API

Definition at line 15 of file pi3web_sapi.h.

#define PHP_MODE_HIGHLIGHT   2

Definition at line 36 of file pi3web_sapi.h.

#define PHP_MODE_INDENT   3

Definition at line 37 of file pi3web_sapi.h.

#define PHP_MODE_LINT   4

Definition at line 38 of file pi3web_sapi.h.

#define PHP_MODE_STANDARD   1

Definition at line 35 of file pi3web_sapi.h.


Typedef Documentation

typedef int BOOL

Definition at line 19 of file pi3web_sapi.h.

typedef unsigned char BYTE

Definition at line 25 of file pi3web_sapi.h.

typedef char CHAR

Definition at line 23 of file pi3web_sapi.h.

typedef struct _CONTROL_BLOCK CONTROL_BLOCK
typedef unsigned long DWORD

Definition at line 21 of file pi3web_sapi.h.

typedef LPVOID HCONN

Definition at line 29 of file pi3web_sapi.h.

typedef BYTE far* LPBYTE

Definition at line 26 of file pi3web_sapi.h.

typedef struct _CONTROL_BLOCK * LPCONTROL_BLOCK
typedef DWORD far* LPDWORD

Definition at line 22 of file pi3web_sapi.h.

typedef CHAR* LPSTR

Definition at line 24 of file pi3web_sapi.h.

typedef void far* LPVOID

Definition at line 20 of file pi3web_sapi.h.

typedef DWORD( * PFN_WRAPPERFUNC)(CONTROL_BLOCK *pCB)

Definition at line 94 of file pi3web_sapi.h.


Function Documentation

Definition at line 424 of file pi3web_sapi.c.

                                {
       if (pi3web_sapi_module.shutdown) {
              pi3web_sapi_module.shutdown(&pi3web_sapi_module);
       };
       sapi_shutdown();
       tsrm_shutdown();
       IWasLoaded = 0;
       return !IWasLoaded;
};

Here is the call graph for this function:

Definition at line 414 of file pi3web_sapi.c.

                               {
       tsrm_startup(1, 1, 0, NULL);
       sapi_startup(&pi3web_sapi_module);
       if (pi3web_sapi_module.startup) {
              pi3web_sapi_module.startup(&pi3web_sapi_module);
       };
       IWasLoaded = 1;
       return IWasLoaded;
};

Here is the call graph for this function:

Definition at line 345 of file pi3web_sapi.c.

{
       zend_file_handle file_handle = {0};
       int iRet = PIAPI_COMPLETED;
       TSRMLS_FETCH();

       zend_first_try {
              file_handle.filename = lpCB->lpszFileName;
              file_handle.free_filename = 0;
              file_handle.type = ZEND_HANDLE_FILENAME;
              file_handle.opened_path = NULL;

              init_request_info(lpCB TSRMLS_CC);
              php_request_startup(TSRMLS_C);

              switch ( lpCB->dwBehavior ) {
                     case PHP_MODE_STANDARD:
                            iRet = ( php_execute_script( &file_handle TSRMLS_CC ) ) ?
                                   PIAPI_COMPLETED : PIAPI_ERROR;
                            break;
                     case PHP_MODE_HIGHLIGHT: {
                            zend_syntax_highlighter_ini syntax_highlighter_ini;
                            if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS )
                                   {
                                   php_get_highlight_struct( &syntax_highlighter_ini );
                                   zend_highlight( &syntax_highlighter_ini TSRMLS_CC );
                                   }
                            else
                                   {
                                   iRet = PIAPI_ERROR;
                                   };
                            };
                            break;
                     case PHP_MODE_INDENT: {
                            sapi_header_line ctr = {0};

                            ctr.line = "Content-Type: text/plain";
                            ctr.line_len = strlen(ctr.line);
                            
                            sapi_header_op(SAPI_HEADER_REPLACE, &ctr TSRMLS_CC);
                       }
                            if ( open_file_for_scanning( &file_handle TSRMLS_CC ) == SUCCESS )
                                   {
                                   zend_indent();
                                   }
                            else
                                   {
                                   iRet = PIAPI_ERROR;
                                   };
                            break;
                     case PHP_MODE_LINT:
                            iRet = (php_lint_script(&file_handle TSRMLS_CC) == SUCCESS) ?
                                   PIAPI_COMPLETED : PIAPI_ERROR;
                            break;
                     default:
                            iRet = PIAPI_ERROR;;
                     }

              if (SG(request_info).cookie_data) {
                     efree(SG(request_info).cookie_data);
              };

              php_request_shutdown(NULL);
       } zend_catch {
              iRet = PIAPI_ERROR;
       } zend_end_try();
       return iRet;
}

Here is the call graph for this function: