Saves a large object */
PHP_FUNCTION(oci_lob_save)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
char *data;
size_t data_len;
zend_long offset = 0;
ub4 bytes_written;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &offset) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &offset) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Loads file into a LOB */
PHP_FUNCTION(oci_lob_import)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
char *filename;
size_t filename_len;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p", &filename, &filename_len) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Loads a large object */
PHP_FUNCTION(oci_lob_load)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
char *buffer = NULL;
ub4 buffer_len;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
RETURN_FALSE;
}
if (buffer_len > 0) {
- zend_string *ret = zend_string_init(buffer, buffer_len, 0);
+ zend_string *ret = zend_string_init(buffer, buffer_len, 0);
if (buffer)
efree(buffer);
RETURN_STR(ret);
Reads particular part of a large object */
PHP_FUNCTION(oci_lob_read)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
zend_long length;
char *buffer;
ub4 buffer_len;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &length) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &z_descriptor, oci_lob_class_entry_ptr, &length) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Checks if EOF is reached */
PHP_FUNCTION(oci_lob_eof)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
ub4 lob_length;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Tells LOB pointer position */
PHP_FUNCTION(oci_lob_tell)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Rewind pointer of a LOB */
PHP_FUNCTION(oci_lob_rewind)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Moves the pointer of a LOB */
PHP_FUNCTION(oci_lob_seek)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
zend_long offset, whence = PHP_OCI_SEEK_SET;
ub4 lob_length;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l|l", &offset, &whence) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol|l", &z_descriptor, oci_lob_class_entry_ptr, &offset, &whence) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Returns size of a large object */
PHP_FUNCTION(oci_lob_size)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
ub4 lob_length;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Writes data to current position of a LOB */
PHP_FUNCTION(oci_lob_write)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
size_t data_len;
zend_long write_len = 0;
ub4 bytes_written;
char *data;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &write_len) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) {
+ RETURN_THROWS();
+ }
- if (ZEND_NUM_ARGS() == 2) {
- data_len = MIN((zend_long) data_len, write_len);
- }
+ if (getThis() && ZEND_NUM_ARGS() == 2) {
+ data_len = MIN((zend_long) data_len, write_len);
}
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &write_len) == FAILURE) {
- RETURN_THROWS();
- }
- if (ZEND_NUM_ARGS() == 3) {
- data_len = MIN((zend_long) data_len, write_len);
- }
+ if (!getThis() && ZEND_NUM_ARGS() == 3) {
+ data_len = MIN((zend_long) data_len, write_len);
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Appends data from a LOB to another LOB */
PHP_FUNCTION(oci_lob_append)
{
- zval *tmp_dest, *tmp_from, *z_descriptor_dest = getThis(), *z_descriptor_from;
+ zval *tmp_dest, *tmp_from, *z_descriptor_dest, *z_descriptor_from;
php_oci_descriptor *descriptor_dest, *descriptor_from;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &z_descriptor_dest, oci_lob_class_entry_ptr, &z_descriptor_from, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_descriptor_dest), "descriptor", sizeof("descriptor")-1)) == NULL) {
Truncates a LOB */
PHP_FUNCTION(oci_lob_truncate)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
zend_long trim_length = 0;
ub4 ub_trim_length;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &trim_length) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &trim_length) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Erases a specified portion of the internal LOB, starting at a specified offset */
PHP_FUNCTION(oci_lob_erase)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
ub4 bytes_erased;
zend_long offset = -1, length = -1;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|ll", &offset, &length) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|ll", &z_descriptor, oci_lob_class_entry_ptr, &offset, &length) == FAILURE) {
+ RETURN_THROWS();
+ }
- if (ZEND_NUM_ARGS() > 0 && offset < 0) {
- php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
- RETURN_FALSE;
- }
+ if (getThis() && ZEND_NUM_ARGS() > 0 && offset < 0) {
+ php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
+ RETURN_FALSE;
+ }
- if (ZEND_NUM_ARGS() > 1 && length < 0) {
- php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
- RETURN_FALSE;
- }
+ if (getThis() && ZEND_NUM_ARGS() > 1 && length < 0) {
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
+ RETURN_FALSE;
}
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|ll", &z_descriptor, oci_lob_class_entry_ptr, &offset, &length) == FAILURE) {
- RETURN_THROWS();
- }
- if (ZEND_NUM_ARGS() > 1 && offset < 0) {
- php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
- RETURN_FALSE;
- }
+ if (!getThis() && ZEND_NUM_ARGS() > 1 && offset < 0) {
+ php_error_docref(NULL, E_WARNING, "Offset must be greater than or equal to 0");
+ RETURN_FALSE;
+ }
- if (ZEND_NUM_ARGS() > 2 && length < 0) {
- php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
- RETURN_FALSE;
- }
+ if (!getThis() && ZEND_NUM_ARGS() > 2 && length < 0) {
+ php_error_docref(NULL, E_WARNING, "Length must be greater than or equal to 0");
+ RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Flushes the LOB buffer */
PHP_FUNCTION(oci_lob_flush)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
zend_long flush_flag = 0;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "|l", &flush_flag) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O|l", &z_descriptor, oci_lob_class_entry_ptr, &flush_flag) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Enables/disables buffering for a LOB */
PHP_FUNCTION(ocisetbufferinglob)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
zend_bool flag;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "b", &flag) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ob", &z_descriptor, oci_lob_class_entry_ptr, &flag) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Returns current state of buffering for a LOB */
PHP_FUNCTION(ocigetbufferinglob)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Writes a large object into a file */
PHP_FUNCTION(oci_lob_export)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
char *filename;
char *buffer;
php_stream *stream;
ub4 lob_length;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "p|ll", &filename, &filename_len, &start, &length) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
+ RETURN_THROWS();
+ }
- if (ZEND_NUM_ARGS() > 1 && start < 0) {
- php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
- RETURN_FALSE;
- }
- if (ZEND_NUM_ARGS() > 2 && length < 0) {
- php_error_docref(NULL, E_WARNING, "length parameter must be greater than or equal to 0");
- RETURN_FALSE;
- }
+ if (getThis() && ZEND_NUM_ARGS() > 1 && start < 0) {
+ php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
+ RETURN_FALSE;
}
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Op|ll", &z_descriptor, oci_lob_class_entry_ptr, &filename, &filename_len, &start, &length) == FAILURE) {
- RETURN_THROWS();
- }
- if (ZEND_NUM_ARGS() > 2 && start < 0) {
- php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
- RETURN_FALSE;
- }
- if (ZEND_NUM_ARGS() > 3 && length < 0) {
- php_error_docref(NULL, E_WARNING, "length parameter must be greater than or equal to 0");
- RETURN_FALSE;
- }
+ if (getThis() && ZEND_NUM_ARGS() > 2 && length < 0) {
+ php_error_docref(NULL, E_WARNING, "length parameter must be greater than or equal to 0");
+ RETURN_FALSE;
+ }
+
+ if (!getThis() && ZEND_NUM_ARGS() > 2 && start < 0) {
+ php_error_docref(NULL, E_WARNING, "Start parameter must be greater than or equal to 0");
+ RETURN_FALSE;
+ }
+
+ if (!getThis() && ZEND_NUM_ARGS() > 3 && length < 0) {
+ php_error_docref(NULL, E_WARNING, "length parameter must be greater than or equal to 0");
+ RETURN_FALSE;
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Writes temporary blob */
PHP_FUNCTION(oci_lob_write_temporary)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
char *data;
size_t data_len;
zend_long type = OCI_TEMP_CLOB;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s|l", &data, &data_len, &type) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os|l", &z_descriptor, oci_lob_class_entry_ptr, &data, &data_len, &type) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
Closes lob descriptor */
PHP_FUNCTION(oci_lob_close)
{
- zval *tmp, *z_descriptor = getThis();
+ zval *tmp, *z_descriptor;
php_oci_descriptor *descriptor;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_descriptor, oci_lob_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_descriptor), "descriptor", sizeof("descriptor")-1)) == NULL) {
zval *z_connection;
php_oci_connection *connection;
- if (OCI_G(old_oci_close_semantics)) {
- /* do nothing to keep BC */
- return;
- }
-
ZEND_PARSE_PARAMETERS_START(1, 1)
Z_PARAM_RESOURCE(z_connection)
ZEND_PARSE_PARAMETERS_END();
+ if (OCI_G(old_oci_close_semantics)) {
+ /* do nothing to keep BC */
+ RETURN_NULL();
+ }
+
PHP_OCI_ZVAL_TO_CONNECTION(z_connection, connection);
if (GC_REFCOUNT(connection->id) == 2) { /* CHANGED VERSION::PHP7
Changed the refCount to 2 since
Deletes collection object*/
PHP_FUNCTION(oci_free_collection)
{
- zval *tmp, *z_collection = getThis();
+ zval *tmp, *z_collection;
php_oci_collection *collection;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) {
Append an object to the collection */
PHP_FUNCTION(oci_collection_append)
{
- zval *tmp, *z_collection = getThis();
+ zval *tmp, *z_collection;
php_oci_collection *collection;
char *value;
size_t value_len;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "s", &value, &value_len) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Os", &z_collection, oci_coll_class_entry_ptr, &value, &value_len) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) {
Retrieve the value at collection index ndx */
PHP_FUNCTION(oci_collection_element_get)
{
- zval *tmp, *z_collection = getThis();
+ zval *tmp, *z_collection;
php_oci_collection *collection;
zend_long element_index;
- zval value;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &element_index) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &z_collection, oci_coll_class_entry_ptr, &element_index) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) {
Assign a collection from another existing collection */
PHP_FUNCTION(oci_collection_assign)
{
- zval *tmp_dest, *tmp_from, *z_collection_dest = getThis(), *z_collection_from;
+ zval *tmp_dest, *tmp_from, *z_collection_dest, *z_collection_from;
php_oci_collection *collection_dest, *collection_from;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "OO", &z_collection_dest, oci_coll_class_entry_ptr, &z_collection_from, oci_coll_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp_dest = zend_hash_str_find(Z_OBJPROP_P(z_collection_dest), "collection", sizeof("collection")-1)) == NULL) {
Assign element val to collection at index ndx */
PHP_FUNCTION(oci_collection_element_assign)
{
- zval *tmp, *z_collection = getThis();
+ zval *tmp, *z_collection;
php_oci_collection *collection;
size_t value_len;
zend_long element_index;
char *value;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "ls", &element_index, &value, &value_len) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ols", &z_collection, oci_coll_class_entry_ptr, &element_index, &value, &value_len) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) {
Return the size of a collection */
PHP_FUNCTION(oci_collection_size)
{
- zval *tmp, *z_collection = getThis();
+ zval *tmp, *z_collection;
php_oci_collection *collection;
sb4 size = 0;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) {
Return the max value of a collection. For a varray this is the maximum length of the array */
PHP_FUNCTION(oci_collection_max)
{
- zval *tmp, *z_collection = getThis();
+ zval *tmp, *z_collection;
php_oci_collection *collection;
zend_long max;
- if (!getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "O", &z_collection, oci_coll_class_entry_ptr) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) {
Trim num elements from the end of a collection */
PHP_FUNCTION(oci_collection_trim)
{
- zval *tmp, *z_collection = getThis();
+ zval *tmp, *z_collection;
php_oci_collection *collection;
zend_long trim_size;
- if (getThis()) {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "l", &trim_size) == FAILURE) {
- RETURN_THROWS();
- }
- }
- else {
- if (zend_parse_parameters(ZEND_NUM_ARGS(), "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) {
- RETURN_THROWS();
- }
+ if (zend_parse_method_parameters(ZEND_NUM_ARGS(), getThis(), "Ol", &z_collection, oci_coll_class_entry_ptr, &trim_size) == FAILURE) {
+ RETURN_THROWS();
}
if ((tmp = zend_hash_str_find(Z_OBJPROP_P(z_collection), "collection", sizeof("collection")-1)) == NULL) {