@@ -263,23 +263,25 @@ PHP_FUNCTION(git_reference_target_peel)
263
263
RETURN_STRING (out , 1 );
264
264
}
265
265
266
- /* {{{ proto resource git_reference_symbolic_target(ref)
267
- */
266
+ /* {{{ proto string git_reference_symbolic_target(resource $ ref)
267
+ */
268
268
PHP_FUNCTION (git_reference_symbolic_target )
269
269
{
270
- zval * ref ;
271
- php_git2_t * _ref ;
272
-
273
- /* TODO(chobie): implement this */
274
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "git_reference_symbolic_target not implemented yet" );
275
- return ;
270
+ const char * result = NULL ;
271
+ zval * ref = NULL ;
272
+ php_git2_t * _ref = NULL ;
276
273
277
274
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC ,
278
275
"r" , & ref ) == FAILURE ) {
279
276
return ;
280
277
}
278
+
281
279
ZEND_FETCH_RESOURCE (_ref , php_git2_t * , & ref , -1 , PHP_GIT2_RESOURCE_NAME , git2_resource_handle );
280
+ result = git_reference_symbolic_target (PHP_GIT2_V (_ref , reference ));
281
+ RETURN_STRING (result , 1 );
282
282
}
283
+ /* }}} */
284
+
283
285
284
286
/* {{{ proto resource git_reference_type(ref)
285
287
*/
@@ -731,29 +733,33 @@ PHP_FUNCTION(git_reference_iterator_free)
731
733
}
732
734
/* }}} */
733
735
734
-
735
- /* {{{ proto long git_reference_foreach_glob(repo, glob, callback, payload)
736
- */
736
+ /* {{{ proto long git_reference_foreach_glob(resource $repo, string $glob, $callback, $payload)
737
+ */
737
738
PHP_FUNCTION (git_reference_foreach_glob )
738
739
{
739
- zval * repo ;
740
- php_git2_t * _repo ;
741
- char * glob = {0 };
742
- int glob_len ;
743
- zval * callback ;
744
- php_git2_t * _callback ;
745
- zval * payload ;
746
-
747
- /* TODO(chobie): implement this */
748
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "git_reference_foreach_glob not implemented yet" );
749
- return ;
740
+ int result = 0 , glob_len = 0 , error = 0 ;
741
+ zval * repo = NULL , * callback = NULL ;
742
+ php_git2_t * _repo = NULL ;
743
+ char * glob = NULL ;
744
+ zend_fcall_info fci = empty_fcall_info ;
745
+ zend_fcall_info_cache fcc = empty_fcall_info_cache ;
746
+ php_git2_cb_t * cb ;
747
+ zval * payload = NULL ;
750
748
751
749
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC ,
752
- "rsrz " , & repo , & glob , & glob_len , & callback , & payload ) == FAILURE ) {
750
+ "rsfz " , & repo , & glob , & glob_len , & fci , & fcc , & payload ) == FAILURE ) {
753
751
return ;
754
752
}
753
+
755
754
ZEND_FETCH_RESOURCE (_repo , php_git2_t * , & repo , -1 , PHP_GIT2_RESOURCE_NAME , git2_resource_handle );
755
+ if (php_git2_cb_init (& cb , & fci , & fcc , payload TSRMLS_CC )) {
756
+ RETURN_FALSE ;
757
+ }
758
+ result = git_reference_foreach_glob (PHP_GIT2_V (_repo , repository ), glob , php_git2_reference_foreach_name_cb , cb );
759
+ php_git2_cb_free (cb );
760
+ RETURN_LONG (result );
756
761
}
762
+ /* }}} */
757
763
758
764
/* {{{ proto long git_reference_has_log(ref)
759
765
*/
0 commit comments