]> granicus.if.org Git - php/commitdiff
MFH: [DOC] Add LOB & Collection class parameter reflection
authorChristopher Jones <sixd@php.net>
Wed, 16 Jul 2008 23:55:13 +0000 (23:55 +0000)
committerChristopher Jones <sixd@php.net>
Wed, 16 Jul 2008 23:55:13 +0000 (23:55 +0000)
ext/oci8/oci8.c
ext/oci8/tests/reflection1.phpt
ext/oci8/tests/reflection2.phpt [new file with mode: 0644]

index 935e62425eb0fb77fce9c39566ed63f0a4b25641..b00ef7476d01aef3699826b706d23c1a0269b052 100644 (file)
@@ -112,7 +112,7 @@ ZEND_GET_MODULE(oci8)
 #endif /* COMPILE_DL */
 /* }}} */
 
-/* {{{ arginfo */
+/* {{{ Function arginfo */
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_define_by_name, 0, 0, 3)
        ZEND_ARG_INFO(0, statement_resource)
@@ -231,7 +231,7 @@ ZEND_END_ARG_INFO()
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_ocisetbufferinglob, 0, 0, 2)
        ZEND_ARG_INFO(0, lob_descriptor)
-       ZEND_ARG_INFO(0, flag)
+       ZEND_ARG_INFO(0, mode)
 ZEND_END_ARG_INFO()
 
 static
@@ -475,7 +475,7 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_free_collection, 0, 0, 1)
 ZEND_END_ARG_INFO()
 
 static
-ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append, 0, 0, )
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append, 0, 0, 2)
        ZEND_ARG_INFO(0, collection)
        ZEND_ARG_INFO(0, value)
 ZEND_END_ARG_INFO()
@@ -512,7 +512,7 @@ ZEND_END_ARG_INFO()
 static
 ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim, 0, 0, 2)
        ZEND_ARG_INFO(0, collection)
-       ZEND_ARG_INFO(0, num)
+       ZEND_ARG_INFO(0, number)
 ZEND_END_ARG_INFO()
 
 static
@@ -523,6 +523,147 @@ ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_new_collection, 0, 0, 2)
 ZEND_END_ARG_INFO()
 /* }}} */
 
+/* {{{ LOB Method arginfo */
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_save_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, data)
+       ZEND_ARG_INFO(0, offset)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_import_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, filename)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_load_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_read_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_eof_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_tell_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_rewind_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_seek_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, offset)
+       ZEND_ARG_INFO(0, whence)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_size_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_write_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, string)
+       ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_append_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, lob_descriptor_from)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_truncate_method, 0, 0, 0)
+       ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_erase_method, 0, 0, 0)
+       ZEND_ARG_INFO(0, offset)
+       ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_flush_method, 0, 0, 0)
+       ZEND_ARG_INFO(0, flag)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_setbuffering_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, mode)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_getbuffering_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_export_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, filename)
+       ZEND_ARG_INFO(0, start)
+       ZEND_ARG_INFO(0, length)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_lob_write_temporary_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, data)
+       ZEND_ARG_INFO(0, type)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_lob_close_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_free_descriptor_method, 0)
+ZEND_END_ARG_INFO()
+/* }}} */
+
+/* {{{ Collection Method arginfo */
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_collection_free_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_append_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_get_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, index)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_assign_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, collection_from)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_element_assign_method, 0, 0, 2)
+       ZEND_ARG_INFO(0, index)
+       ZEND_ARG_INFO(0, value)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_collection_size_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO(arginfo_oci_collection_max_method, 0)
+ZEND_END_ARG_INFO()
+
+static
+ZEND_BEGIN_ARG_INFO_EX(arginfo_oci_collection_trim_method, 0, 0, 1)
+       ZEND_ARG_INFO(0, number)
+ZEND_END_ARG_INFO()
+/* }}} */
+
 /* {{{ extension function prototypes
 */
 PHP_FUNCTION(oci_bind_by_name);
@@ -729,28 +870,28 @@ static
 const
 #endif
 zend_function_entry php_oci_lob_class_functions[] = {
-       PHP_FALIAS(load,                oci_lob_load,                   NULL)
-       PHP_FALIAS(tell,                oci_lob_tell,                   NULL)
-       PHP_FALIAS(truncate,    oci_lob_truncate,               NULL)
-       PHP_FALIAS(erase,               oci_lob_erase,                  NULL)
-       PHP_FALIAS(flush,               oci_lob_flush,                  NULL)
-       PHP_FALIAS(setbuffering,ocisetbufferinglob,             NULL)
-       PHP_FALIAS(getbuffering,ocigetbufferinglob,             NULL)
-       PHP_FALIAS(rewind,              oci_lob_rewind,                 NULL)
-       PHP_FALIAS(read,                oci_lob_read,                   NULL)
-       PHP_FALIAS(eof,                 oci_lob_eof,                    NULL)
-       PHP_FALIAS(seek,                oci_lob_seek,                   NULL)
-       PHP_FALIAS(write,               oci_lob_write,                  NULL)
-       PHP_FALIAS(append,              oci_lob_append,                 NULL)
-       PHP_FALIAS(size,                oci_lob_size,                   NULL)
-       PHP_FALIAS(writetofile, oci_lob_export,                 NULL)
-       PHP_FALIAS(export,              oci_lob_export,                 NULL)
-       PHP_FALIAS(import,              oci_lob_import,                 NULL)
-       PHP_FALIAS(writetemporary,      oci_lob_write_temporary,        NULL)
-       PHP_FALIAS(close,                       oci_lob_close,                          NULL)
-       PHP_FALIAS(save,                oci_lob_save,                   NULL)
-       PHP_FALIAS(savefile,    oci_lob_import,                 NULL)
-       PHP_FALIAS(free,                oci_free_descriptor,    NULL)
+       PHP_FALIAS(load,                oci_lob_load,                   arginfo_oci_lob_load_method)
+       PHP_FALIAS(tell,                oci_lob_tell,                   arginfo_oci_lob_tell_method)
+       PHP_FALIAS(truncate,    oci_lob_truncate,               arginfo_oci_lob_truncate_method)
+       PHP_FALIAS(erase,               oci_lob_erase,                  arginfo_oci_lob_erase_method)
+       PHP_FALIAS(flush,               oci_lob_flush,                  arginfo_oci_lob_flush_method)
+       PHP_FALIAS(setbuffering,ocisetbufferinglob,             arginfo_oci_lob_setbuffering_method)
+       PHP_FALIAS(getbuffering,ocigetbufferinglob,             arginfo_oci_lob_getbuffering_method)
+       PHP_FALIAS(rewind,              oci_lob_rewind,                 arginfo_oci_lob_rewind_method)
+       PHP_FALIAS(read,                oci_lob_read,                   arginfo_oci_lob_read_method)
+       PHP_FALIAS(eof,                 oci_lob_eof,                    arginfo_oci_lob_eof_method)
+       PHP_FALIAS(seek,                oci_lob_seek,                   arginfo_oci_lob_seek_method)
+       PHP_FALIAS(write,               oci_lob_write,                  arginfo_oci_lob_write_method)
+       PHP_FALIAS(append,              oci_lob_append,                 arginfo_oci_lob_append_method)
+       PHP_FALIAS(size,                oci_lob_size,                   arginfo_oci_lob_size_method)
+       PHP_FALIAS(writetofile, oci_lob_export,                 arginfo_oci_lob_export_method)
+       PHP_FALIAS(export,              oci_lob_export,                 arginfo_oci_lob_export_method)
+       PHP_FALIAS(import,              oci_lob_import,                 arginfo_oci_lob_import_method)
+       PHP_FALIAS(writetemporary,      oci_lob_write_temporary,        arginfo_oci_lob_write_temporary_method)
+       PHP_FALIAS(close,                       oci_lob_close,                          arginfo_oci_lob_close_method)
+       PHP_FALIAS(save,                oci_lob_save,                   arginfo_oci_lob_save_method)
+       PHP_FALIAS(savefile,    oci_lob_import,                 arginfo_oci_lob_import_method)
+       PHP_FALIAS(free,                oci_free_descriptor,    arginfo_oci_free_descriptor_method)
        {NULL,NULL,NULL}
 };
 
@@ -760,14 +901,14 @@ static
 const
 #endif
 zend_function_entry php_oci_coll_class_functions[] = {
-       PHP_FALIAS(append,                oci_collection_append,                        NULL)
-       PHP_FALIAS(getelem,               oci_collection_element_get,           NULL)
-       PHP_FALIAS(assignelem,    oci_collection_element_assign,        NULL)
-       PHP_FALIAS(assign,                oci_collection_assign,                        NULL)
-       PHP_FALIAS(size,                  oci_collection_size,                          NULL)
-       PHP_FALIAS(max,                   oci_collection_max,                           NULL)
-       PHP_FALIAS(trim,                  oci_collection_trim,                          NULL)
-       PHP_FALIAS(free,                  oci_free_collection,                          NULL)
+       PHP_FALIAS(append,                oci_collection_append,                        arginfo_oci_collection_append_method)
+       PHP_FALIAS(getelem,               oci_collection_element_get,           arginfo_oci_collection_element_get_method)
+       PHP_FALIAS(assignelem,    oci_collection_element_assign,        arginfo_oci_collection_element_assign_method)
+       PHP_FALIAS(assign,                oci_collection_assign,                        arginfo_oci_collection_assign_method)
+       PHP_FALIAS(size,                  oci_collection_size,                          arginfo_oci_collection_size_method)
+       PHP_FALIAS(max,                   oci_collection_max,                           arginfo_oci_collection_max_method)
+       PHP_FALIAS(trim,                  oci_collection_trim,                          arginfo_oci_collection_trim_method)
+       PHP_FALIAS(free,                  oci_free_collection,                          arginfo_oci_collection_free_method)
        {NULL,NULL,NULL}
 };
 
index bc291fcd7d97592172f0d624b92526b3375f71fd..c62bdfc4b1f86668e0ed9134d13af8d246cbe8ed 100644 (file)
@@ -487,7 +487,7 @@ Function [ <internal:oci8> function ocisetbufferinglob ] {
 
   - Parameters [2] {
     Parameter #0 [ <required> $lob_descriptor ]
-    Parameter #1 [ <required> $flag ]
+    Parameter #1 [ <required> $mode ]
   }
 }
 
@@ -608,8 +608,8 @@ Function [ <internal:oci8> function oci_free_collection ] {
 Function [ <internal:oci8> function oci_collection_append ] {
 
   - Parameters [2] {
-    Parameter #0 [ <optional> $collection ]
-    Parameter #1 [ <optional> $value ]
+    Parameter #0 [ <required> $collection ]
+    Parameter #1 [ <required> $value ]
   }
 }
 
@@ -656,7 +656,7 @@ Function [ <internal:oci8> function oci_collection_trim ] {
 
   - Parameters [2] {
     Parameter #0 [ <required> $collection ]
-    Parameter #1 [ <required> $num ]
+    Parameter #1 [ <required> $number ]
   }
 }
 
@@ -1005,8 +1005,8 @@ Function [ <internal:oci8> function ocinewcollection ] {
 Function [ <internal:oci8> function ocicollappend ] {
 
   - Parameters [2] {
-    Parameter #0 [ <optional> $collection ]
-    Parameter #1 [ <optional> $value ]
+    Parameter #0 [ <required> $collection ]
+    Parameter #1 [ <required> $value ]
   }
 }
 
@@ -1045,7 +1045,7 @@ Function [ <internal:oci8> function ocicolltrim ] {
 
   - Parameters [2] {
     Parameter #0 [ <required> $collection ]
-    Parameter #1 [ <required> $num ]
+    Parameter #1 [ <required> $number ]
   }
 }
 
diff --git a/ext/oci8/tests/reflection2.phpt b/ext/oci8/tests/reflection2.phpt
new file mode 100644 (file)
index 0000000..8188222
--- /dev/null
@@ -0,0 +1,258 @@
+--TEST--
+Test OCI8 LOB & Collection Class Reflection
+--SKIPIF--
+<?php if (!extension_loaded('oci8')) die ("skip no oci8 extension"); ?>
+--FILE--
+<?php
+
+reflection::export(new reflectionclass('OCI-Lob'));
+reflection::export(new reflectionclass('OCI-Collection'));
+
+?>
+===DONE===
+<?php exit(0); ?>
+--EXPECTF--
+Class [ <internal:oci8> class OCI-Lob ] {
+
+  - Constants [0] {
+  }
+
+  - Static properties [0] {
+  }
+
+  - Static methods [0] {
+  }
+
+  - Properties [0] {
+  }
+
+  - Methods [22] {
+    Method [ <internal:oci8> public method load ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method tell ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method truncate ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <optional> $length ]
+      }
+    }
+
+    Method [ <internal:oci8> public method erase ] {
+
+      - Parameters [2] {
+        Parameter #0 [ <optional> $offset ]
+        Parameter #1 [ <optional> $length ]
+      }
+    }
+
+    Method [ <internal:oci8> public method flush ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <optional> $flag ]
+      }
+    }
+
+    Method [ <internal:oci8> public method setbuffering ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $mode ]
+      }
+    }
+
+    Method [ <internal:oci8> public method getbuffering ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method rewind ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method read ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $length ]
+      }
+    }
+
+    Method [ <internal:oci8> public method eof ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method seek ] {
+
+      - Parameters [2] {
+        Parameter #0 [ <required> $offset ]
+        Parameter #1 [ <optional> $whence ]
+      }
+    }
+
+    Method [ <internal:oci8> public method write ] {
+
+      - Parameters [2] {
+        Parameter #0 [ <required> $string ]
+        Parameter #1 [ <optional> $length ]
+      }
+    }
+
+    Method [ <internal:oci8> public method append ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $lob_descriptor_from ]
+      }
+    }
+
+    Method [ <internal:oci8> public method size ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method writetofile ] {
+
+      - Parameters [3] {
+        Parameter #0 [ <required> $filename ]
+        Parameter #1 [ <optional> $start ]
+        Parameter #2 [ <optional> $length ]
+      }
+    }
+
+    Method [ <internal:oci8> public method export ] {
+
+      - Parameters [3] {
+        Parameter #0 [ <required> $filename ]
+        Parameter #1 [ <optional> $start ]
+        Parameter #2 [ <optional> $length ]
+      }
+    }
+
+    Method [ <internal:oci8> public method import ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $filename ]
+      }
+    }
+
+    Method [ <internal:oci8> public method writetemporary ] {
+
+      - Parameters [2] {
+        Parameter #0 [ <required> $data ]
+        Parameter #1 [ <optional> $type ]
+      }
+    }
+
+    Method [ <internal:oci8> public method close ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method save ] {
+
+      - Parameters [2] {
+        Parameter #0 [ <required> $data ]
+        Parameter #1 [ <optional> $offset ]
+      }
+    }
+
+    Method [ <internal:oci8> public method savefile ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $filename ]
+      }
+    }
+
+    Method [ <internal:oci8> public method free ] {
+
+      - Parameters [0] {
+      }
+    }
+  }
+}
+
+Class [ <internal:oci8> class OCI-Collection ] {
+
+  - Constants [0] {
+  }
+
+  - Static properties [0] {
+  }
+
+  - Static methods [0] {
+  }
+
+  - Properties [0] {
+  }
+
+  - Methods [8] {
+    Method [ <internal:oci8> public method append ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $value ]
+      }
+    }
+
+    Method [ <internal:oci8> public method getelem ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $index ]
+      }
+    }
+
+    Method [ <internal:oci8> public method assignelem ] {
+
+      - Parameters [2] {
+        Parameter #0 [ <required> $index ]
+        Parameter #1 [ <required> $value ]
+      }
+    }
+
+    Method [ <internal:oci8> public method assign ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $collection_from ]
+      }
+    }
+
+    Method [ <internal:oci8> public method size ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method max ] {
+
+      - Parameters [0] {
+      }
+    }
+
+    Method [ <internal:oci8> public method trim ] {
+
+      - Parameters [1] {
+        Parameter #0 [ <required> $number ]
+      }
+    }
+
+    Method [ <internal:oci8> public method free ] {
+
+      - Parameters [0] {
+      }
+    }
+  }
+}
+
+===DONE===