Changeset 16

Show
Ignore:
Timestamp:
12/06/07 00:22:54 (1 year ago)
Author:
scott
Message:

Fixed various bugs prior to a release

Files:

Legend:

Unmodified
Added
Removed
Modified
Copied
Moved
  • trunk/config.m4

    r4 r16  
    5959                fi 
    6060 
    61                 if test "$enable_maintainer_zts" = "yes"; then 
     61                if test "$ZEND_DEBUG" = "yes"; then 
    6262                        debug_flags="-DSQLITE_DEBUG=1" 
    6363                fi 
  • trunk/config.w32

    r2 r16  
    55 
    66if (PHP_SQLITE3 != "no") { 
    7  
    8         EXTENSION("sqlite3", "sqlite3.c", null, "/DTHREADSAFE=1 /I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname); 
     7        ADD_FLAG("CFLAGS_SQLITE3", "/D THREADSAFE=1 "); 
     8        EXTENSION("sqlite3", "sqlite3.c", null, "/I" + configure_module_dirname + "/libsqlite /I" + configure_module_dirname); 
    99        ADD_SOURCES(configure_module_dirname + "/libsqlite", 
    1010                "attach.c auth.c btmutex.c btree.c \ 
  • trunk/sqlite3.c

    r15 r16  
    204204/* }}} */ 
    205205 
    206 /* {{{ proto int SQLite3::last_insert_rowid() 
     206/* {{{ proto int SQLite3::lastInsertRowID() 
    207207        Returns the rowid of the most recent INSERT into the database from the database connection. 
    208208*/ 
    209 PHP_METHOD(sqlite3, last_insert_rowid
     209PHP_METHOD(sqlite3, lastInsertRowID
    210210{ 
    211211        php_sqlite3_db *db; 
     
    221221/* }}} */ 
    222222 
    223 /* {{{ proto bool SQLite3::load_extension(String Shared Library) 
     223/* {{{ proto bool SQLite3::loadExtension(String Shared Library) 
    224224        Attempts to load an SQLite extension library 
    225225*/ 
    226 PHP_METHOD(sqlite3, load_extension) 
     226PHP_METHOD(sqlite3, loadExtension) 
    227227{ 
    228228        php_sqlite3_db *db; 
     
    267267        } 
    268268 
    269         /* Extension loading should only be enabled for when we attempt to load */ 
     269       /* Extension loading should only be enabled for when we attempt to load */ 
    270270        sqlite3_enable_load_extension(db->db, 1); 
    271271        if (sqlite3_load_extension(db->db, fullpath, 0, &errtext) != SQLITE_OK) { 
     
    275275                RETURN_FALSE; 
    276276        } 
    277         sqlite3_enable_load_extension(db->db, 0); 
     277       sqlite3_enable_load_extension(db->db, 0); 
    278278 
    279279        RETURN_TRUE; 
     
    298298/* }}} */ 
    299299 
    300 /* {{{ proto String SQLite3::escape_string(String Query
     300/* {{{ proto String SQLite3::escapeString(String value
    301301        Returns a string that has been properly escaped 
    302302*/ 
    303 PHP_METHOD(sqlite3, escape_string) 
     303PHP_METHOD(sqlite3, escapeString) 
    304304{ 
    305305        php_sqlite3_db *db; 
     
    466466                MAKE_STD_ZVAL(*zargs[i + is_agg]); 
    467467 
    468                 /* get the value */ 
    469468                switch (sqlite3_value_type(argv[i])) { 
    470469                        case SQLITE_INTEGER: 
     
    489488        } 
    490489 
    491  
    492490        fc->fci.params = zargs; 
    493  
    494491 
    495492        if ((ret = zend_call_function(&fc->fci, &fc->fcc TSRMLS_CC)) == FAILURE) { 
     
    585582} 
    586583 
    587 /* {{{ proto bool SQLite3::create_function(string name, mixed callback [, int argcount])) 
     584/* {{{ proto bool SQLite3::createFunction(string name, mixed callback [, int argcount])) 
    588585        Allows registration of a PHP function as a SQLite UDF that can be called within SQL statements 
    589586*/ 
    590 PHP_METHOD(sqlite3, create_function) 
     587PHP_METHOD(sqlite3, createFunction) 
    591588{ 
    592589        php_sqlite3_db *db; 
     
    636633/* }}} */ 
    637634 
    638 /* {{{ proto bool SQLite3::create_aggregate(string name, mixed step, mixed final [, int argcount])) 
     635/* {{{ proto bool SQLite3::createAggregate(string name, mixed step, mixed final [, int argcount])) 
    639636        Allows registration of a PHP function for use as an aggregate 
    640637*/ 
    641 PHP_METHOD(sqlite3, create_aggregate) 
     638PHP_METHOD(sqlite3, createAggregate) 
    642639{ 
    643640        php_sqlite3_db *db; 
     
    698695/* }}} */ 
    699696 
    700 /* {{{ proto int SQLite3_stmt::param_count() 
     697/* {{{ proto int SQLite3_stmt::paramCount() 
    701698        Returns the number of parameters within the prepared statement 
    702699*/ 
    703 PHP_METHOD(sqlite3_stmt, param_count) 
     700PHP_METHOD(sqlite3_stmt, paramCount) 
    704701{ 
    705702        php_sqlite3_stmt *internp; 
     
    859856/* }}} */ 
    860857 
    861 /* {{{ proto bool SQLite3_stmt::bind_param(integer parameter_number, mixed parameter [, integer type]) 
     858/* {{{ proto bool SQLite3_stmt::bindParam(integer parameter_number, mixed parameter [, integer type]) 
    862859        Bind Paramater to a stmt variable 
    863860*/ 
    864 PHP_METHOD(sqlite3_stmt, bind_param) 
     861PHP_METHOD(sqlite3_stmt, bindParam) 
    865862{ 
    866863        php_sqlite3_stmt *internp; 
     
    899896/* }}} */ 
    900897 
    901 /* {{{ proto bool SQLite3_stmt::bind_value(integer parameter_number, mixed parameter [, integer type]) 
     898/* {{{ proto bool SQLite3_stmt::bindValue(integer parameter_number, mixed parameter [, integer type]) 
    902899        Bind Value of a parameter to a stmt variable 
    903900*/ 
    904 PHP_METHOD(sqlite3_stmt, bind_value) 
     901PHP_METHOD(sqlite3_stmt, bindValue) 
    905902{ 
    906903        php_sqlite3_stmt *internp; 
     
    10151012/* }}} */ 
    10161013 
    1017 /* {{{ proto int SQLite3_result::num_columns() 
     1014/* {{{ proto int SQLite3_result::numColumns() 
    10181015        Number of columns in result 
    10191016*/ 
    1020 PHP_METHOD(sqlite3_result, num_columns) 
     1017PHP_METHOD(sqlite3_result, numColumns) 
    10211018{ 
    10221019        php_sqlite3_result *internp; 
     
    10321029/* }}} */ 
    10331030 
    1034 /* {{{ proto string SQLite3_result::column_name(int column) 
     1031/* {{{ proto string SQLite3_result::columnName(int column) 
    10351032        Returns the name of the nth column 
    10361033*/ 
    1037 PHP_METHOD(sqlite3_result, column_name) 
     1034PHP_METHOD(sqlite3_result, columnName) 
    10381035{ 
    10391036        php_sqlite3_result *internp; 
     
    10501047/* }}} */ 
    10511048 
    1052 /* {{{ proto array SQLite3_result::fetch_array(int mode) 
     1049/* {{{ proto array SQLite3_result::fetchArray(int mode) 
    10531050        Fetch a result row as both an associative and numeric array 
    10541051*/ 
    1055 PHP_METHOD(sqlite3_result, fetch_array) 
     1052PHP_METHOD(sqlite3_result, fetchArray) 
    10561053{ 
    10571054        php_sqlite3_result *internp; 
     
    11041101                                        case SQLITE_BLOB: 
    11051102                                        default: 
    1106                                                 /*ZVAL_STRINGL(data, (char*)sqlite3_column_text(*(internp->intern_stmt), i), sqlite3_column_bytes(*(internp->intern_stmt), i), 1);*/ 
    11071103                                                ZVAL_STRINGL(data, (char*)sqlite3_column_blob(*(internp->intern_stmt), i), sqlite3_column_bytes(*(internp->intern_stmt), i), 1); 
    11081104                                } 
     
    11181114                                        add_assoc_zval(return_value, (char*)sqlite3_column_name(*(internp->intern_stmt), i), data); 
    11191115                                } 
    1120  
    1121                                 /*add_index_zval(return_value, i, data); 
    1122                                 add_assoc_zval(return_value, (char*)sqlite3_column_name(*(internp->intern_stmt), i), data);*/ 
    11231116                        } 
    11241117                break; 
     
    11341127 
    11351128/* {{{ proto bool SQLite3_result::finalize() 
    1136         Closes the prepared statemen
     1129        Closes the result se
    11371130*/ 
    11381131PHP_METHOD(sqlite3_result, finalize) 
     
    11501143        } 
    11511144 
    1152         *internp->intern_stmt = (sqlite3_stmt *)NULL; 
     1145        *(internp->intern_stmt) = (sqlite3_stmt *)NULL; 
    11531146        RETURN_TRUE; 
    11541147} 
     
    11741167        PHP_ME(sqlite3,         exec,                           NULL, ZEND_ACC_PUBLIC) 
    11751168        PHP_ME(sqlite3,         version,                        NULL, ZEND_ACC_PUBLIC) 
    1176         PHP_ME(sqlite3,         last_insert_rowid,            NULL, ZEND_ACC_PUBLIC) 
    1177         PHP_ME(sqlite3,         load_extension,                       NULL, ZEND_ACC_PUBLIC) 
     1169        PHP_ME(sqlite3,         lastInsertRowID,              NULL, ZEND_ACC_PUBLIC) 
     1170        PHP_ME(sqlite3,         loadExtension,                        NULL, ZEND_ACC_PUBLIC) 
    11781171        PHP_ME(sqlite3,         changes,                        NULL, ZEND_ACC_PUBLIC) 
    1179         PHP_ME(sqlite3,         escape_string,                        NULL, ZEND_ACC_PUBLIC) 
     1172        PHP_ME(sqlite3,         escapeString,                 NULL, ZEND_ACC_PUBLIC) 
    11801173        PHP_ME(sqlite3,         prepare,                        NULL, ZEND_ACC_PUBLIC) 
    11811174        PHP_ME(sqlite3,         query,                          NULL, ZEND_ACC_PUBLIC) 
    1182         PHP_ME(sqlite3,         create_function,              NULL, ZEND_ACC_PUBLIC) 
    1183         PHP_ME(sqlite3,         create_aggregate,             NULL, ZEND_ACC_PUBLIC) 
     1175        PHP_ME(sqlite3,         createFunction,               NULL, ZEND_ACC_PUBLIC) 
     1176        PHP_ME(sqlite3,         createAggregate,              NULL, ZEND_ACC_PUBLIC) 
    11841177        /* Aliases */ 
    11851178        PHP_MALIAS(sqlite3,     __construct, open, NULL, ZEND_ACC_PUBLIC) 
     
    11901183/* {{{ php_sqlite3_stmt_class_methods */ 
    11911184static zend_function_entry php_sqlite3_stmt_class_methods[] = { 
    1192         PHP_ME(sqlite3_stmt, param_count,     NULL, ZEND_ACC_PUBLIC) 
     1185        PHP_ME(sqlite3_stmt, paramCount,      NULL, ZEND_ACC_PUBLIC) 
    11931186        PHP_ME(sqlite3_stmt, close,             NULL, ZEND_ACC_PUBLIC) 
    11941187        PHP_ME(sqlite3_stmt, execute,           NULL, ZEND_ACC_PUBLIC) 
     
    11981191        PHP_ME(sqlite3_stmt, bind_params,       NULL, ZEND_ACC_PUBLIC) 
    11991192#endif 
    1200         PHP_ME(sqlite3_stmt, bind_param,      arginfo_sqlite3_stmt_bindparam, ZEND_ACC_PUBLIC) 
    1201         PHP_ME(sqlite3_stmt, bind_value,      arginfo_sqlite3_stmt_bindvalue, ZEND_ACC_PUBLIC) 
     1193        PHP_ME(sqlite3_stmt, bindParam,       arginfo_sqlite3_stmt_bindparam, ZEND_ACC_PUBLIC) 
     1194        PHP_ME(sqlite3_stmt, bindValue,       arginfo_sqlite3_stmt_bindvalue, ZEND_ACC_PUBLIC) 
    12021195        {NULL, NULL, NULL} 
    12031196}; 
     
    12061199/* {{{ php_sqlite3_result_class_methods */ 
    12071200static zend_function_entry php_sqlite3_result_class_methods[] = { 
    1208         PHP_ME(sqlite3_result, num_columns,           NULL, ZEND_ACC_PUBLIC) 
    1209         PHP_ME(sqlite3_result, column_name,           NULL, ZEND_ACC_PUBLIC) 
     1201        PHP_ME(sqlite3_result, numColumns,            NULL, ZEND_ACC_PUBLIC) 
     1202        PHP_ME(sqlite3_result, columnName,            NULL, ZEND_ACC_PUBLIC) 
    12101203        PHP_ME(sqlite3_result, finalize,                NULL, ZEND_ACC_PUBLIC) 
    1211         PHP_ME(sqlite3_result, fetch_array,           NULL, ZEND_ACC_PUBLIC) 
     1204        PHP_ME(sqlite3_result, fetchArray,            NULL, ZEND_ACC_PUBLIC) 
    12121205        {NULL, NULL, NULL} 
    12131206}; 
     
    13731366 
    13741367        /* Allocate memory for it */ 
    1375         intern = emalloc( sizeof( php_sqlite3_result ) ); 
    1376         memset( &intern->zo, 0, sizeof( php_sqlite3_result ) ); 
     1368        intern = emalloc(sizeof(php_sqlite3_result)); 
     1369        memset(&intern->zo, 0, sizeof(php_sqlite3_result)); 
    13771370 
    13781371        intern->intern_stmt = emalloc(sizeof(sqlite3_stmt *)); 
     
    14111404 
    14121405#if defined(ZTS) 
    1413         /* We should refuse to load if this wasn't a threasafe library */ 
     1406        /* Refuse to load if this wasn't a threasafe library loaded */ 
    14141407        if (!sqlite3_threadsafe()) { 
    14151408                return FAILURE; 
     
    14711464        php_info_print_table_start(); 
    14721465        php_info_print_table_header(2, "SQLite3 support", "enabled"); 
    1473         php_info_print_table_row(2, "SQLite3 module version", PHP_SQLITE3_MODULE_VERSION ); 
     1466        php_info_print_table_row(2, "SQLite3 module version", PHP_SQLITE3_MODULE_VERSION); 
    14741467        php_info_print_table_row(2, "SQLite Library", sqlite3_libversion()); 
    14751468        php_info_print_table_end(); 
  • trunk/tests/sqlite3_03_insert.phpt

    r13 r16  
    1818echo "SELECTING results\n"; 
    1919$results = $db->query("SELECT * FROM test ORDER BY id ASC"); 
    20 while ($result = $results->fetch_array(SQLITE3_NUM)) 
     20while ($result = $results->fetchArray(SQLITE3_NUM)) 
    2121{ 
    2222        var_dump($result); 
  • trunk/tests/sqlite3_04_update.phpt

    r13 r16  
    1818echo "SELECTING results\n"; 
    1919$results = $db->query("SELECT * FROM test ORDER BY id ASC"); 
    20 while ($result = $results->fetch_array(SQLITE3_NUM)) 
     20while ($result = $results->fetchArray(SQLITE3_NUM)) 
    2121{ 
    2222        var_dump($result); 
     
    2929echo "Checking results\n"; 
    3030$results = $db->query("SELECT * FROM test ORDER BY id ASC"); 
    31 while ($result = $results->fetch_array(SQLITE3_NUM)) 
     31while ($result = $results->fetchArray(SQLITE3_NUM)) 
    3232{ 
    3333        var_dump($result); 
  • trunk/tests/sqlite3_05_delete.phpt

    r13 r16  
    1818echo "SELECTING results\n"; 
    1919$results = $db->query("SELECT * FROM test ORDER BY id ASC"); 
    20 while ($result = $results->fetch_array(SQLITE3_NUM)) 
     20while ($result = $results->fetchArray(SQLITE3_NUM)) 
    2121{ 
    2222        var_dump($result); 
     
    2929echo "Checking results\n"; 
    3030$results = $db->query("SELECT * FROM test ORDER BY id ASC"); 
    31 while ($result = $results->fetch_array(SQLITE3_NUM)) 
     31while ($result = $results->fetchArray(SQLITE3_NUM)) 
    3232{ 
    3333        var_dump($result); 
  • trunk/tests/sqlite3_06_prepared_stmt.phpt

    r14 r16  
    11--TEST-- 
    2 SQLite3::query DELETE tests 
     2SQLite3::prepare Bound Variable test 
    33--SKIPIF-- 
    44<?php require_once(dirname(__FILE__) . '/skipif.inc'); ?> 
     
    2020$foo = 'c'; 
    2121echo "BINDING Parameter\n"; 
    22 var_dump($stmt->bind_param(1, $foo, SQLITE_TEXT)); 
     22var_dump($stmt->bindParam(1, $foo, SQLITE_TEXT)); 
    2323$foo = 'a'; 
    2424$results = $stmt->execute(); 
    25 while ($result = $results->fetch_array(SQLITE3_NUM)) 
     25while ($result = $results->fetchArray(SQLITE3_NUM)) 
    2626{ 
    2727        var_dump($result);