skip to Main Content

I am trying to compile the SAP SqlAnywhere php extension for use with PHP 8.0.12; the source for this extension I downloaded from this location. This site has compiled versions of the extension for various versions of PHP up until PHP 7.4. As we are currently using PHP 8.0.12 on our development server, I wanted to build this extension for this version, or for PHP 8.0.13.

I managed to setup the development environment correctly on Windows 10, having installed Visual Studio 2019 including Visual C++ 2015-2022 Redistributable and git. Using this environment I have been able to build the extension for PHP 7.4 without issues, but when I try build for PHP 8.0.12, I get the following errors reported:

$ nmake

Microsoft (R) Program Maintenance Utility Version 14.29.30137.0
Copyright (C) Microsoft Corporation.  All rights reserved.

sacapidll.c
sqlany_dbg.c
sqlanywhere.c
extsqlanywheresqlanywhere.c(773): error C2146: syntax error: missing ')' before identifier 'TSRMLS_DC'
extsqlanywheresqlanywhere.c(773): error C2061: syntax error: identifier 'TSRMLS_DC'
extsqlanywheresqlanywhere.c(773): error C2059: syntax error: ';'
extsqlanywheresqlanywhere.c(773): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(775): error C2449: found '{' at file scope (missing function header?)
extsqlanywheresqlanywhere.c(780): error C2059: syntax error: '}'
extsqlanywheresqlanywhere.c(1002): error C2146: syntax error: missing ')' before identifier 'TSRMLS_DC'
extsqlanywheresqlanywhere.c(1002): error C2061: syntax error: identifier 'TSRMLS_DC'
extsqlanywheresqlanywhere.c(1002): error C2059: syntax error: ';'
extsqlanywheresqlanywhere.c(1002): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(1004): error C2449: found '{' at file scope (missing function header?)
extsqlanywheresqlanywhere.c(1007): error C2059: syntax error: '}'
extsqlanywheresqlanywhere.c(1194): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1194): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(1246): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1246): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(1258): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1258): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(1306): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1306): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(1347): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1347): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(1415): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1415): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(1462): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1462): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(1540): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1540): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(1678): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1677): error C2198: 'zend_fetch_resource2_ex': too few arguments for call
extsqlanywheresqlanywhere.c(1678): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(1699): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1699): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(1725): error C2146: syntax error: missing ')' before identifier 'TSRMLS_DC'
extsqlanywheresqlanywhere.c(1725): error C2061: syntax error: identifier 'TSRMLS_DC'
extsqlanywheresqlanywhere.c(1725): error C2059: syntax error: ';'
extsqlanywheresqlanywhere.c(1725): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(1727): error C2449: found '{' at file scope (missing function header?)
extsqlanywheresqlanywhere.c(1763): error C2059: syntax error: '}'
extsqlanywheresqlanywhere.c(1855): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1854): error C2198: 'zend_fetch_resource2_ex': too few arguments for call
extsqlanywheresqlanywhere.c(1855): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(1866): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(1866): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(1870): error C2059: syntax error: 'while'
extsqlanywheresqlanywhere.c(1870): error C2059: syntax error: 'return'
extsqlanywheresqlanywhere.c(1870): error C2059: syntax error: '}'
extsqlanywheresqlanywhere.c(1871): error C2059: syntax error: '}'
extsqlanywheresqlanywhere.c(1878): error C2099: initializer is not a constant
extsqlanywheresqlanywhere.c(1880): error C2143: syntax error: missing '{' before '->'
extsqlanywheresqlanywhere.c(1880): error C2059: syntax error: '->'
extsqlanywheresqlanywhere.c(1884): error C2143: syntax error: missing '{' before '->'
extsqlanywheresqlanywhere.c(1884): error C2059: syntax error: '->'
extsqlanywheresqlanywhere.c(1885): error C2143: syntax error: missing '{' before '->'
extsqlanywheresqlanywhere.c(1885): error C2059: syntax error: '->'
extsqlanywheresqlanywhere.c(1886): error C2143: syntax error: missing '{' before '->'
extsqlanywheresqlanywhere.c(1886): error C2059: syntax error: '->'
extsqlanywheresqlanywhere.c(1887): error C2143: syntax error: missing '{' before '->'
extsqlanywheresqlanywhere.c(1887): error C2059: syntax error: '->'
extsqlanywheresqlanywhere.c(1888): error C2143: syntax error: missing '{' before '->'
extsqlanywheresqlanywhere.c(1888): error C2059: syntax error: '->'
extsqlanywheresqlanywhere.c(1889): error C2143: syntax error: missing '{' before '->'
extsqlanywheresqlanywhere.c(1889): error C2059: syntax error: '->'
extsqlanywheresqlanywhere.c(1891): error C2059: syntax error: 'if'
extsqlanywheresqlanywhere.c(1903): warning C4047: 'function': 'sqlany_result_t *' differs in levels of indirection from 'int'
extsqlanywheresqlanywhere.c(1903): warning C4024: 'cache_result': different types for formal and actual parameter 1
extsqlanywheresqlanywhere.c(1903): error C2099: initializer is not a constant
extsqlanywheresqlanywhere.c(1904): error C2059: syntax error: 'if'
extsqlanywheresqlanywhere.c(1907): error C2059: syntax error: 'else'
extsqlanywheresqlanywhere.c(1910): error C2059: syntax error: 'if'
extsqlanywheresqlanywhere.c(1920): error C2059: syntax error: 'else'
extsqlanywheresqlanywhere.c(1932): error C2059: syntax error: 'if'
extsqlanywheresqlanywhere.c(1933): error C2059: syntax error: 'do'
extsqlanywheresqlanywhere.c(1933): error C2059: syntax error: 'while'
extsqlanywheresqlanywhere.c(1939): error C2059: syntax error: '}'
extsqlanywheresqlanywhere.c(2062): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2061): error C2198: 'zend_fetch_resource2_ex': too few arguments for call
extsqlanywheresqlanywhere.c(2062): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(2072): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2072): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(2077): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2077): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(2129): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2128): error C2198: 'zend_fetch_resource2_ex': too few arguments for call
extsqlanywheresqlanywhere.c(2129): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(2139): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2139): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(2192): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2191): error C2198: 'zend_fetch_resource_ex': too few arguments for call
extsqlanywheresqlanywhere.c(2192): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(2227): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2226): error C2198: 'zend_fetch_resource_ex': too few arguments for call
extsqlanywheresqlanywhere.c(2227): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(2237): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2237): error C2198: 'php_error_docref': too few arguments for call
extsqlanywheresqlanywhere.c(2266): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2265): error C2198: 'zend_fetch_resource_ex': too few arguments for call
extsqlanywheresqlanywhere.c(2266): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(2289): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2288): error C2198: 'zend_fetch_resource2_ex': too few arguments for call
extsqlanywheresqlanywhere.c(2289): error C2059: syntax error: ')'
extsqlanywheresqlanywhere.c(2318): error C2146: syntax error: missing ')' before identifier 'TSRMLS_CC'
extsqlanywheresqlanywhere.c(2317): error C2198: 'zend_fetch_resource2_ex': too few arguments for call
extsqlanywheresqlanywhere.c(2318): fatal error C1003: error count exceeds 100; stopping compilation
NMAKE : fatal error U1077: '"C:Program Files (x86)Microsoft Visual Studio2019CommunityVCToolsMSVC14.29.30133binHostX86x86cl.exe"' : return code '0x2'
Stop.

Clearly something is missing from the PHP 8.0.12 core that is present in PHP 7.4 – I think it has something to do with TSRMLS_DC not being defined, as this is the error that is reported first.

Can anyone shed some light on this error/these errors and let me know if there is some way to resolve the missing dependencies so that this extension builds correctly?

2

Answers


  1. Chosen as BEST ANSWER

    I found the answer to this on this site. The TSRMLS_DC that the compiler is complaining about is Thread-Safe Resource Manager macros which were previously required, but are no longer need for PHP 8. These can just be removed from the code.

    After removing those macros, the source will compile, but when the extension runs, a number of warnings, such as the following, will be issued by PHP:

    Warning: Missing arginfo for sqlanywhere_connect() in Unknown on line 0
    Warning: Missing arginfo for sqlanywhere_commit() in Unknown on line 0
    

    The reason for these warnings is that PHP 8 is stricter on requiring arginfo definitions for all the extension functions.

    You can define these blocks for all of the functions, as outlined in the link above, to get rid of these warnings.


  2. Step by step solution, but for Linux – yes, the question is about Windows, but one can save some time by coping the required by PHP8 pieces of code. Attachments marked with brackets are below the ordered list:

    1. Download the source code (a)
    2. Create the Dockerfile (b)
    3. Put the unpacked source catalog in the same path as the docker file, so you have the file and the catalog next to each other
    4. Add (c) to sasql_php/sqlanywhere.c, after the line 24
    5. …and add (d) right above (!) second (!) occurence of the phrase ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_bind_param_ex, 0)
    6. …and replace the whole section starting with zend_function_entry sqlanywhere_functions[] = { and ending with }; with the (e)…
    7. …and replace the section if( object_init( return_value ) == FAILURE ) { RETURN_FALSE; } (just look for the phrase object_init) with just object_init( return_value );
    8. In a terminal, in the path with the docker file run docker build -t php-sqlanywhere12-compiler:8.0-cli-alpine .
    9. Extract the compiled module by something like docker run --rm -v "/path/on/the/host:/module" php-sqlanywhere12-compiler:8.0-cli-alpine /bin/sh -c "cp /sasql_php/modules/sqlanywhere.so /module/php-8.0.0_sqlanywhere.so"
    10. You should have the compiled module in /path/on/the/host

    a) https://wiki.scn.sap.com/wiki/display/SQLANY/The+SAP+SQL+Anywhere+PHP+Module – at the very bottom

    b)

    FROM debian:11
    
    RUN apt update && 
        apt install -y build-essential autoconf automake bison 
                       flex re2c gdb libtool make pkgconf 
                       valgrind git libxml2-dev libsqlite3-dev
    
    RUN git clone https://github.com/php/php-src.git && 
        cd ./php-src && 
        git checkout PHP-8.0.12
    
    WORKDIR /php-src
    
    RUN ./buildconf --force && 
        ./configure --prefix=/php && 
        make && 
        make install
    
    ENV PATH="/php/bin:${PATH}"
    
    COPY ./sasql_php /sasql_php
    
    WORKDIR /sasql_php
    
    RUN phpize && 
        ./configure && 
        make && 
        make install
    

    c)

    #ifndef TSRMLS_D
    #define TSRMLS_D void
    #define TSRMLS_DC
    #define TSRMLS_C
    #define TSRMLS_CC
    #define TSRMLS_FETCH()
    #endif
    

    d)

    ZEND_BEGIN_ARG_INFO(arginfo_sasql_connect, 0)
      ZEND_ARG_INFO(0, con_str)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_pconnect, 0)
      ZEND_ARG_INFO(0, con_str)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_pconnect_from_sqlca, 0)
      ZEND_ARG_INFO(0, sqlca)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_close, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_query, 0)
      ZEND_ARG_INFO(0, conn)
      ZEND_ARG_INFO(0, sql_str)
      ZEND_ARG_INFO(0, result_mode)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_real_query, 0)
      ZEND_ARG_INFO(0, conn)
      ZEND_ARG_INFO(0, sql_str)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_store_result, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_use_result, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_next_result, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_set_option, 0)
      ZEND_ARG_INFO(0, conn)
      ZEND_ARG_INFO(0, option)
      ZEND_ARG_INFO(0, value)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_affected_rows, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_commit, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_rollback, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_sqlstate, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_data_seek, 0)
      ZEND_ARG_INFO(0, result)
      ZEND_ARG_INFO(0, row_num)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_fetch_array, 0)
      ZEND_ARG_INFO(0, result)
      ZEND_ARG_INFO(0, result_type)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_fetch_assoc, 0)
      ZEND_ARG_INFO(0, result)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_fetch_field, 0)
      ZEND_ARG_INFO(0, result)
      ZEND_ARG_INFO(0, field_offset)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_fetch_object, 0)
      ZEND_ARG_INFO(0, result)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_fetch_row, 0)
      ZEND_ARG_INFO(0, result)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_field_seek, 0)
      ZEND_ARG_INFO(0, result)
      ZEND_ARG_INFO(0, field_offset)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_free_result, 0)
      ZEND_ARG_INFO(0, result)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_num_rows, 0)
      ZEND_ARG_INFO(0, result)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_result_all, 0)
      ZEND_ARG_INFO(0, result)
      ZEND_ARG_INFO(0, html_table_format_string)
      ZEND_ARG_INFO(0, html_table_header_format_string)
      ZEND_ARG_INFO(0, html_table_row_format_string)
      ZEND_ARG_INFO(0, html_table_cell_format_string)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_error, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_errorcode, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_insert_id, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_message, 0)
      ZEND_ARG_INFO(0, conn)
      ZEND_ARG_INFO(0, message)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_prepare, 0)
      ZEND_ARG_INFO(0, conn)
      ZEND_ARG_INFO(0, sql_str)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_field_count, 0)
      ZEND_ARG_INFO(0, conn)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_num_fields, 0)
      ZEND_ARG_INFO(0, result)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_param_count, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_execute, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_close, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_result_metadata, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_affected_rows, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_num_rows, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_insert_id, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_send_long_data, 0)
      ZEND_ARG_INFO(0, stmt)
      ZEND_ARG_INFO(0, param_number)
      ZEND_ARG_INFO(0, data)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_store_result, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_free_result, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_reset, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_fetch, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_field_count, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_data_seek, 0)
      ZEND_ARG_INFO(0, stmt)
      ZEND_ARG_INFO(0, offset)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_next_result, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_errno, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_error, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_stmt_sqlstate, 0)
      ZEND_ARG_INFO(0, stmt)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_real_escape_string, 0)
      ZEND_ARG_INFO(0, conn)
      ZEND_ARG_INFO(0, str)
    ZEND_END_ARG_INFO()
    
    ZEND_BEGIN_ARG_INFO(arginfo_sasql_get_client_info, 0)
    ZEND_END_ARG_INFO()
    

    e)

    zend_function_entry sqlanywhere_functions[] = {
        /* connection functions */
    PHP_FE(sasql_connect,               arginfo_sasql_connect)
    PHP_FE(sasql_pconnect,              arginfo_sasql_pconnect)
    PHP_FE(sasql_pconnect_from_sqlca,   arginfo_sasql_pconnect_from_sqlca)
    PHP_FE(sasql_close,                 arginfo_sasql_close)
    PHP_FE(sasql_query,                 arginfo_sasql_query)
    PHP_FE(sasql_real_query,            arginfo_sasql_real_query)
    PHP_FE(sasql_store_result,          arginfo_sasql_store_result)
    PHP_FE(sasql_use_result,            arginfo_sasql_use_result)
    PHP_FE(sasql_next_result,           arginfo_sasql_next_result)
    PHP_FE(sasql_set_option,            arginfo_sasql_set_option)
    PHP_FE(sasql_affected_rows,         arginfo_sasql_affected_rows)
    PHP_FE(sasql_commit,                arginfo_sasql_commit)
    PHP_FE(sasql_rollback,              arginfo_sasql_rollback)
    PHP_FE(sasql_sqlstate,              arginfo_sasql_sqlstate)
    
    /* result functions */
    /*  PHP_FE(sasql_field_tell,            NULL) */
    PHP_FE(sasql_data_seek,             arginfo_sasql_data_seek)
    PHP_FE(sasql_fetch_array,           arginfo_sasql_fetch_array)
    PHP_FE(sasql_fetch_assoc,           arginfo_sasql_fetch_assoc)
    /*  PHP_FE(sasql_fetch_field_direct,    NULL) */
    PHP_FE(sasql_fetch_field,           arginfo_sasql_fetch_field)
    PHP_FE(sasql_fetch_object,          arginfo_sasql_fetch_object)
    PHP_FE(sasql_fetch_row,             arginfo_sasql_fetch_row)
    PHP_FE(sasql_field_seek,            arginfo_sasql_field_seek)
    PHP_FE(sasql_free_result,           arginfo_sasql_free_result)
    /*  PHP_FE(sasql_fetch_lengths,         NULL) */
    PHP_FE(sasql_num_rows,              arginfo_sasql_num_rows)
    PHP_FE(sasql_result_all,            arginfo_sasql_result_all)
    
    /* connection functions */
    PHP_FE(sasql_error,                 arginfo_sasql_error)
    PHP_FE(sasql_errorcode,             arginfo_sasql_errorcode)
    PHP_FE(sasql_insert_id,             arginfo_sasql_insert_id)
    PHP_FE(sasql_message,               arginfo_sasql_message)
    PHP_FE(sasql_prepare,               arginfo_sasql_prepare)
    PHP_FE(sasql_field_count,           arginfo_sasql_field_count)
    PHP_FE(sasql_num_fields,            arginfo_sasql_num_fields)
    
    /* statement functions */
    PHP_FE(sasql_stmt_param_count,      arginfo_sasql_stmt_param_count)
    PHP_FE(sasql_stmt_bind_param_ex,    arginfo_sasql_stmt_bind_param_ex)
    PHP_FE(sasql_stmt_bind_param,       arginfo_sasql_stmt_bind_param)
    PHP_FE(sasql_stmt_execute,          arginfo_sasql_stmt_execute)
    PHP_FE(sasql_stmt_close,            arginfo_sasql_stmt_close)
    PHP_FE(sasql_stmt_result_metadata,  arginfo_sasql_stmt_result_metadata)
    PHP_FE(sasql_stmt_affected_rows,    arginfo_sasql_stmt_affected_rows)
    PHP_FE(sasql_stmt_num_rows,         arginfo_sasql_stmt_num_rows)
    PHP_FE(sasql_stmt_insert_id,        arginfo_sasql_stmt_insert_id)
    PHP_FE(sasql_stmt_bind_result,      arginfo_sasql_stmt_bind_result)
    PHP_FE(sasql_stmt_send_long_data,   arginfo_sasql_stmt_send_long_data)
    PHP_FE(sasql_stmt_store_result,     arginfo_sasql_stmt_store_result)
    PHP_FE(sasql_stmt_free_result,      arginfo_sasql_stmt_free_result)
    PHP_FE(sasql_stmt_reset,            arginfo_sasql_stmt_reset)
    PHP_FE(sasql_stmt_fetch,            arginfo_sasql_stmt_fetch)
    PHP_FE(sasql_stmt_field_count,      arginfo_sasql_stmt_field_count)
    PHP_FE(sasql_stmt_data_seek,        arginfo_sasql_stmt_data_seek)
    PHP_FE(sasql_stmt_next_result,      arginfo_sasql_stmt_next_result)
    PHP_FE(sasql_stmt_errno,            arginfo_sasql_stmt_errno)
    PHP_FE(sasql_stmt_error,            arginfo_sasql_stmt_error)
    PHP_FE(sasql_stmt_sqlstate,         arginfo_sasql_stmt_sqlstate)
    
    /* misc functions */
    PHP_FE(sasql_real_escape_string,    arginfo_sasql_real_escape_string)
    PHP_FE(sasql_get_client_info,       arginfo_sasql_get_client_info)
    
    
    /* Aliases */
    PHP_FALIAS(sasql_disconnect,        sasql_close,                arginfo_sasql_close)
    PHP_FALIAS(sasql_escape_string,     sasql_real_escape_string,   arginfo_sasql_real_escape_string)
    PHP_FALIAS(sasql_multi_query,       sasql_real_query,           arginfo_sasql_real_query)
    {NULL, NULL, NULL}  
    };
    
    Login or Signup to reply.
Please signup or login to give your own answer.
Back To Top
Search