Skip to content

Commit c97b1dc

Browse files
committedJan 11, 2014
add config
1 parent a6721ce commit c97b1dc

8 files changed

+1242
-4
lines changed
 

‎README.md

+65-1
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,71 @@
11
# PHP-Git2 - libgit2 bindings in PHP
22

33
php-git2 is a PHP bindings to the libgit2 linkable C Git library.
4-
this extension are re-writing php-git as that code too dirty.
4+
5+
## Status
6+
7+
0.3.0 Alpha (switching to functions)
8+
9+
## For Contributors
10+
11+
##### Issue first.
12+
13+
please make a issue first. don't work before creating it.
14+
15+
##### Coding Styles
16+
17+
follow pecl coding standards (except 8 at this moment).
18+
19+
* http://git.php.net/?p=php-src.git;a=blob_plain;f=CODING_STANDARDS;hb=HEAD
20+
21+
##### Signature conversions
22+
23+
````
24+
GIT_EXTERN(int) git_repository_init(
25+
git_repository **out,
26+
const char *path,
27+
unsigned is_bare);
28+
29+
30+
// error code will handle extension.
31+
// resource creation or getting functions will return their resource or bool.
32+
resource|bool function git_repository_init(string $path, long $is_bare);
33+
34+
some small structure (e.g: git_config_entry) should consider return as an array. it's usefull.
35+
````
36+
37+
see http://libgit2.github.com/libgit2/#HEAD
38+
39+
##### file name rules.
40+
41+
basically, we rely libgit2 grouping at this time. (`branch` group functions should be in branch.c)
42+
some group (e.g config) will conflicts php headers. we choose `g_` prefix for now.
43+
44+
check grouping here http://libgit2.github.com/libgit2/#HEAD
45+
46+
##### generating files
47+
48+
if you wanna try to work new file. please use gen.php and generate stubs. as declarations are bored task.
49+
(sometimes, this generator might output wrong headers. then just comment out or fix generator)
50+
51+
````
52+
php gen.php libgit2/include/git2/branch.h (0|1) [filter] > target.c or target.h
53+
````
54+
55+
you can ouptut function entry with this. past it to `php_git2.c`
56+
57+
````
58+
php fe.php target.c
59+
````
60+
61+
##### testing
62+
63+
group/function.phpt
64+
65+
##### policy
66+
67+
* don't create OOP interface for ease of maintenance.
68+
* follow latest libgit2 api. don't consider BC at this time.
569

670
## LICENSE
771

‎blob.c

+1-1
Original file line numberDiff line numberDiff line change
@@ -180,12 +180,12 @@ PHP_FUNCTION(git_blob_lookup)
180180

181181
ZEND_FETCH_RESOURCE(git2, php_git2_t*, &repository, -1, PHP_GIT2_RESOURCE_NAME, git2_resource_handle);
182182

183-
PHP_GIT2_MAKE_RESOURCE(result);
184183
error = git_blob_lookup(&blob, PHP_GIT2_V(git2, repository), &id);
185184
if (php_git2_check_error(error, "git_blob_lookup" TSRMLS_CC)) {
186185
RETURN_FALSE
187186
}
188187

188+
PHP_GIT2_MAKE_RESOURCE(result);
189189
PHP_GIT2_V(result, blob) = blob;
190190
result->type = PHP_GIT2_TYPE_BLOB;
191191
result->resource_id = PHP_GIT2_LIST_INSERT(result, git2_resource_handle);

‎config.m4

+1-1
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ PHP_ARG_ENABLE(git2-debug, for git2 debug support,
77
if test $PHP_GIT2 != "no"; then
88
PHP_SUBST(GIT2_SHARED_LIBADD)
99

10-
PHP_NEW_EXTENSION(git2, php_git2.c repository.c commit.c tree.c clone.c blob.c helper.c revwalk.c treebuilder.c reference.c, $ext_shared)
10+
PHP_NEW_EXTENSION(git2, php_git2.c repository.c commit.c tree.c clone.c blob.c helper.c revwalk.c treebuilder.c reference.c g_config.c, $ext_shared)
1111
PHP_ADD_INCLUDE([$ext_srcdir/libgit2/include])
1212

1313
# for now

‎g_config.c

+764
Large diffs are not rendered by default.

‎g_config.h

+366
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,366 @@
1+
/*
2+
* PHP Libgit2 Extension
3+
*
4+
* https://github.com/libgit2/php-git
5+
*
6+
* Copyright 2014 Shuhei Tanuma. All rights reserved.
7+
*
8+
* Permission is hereby granted, free of charge, to any person obtaining a copy
9+
* of this software and associated documentation files (the "Software"), to deal
10+
* in the Software without restriction, including without limitation the rights
11+
* to use, copy, modify, merge, publish, distribute, sublicense, and/or sell
12+
* copies of the Software, and to permit persons to whom the Software is
13+
* furnished to do so, subject to the following conditions:
14+
*
15+
* The above copyright notice and this permission notice shall be included in
16+
* all copies or substantial portions of the Software.
17+
*
18+
* THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
19+
* IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY,
20+
* FITNESS FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE
21+
* AUTHORS OR COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER
22+
* LIABILITY, WHETHER IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM,
23+
* OUT OF OR IN CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN
24+
* THE SOFTWARE.
25+
*/
26+
#ifndef PHP_GIT2_G_CONFIG_H
27+
#define PHP_GIT2_G_CONFIG_H
28+
29+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_find_global, 0, 0, 0)
30+
ZEND_END_ARG_INFO()
31+
32+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_find_xdg, 0, 0, 2)
33+
ZEND_ARG_INFO(0, length)
34+
ZEND_END_ARG_INFO()
35+
36+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_find_system, 0, 0, 2)
37+
ZEND_ARG_INFO(0, length)
38+
ZEND_END_ARG_INFO()
39+
40+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_open_default, 0, 0, 1)
41+
ZEND_END_ARG_INFO()
42+
43+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_new, 0, 0, 1)
44+
ZEND_END_ARG_INFO()
45+
46+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_add_file_ondisk, 0, 0, 4)
47+
ZEND_ARG_INFO(0, cfg)
48+
ZEND_ARG_INFO(0, path)
49+
ZEND_ARG_INFO(0, level)
50+
ZEND_ARG_INFO(0, force)
51+
ZEND_END_ARG_INFO()
52+
53+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_open_ondisk, 0, 0, 2)
54+
ZEND_ARG_INFO(0, path)
55+
ZEND_END_ARG_INFO()
56+
57+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_open_level, 0, 0, 3)
58+
ZEND_ARG_INFO(0, parent)
59+
ZEND_ARG_INFO(0, level)
60+
ZEND_END_ARG_INFO()
61+
62+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_open_global, 0, 0, 2)
63+
ZEND_ARG_INFO(0, config)
64+
ZEND_END_ARG_INFO()
65+
66+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_refresh, 0, 0, 1)
67+
ZEND_ARG_INFO(0, cfg)
68+
ZEND_END_ARG_INFO()
69+
70+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_free, 0, 0, 1)
71+
ZEND_ARG_INFO(0, cfg)
72+
ZEND_END_ARG_INFO()
73+
74+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_get_entry, 0, 0, 3)
75+
ZEND_ARG_INFO(0, cfg)
76+
ZEND_ARG_INFO(0, name)
77+
ZEND_END_ARG_INFO()
78+
79+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_get_int32, 0, 0, 3)
80+
ZEND_ARG_INFO(0, cfg)
81+
ZEND_ARG_INFO(0, name)
82+
ZEND_END_ARG_INFO()
83+
84+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_get_int64, 0, 0, 3)
85+
ZEND_ARG_INFO(0, cfg)
86+
ZEND_ARG_INFO(0, name)
87+
ZEND_END_ARG_INFO()
88+
89+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_get_bool, 0, 0, 3)
90+
ZEND_ARG_INFO(0, cfg)
91+
ZEND_ARG_INFO(0, name)
92+
ZEND_END_ARG_INFO()
93+
94+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_get_string, 0, 0, 3)
95+
ZEND_ARG_INFO(0, cfg)
96+
ZEND_ARG_INFO(0, name)
97+
ZEND_END_ARG_INFO()
98+
99+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_get_multivar_foreach, 0, 0, 5)
100+
ZEND_ARG_INFO(0, cfg)
101+
ZEND_ARG_INFO(0, name)
102+
ZEND_ARG_INFO(0, regexp)
103+
ZEND_ARG_INFO(0, callback)
104+
ZEND_ARG_INFO(0, payload)
105+
ZEND_END_ARG_INFO()
106+
107+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_multivar_iterator_new, 0, 0, 4)
108+
ZEND_ARG_INFO(0, cfg)
109+
ZEND_ARG_INFO(0, name)
110+
ZEND_ARG_INFO(0, regexp)
111+
ZEND_END_ARG_INFO()
112+
113+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_next, 0, 0, 2)
114+
ZEND_ARG_INFO(0, iter)
115+
ZEND_END_ARG_INFO()
116+
117+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_iterator_free, 0, 0, 1)
118+
ZEND_ARG_INFO(0, iter)
119+
ZEND_END_ARG_INFO()
120+
121+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_set_int32, 0, 0, 3)
122+
ZEND_ARG_INFO(0, cfg)
123+
ZEND_ARG_INFO(0, name)
124+
ZEND_ARG_INFO(0, value)
125+
ZEND_END_ARG_INFO()
126+
127+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_set_int64, 0, 0, 3)
128+
ZEND_ARG_INFO(0, cfg)
129+
ZEND_ARG_INFO(0, name)
130+
ZEND_ARG_INFO(0, value)
131+
ZEND_END_ARG_INFO()
132+
133+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_set_bool, 0, 0, 3)
134+
ZEND_ARG_INFO(0, cfg)
135+
ZEND_ARG_INFO(0, name)
136+
ZEND_ARG_INFO(0, value)
137+
ZEND_END_ARG_INFO()
138+
139+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_set_string, 0, 0, 3)
140+
ZEND_ARG_INFO(0, cfg)
141+
ZEND_ARG_INFO(0, name)
142+
ZEND_ARG_INFO(0, value)
143+
ZEND_END_ARG_INFO()
144+
145+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_set_multivar, 0, 0, 4)
146+
ZEND_ARG_INFO(0, cfg)
147+
ZEND_ARG_INFO(0, name)
148+
ZEND_ARG_INFO(0, regexp)
149+
ZEND_ARG_INFO(0, value)
150+
ZEND_END_ARG_INFO()
151+
152+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_delete_entry, 0, 0, 2)
153+
ZEND_ARG_INFO(0, cfg)
154+
ZEND_ARG_INFO(0, name)
155+
ZEND_END_ARG_INFO()
156+
157+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_delete_multivar, 0, 0, 3)
158+
ZEND_ARG_INFO(0, cfg)
159+
ZEND_ARG_INFO(0, name)
160+
ZEND_ARG_INFO(0, regexp)
161+
ZEND_END_ARG_INFO()
162+
163+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_foreach, 0, 0, 3)
164+
ZEND_ARG_INFO(0, cfg)
165+
ZEND_ARG_INFO(0, callback)
166+
ZEND_ARG_INFO(0, payload)
167+
ZEND_END_ARG_INFO()
168+
169+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_iterator_new, 0, 0, 2)
170+
ZEND_ARG_INFO(0, cfg)
171+
ZEND_END_ARG_INFO()
172+
173+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_iterator_glob_new, 0, 0, 3)
174+
ZEND_ARG_INFO(0, cfg)
175+
ZEND_ARG_INFO(0, regexp)
176+
ZEND_END_ARG_INFO()
177+
178+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_foreach_match, 0, 0, 4)
179+
ZEND_ARG_INFO(0, cfg)
180+
ZEND_ARG_INFO(0, regexp)
181+
ZEND_ARG_INFO(0, callback)
182+
ZEND_ARG_INFO(0, payload)
183+
ZEND_END_ARG_INFO()
184+
185+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_get_mapped, 0, 0, 5)
186+
ZEND_ARG_INFO(0, cfg)
187+
ZEND_ARG_INFO(0, name)
188+
ZEND_ARG_INFO(0, maps)
189+
ZEND_ARG_INFO(0, map_n)
190+
ZEND_END_ARG_INFO()
191+
192+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_lookup_map_value, 0, 0, 4)
193+
ZEND_ARG_INFO(0, maps)
194+
ZEND_ARG_INFO(0, map_n)
195+
ZEND_ARG_INFO(0, value)
196+
ZEND_END_ARG_INFO()
197+
198+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_parse_bool, 0, 0, 2)
199+
ZEND_ARG_INFO(0, value)
200+
ZEND_END_ARG_INFO()
201+
202+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_parse_int32, 0, 0, 2)
203+
ZEND_ARG_INFO(0, value)
204+
ZEND_END_ARG_INFO()
205+
206+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_parse_int64, 0, 0, 2)
207+
ZEND_ARG_INFO(0, value)
208+
ZEND_END_ARG_INFO()
209+
210+
ZEND_BEGIN_ARG_INFO_EX(arginfo_git_config_backend_foreach_match, 0, 0, 5)
211+
ZEND_ARG_INFO(0, backend)
212+
ZEND_ARG_INFO(0, regexp)
213+
// ZEND_ARG_INFO(0, )
214+
// ZEND_ARG_INFO(0, ))
215+
// ZEND_ARG_INFO(0, data)
216+
ZEND_END_ARG_INFO()
217+
218+
/* {{{ proto resource git_config_find_global(length)
219+
*/
220+
PHP_FUNCTION(git_config_find_global);
221+
222+
/* {{{ proto resource git_config_find_xdg(length)
223+
*/
224+
PHP_FUNCTION(git_config_find_xdg);
225+
226+
/* {{{ proto resource git_config_find_system(length)
227+
*/
228+
PHP_FUNCTION(git_config_find_system);
229+
230+
/* {{{ proto resource git_config_open_default()
231+
*/
232+
PHP_FUNCTION(git_config_open_default);
233+
234+
/* {{{ proto resource git_config_new()
235+
*/
236+
PHP_FUNCTION(git_config_new);
237+
238+
/* {{{ proto long git_config_add_file_ondisk(cfg, path, level, force)
239+
*/
240+
PHP_FUNCTION(git_config_add_file_ondisk);
241+
242+
/* {{{ proto resource git_config_open_ondisk(path)
243+
*/
244+
PHP_FUNCTION(git_config_open_ondisk);
245+
246+
/* {{{ proto resource git_config_open_level(parent, level)
247+
*/
248+
PHP_FUNCTION(git_config_open_level);
249+
250+
/* {{{ proto resource git_config_open_global(config)
251+
*/
252+
PHP_FUNCTION(git_config_open_global);
253+
254+
/* {{{ proto long git_config_refresh(cfg)
255+
*/
256+
PHP_FUNCTION(git_config_refresh);
257+
258+
/* {{{ proto void git_config_free(cfg)
259+
*/
260+
PHP_FUNCTION(git_config_free);
261+
262+
/* {{{ proto resource git_config_get_entry(cfg, name)
263+
*/
264+
PHP_FUNCTION(git_config_get_entry);
265+
266+
/* {{{ proto resource git_config_get_int32(cfg, name)
267+
*/
268+
PHP_FUNCTION(git_config_get_int32);
269+
270+
/* {{{ proto resource git_config_get_int64(cfg, name)
271+
*/
272+
PHP_FUNCTION(git_config_get_int64);
273+
274+
/* {{{ proto resource git_config_get_bool(cfg, name)
275+
*/
276+
PHP_FUNCTION(git_config_get_bool);
277+
278+
/* {{{ proto resource git_config_get_string(cfg, name)
279+
*/
280+
PHP_FUNCTION(git_config_get_string);
281+
282+
/* {{{ proto long git_config_get_multivar_foreach(cfg, name, regexp, callback, payload)
283+
*/
284+
PHP_FUNCTION(git_config_get_multivar_foreach);
285+
286+
/* {{{ proto resource git_config_multivar_iterator_new(cfg, name, regexp)
287+
*/
288+
PHP_FUNCTION(git_config_multivar_iterator_new);
289+
290+
/* {{{ proto resource git_config_next(iter)
291+
*/
292+
PHP_FUNCTION(git_config_next);
293+
294+
/* {{{ proto void git_config_iterator_free(iter)
295+
*/
296+
PHP_FUNCTION(git_config_iterator_free);
297+
298+
/* {{{ proto long git_config_set_int32(cfg, name, value)
299+
*/
300+
PHP_FUNCTION(git_config_set_int32);
301+
302+
/* {{{ proto long git_config_set_int64(cfg, name, value)
303+
*/
304+
PHP_FUNCTION(git_config_set_int64);
305+
306+
/* {{{ proto long git_config_set_bool(cfg, name, value)
307+
*/
308+
PHP_FUNCTION(git_config_set_bool);
309+
310+
/* {{{ proto long git_config_set_string(cfg, name, value)
311+
*/
312+
PHP_FUNCTION(git_config_set_string);
313+
314+
/* {{{ proto long git_config_set_multivar(cfg, name, regexp, value)
315+
*/
316+
PHP_FUNCTION(git_config_set_multivar);
317+
318+
/* {{{ proto long git_config_delete_entry(cfg, name)
319+
*/
320+
PHP_FUNCTION(git_config_delete_entry);
321+
322+
/* {{{ proto long git_config_delete_multivar(cfg, name, regexp)
323+
*/
324+
PHP_FUNCTION(git_config_delete_multivar);
325+
326+
/* {{{ proto long git_config_foreach(cfg, callback, payload)
327+
*/
328+
PHP_FUNCTION(git_config_foreach);
329+
330+
/* {{{ proto resource git_config_iterator_new(cfg)
331+
*/
332+
PHP_FUNCTION(git_config_iterator_new);
333+
334+
/* {{{ proto resource git_config_iterator_glob_new(cfg, regexp)
335+
*/
336+
PHP_FUNCTION(git_config_iterator_glob_new);
337+
338+
/* {{{ proto long git_config_foreach_match(cfg, regexp, callback, payload)
339+
*/
340+
PHP_FUNCTION(git_config_foreach_match);
341+
342+
/* {{{ proto resource git_config_get_mapped(cfg, name, maps, map_n)
343+
*/
344+
PHP_FUNCTION(git_config_get_mapped);
345+
346+
/* {{{ proto resource git_config_lookup_map_value(maps, map_n, value)
347+
*/
348+
PHP_FUNCTION(git_config_lookup_map_value);
349+
350+
/* {{{ proto resource git_config_parse_bool(value)
351+
*/
352+
PHP_FUNCTION(git_config_parse_bool);
353+
354+
/* {{{ proto resource git_config_parse_int32(value)
355+
*/
356+
PHP_FUNCTION(git_config_parse_int32);
357+
358+
/* {{{ proto resource git_config_parse_int64(value)
359+
*/
360+
PHP_FUNCTION(git_config_parse_int64);
361+
362+
/* {{{ proto long git_config_backend_foreach_match(backend, regexp, , ), data)
363+
*/
364+
PHP_FUNCTION(git_config_backend_foreach_match);
365+
366+
#endif

‎gen.php

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
$tmp['retval'] = $match[1][$i];
2020

2121
$d = count($list);
22-
if (preg_match("/\*\*/", $list[0])) {
22+
if ((preg_match("/(\*\*|out)/", $list[0]) || preg_match("/(write|create|new)/", $match[2][$i]))) {
2323
$d--;
2424
}
2525

‎php_git2.c

+42
Original file line numberDiff line numberDiff line change
@@ -33,6 +33,7 @@
3333
#include "revwalk.h"
3434
#include "treebuilder.h"
3535
#include "reference.h"
36+
#include "g_config.h"
3637

3738
int git2_resource_handle;
3839

@@ -61,6 +62,8 @@ void static destruct_git2(zend_rsrc_list_entry *rsrc TSRMLS_DC)
6162
git_treebuilder_free(PHP_GIT2_V(resource, treebuilder));
6263
case PHP_GIT2_TYPE_REFERENCE:
6364
git_reference_free(PHP_GIT2_V(resource, reference));
65+
case PHP_GIT2_TYPE_CONFIG:
66+
git_config_free(PHP_GIT2_V(resource, config));
6467
default:
6568
break;
6669
}
@@ -213,6 +216,45 @@ static zend_function_entry php_git2_functions[] = {
213216
PHP_FE(git_revwalk_free, arginfo_git_revwalk_free)
214217
PHP_FE(git_revwalk_repository, arginfo_git_revwalk_repository)
215218

219+
/* config */
220+
PHP_FE(git_config_find_global, arginfo_git_config_find_global)
221+
PHP_FE(git_config_find_xdg, arginfo_git_config_find_xdg)
222+
PHP_FE(git_config_find_system, arginfo_git_config_find_system)
223+
PHP_FE(git_config_open_default, arginfo_git_config_open_default)
224+
PHP_FE(git_config_new, arginfo_git_config_new)
225+
PHP_FE(git_config_add_file_ondisk, arginfo_git_config_add_file_ondisk)
226+
PHP_FE(git_config_open_ondisk, arginfo_git_config_open_ondisk)
227+
PHP_FE(git_config_open_level, arginfo_git_config_open_level)
228+
PHP_FE(git_config_open_global, arginfo_git_config_open_global)
229+
PHP_FE(git_config_refresh, arginfo_git_config_refresh)
230+
PHP_FE(git_config_free, arginfo_git_config_free)
231+
PHP_FE(git_config_get_entry, arginfo_git_config_get_entry)
232+
PHP_FE(git_config_get_int32, arginfo_git_config_get_int32)
233+
PHP_FE(git_config_get_int64, arginfo_git_config_get_int64)
234+
PHP_FE(git_config_get_bool, arginfo_git_config_get_bool)
235+
PHP_FE(git_config_get_string, arginfo_git_config_get_string)
236+
PHP_FE(git_config_get_multivar_foreach, arginfo_git_config_get_multivar_foreach)
237+
PHP_FE(git_config_multivar_iterator_new, arginfo_git_config_multivar_iterator_new)
238+
PHP_FE(git_config_next, arginfo_git_config_next)
239+
PHP_FE(git_config_iterator_free, arginfo_git_config_iterator_free)
240+
PHP_FE(git_config_set_int32, arginfo_git_config_set_int32)
241+
PHP_FE(git_config_set_int64, arginfo_git_config_set_int64)
242+
PHP_FE(git_config_set_bool, arginfo_git_config_set_bool)
243+
PHP_FE(git_config_set_string, arginfo_git_config_set_string)
244+
PHP_FE(git_config_set_multivar, arginfo_git_config_set_multivar)
245+
PHP_FE(git_config_delete_entry, arginfo_git_config_delete_entry)
246+
PHP_FE(git_config_delete_multivar, arginfo_git_config_delete_multivar)
247+
PHP_FE(git_config_foreach, arginfo_git_config_foreach)
248+
PHP_FE(git_config_iterator_new, arginfo_git_config_iterator_new)
249+
PHP_FE(git_config_iterator_glob_new, arginfo_git_config_iterator_glob_new)
250+
PHP_FE(git_config_foreach_match, arginfo_git_config_foreach_match)
251+
PHP_FE(git_config_get_mapped, arginfo_git_config_get_mapped)
252+
PHP_FE(git_config_lookup_map_value, arginfo_git_config_lookup_map_value)
253+
PHP_FE(git_config_parse_bool, arginfo_git_config_parse_bool)
254+
PHP_FE(git_config_parse_int32, arginfo_git_config_parse_int32)
255+
PHP_FE(git_config_parse_int64, arginfo_git_config_parse_int64)
256+
PHP_FE(git_config_backend_foreach_match, arginfo_git_config_backend_foreach_match)
257+
216258
PHP_FE_END
217259
};
218260

‎php_git2.h

+2
Original file line numberDiff line numberDiff line change
@@ -82,6 +82,7 @@ enum php_git2_resource_type {
8282
PHP_GIT2_TYPE_REVWALK,
8383
PHP_GIT2_TYPE_TREEBUILDER,
8484
PHP_GIT2_TYPE_REFERENCE,
85+
PHP_GIT2_TYPE_CONFIG,
8586
};
8687

8788
typedef struct php_git2_t {
@@ -95,6 +96,7 @@ typedef struct php_git2_t {
9596
git_revwalk *revwalk;
9697
git_treebuilder *treebuilder;
9798
git_reference *reference;
99+
git_config *config;
98100
} v;
99101
int should_free_v;
100102
int resource_id;

0 commit comments

Comments
 (0)
Please sign in to comment.