tony2001                Wed Jan 21 11:18:59 2004 EDT

  Modified files:              
    /php-src/ext/oci8   oci8.c 
  Log:
  *change constant name, coz it doesn't comply with others
  *add constant's alias, coz others do have aliases
  *change protos (oops =))
  *add notices to collection functions
  *change coll_element_get & coll_assign to inform user, that this type of element is 
not supported yet.
  
  
http://cvs.php.net/diff.php/php-src/ext/oci8/oci8.c?r1=1.235&r2=1.236&ty=u
Index: php-src/ext/oci8/oci8.c
diff -u php-src/ext/oci8/oci8.c:1.235 php-src/ext/oci8/oci8.c:1.236
--- php-src/ext/oci8/oci8.c:1.235       Wed Jan 21 07:30:05 2004
+++ php-src/ext/oci8/oci8.c     Wed Jan 21 11:18:58 2004
@@ -22,7 +22,7 @@
    +----------------------------------------------------------------------+
  */
 
-/* $Id: oci8.c,v 1.235 2004/01/21 12:30:05 tony2001 Exp $ */
+/* $Id: oci8.c,v 1.236 2004/01/21 16:18:58 tony2001 Exp $ */
 
 /* TODO list:
  *
@@ -683,7 +683,8 @@
        REGISTER_LONG_CONSTANT("SQLT_RDD",SQLT_RDD, CONST_CS | CONST_PERSISTENT);
 
 #ifdef PHP_OCI8_HAVE_COLLECTIONS
-       REGISTER_LONG_CONSTANT("OCI_B_SQLT_NTY",SQLT_NTY, CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("OCI_B_NTY",SQLT_NTY, CONST_CS | CONST_PERSISTENT);
+       REGISTER_LONG_CONSTANT("SQLT_NTY",SQLT_NTY, CONST_CS | CONST_PERSISTENT);      
 
        REGISTER_STRING_CONSTANT("OCI_SYSDATE","SYSDATE",CONST_PERSISTENT);
 #endif
 
@@ -784,7 +785,7 @@
 
        php_info_print_table_start();
        php_info_print_table_row(2, "OCI8 Support", "enabled");
-       php_info_print_table_row(2, "Revision", "$Revision: 1.235 $");
+       php_info_print_table_row(2, "Revision", "$Revision: 1.236 $");
 
        sprintf(buf, "%ld", num_persistent);
        php_info_print_table_row(2, "Active Persistent Links", buf);
@@ -5734,7 +5735,7 @@
 }
 /* }}} */
 
-/* {{{ proto object oci_fetch_row( resource stmt )
+/* {{{ proto array oci_fetch_row( resource stmt )
    Fetch a result row as an enumerated array */
 PHP_FUNCTION(oci_fetch_row)
 {
@@ -5742,7 +5743,7 @@
 }
 /* }}} */
 
-/* {{{ proto object oci_fetch_assoc( resource stmt )
+/* {{{ proto array oci_fetch_assoc( resource stmt )
    Fetch a result row as an associative array */
 PHP_FUNCTION(oci_fetch_assoc)
 {
@@ -5750,7 +5751,7 @@
 }
 /* }}} */
 
-/* {{{ proto object oci_fetch_array( resource stmt [, int mode ])
+/* {{{ proto array oci_fetch_array( resource stmt [, int mode ])
    Fetch a result row as an array */
 PHP_FUNCTION(oci_fetch_array)
 {
@@ -6438,9 +6439,14 @@
 
                                RETURN_TRUE;
                                break;
+                       default:
+                               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or 
unsupported type of element");
+                               RETURN_FALSE;
+                               break;
                }
        }
-
+       
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "oci_collection_append() should not 
be called like this. Use $collection->append($element) to append an element to the 
collection");
        RETURN_FALSE;
 }
 /* }}} */
@@ -6552,9 +6558,14 @@
                                }
                                RETURN_DOUBLE(dnum);
                                break;
+                       default:
+                               php_error_docref(NULL TSRMLS_CC, E_NOTICE, "Unknown or 
unsupported type of element");
+                               RETURN_FALSE;
+                               break;
                }
        }
 
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "oci_collection_element_get() 
should not be called like this. Use $collection->getelem($index) to get an element of 
the collection with the given index");
        RETURN_FALSE;
 }
 /* }}} */
@@ -6599,6 +6610,7 @@
                RETURN_TRUE;
        }
 
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "oci_collection_assign() should not 
be called like this. Use $collection->assign($collection_value) to assign value to the 
collection");
        RETURN_FALSE;
 }
 /* }}} */
@@ -6782,6 +6794,8 @@
                                break;
                }
        }
+
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "oci_collection_element_assign() 
should not be called like this. Use $collection->assignelem($index, $value) to assign 
value to an element of the collection");
        RETURN_FALSE;
 }
 /* }}} */
@@ -6818,6 +6832,8 @@
 
                RETURN_LONG(sz);
        }
+
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "oci_collection_size() should not 
be called like this. Use $collection->size() to get size of the collection");
        RETURN_FALSE;
 }
 /* }}} */
@@ -6839,6 +6855,8 @@
 
                RETURN_LONG(sz);
        }
+
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "oci_collection_max() should not be 
called like this. Use $collection->max() to get maximum number of elements in the 
collection");
        RETURN_FALSE;
 }
 /* }}} */
@@ -6875,6 +6893,8 @@
                }
                RETURN_TRUE;
        }
+
+       php_error_docref(NULL TSRMLS_CC, E_NOTICE, "oci_collection_trim() should not 
be called like this. Use $collection->trim($length) to trim collection to the given 
length");
        RETURN_FALSE;
 }
 /* }}} */

-- 
PHP CVS Mailing List (http://www.php.net/)
To unsubscribe, visit: http://www.php.net/unsub.php

Reply via email to