@@ -158,25 +158,32 @@ PHP_FUNCTION(git_transport_local)
158
158
/* }}} */
159
159
160
160
161
- /* {{{ proto resource git_transport_smart(owner, payload)
162
- */
161
+ /* {{{ proto resource git_transport_smart(resource $ owner, $ payload)
162
+ */
163
163
PHP_FUNCTION (git_transport_smart )
164
164
{
165
- zval * owner ;
166
- php_git2_t * _owner ;
167
- zval * payload ;
168
- php_git2_t * _payload ;
169
-
170
- /* TODO(chobie): implement this */
171
- php_error_docref (NULL TSRMLS_CC , E_WARNING , "git_transport_smart not implemented yet" );
172
- return ;
165
+ php_git2_t * result = NULL , * _owner = NULL ;
166
+ git_transport * out = NULL ;
167
+ zval * owner = NULL , * payload = NULL ;
168
+ int error = 0 ;
173
169
174
170
if (zend_parse_parameters (ZEND_NUM_ARGS () TSRMLS_CC ,
175
- "rr " , & owner , & payload ) == FAILURE ) {
171
+ "r</* (git_smart_subtransport_definition *) */ void> " , & owner , & payload ) == FAILURE ) {
176
172
return ;
177
173
}
174
+
178
175
ZEND_FETCH_RESOURCE (_owner , php_git2_t * , & owner , -1 , PHP_GIT2_RESOURCE_NAME , git2_resource_handle );
176
+ error = git_transport_smart (& out , PHP_GIT2_V (_owner , remote ), payload );
177
+ if (php_git2_check_error (error , "git_transport_smart" TSRMLS_CC )) {
178
+ RETURN_FALSE ;
179
+ }
180
+ if (php_git2_make_resource (& result , PHP_GIT2_TYPE_TRANSPORT , out , 1 TSRMLS_CC )) {
181
+ RETURN_FALSE ;
182
+ }
183
+ ZVAL_RESOURCE (return_value , GIT2_RVAL_P (result ));
179
184
}
185
+ /* }}} */
186
+
180
187
181
188
/* {{{ proto resource git_smart_subtransport_http(resource $owner)
182
189
*/
0 commit comments