*
* \param $array the array to use.
*/
- private function __construct($array)
+ private function __construct($array);
/*! \copydoc spl_sequence::rewind
*/
- function rewind()
+ function rewind();
/*! \copydoc spl_forward::current
*/
- function current()
+ function current();
/*! \copydoc spl_assoc::key
*/
- function key()
+ function key();
/*! \copydoc spl_forward::next
*/
- function next()
+ function next();
/*! \copydoc spl_forward::has_more
*/
- function has_more()
+ function has_more();
}
+/*! \brief Directory iterator
+ */
+class spl_array_it implements spl_sequence {
+
+ /*! Construct a directory iterator from a path-string.
+ *
+ * \param $path directory to iterate.
+ */
+ private function __construct($path);
+
+ /*! \copydoc spl_sequence::rewind
+ */
+ function rewind();
+
+ /*! \copydoc spl_forward::current
+ */
+ function current();
+
+ /*! \copydoc spl_forward::next
+ */
+ function next();
+
+ /*! \copydoc spl_forward::has_more
+ */
+ function has_more();
+
+ /*! \return The opened path.
+ */
+ function get_path();
+}
?>
\ No newline at end of file
SPL_CLASS_FUNCTION(dir, has_more);
SPL_CLASS_FUNCTION(dir, get_path);
+static
+ZEND_BEGIN_ARG_INFO(arginfo_dir___construct, 0)
+ ZEND_ARG_INFO(0, path)
+ZEND_END_ARG_INFO();
+
static zend_function_entry spl_dir_class_functions[] = {
- SPL_CLASS_FE(dir, __construct, NULL)
- SPL_CLASS_FE(dir, rewind, NULL)
- SPL_CLASS_FE(dir, current, NULL)
- SPL_CLASS_FE(dir, next, NULL)
- SPL_CLASS_FE(dir, has_more, NULL)
- SPL_CLASS_FE(dir, get_path, NULL)
+ SPL_CLASS_FE(dir, __construct, arginfo_dir___construct, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(dir, rewind, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(dir, current, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(dir, next, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(dir, has_more, NULL, ZEND_ACC_PUBLIC)
+ SPL_CLASS_FE(dir, get_path, NULL, ZEND_ACC_PUBLIC)
{NULL, NULL, NULL}
};
int spl_add_classes(zend_class_entry ** ppce, zval *list TSRMLS_DC);
#define SPL_CLASS_FE(class_name, function_name, arg_info, flags) \
- { #function_name, spl_ ## class_name ## _ ## function_name, arg_info, sizeof(arg_info)/sizeof(struct _zend_arg_info)-1, flags },
+ PHP_ME( spl_ ## class_name, function_name, arg_info, flags)
#define SPL_CLASS_FUNCTION(class_name, function_name) \
- PHP_NAMED_FUNCTION(spl_ ## class_name ## _ ## function_name)
+ PHP_METHOD(spl_ ## class_name, function_name)
#endif /* PHP_FUNCTIONS_H */