libgit2 / php-git Goto Github PK
View Code? Open in Web Editor NEWPHP bindings for libgit2
Home Page: http://libgit2.github.com
License: MIT License
PHP bindings for libgit2
Home Page: http://libgit2.github.com
License: MIT License
Hello,
Is there a method for diffing between commits or branches?
I wanted to compile this PHP extension after your update today (commit a18e511), but I can't make make
works.
I'm on OSX 10.7 with PHP 5.3.10:
$ uname -a
Darwin mattketmo.local 11.4.0 Darwin Kernel Version 11.4.0: Mon Apr 9 19:32:15 PDT 2012; root:xnu-1699.26.8~1/RELEASE_X86_64 x86_64
$ php -v
PHP 5.3.10 with Suhosin-Patch (cli) (built: Feb 20 2012 22:55:53)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
Here is the output for ./configure
& make
:
➜ php-git git:(develop) ./configure
checking for grep that handles long lines and -e... /usr/bin/grep
checking for egrep... /usr/bin/grep -E
checking for a sed that does not truncate output... /opt/local/bin/gsed
checking for cc... cc
checking for C compiler default output file name... a.out
checking whether the C compiler works... yes
checking whether we are cross compiling... no
checking for suffix of executables...
checking for suffix of object files... o
checking whether we are using the GNU C compiler... yes
checking whether cc accepts -g... yes
checking for cc option to accept ISO C89... none needed
checking how to run the C preprocessor... cc -E
checking for icc... no
checking for suncc... no
checking whether cc understands -c and -o together... yes
checking for system library directory... lib
checking if compiler supports -R... no
checking if compiler supports -Wl,-rpath,... yes
checking build system type... i386-apple-darwin11.4.0
checking host system type... i386-apple-darwin11.4.0
checking target system type... i386-apple-darwin11.4.0
checking for PHP prefix... /usr
checking for PHP includes... -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib
checking for PHP extension directory... /usr/lib/php/extensions/no-debug-non-zts-20090626
checking for PHP installed headers prefix... /usr/include/php
checking if debug is enabled... no
checking if zts is enabled... no
checking for re2c... no
configure: WARNING: You will need re2c 0.13.4 or later if you want to regenerate PHP parsers.
checking for gawk... gawk
checking Whether to enable the "git2" extension... yes, shared
checking for libgit2... yes, shared
checking for ld used by cc... /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld
checking if the linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) is GNU ld... no
checking for /usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld option to reload object files... -r
checking for BSD-compatible nm... /usr/bin/nm
checking whether ln -s works... yes
checking how to recognize dependent libraries... pass_all
checking for ANSI C header files... yes
checking for sys/types.h... yes
checking for sys/stat.h... yes
checking for stdlib.h... yes
checking for string.h... yes
checking for memory.h... yes
checking for strings.h... yes
checking for inttypes.h... yes
checking for stdint.h... yes
checking for unistd.h... yes
checking dlfcn.h usability... yes
checking dlfcn.h presence... yes
checking for dlfcn.h... yes
checking the maximum length of command line arguments... 196608
checking command to parse /usr/bin/nm output from cc object... rm: conftest.dSYM: is a directory
ok
checking for objdir... .libs
checking for ar... ar
checking for ranlib... ranlib
checking for strip... strip
checking for dsymutil... dsymutil
checking for nmedit... nmedit
checking for -single_module linker flag... yes
checking for -exported_symbols_list linker flag... yes
checking if cc supports -fno-rtti -fno-exceptions... no
checking for cc option to produce PIC... -fno-common
checking if cc PIC flag -fno-common works... yes
checking if cc static flag -static works... no
checking if cc supports -c -o file.o... yes
checking whether the cc linker (/usr/llvm-gcc-4.2/libexec/gcc/i686-apple-darwin11/4.2.1/ld) supports shared libraries... yes
checking dynamic linker characteristics... darwin11.4.0 dyld
checking how to hardcode library paths into programs... immediate
checking whether stripping libraries is possible... yes
checking if libtool supports shared libraries... yes
checking whether to build shared libraries... yes
checking whether to build static libraries... no
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
➜ php-git git:(develop) make
/bin/sh /tmp/php-git/libtool --mode=compile cc -I. -I/tmp/php-git -DPHP_ATOM_INC -I/tmp/php-git/include -I/tmp/php-git/main -I/tmp/php-git -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -Wl,libgit2/build/libgit2.a -c /tmp/php-git/git2.c -o git2.lo
mkdir .libs
cc -I. -I/tmp/php-git -DPHP_ATOM_INC -I/tmp/php-git/include -I/tmp/php-git/main -I/tmp/php-git -I/usr/include/php -I/usr/include/php/main -I/usr/include/php/TSRM -I/usr/include/php/Zend -I/usr/include/php/ext -I/usr/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -Wl,libgit2/build/libgit2.a -c /tmp/php-git/git2.c -fno-common -DPIC -o .libs/git2.o
In file included from /usr/include/php/main/php.h:388,
from /tmp/php-git/php_git2.h:35,
from /tmp/php-git/git2.c:25:
/usr/include/php/main/php_output.h:49: warning: redundant redeclaration of ‘php_ob_get_buffer’
/usr/include/php/main/php_output.h:40: warning: previous declaration of ‘php_ob_get_buffer’ was here
/usr/include/php/main/php_output.h:50: warning: redundant redeclaration of ‘php_ob_get_length’
/usr/include/php/main/php_output.h:41: warning: previous declaration of ‘php_ob_get_length’ was here
In file included from /tmp/php-git/git2.c:25:
/tmp/php-git/php_git2.h:40:20: error: git2.h: No such file or directory
/tmp/php-git/php_git2.h:41:27: error: git2/errors.h: No such file or directory
/tmp/php-git/php_git2.h:42:32: error: git2/odb_backend.h: No such file or directory
In file included from /tmp/php-git/git2.c:25:
/tmp/php-git/php_git2.h:69: error: expected specifier-qualifier-list before ‘git_repository’
/tmp/php-git/php_git2.h:74: error: expected specifier-qualifier-list before ‘git_commit’
/tmp/php-git/php_git2.h:79: error: expected specifier-qualifier-list before ‘git_blob’
/tmp/php-git/php_git2.h:84: error: expected specifier-qualifier-list before ‘git_tree’
/tmp/php-git/php_git2.h:91: error: expected specifier-qualifier-list before ‘git_tree_entry’
/tmp/php-git/php_git2.h:96: error: expected specifier-qualifier-list before ‘git_treebuilder’
/tmp/php-git/php_git2.h:101: error: expected specifier-qualifier-list before ‘git_signature’
/tmp/php-git/php_git2.h:106: error: expected specifier-qualifier-list before ‘git_reference’
/tmp/php-git/php_git2.h:111: error: expected specifier-qualifier-list before ‘git_revwalk’
/tmp/php-git/php_git2.h:118: error: expected specifier-qualifier-list before ‘git_index’
/tmp/php-git/php_git2.h:124: error: expected specifier-qualifier-list before ‘git_index_entry’
/tmp/php-git/php_git2.h:129: error: expected specifier-qualifier-list before ‘git_config’
/tmp/php-git/php_git2.h:134: error: expected specifier-qualifier-list before ‘git_remote’
/tmp/php-git/php_git2.h:139: error: expected specifier-qualifier-list before ‘git_tag’
/tmp/php-git/php_git2.h:144: error: expected specifier-qualifier-list before ‘git_odb’
/tmp/php-git/php_git2.h:149: error: expected specifier-qualifier-list before ‘git_odb_object’
/tmp/php-git/php_git2.h:158: error: expected specifier-qualifier-list before ‘git_odb_backend’
/tmp/php-git/php_git2.h:198: error: expected ‘)’ before ‘*’ token
/tmp/php-git/php_git2.h:216: error: expected declaration specifiers or ‘...’ before ‘git_commit’
/tmp/php-git/php_git2.h: In function ‘php_git2_create_signature_from_commit’:
/tmp/php-git/php_git2.h:220: error: nested functions are disabled, use -fnested-functions to re-enable
/tmp/php-git/php_git2.h:220: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/tmp/php-git/php_git2.h:220: error: ‘author’ undeclared (first use in this function)
/tmp/php-git/php_git2.h:220: error: (Each undeclared identifier is reported only once
/tmp/php-git/php_git2.h:220: error: for each function it appears in.)
/tmp/php-git/php_git2.h:221: warning: ISO C90 forbids mixed declarations and code
/tmp/php-git/php_git2.h:224: warning: implicit declaration of function ‘git_commit_author’
/tmp/php-git/php_git2.h:224: error: ‘commit’ undeclared (first use in this function)
/tmp/php-git/php_git2.h:226: warning: implicit declaration of function ‘git_commit_committer’
/tmp/php-git/php_git2.h: At top level:
/tmp/php-git/php_git2.h:258: error: expected declaration specifiers or ‘...’ before ‘git_tree_entry’
/tmp/php-git/php_git2.h:258: error: expected declaration specifiers or ‘...’ before ‘git_repository’
/tmp/php-git/php_git2.h: In function ‘create_tree_entry_from_entry’:
/tmp/php-git/php_git2.h:261: error: ‘GIT_OID_HEXSZ’ undeclared (first use in this function)
/tmp/php-git/php_git2.h:261: warning: ISO C90 forbids mixed declarations and code
/tmp/php-git/php_git2.h:262: error: nested functions are disabled, use -fnested-functions to re-enable
/tmp/php-git/php_git2.h:262: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘__attribute__’ before ‘*’ token
/tmp/php-git/php_git2.h:262: error: ‘oid’ undeclared (first use in this function)
/tmp/php-git/php_git2.h:263: warning: ISO C90 forbids mixed declarations and code
/tmp/php-git/php_git2.h:269: error: ‘php_git2_tree_entry’ has no member named ‘entry’
/tmp/php-git/php_git2.h:269: error: ‘entry’ undeclared (first use in this function)
/tmp/php-git/php_git2.h:270: warning: implicit declaration of function ‘git_tree_entry_id’
/tmp/php-git/php_git2.h:271: warning: implicit declaration of function ‘git_oid_tostr’
/tmp/php-git/php_git2.h:273: warning: implicit declaration of function ‘git_tree_entry_name’
/tmp/php-git/php_git2.h:273: warning: cast to pointer from integer of different size
/tmp/php-git/php_git2.h:275: warning: implicit declaration of function ‘git_tree_entry_attributes’
/tmp/php-git/php_git2.h:261: warning: unused variable ‘buf’
/tmp/php-git/php_git2.h: At top level:
/tmp/php-git/php_git2.h:278: error: expected declaration specifiers or ‘...’ before ‘git_index_entry’
/tmp/php-git/php_git2.h: In function ‘php_git2_create_index_entry’:
/tmp/php-git/php_git2.h:281: error: ‘GIT_OID_HEXSZ’ undeclared (first use in this function)
/tmp/php-git/php_git2.h:285: warning: implicit declaration of function ‘git_oid_fmt’
/tmp/php-git/php_git2.h:285: error: ‘entry’ undeclared (first use in this function)
/tmp/php-git/php_git2.h:281: warning: unused variable ‘oid_out’
/tmp/php-git/php_git2.h: In function ‘php_git2_exception_check’:
/tmp/php-git/php_git2.h:313: warning: implicit declaration of function ‘giterr_last’
/tmp/php-git/php_git2.h:314: warning: implicit declaration of function ‘giterr_clear’
/tmp/php-git/git2.c: At top level:
/tmp/php-git/git2.c:88: error: expected ‘)’ before ‘*’ token
/tmp/php-git/git2.c: In function ‘zm_info_git2’:
/tmp/php-git/git2.c:245: error: ‘LIBGIT2_VERSION’ undeclared (first use in this function)
make: *** [git2.lo] Error 1
Which is your current configuration (OS & PHP)?
By cloning with git-submodule as marked in the README, I'm on commit e460739 of libgit2. Should I change its position?
Thank you.
I've spent several hours trying to get some version of this to compile. I've even tried older version of the repo, and only hit other walls. If anyone can get this to compile I would be extremely appreciative of the instruction set - even if it involves source changes.
So here is the repo README.md instructions:
git clone https://github.com/libgit2/php-git.git --recursive
cd libgit2
mkdir build && cd build
cmake ..
cmake -DBUILD_SHARED_LIBS=OFF -build .
make
cd ../../
phpize
./configure
make
make install
sudo make install
# add `extension=git2.so` to your php.ini
Line 2 bombs, so I assume it should be
cd php-git/libgit2
That works fine till you get down to the make command which bombs out with syntax error:
Linking C static library libgit2.a
[ 25%] Built target git2
[ 26%] Generating ../tests-clar/clar_main.c, ../tests-clar/clar.h
File "clar", line 65
self.clar_path = os.path.abspath(clar_path) if clar_path else None
^
SyntaxError: invalid syntax
make[2]: *** [../tests-clar/clar_main.c] Error 1
make[1]: *** [CMakeFiles/libgit2_clar.dir/all] Error 2
make: *** [all] Error 2
If I try other revisions I get different errors, but I don't want to cloud the issue.
As with anything, this issue is somewhat urgent. Any help would certainly be appreciated!
Is there a way to easily determine if a repository is empty with this library ?
I'd really like to get php-git updated and get a version bump - along with having a dev branch based on the latest libgit2 dev code.
To that end, what php-git needs the most right now are unit tests to ensure all the functionality it does provide is working.
While I added a unit test yesterday, it's a pretty crappy one and I will be submitting a replacement - before I start that I wanted to get feedback from other contributors/users of php-git.
For one thing, rather then writing our own tests, I'd like to use the model from libgit2
https://github.com/libgit2/libgit2/tree/v0.20.0/tests
The resources directory contains a large number of git repositories for testing. Rather then getting them from that folder, I want to copy that folder into our own - that way when changing libgit2 versions if the api has changed our copies will fail showing where the api needs to be changed.
Secondly, I want to create a php version of https://github.com/libgit2/libgit2/blob/v0.20.0/tests/clar.c. clar provides the basic functions to initialize tests. I was thinking of an abstract class with static functions like. Since php already has a unit testing process, we don't need most of the functionality of clar, just some little bits like cl_git_sandbox_init("testrepo") - for libgit2 this function will create a subdirectory in the folder where the test is running, copies the testrepo folder over from resources which is a predefined git repo, and copies the .gittree folder to .git in order to make it an active git repo.
So something like:
Clar::sandbox_init($reponame)
and
Clar::sandbox_cleanup($reponame)
Would be sufficient to create the repo and then clean up afterwards.
Thirdly, I'd rather use the libgit directory model where possible, so instead of https://github.com/libgit2/php-git/tree/develop/tests/tree
I should have placed that test under
tests/object/tree/read/
Where read.c is the libgit2 unit test file that I copied that test from.
I find this helpful in that instead of coming up with our own tests and hash id's, we can use the ones already written for libgit2
I'd also like to follow the guidelines for php:
https://qa.php.net/write-test.php
Under that standard instead of
git_tree_lookup.phpt
Which tests both the success and failure of looking up a directory, I should have written
git_tree_lookup_basic.phpt
git_tree_lookup_error.phpt
Which gives 2 tests to make it easier to determine what is wrong.
It would also be helpful if run-tests.php could be setup to post fail logs to one of the irc channels[either #libgit2 or #php-git) rather then sending e-mail to a PHP mailling list.
There are a LARGE number of tests so I don't expect them to be done right away, but if we all pitch in we can fill them in as we use php-git[ie if you are using the git_tree_lookup function and there is no unit test for it - spend 45 minutes and write a few based on the libgit2 tests. It will save you time since by doing so you can both verify that it works, and learn how it works!
Before setting up the framework, I wanted to check to see if anyone here has a different preferred way of doing things, since I'm more likely to get help if I use a framework others will enjoy, or at least tolerate.
Would any one be able to provide me with a windows compiled .dll for this to drop into my php extension directory?
Hi, I create a config.w32 but unfortunately many syntax errors appear.
Can you release a new 0.3.0 tagged version? The 0.2.1 version is 2 years old, and bumping to 0.3.0 would bring things up to date.
hi , after installing the php-git with no error , I run the file in tests folder on Ubuntu 11.04 , the browser display internal server error 500.
The versions : PHP 5.3.5 , Mysql 5.1.63 , Apache 2.0
Now with libgit2 0.19.0 being tagged, it would be cool if we could have git push api support in php-git :)
I get the libgit2 v0.10.0 and php-git v0.2.1 compile, then install, restart apache, get this error:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/git.so' - /usr/lib64/php/modules/git.so: undefined symbol: git_reference_write in Unknown on line 0
In file included from /var/www/Paomianba/src/repo/php-git/php_git2.h:35,
from /var/www/Paomianba/src/repo/php-git/tree.c:25:
/usr/include/php/main/php.h:267: warning: redundant redeclaration of ‘environ’
/usr/include/unistd.h:542: note: previous declaration of ‘environ’ was here
In file included from /usr/include/php/main/php.h:389,
from /var/www/Paomianba/src/repo/php-git/php_git2.h:35,
from /var/www/Paomianba/src/repo/php-git/tree.c:25:
/usr/include/php/main/php_output.h:49: warning: redundant redeclaration of ‘php_ob_get_buffer’
/usr/include/php/main/php_output.h:40: note: previous declaration of ‘php_ob_get_buffer’ was here
/usr/include/php/main/php_output.h:50: warning: redundant redeclaration of ‘php_ob_get_length’
/usr/include/php/main/php_output.h:41: note: previous declaration of ‘php_ob_get_length’ was here
In file included from /var/www/Paomianba/src/repo/php-git/tree.c:25:
/var/www/Paomianba/src/repo/php-git/php_git2.h: In function ‘create_tree_entry_from_entry’:
/var/www/Paomianba/src/repo/php-git/php_git2.h:270: warning: ISO C90 forbids mixed declarations and code
In file included from /usr/include/php/ext/spl/spl_iterators.h:27,
from /usr/include/php/ext/spl/spl_array.h:26,
from /var/www/Paomianba/src/repo/php-git/tree.c:26:
/usr/include/php/ext/pcre/php_pcre.h:29:18: error: pcre.h: No such file or directory
In file included from /usr/include/php/ext/spl/spl_iterators.h:27,
from /usr/include/php/ext/spl/spl_array.h:26,
from /var/www/Paomianba/src/repo/php-git/tree.c:26:
/usr/include/php/ext/pcre/php_pcre.h: At top level:
/usr/include/php/ext/pcre/php_pcre.h:37: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
/usr/include/php/ext/pcre/php_pcre.h:38: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
/usr/include/php/ext/pcre/php_pcre.h:44: error: expected specifier-qualifier-list before ‘pcre’
make: *** [tree.lo] Error 1
$ uname -a
FreeBSD 9.1-RELEASE FreeBSD 9.1-RELEASE #0 r243825: Tue Dec 4 09:23:10 UTC 2012 [email protected]:/usr/obj/usr/src/sys/GENERIC amd64
$ cmake --version
cmake version 2.8.10.2
$ gcc -v
Using built-in specs.
Target: amd64-undermydesk-freebsd
Configured with: FreeBSD/amd64 system compiler
Thread model: posix
gcc version 4.2.1 20070831 patched [FreeBSD]
$ cmake ..
-- The C compiler identification is GNU 4.2.1
-- Check for working C compiler: /usr/bin/cc
-- Check for working C compiler: /usr/bin/cc -- works
-- Detecting C compiler ABI info
-- Detecting C compiler ABI info - done
-- Found OpenSSL: /usr/local/lib/libssl.so;/usr/local/lib/libcrypto.so (found version "1.0.1e")
-- Found ZLIB: /usr/lib/libz.so (found version "1.2.7")
-- Found PythonInterp: /usr/local/bin/python (found version "2.7.3")
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/php-git/libgit2/build
$ cmake -DBUILD_SHARED_LIBS=OFF -build .
-- Configuring done
-- Generating done
-- Build files have been written to: /tmp/php-git/libgit2/build
$ make
Scanning dependencies of target git2
[ 0%] Building C object CMakeFiles/git2.dir/src/attr.c.o
[ 0%] Building C object CMakeFiles/git2.dir/src/attr_file.c.o
[ 0%] Building C object CMakeFiles/git2.dir/src/blob.c.o
[ 1%] Building C object CMakeFiles/git2.dir/src/branch.c.o
[ 1%] Building C object CMakeFiles/git2.dir/src/buffer.c.o
[ 1%] Building C object CMakeFiles/git2.dir/src/cache.c.o
[ 2%] Building C object CMakeFiles/git2.dir/src/checkout.c.o
[ 2%] Building C object CMakeFiles/git2.dir/src/clone.c.o
[ 2%] Building C object CMakeFiles/git2.dir/src/commit.c.o
[ 3%] Building C object CMakeFiles/git2.dir/src/compress.c.o
[ 3%] Building C object CMakeFiles/git2.dir/src/config.c.o
[ 3%] Building C object CMakeFiles/git2.dir/src/config_cache.c.o
[ 3%] Building C object CMakeFiles/git2.dir/src/config_file.c.o
[ 4%] Building C object CMakeFiles/git2.dir/src/crlf.c.o
[ 4%] Building C object CMakeFiles/git2.dir/src/date.c.o
[ 4%] Building C object CMakeFiles/git2.dir/src/delta-apply.c.o
[ 5%] Building C object CMakeFiles/git2.dir/src/delta.c.o
[ 5%] Building C object CMakeFiles/git2.dir/src/diff.c.o
[ 5%] Building C object CMakeFiles/git2.dir/src/diff_output.c.o
[ 6%] Building C object CMakeFiles/git2.dir/src/diff_tform.c.o
[ 6%] Building C object CMakeFiles/git2.dir/src/errors.c.o
[ 6%] Building C object CMakeFiles/git2.dir/src/fetch.c.o
[ 6%] Building C object CMakeFiles/git2.dir/src/filebuf.c.o
[ 7%] Building C object CMakeFiles/git2.dir/src/fileops.c.o
[ 7%] Building C object CMakeFiles/git2.dir/src/filter.c.o
[ 7%] Building C object CMakeFiles/git2.dir/src/fnmatch.c.o
[ 8%] Building C object CMakeFiles/git2.dir/src/global.c.o
[ 8%] Building C object CMakeFiles/git2.dir/src/hash.c.o
[ 8%] Building C object CMakeFiles/git2.dir/src/ignore.c.o
[ 9%] Building C object CMakeFiles/git2.dir/src/index.c.o
[ 9%] Building C object CMakeFiles/git2.dir/src/indexer.c.o
[ 9%] Building C object CMakeFiles/git2.dir/src/iterator.c.o
[ 9%] Building C object CMakeFiles/git2.dir/src/merge.c.o
[ 10%] Building C object CMakeFiles/git2.dir/src/message.c.o
[ 10%] Building C object CMakeFiles/git2.dir/src/mwindow.c.o
[ 10%] Building C object CMakeFiles/git2.dir/src/netops.c.o
/tmp/php-git/libgit2/src/netops.c: In function 'verify_server_cert':
/tmp/php-git/libgit2/src/netops.c:269: error: storage size of 'addr6' isn't known
/tmp/php-git/libgit2/src/netops.c:269: warning: unused variable 'addr6'
*** [CMakeFiles/git2.dir/src/netops.c.o] Error code 1
Stop in /usr/tmp/php-git/libgit2/build.
*** [CMakeFiles/git2.dir/all] Error code 1
Stop in /usr/tmp/php-git/libgit2/build.
*** [all] Error code 1
Stop in /usr/tmp/php-git/libgit2/build.
Followed the build procedure in the README file.
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/git2.so' - /usr/lib/php5/20100525/git2.so: undefined symbol: git_tree_create_fromindex in Unknown on line 0
With PHP 5.4.4-14 on Debian Wheezy 64.
The "how to build" instructions in the readme file will probably work fine on 32bits machines, however compiling a static version of libgit2 to then compile a dynamic php module will not work (linker will complain about -fPIC).
Easy fix by replacining line
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DBUILD_CLAR=OFF ..
with:
cmake -DCMAKE_BUILD_TYPE=Debug -DBUILD_SHARED_LIBS=OFF -DBUILD_CLAR=OFF -DCMAKE_C_FLAGS=-fPIC ..
Hello,
After compiling and installing i have added the line 'extension=git2.so' at the end of php.ini then restarted apache.
If i run command: php -i | grep extension_dir
Result:
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20090626+lfs/git2.so' - /usr/lib/php5/20090626+lfs/git2.so: cannot open shared object file: No such file or directory in Unknown on line 0
Thanks
/tmp/php-git/repository.c:237:13: error: use of undeclared identifier 'GIT_SUCCESS'
if (ret == GIT_SUCCESS) {
^
/tmp/php-git/repository.c:313:124: error: use of undeclared identifier 'GIT_SUCCESS'
if (git_repository_discover(path_buffer,path_size,(const char *)start_path,(int)across_fs, (const char *)ceiling_dirs) == GIT_SUCCESS) {
^
/tmp/php-git/repository.c:341:36: error: use of undeclared identifier 'GIT_SUCCESS'
if (git_oid_fromstr(&id, hash) != GIT_SUCCESS) {
^
/tmp/php-git/repository.c:377:47: error: use of undeclared identifier 'GIT_SUCCESS'
if (git_oid_fromstrn(&id, hash, hash_len) != GIT_SUCCESS) {
^
SYSTEM: macOS X MAMP and PHP 5.4
I tried to compile php-git with latest git clone of libgit2, and it worked except for:
/home/james/workspace/php-git/src/reference_manager.c:246: error: too few arguments to function ‘git_reference_create_oid’
I had a quick dig around and it turns out in libgit2 a parameter has been added.
diff --git a/src/reference_manager.c b/src/reference_manager.c
index 2786998..beec6ce 100644
--- a/src/reference_manager.c
+++ b/src/reference_manager.c
@@ -243,7 +243,7 @@ PHP_METHOD(git_reference_manager, create)
}
git_reference *reference;
- int ret = git_reference_create_oid(&reference, this->repository, name, &id);
+ int ret = git_reference_create_oid(&reference, this->repository, name, &id, 0);
if(ret != GIT_SUCCESS){
zend_throw_exception_ex(spl_ce_InvalidArgumentException, 0 TSRMLS_CC,
"can't add reference");
This seemed to work and I got the php-git-sample app working - however I'm not experienced enough to know whether this "force" value should be 1 or 0...
I am getting a segmentation fault when calling Git\Tree\Entry::toObject(). It worked correctly before I moved from v0.2.1 tag to develop branch. Also I have libgit v0.11.0 installed.
Status: success
PHP Version: 5.5.6
Body:
=====================================================================
TEST RESULT SUMMARY
---------------------------------------------------------------------
Exts skipped : 0
Exts tested : 50
---------------------------------------------------------------------
Number of tests : 1 1
Tests skipped : 0 ( 0.0%) --------
Tests warned : 0 ( 0.0%) ( 0.0%)
Tests failed : 0 ( 0.0%) ( 0.0%)
Expected fail : 0 ( 0.0%) ( 0.0%)
Tests passed : 1 (100.0%) (100.0%)
---------------------------------------------------------------------
Time taken : 0 seconds
=====================================================================
================================================================================
BUILD ENVIRONMENT
================================================================================
OS:
Darwin - Darwin macbook.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Autoconf:
autoconf (GNU Autoconf) 2.69
Copyright (C) 2012 Free Software Foundation, Inc.
License GPLv3+/Autoconf: GNU GPL version 3 or later
<http://gnu.org/licenses/gpl.html>, <http://gnu.org/licenses/exceptions.html>
This is free software: you are free to change and redistribute it.
There is NO WARRANTY, to the extent permitted by law.
Written by David J. MacKenzie and Akim Demaille.
Bundled Libtool:
ltmain.sh (GNU libtool) 1.5.26 (1.1220.2.492 2008/01/30 06:40:56)
Copyright (C) 2008 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
System Libtool:
libtool (GNU libtool) 2.4.2
Written by Gordon Matzigkeit <[email protected]>, 1996
Copyright (C) 2011 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Compiler:
Apple LLVM version 5.1 (clang-503.0.40) (based on LLVM 3.4svn)
Target: x86_64-apple-darwin13.1.0
Thread model: posix
Bison:
bison (GNU Bison) 2.7
Written by Robert Corbett and Richard Stallman.
Copyright (C) 2012 Free Software Foundation, Inc.
This is free software; see the source for copying conditions. There is NO
warranty; not even for MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
Libraries:
User's E-mail:
================================================================================
PHPINFO
================================================================================
phpinfo()
PHP Version => 5.5.6
System => Darwin macbook.local 13.1.0 Darwin Kernel Version 13.1.0: Thu Jan 16 19:40:37 PST 2014; root:xnu-2422.90.20~2/RELEASE_X86_64 x86_64
Build Date => Jan 10 2014 00:17:21
Configure Command => './configure' '--with-config-file-path=/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc' '--with-config-file-scan-dir=/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d' '--prefix=/Users/chobie/.phpenv/versions/5.5.6-debug-zts' '--libexecdir=/Users/chobie/.phpenv/versions/5.5.6-debug-zts/libexec' '--without-pear' '--with-gd' '--enable-sockets' '--with-jpeg-dir=/usr' '--enable-exif' '--enable-zip' '--with-zlib' '--with-zlib-dir=/usr' '--with-kerberos' '--with-openssl' '--with-mcrypt=/usr' '--enable-soap' '--enable-xmlreader' '--with-xsl' '--with-curl=/usr' '--with-tidy' '--with-xmlrpc' '--enable-sysvsem' '--enable-sysvshm' '--enable-shmop' '--with-mysql=mysqlnd' '--with-mysqli=mysqlnd' '--with-pdo-mysql=mysqlnd' '--with-pdo-sqlite' '--enable-pcntl' '--enable-mbstring' '--enable-bcmath' '--enable-debug' '--enable-maintainer-zts' '--with-pear=/Users/chobie/.phpenv/versions/5.5.6-debug-zts/pear' '--with-libedit' '--with-png-dir=/usr/X11' '--enable-phpdbg' '--with-readline'
Server API => Command Line Interface
Virtual Directory Support => enabled
Configuration File (php.ini) Path => /Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc
Loaded Configuration File => /Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/php-cli.ini
Scan this dir for additional .ini files => /Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d
Additional .ini files parsed => /Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/changefinder.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/fluent.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/git2.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/mbstring.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/mecab.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/nanoirc.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/newchobits.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/protocolbuffers.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/pyrus.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/sundown.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/uv.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/xhprof.ini,
/Users/chobie/.phpenv/versions/5.5.6-debug-zts/etc/conf.d/yrmds.ini
PHP API => 20121113
PHP Extension => 20121212
Zend Extension => 220121212
Zend Extension Build => API220121212,TS,debug
PHP Extension Build => API20121212,TS,debug
Debug Build => yes
Thread Safety => enabled
Zend Signal Handling => disabled
Zend Memory Manager => enabled
Zend Multibyte Support => provided by mbstring
IPv6 Support => enabled
DTrace Support => disabled
Registered PHP Streams => https, ftps, compress.zlib, php, file, glob, data, http, ftp, phar, zip
Registered Stream Socket Transports => tcp, udp, unix, udg, ssl, sslv3, sslv2, tls
Registered Stream Filters => zlib.*, convert.iconv.*, mcrypt.*, mdecrypt.*, string.rot13, string.toupper, string.tolower, string.strip_tags, convert.*, consumed, dechunk
This program makes use of the Zend Scripting Language Engine:
Zend Engine v2.5.0, Copyright (c) 1998-2013 Zend Technologies
_______________________________________________________________________
Configuration
bcmath
BCMath support => enabled
Directive => Local Value => Master Value
bcmath.scale => 0 => 0
changefinder
PHP Change Finder Extension
Changefinder Support => enabled
Version => 0.1.0
Core
PHP Version => 5.5.6
Directive => Local Value => Master Value
allow_url_fopen => On => On
allow_url_include => Off => Off
always_populate_raw_post_data => Off => Off
arg_separator.input => & => &
arg_separator.output => & => &
asp_tags => Off => Off
auto_append_file => no value => no value
auto_globals_jit => On => On
auto_prepend_file => no value => no value
browscap => no value => no value
default_charset => no value => no value
default_mimetype => text/html => text/html
disable_classes => no value => no value
disable_functions => no value => no value
display_errors => STDERR => STDERR
display_startup_errors => Off => Off
doc_root => no value => no value
docref_ext => no value => no value
docref_root => no value => no value
enable_dl => Off => Off
enable_post_data_reading => On => On
error_append_string => no value => no value
error_log => no value => no value
error_prepend_string => no value => no value
error_reporting => 22527 => 22527
exit_on_timeout => Off => Off
expose_php => On => On
extension_dir => /Users/chobie/.phpenv/versions/5.5.6-debug-zts/lib/php/extensions/debug-zts-20121212 => /Users/chobie/.phpenv/versions/5.5.6-debug-zts/lib/php/extensions/debug-zts-20121212
file_uploads => On => On
highlight.comment => <font style="color: #FF8000">#FF8000</font> => <font style="color: #FF8000">#FF8000</font>
highlight.default => <font style="color: #0000BB">#0000BB</font> => <font style="color: #0000BB">#0000BB</font>
highlight.html => <font style="color: #000000">#000000</font> => <font style="color: #000000">#000000</font>
highlight.keyword => <font style="color: #007700">#007700</font> => <font style="color: #007700">#007700</font>
highlight.string => <font style="color: #DD0000">#DD0000</font> => <font style="color: #DD0000">#DD0000</font>
html_errors => Off => Off
ignore_repeated_errors => Off => Off
ignore_repeated_source => Off => Off
ignore_user_abort => Off => Off
implicit_flush => On => On
include_path => .::/Users/chobie/.phpenv/versions/5.5.6-debug-zts/share/pyrus/.pear/php:/Users/chobie/.phpenv/versions/5.5.6-debug-zts/share/pyrus/.pear/php => .::/Users/chobie/.phpenv/versions/5.5.6-debug-zts/share/pyrus/.pear/php:/Users/chobie/.phpenv/versions/5.5.6-debug-zts/share/pyrus/.pear/php
log_errors => On => On
log_errors_max_len => 1024 => 1024
mail.add_x_header => On => On
mail.force_extra_parameters => no value => no value
mail.log => no value => no value
max_execution_time => 0 => 0
max_file_uploads => 20 => 20
max_input_nesting_level => 64 => 64
max_input_time => -1 => -1
max_input_vars => 1000 => 1000
memory_limit => 128M => 128M
open_basedir => no value => no value
output_buffering => 0 => 0
output_handler => no value => no value
post_max_size => 8M => 8M
precision => 14 => 14
realpath_cache_size => 16K => 16K
realpath_cache_ttl => 120 => 120
register_argc_argv => On => On
report_memleaks => On => On
report_zend_debug => Off => Off
request_order => GP => GP
sendmail_from => no value => no value
sendmail_path => /usr/sbin/sendmail -t -i => /usr/sbin/sendmail -t -i
serialize_precision => 17 => 17
short_open_tag => Off => Off
SMTP => localhost => localhost
smtp_port => 25 => 25
sql.safe_mode => Off => Off
sys_temp_dir => no value => no value
track_errors => Off => Off
unserialize_callback_func => no value => no value
upload_max_filesize => 2M => 2M
upload_tmp_dir => no value => no value
user_dir => no value => no value
user_ini.cache_ttl => 300 => 300
user_ini.filename => .user.ini => .user.ini
variables_order => GPCS => GPCS
xmlrpc_error_number => 0 => 0
xmlrpc_errors => Off => Off
zend.detect_unicode => On => On
zend.enable_gc => On => On
zend.multibyte => Off => Off
zend.script_encoding => no value => no value
ctype
ctype functions => enabled
curl
cURL support => enabled
cURL Information => 7.30.0
Age => 3
Features
AsynchDNS => Yes
CharConv => No
Debug => No
GSS-Negotiate => Yes
IDN => No
IPv6 => Yes
krb4 => No
Largefile => Yes
libz => Yes
NTLM => Yes
NTLMWB => Yes
SPNEGO => No
SSL => Yes
SSPI => No
TLS-SRP => No
Protocols => dict, file, ftp, ftps, gopher, http, https, imap, imaps, ldap, ldaps, pop3, pop3s, rtsp, smtp, smtps, telnet, tftp
Host => x86_64-apple-darwin13.0
SSL Version => SecureTransport
ZLib Version => 1.2.5
date
date/time support => enabled
"Olson" Timezone Database Version => 2013.8
Timezone Database => internal
Default timezone => Asia/Tokyo
Directive => Local Value => Master Value
date.default_latitude => 31.7667 => 31.7667
date.default_longitude => 35.2333 => 35.2333
date.sunrise_zenith => 90.583333 => 90.583333
date.sunset_zenith => 90.583333 => 90.583333
date.timezone => Asia/Tokyo => Asia/Tokyo
dom
DOM/XML => enabled
DOM/XML API Version => 20031129
libxml Version => 2.9.0
HTML Support => enabled
XPath Support => enabled
XPointer Support => enabled
Schema Support => enabled
RelaxNG Support => enabled
ereg
Regex Library => Bundled library enabled
exif
EXIF Support => enabled
EXIF Version => 1.4 $Id$
Supported EXIF Version => 0220
Supported filetypes => JPEG,TIFF
Directive => Local Value => Master Value
exif.decode_jis_intel => JIS => JIS
exif.decode_jis_motorola => JIS => JIS
exif.decode_unicode_intel => UCS-2LE => UCS-2LE
exif.decode_unicode_motorola => UCS-2BE => UCS-2BE
exif.encode_jis => no value => no value
exif.encode_unicode => ISO-8859-15 => ISO-8859-15
fileinfo
fileinfo support => enabled
version => 1.0.5-dev
filter
Input Validation and Filtering => enabled
Revision => $Id: 12aebcf366f801ceeae618aefd4383fef24e701b $
Directive => Local Value => Master Value
filter.default => unsafe_raw => unsafe_raw
filter.default_flags => no value => no value
gd
GD Support => enabled
GD Version => bundled (2.1.0 compatible)
GIF Read Support => enabled
GIF Create Support => enabled
JPEG Support => enabled
libJPEG Version => 8
PNG Support => enabled
libPNG Version => 1.5.17
WBMP Support => enabled
XBM Support => enabled
Directive => Local Value => Master Value
gd.jpeg_ignore_warning => 0 => 0
git2
PHP Git2 Extension
Git2 Support => enabled
libgit2 version => 0.20.0
hash
hash support => enabled
Hashing Engines => md2 md4 md5 sha1 sha224 sha256 sha384 sha512 ripemd128 ripemd160 ripemd256 ripemd320 whirlpool tiger128,3 tiger160,3 tiger192,3 tiger128,4 tiger160,4 tiger192,4 snefru snefru256 gost adler32 crc32 crc32b fnv132 fnv164 joaat haval128,3 haval160,3 haval192,3 haval224,3 haval256,3 haval128,4 haval160,4 haval192,4 haval224,4 haval256,4 haval128,5 haval160,5 haval192,5 haval224,5 haval256,5
iconv
iconv support => enabled
iconv implementation => libiconv
iconv library version => 1.11
Directive => Local Value => Master Value
iconv.input_encoding => ISO-8859-1 => ISO-8859-1
iconv.internal_encoding => ISO-8859-1 => ISO-8859-1
iconv.output_encoding => ISO-8859-1 => ISO-8859-1
json
json support => enabled
json version => 1.2.1
libxml
libXML support => active
libXML Compiled Version => 2.9.0
libXML Loaded Version => 20900
libXML streams => enabled
mbstring
Multibyte Support => enabled
Multibyte string engine => libmbfl
HTTP input encoding translation => enabled
libmbfl version => 1.3.2
mbstring extension makes use of "streamable kanji code filter and converter", which is distributed under the GNU Lesser General Public License version 2.1.
Multibyte (japanese) regex support => enabled
Multibyte regex (oniguruma) backtrack check => On
Multibyte regex (oniguruma) version => 5.9.2
Directive => Local Value => Master Value
mbstring.detect_order => no value => no value
mbstring.encoding_translation => On => On
mbstring.func_overload => 0 => 0
mbstring.http_input => pass => pass
mbstring.http_output => pass => pass
mbstring.http_output_conv_mimetypes => ^(text/|application/xhtml\+xml) => ^(text/|application/xhtml\+xml)
mbstring.internal_encoding => UTF-8 => UTF-8
mbstring.language => neutral => neutral
mbstring.strict_detection => Off => Off
mbstring.substitute_character => no value => no value
mcrypt
mcrypt support => enabled
mcrypt_filter support => enabled
Version => 2.5.8
Api No => 20021217
Supported ciphers => cast-128 gost rijndael-128 twofish arcfour cast-256 loki97 rijndael-192 saferplus wake blowfish-compat des rijndael-256 serpent xtea blowfish enigma rc2 tripledes
Supported modes => cbc cfb ctr ecb ncfb nofb ofb stream
Directive => Local Value => Master Value
mcrypt.algorithms_dir => no value => no value
mcrypt.modes_dir => no value => no value
mecab
MeCab Support => enabled
Module Version => 0.5.0
Version Info => Compiled => Linked
MeCab Library => 0.996 => 0.996
Directive => Local Value => Master Value
mecab.default_dicdir => no value => no value
mecab.default_rcfile => no value => no value
mecab.default_userdic => no value => no value
mysql
MySQL Support => enabled
Active Persistent Links => 0
Active Links => 0
Client API version => mysqlnd 5.0.11-dev - 20120503 - $Id: 40933630edef551dfaca71298a83fad8d03d62d4 $
Directive => Local Value => Master Value
mysql.allow_local_infile => On => On
mysql.allow_persistent => On => On
mysql.connect_timeout => 60 => 60
mysql.default_host => no value => no value
mysql.default_password => no value => no value
mysql.default_port => no value => no value
mysql.default_socket => no value => no value
mysql.default_user => no value => no value
mysql.max_links => Unlimited => Unlimited
mysql.max_persistent => Unlimited => Unlimited
mysql.trace_mode => Off => Off
mysqli
MysqlI Support => enabled
Client API library version => mysqlnd 5.0.11-dev - 20120503 - $Id: 40933630edef551dfaca71298a83fad8d03d62d4 $
Active Persistent Links => 0
Inactive Persistent Links => 0
Active Links => 0
Directive => Local Value => Master Value
mysqli.allow_local_infile => On => On
mysqli.allow_persistent => On => On
mysqli.default_host => no value => no value
mysqli.default_port => 3306 => 3306
mysqli.default_pw => no value => no value
mysqli.default_socket => no value => no value
mysqli.default_user => no value => no value
mysqli.max_links => Unlimited => Unlimited
mysqli.max_persistent => Unlimited => Unlimited
mysqli.reconnect => Off => Off
mysqlnd
mysqlnd => enabled
Version => mysqlnd 5.0.11-dev - 20120503 - $Id: 40933630edef551dfaca71298a83fad8d03d62d4 $
Compression => supported
core SSL => supported
extended SSL => supported
Command buffer size => 4096
Read buffer size => 32768
Read timeout => 31536000
Collecting statistics => Yes
Collecting memory statistics => No
Tracing => n/a
Loaded plugins => mysqlnd,example,debug_trace,auth_plugin_mysql_native_password,auth_plugin_mysql_clear_password,auth_plugin_sha256_password
API Extensions => mysqli,pdo_mysql,mysql
mysqlnd statistics =>
bytes_sent => 0
bytes_received => 0
packets_sent => 0
packets_received => 0
protocol_overhead_in => 0
protocol_overhead_out => 0
bytes_received_ok_packet => 0
bytes_received_eof_packet => 0
bytes_received_rset_header_packet => 0
bytes_received_rset_field_meta_packet => 0
bytes_received_rset_row_packet => 0
bytes_received_prepare_response_packet => 0
bytes_received_change_user_packet => 0
packets_sent_command => 0
packets_received_ok => 0
packets_received_eof => 0
packets_received_rset_header => 0
packets_received_rset_field_meta => 0
packets_received_rset_row => 0
packets_received_prepare_response => 0
packets_received_change_user => 0
result_set_queries => 0
non_result_set_queries => 0
no_index_used => 0
bad_index_used => 0
slow_queries => 0
buffered_sets => 0
unbuffered_sets => 0
ps_buffered_sets => 0
ps_unbuffered_sets => 0
flushed_normal_sets => 0
flushed_ps_sets => 0
ps_prepared_never_executed => 0
ps_prepared_once_executed => 0
rows_fetched_from_server_normal => 0
rows_fetched_from_server_ps => 0
rows_buffered_from_client_normal => 0
rows_buffered_from_client_ps => 0
rows_fetched_from_client_normal_buffered => 0
rows_fetched_from_client_normal_unbuffered => 0
rows_fetched_from_client_ps_buffered => 0
rows_fetched_from_client_ps_unbuffered => 0
rows_fetched_from_client_ps_cursor => 0
rows_affected_normal => 0
rows_affected_ps => 0
rows_skipped_normal => 0
rows_skipped_ps => 0
copy_on_write_saved => 0
copy_on_write_performed => 0
command_buffer_too_small => 0
connect_success => 0
connect_failure => 0
connection_reused => 0
reconnect => 0
pconnect_success => 0
active_connections => 0
active_persistent_connections => 0
explicit_close => 0
implicit_close => 0
disconnect_close => 0
in_middle_of_command_close => 0
explicit_free_result => 0
implicit_free_result => 0
explicit_stmt_close => 0
implicit_stmt_close => 0
mem_emalloc_count => 0
mem_emalloc_amount => 0
mem_ecalloc_count => 0
mem_ecalloc_amount => 0
mem_erealloc_count => 0
mem_erealloc_amount => 0
mem_efree_count => 0
mem_efree_amount => 0
mem_malloc_count => 0
mem_malloc_amount => 0
mem_calloc_count => 0
mem_calloc_amount => 0
mem_realloc_count => 0
mem_realloc_amount => 0
mem_free_count => 0
mem_free_amount => 0
mem_estrndup_count => 0
mem_strndup_count => 0
mem_estndup_count => 0
mem_strdup_count => 0
proto_text_fetched_null => 0
proto_text_fetched_bit => 0
proto_text_fetched_tinyint => 0
proto_text_fetched_short => 0
proto_text_fetched_int24 => 0
proto_text_fetched_int => 0
proto_text_fetched_bigint => 0
proto_text_fetched_decimal => 0
proto_text_fetched_float => 0
proto_text_fetched_double => 0
proto_text_fetched_date => 0
proto_text_fetched_year => 0
proto_text_fetched_time => 0
proto_text_fetched_datetime => 0
proto_text_fetched_timestamp => 0
proto_text_fetched_string => 0
proto_text_fetched_blob => 0
proto_text_fetched_enum => 0
proto_text_fetched_set => 0
proto_text_fetched_geometry => 0
proto_text_fetched_other => 0
proto_binary_fetched_null => 0
proto_binary_fetched_bit => 0
proto_binary_fetched_tinyint => 0
proto_binary_fetched_short => 0
proto_binary_fetched_int24 => 0
proto_binary_fetched_int => 0
proto_binary_fetched_bigint => 0
proto_binary_fetched_decimal => 0
proto_binary_fetched_float => 0
proto_binary_fetched_double => 0
proto_binary_fetched_date => 0
proto_binary_fetched_year => 0
proto_binary_fetched_time => 0
proto_binary_fetched_datetime => 0
proto_binary_fetched_timestamp => 0
proto_binary_fetched_string => 0
proto_binary_fetched_blob => 0
proto_binary_fetched_enum => 0
proto_binary_fetched_set => 0
proto_binary_fetched_geometry => 0
proto_binary_fetched_other => 0
init_command_executed_count => 0
init_command_failed_count => 0
com_quit => 0
com_init_db => 0
com_query => 0
com_field_list => 0
com_create_db => 0
com_drop_db => 0
com_refresh => 0
com_shutdown => 0
com_statistics => 0
com_process_info => 0
com_connect => 0
com_process_kill => 0
com_debug => 0
com_ping => 0
com_time => 0
com_delayed_insert => 0
com_change_user => 0
com_binlog_dump => 0
com_table_dump => 0
com_connect_out => 0
com_register_slave => 0
com_stmt_prepare => 0
com_stmt_execute => 0
com_stmt_send_long_data => 0
com_stmt_close => 0
com_stmt_reset => 0
com_stmt_set_option => 0
com_stmt_fetch => 0
com_deamon => 0
bytes_received_real_data_normal => 0
bytes_received_real_data_ps => 0
example statistics =>
stat1 => 0
stat2 => 0
nanoirc
PHP Nanoirc parser Extension
openssl
OpenSSL support => enabled
OpenSSL Library Version => OpenSSL 0.9.8y 5 Feb 2013
OpenSSL Header Version => OpenSSL 0.9.8y 5 Feb 2013
pcntl
pcntl support => enabled
pcre
PCRE (Perl Compatible Regular Expressions) Support => enabled
PCRE Library Version => 8.32 2012-11-30
Directive => Local Value => Master Value
pcre.backtrack_limit => 1000000 => 1000000
pcre.recursion_limit => 100000 => 100000
PDO
PDO support => enabled
PDO drivers => mysql, sqlite
pdo_mysql
PDO Driver for MySQL => enabled
Client API version => mysqlnd 5.0.11-dev - 20120503 - $Id: 40933630edef551dfaca71298a83fad8d03d62d4 $
Directive => Local Value => Master Value
pdo_mysql.debug => no value => no value
pdo_mysql.default_socket => /tmp/mysql.sock => /tmp/mysql.sock
pdo_sqlite
PDO Driver for SQLite 3.x => enabled
SQLite Library => 3.7.7.1
Phar
Phar: PHP Archive support => enabled
Phar EXT version => 2.0.2
Phar API version => 1.1.1
SVN revision => $Id: 13b3d6428e324aa0041694ace9992641a0f48ed8 $
Phar-based phar archives => enabled
Tar-based phar archives => enabled
ZIP-based phar archives => enabled
gzip compression => enabled
bzip2 compression => disabled (install pecl/bz2)
Native OpenSSL support => enabled
Phar based on pear/PHP_Archive, original concept by Davey Shafik.
Phar fully realized by Gregory Beaver and Marcus Boerger.
Portions of tar implementation Copyright (c) 2003-2009 Tim Kientzle.
Directive => Local Value => Master Value
phar.cache_list => no value => no value
phar.readonly => Off => Off
phar.require_hash => On => On
posix
Revision => $Id: 32db6705f5b617967a546be3114e178a4138c1ca $
protocolbuffers
PHP Protocol Buffers Extension
Protocol Buffers Support => enabled
Version => 0.1.0
readline
Readline Support => enabled
Readline library => EditLine wrapper
Directive => Local Value => Master Value
cli.pager => no value => no value
cli.prompt => \b \> => \b \>
Reflection
Reflection => enabled
Version => $Id: b1f7484f243ca1baeb64560b43b1927e7279dc80 $
session
Session Support => enabled
Registered save handlers => files user
Registered serializer handlers => php_serialize php php_binary
Directive => Local Value => Master Value
session.auto_start => Off => Off
session.cache_expire => 180 => 180
session.cache_limiter => nocache => nocache
session.cookie_domain => no value => no value
session.cookie_httponly => Off => Off
session.cookie_lifetime => 0 => 0
session.cookie_path => / => /
session.cookie_secure => Off => Off
session.entropy_file => /dev/urandom => /dev/urandom
session.entropy_length => 32 => 32
session.gc_divisor => 1000 => 1000
session.gc_maxlifetime => 1440 => 1440
session.gc_probability => 1 => 1
session.hash_bits_per_character => 5 => 5
session.hash_function => 0 => 0
session.name => PHPSESSID => PHPSESSID
session.referer_check => no value => no value
session.save_handler => files => files
session.save_path => no value => no value
session.serialize_handler => php => php
session.upload_progress.cleanup => On => On
session.upload_progress.enabled => On => On
session.upload_progress.freq => 1% => 1%
session.upload_progress.min_freq => 1 => 1
session.upload_progress.name => PHP_SESSION_UPLOAD_PROGRESS => PHP_SESSION_UPLOAD_PROGRESS
session.upload_progress.prefix => upload_progress_ => upload_progress_
session.use_cookies => On => On
session.use_only_cookies => On => On
session.use_strict_mode => Off => Off
session.use_trans_sid => 0 => 0
shmop
shmop support => enabled
SimpleXML
Simplexml support => enabled
Revision => $Id: eba46b909103648e33046d39de5d9de73bc28162 $
Schema support => enabled
soap
Soap Client => enabled
Soap Server => enabled
Directive => Local Value => Master Value
soap.wsdl_cache => 1 => 1
soap.wsdl_cache_dir => /tmp => /tmp
soap.wsdl_cache_enabled => 1 => 1
soap.wsdl_cache_limit => 5 => 5
soap.wsdl_cache_ttl => 86400 => 86400
sockets
Sockets Support => enabled
SPL
SPL support => enabled
Interfaces => Countable, OuterIterator, RecursiveIterator, SeekableIterator, SplObserver, SplSubject
Classes => AppendIterator, ArrayIterator, ArrayObject, BadFunctionCallException, BadMethodCallException, CachingIterator, CallbackFilterIterator, DirectoryIterator, DomainException, EmptyIterator, FilesystemIterator, FilterIterator, GlobIterator, InfiniteIterator, InvalidArgumentException, IteratorIterator, LengthException, LimitIterator, LogicException, MultipleIterator, NoRewindIterator, OutOfBoundsException, OutOfRangeException, OverflowException, ParentIterator, RangeException, RecursiveArrayIterator, RecursiveCachingIterator, RecursiveCallbackFilterIterator, RecursiveDirectoryIterator, RecursiveFilterIterator, RecursiveIteratorIterator, RecursiveRegexIterator, RecursiveTreeIterator, RegexIterator, RuntimeException, SplDoublyLinkedList, SplFileInfo, SplFileObject, SplFixedArray, SplHeap, SplMinHeap, SplMaxHeap, SplObjectStorage, SplPriorityQueue, SplQueue, SplStack, SplTempFileObject, UnderflowException, UnexpectedValueException
sqlite3
SQLite3 support => enabled
SQLite3 module version => 0.7-dev
SQLite Library => 3.7.7.1
Directive => Local Value => Master Value
sqlite3.extension_dir => no value => no value
standard
Dynamic Library Support => enabled
Path to sendmail => /usr/sbin/sendmail -t -i
Directive => Local Value => Master Value
assert.active => 1 => 1
assert.bail => 0 => 0
assert.callback => no value => no value
assert.quiet_eval => 0 => 0
assert.warning => 1 => 1
auto_detect_line_endings => 0 => 0
default_socket_timeout => 60 => 60
from => no value => no value
url_rewriter.tags => a=href,area=href,frame=src,input=src,form=fakeentry => a=href,area=href,frame=src,input=src,form=fakeentry
user_agent => no value => no value
sundown
I get the following error when calling $tree->getEntryByName().
"symbol lookup error: /usr/lib/php/modules/git2.so: undefined symbol: git_oid_tostr"
Can you please fix ?
Ubuntu 13.10, PHP 5.4.24 (build myself) or PHP 5.5.3(Ubuntu's package)
Some of the error messages:
In file included from /home/jaya/src/gitrepo/php-git-function/php_git2.h:36:0,
from /home/jaya/src/gitrepo/php-git-function/reference.c:1:
/opt/apache22/php/5.4/include/php/main/php.h:268:15: warning: redundant redeclaration of ‘environ’ [-Wredundant-decls]
extern char **environ;
^
In file included from /opt/apache22/php/5.4/include/php/main/php.h:166:0,
from /home/jaya/src/gitrepo/php-git-function/php_git2.h:36,
from /home/jaya/src/gitrepo/php-git-function/reference.c:1:
/usr/include/unistd.h:545:15: note: previous declaration of ‘environ’ was here
extern char **environ;
^
In file included from /opt/apache22/php/5.4/include/php/main/php.h:38:0,
from /home/jaya/src/gitrepo/php-git-function/php_git2.h:36,
from /home/jaya/src/gitrepo/php-git-function/reference.c:1:
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:65:23: warning: redundant redeclaration of ‘zif_clearstatcache’ [-Wredundant-decls]
#define ZEND_FN(name) zif_##name
^
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:67:41: note: in definition of macro ‘ZEND_NAMED_FUNCTION’
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
^
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:68:52: note: in expansion of macro ‘ZEND_FN’
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
^
/opt/apache22/php/5.4/include/php/main/php.h:345:24: note: in expansion of macro ‘ZEND_FUNCTION’
#define PHP_FUNCTION ZEND_FUNCTION
^
/opt/apache22/php/5.4/include/php/ext/standard/php_filestat.h:62:1: note: in expansion of macro ‘PHP_FUNCTION’
PHP_FUNCTION(clearstatcache);
^
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:65:23: note: previous declaration of ‘zif_clearstatcache’ was here
#define ZEND_FN(name) zif_##name
^
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:67:41: note: in definition of macro ‘ZEND_NAMED_FUNCTION’
#define ZEND_NAMED_FUNCTION(name) void name(INTERNAL_FUNCTION_PARAMETERS)
^
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:68:52: note: in expansion of macro ‘ZEND_FN’
#define ZEND_FUNCTION(name) ZEND_NAMED_FUNCTION(ZEND_FN(name))
^
/opt/apache22/php/5.4/include/php/main/php.h:345:24: note: in expansion of macro ‘ZEND_FUNCTION’
#define PHP_FUNCTION ZEND_FUNCTION
^
/opt/apache22/php/5.4/include/php/ext/standard/php_filestat.h:29:1: note: in expansion of macro ‘PHP_FUNCTION’
PHP_FUNCTION(clearstatcache);
^
/home/jaya/src/gitrepo/php-git-function/reference.c: In function ‘zif_git_reference_target_peel’:
/home/jaya/src/gitrepo/php-git-function/reference.c:233:6: warning: assignment discards ‘const’ qualifier from pointer target type [enabled by default]
oid = git_reference_target_peel(PHP_GIT2_V(_ref, reference));
^
/home/jaya/src/gitrepo/php-git-function/reference.c: In function ‘zif_git_reference_type’:
/home/jaya/src/gitrepo/php-git-function/reference.c:272:9: error: incompatible types when assigning to type ‘enum git_ref_t *’ from type ‘git_ref_t’
result = git_reference_type(PHP_GIT2_V(_ref, reference));
^
In file included from /opt/apache22/php/5.4/include/php/main/php.h:38:0,
from /home/jaya/src/gitrepo/php-git-function/php_git2.h:36,
from /home/jaya/src/gitrepo/php-git-function/reference.c:1:
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:560:17: warning: assignment makes integer from pointer without a cast [enabled by default]
Z_LVAL_P(__z) = l; \
^
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:616:29: note: in expansion of macro ‘ZVAL_LONG’
#define RETVAL_LONG(l) ZVAL_LONG(return_value, l)
^
/opt/apache22/php/5.4/include/php/Zend/zend_API.h:628:31: note: in expansion of macro ‘RETVAL_LONG’
#define RETURN_LONG(l) { RETVAL_LONG(l); return; }
^
/home/jaya/src/gitrepo/php-git-function/reference.c:273:2: note: in expansion of macro ‘RETURN_LONG’
RETURN_LONG(result);
^
make: *** [reference.lo] Error 1
Been trying on develop
and functions
, got the same error message
Hey
I tried out the new diff feature on the jquery repo and it's erring out.
PHP Test code is below
gdb php output
#1 0x000000010190211b in zim_git2_repository_diff (ht=<value temporarily unavailable, due to optimizations>, return_value=0x101f6f938, return_value_ptr=0x0, this_ptr=<value temporarily unavailable, due to optimizations>, return_value_used=3) at repository.c:572
__s = 0x0
new = (zval *) 0x101f6aab0
new = (zval *) 0x101f6aab0
new = (zval *) 0x101f6aab0
new = (zval *) 0x101f6aab0
new = (zval *) 0x101f6aab0
new = (zval *) 0x101f6aab0
old = (zval *) 0x101f6a530
list = (git_diff_list *) 0x101bcb0c0
old = (zval *) 0x101f6a530
old = (zval *) 0x101f6a530
old = (zval *) 0x101f6a530
old = (zval *) 0x101f6a530
old = (zval *) 0x101f6a530
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
list = (git_diff_list *) 0x101bcb0c0
string = {
c = 0x0,
len = 0,
a = 0
}
Seems to be a problem with the strlen function in the printer. Not sure if it's a problem because there is nothing to print or something else. It may also be a problem with RETVAL_STRING, as it doesn't look right. But then again what do I know lol
This is not an issue but rather a question.
How would you perform a git log master..foobar
with php-git (ie. display all commits on a foobar
branch which are not on the master
branch)?
It's quite easy to do a git log
with the Git2\Walker
, but is there a simple way to know if a commit belongs to another branch in order to not display it. I mean, can we do this without traverse the master branch and store all commits in a hash table (which can be performance killer depending on the size of the tree).
Hi there,
I am trying to get php-git extension loaded into php (5.3.18, 5.3.20) on Amazon Linux (Amazon Linux AMI release 2012.09). It does build correctly, git2.so is installed into /usr/lib64/php/modules/git2.so and can be seen by php.
Here is the error message I get with extension=git2.so enabled:
$ php
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib64/php/modules/git2.so' - /usr/lib64/php/modules/git2.so: undefined symbol: git_index_get in Unknown on line 0
I have followed steps from README. What other information could I provide you to aid search for solution?
Kind regards,
Kamil
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/git2.so' - /usr/lib/php5/20100525/git2.so: undefined symbol: git_tree_create_fromindex in Unknown on line 0
Apache2, I added an ini file in / etc/php5/apache2/conf.d/git2.ini.
Apache2 chage what file (phpinfo ()), but the library is not loaded.
I can not understand why.
I followed this procedure:
git clone https://github.com/libgit2/php-git.git --recursive
cd libgit2
mkdir build && cd build
cmake ..
cmake -DBUILD_SHARED_LIBS=OFF -build .
make
cd ../../
phpize
./configure
make
make install
sudo make install
php --re git2
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php5/20100525/git2.so' - /usr/lib/php5/20100525/git2.so: undefined symbol: git_tree_create_fromindex in Unknown on line 0
Exception: Extension git2 does not exist
Hi!
I need to commit all files in work_dir like "git commit -a". I can't get it from docs.
And in readme.md its like:
$bld = new Git2\TreeBuilder();
$bld->insert(new Git2\TreeEntry(array(
"name" => "README.txt",
"oid" => "63542fbea05732b78711479a31557bd1b0aa2116",
"attributes" => octdec('100644'),
)));
$tree = $bld->write($repo);
How can I get this oid ? It doesnt work like
$repo->hash("file-path")
tried to find out what (int type) is,
api snippet -> string $odb->hash(string contents, int type)
found definition here http://libgit2.github.com/libgit2/#HEAD/type/git_otype
Please, take a look at my reported issue a few weeks ago. I want to be able to do this in any way possible. Can php-git help me with this?
Thanks!
Hi , I need to create a new branch like fork on github with php , is there any api can solve it?thx
I try compile extension but have this error and i don't know how fix it.
Thx for help
→ make
/bin/bash /home/prskavecl/Sites/php-git/src/libtool --mode=compile cc -I. -I/home/prskavecl/Sites/php-git/src -DPHP_ATOM_INC -I/home/prskavecl/Sites/php-git/src/include -I/home/prskavecl/Sites/php-git/src/main -I/home/prskavecl/Sites/php-git/src -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/prskavecl/Sites/php-git/src/php_git.c -o php_git.lo
libtool: compile: cc -I. -I/home/prskavecl/Sites/php-git/src -DPHP_ATOM_INC -I/home/prskavecl/Sites/php-git/src/include -I/home/prskavecl/Sites/php-git/src/main -I/home/prskavecl/Sites/php-git/src -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -DHAVE_CONFIG_H -g -O2 -c /home/prskavecl/Sites/php-git/src/php_git.c -fPIC -DPIC -o .libs/php_git.o
In file included from /home/prskavecl/Sites/php-git/src/php_git.c:25:
/home/prskavecl/Sites/php-git/src/php_git.h:123: error: expected specifier-qualifier-list before ‘git_rawobj’
make: *** [php_git.lo] Error 1
Hey there,
up-to-date debian, building against newest libgit2 ;)
According to the code from libgit/include/git2/errors.h the constants should be changed to GIT_OK and so on? defining "GIT_OLD_ERRORS" would be fine for the moment, too. Just had a read quick view on that.
root@ed:/php-git# make/php-git#
/bin/bash /root/php-git/libtool --mode=compile cc -I. -I/root/php-git -DPHP_ATOM_INC -I/root/php-git/include -I/root/php-git/main -I/root/php-git -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /root/php-git/repository.c -o repository.lo
libtool: compile: cc -I. -I/root/php-git -DPHP_ATOM_INC -I/root/php-git/include -I/root/php-git/main -I/root/php-git -I/usr/include/php5 -I/usr/include/php5/main -I/usr/include/php5/TSRM -I/usr/include/php5/Zend -I/usr/include/php5/ext -I/usr/include/php5/ext/date/lib -D_LARGEFILE_SOURCE -D_FILE_OFFSET_BITS=64 -DHAVE_CONFIG_H -g -O2 -c /root/php-git/repository.c -fPIC -DPIC -o .libs/repository.o
/root/php-git/repository.c: In function ‘php_git2_repository_initialize’:
/root/php-git/repository.c:98: warning: passing argument 4 of ‘add_property_string_ex’ discards qualifiers from pointer target type
/usr/include/php5/Zend/zend_API.h:413: note: expected ‘char ’ but argument is of type ‘const char *’
/root/php-git/repository.c: In function ‘zim_git2_repository_init’:
/root/php-git/repository.c:237: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/root/php-git/repository.c:237: error: (Each undeclared identifier is reported only once
/root/php-git/repository.c:237: error: for each function it appears in.)
/root/php-git/repository.c: In function ‘zim_git2_repository_discover’:
/root/php-git/repository.c:313: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/root/php-git/repository.c: In function ‘zim_git2_repository_exists’:
/root/php-git/repository.c:341: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/root/php-git/repository.c: In function ‘zim_git2_repository_lookup’:
/root/php-git/repository.c:377: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
make: ** [repository.lo] Error 1
root@ed:
test
libgit2 @ eddc1f1
it looked for a long time not update
i hope update the libgit2 to newest version
@chobie can you do this?
[root@localhost ~]# php -i | grep extension_dir
PHP Warning: PHP Startup: Unable to load dynamic library '/usr/lib/php/modules/git2.so' - /usr/lib/php/modules/git2.so: cannot open shared object file: No such file or directory in Unknown on line 0
PHP Warning: PHP Startup: mcrypt: Unable to initialize module
Module compiled with module API=20050922, debug=0, thread-safety=0
PHP compiled with module API=20060613, debug=0, thread-safety=0
These options need to match
in Unknown on line 0
extension_dir => /usr/lib/php/modules => /usr/lib/php/modules
[root@localhost ~]#
calling $commit->getTree on a valid commit object results in the following error.
Fatal error: Git\Commit::getTree(): specified tree not found.
Yet when I dump the commit object I see
["tree":protected]=> string(40) "765cfd1f3d91010d5e45d2af3a40a6a7eb4f7378"
For some reason I am getting a segmentation fault whenever I call getName() for the Git\Reference Object.
Hey,
I'm getting a single fault now when I try to do the following, which used to work.
$repo = new Git2\Repository('/tmp/jquery.git');
$sha = \Git2\Reference::lookup($repo,"refs/heads/master");
$ref = $sha->resolve();
$commit = $repo->lookup($ref->getTarget());
if ($commit instanceof Git2\Tag) {
$commit = $commit->getTarget();
}
$tree = $commit->getTree();
$subtree = $tree->getSubTree('/src/');
foreach($tree as $oid => $entry) {
print "<pre><br>";
print $entry->name;
print " - ".$oid;
var_dump($entry->isTree());
var_dump($entry->isSubmodule());
var_dump($repo->lookup($oid)); <-- This line
}
Upon removing the var_dump($repo->lookup($oid)); it begins working again.
Btw I am using a git clone --bare jquery repo
gdb backtrace
Program received signal EXC_BAD_ACCESS, Could not access memory.
Reason: KERN_INVALID_ADDRESS at address: 0x0000000000000040
0x000000010193a3c3 in git_object_type (obj=0x20) at object.c:260
260 return obj->type;
Regards,
Followed the readme installation guide, stuck on the "make" command for php-git.
It configured without a problem, however make fails.
[...]
creating libtool
appending configuration tag "CXX" to libtool
configure: creating ./config.status
config.status: creating config.h
paulpeelen:php-git paulp$ make
/bin/sh /Users/paulp/tmp/php-git/libtool --mode=compile cc -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -I/Users/paulp/tmp/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/paulp/tmp/php-git/git2.c -o git2.lo
mkdir .libs
cc -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -I/Users/paulp/tmp/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/paulp/tmp/php-git/git2.c -fno-common -DPIC -o .libs/git2.o
In file included from /Users/paulp/tmp/php-git/git2.c:25:
./php_git2.h:280:2: warning: implicit declaration of function 'git_oid_tostr' is invalid in C99 [-Wimplicit-function-declaration]
git_oid_tostr(buf,GIT_OID_HEXSZ+1,oid);
^
./php_git2.h:284:43: warning: implicit declaration of function 'git_tree_entry_filemode' is invalid in C99 [-Wimplicit-function-declaration]
add_property_long(*object, "attributes", git_tree_entry_filemode(entry));
^
/opt/local/include/php/Zend/zend_API.h:419:98: note: expanded from macro 'add_property_long'
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
^
In file included from /Users/paulp/tmp/php-git/git2.c:25:
./php_git2.h:296:54: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
add_property_string_ex(tmp, "path", sizeof("path"), entry->path, 1 TSRMLS_CC);
^~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:415:85: note: passing argument to parameter 'str' here
ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
^
In file included from /Users/paulp/tmp/php-git/git2.c:25:
./php_git2.h:322:68: warning: implicit declaration of function 'giterr_last' is invalid in C99 [-Wimplicit-function-declaration]
zend_throw_exception_ex(NULL, 0 TSRMLS_CC,"%d\n(error code %d)", giterr_last(), errorcode);
^
./php_git2.h:323:3: warning: implicit declaration of function 'giterr_clear' is invalid in C99 [-Wimplicit-function-declaration]
giterr_clear();
^
/Users/paulp/tmp/php-git/git2.c:146:62: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
add_property_stringl_ex(m_entry, "name", sizeof("name"), (const char *)entry_name, strlen(entry_name), 1 TSRMLS_CC);
^~~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:416:87: note: passing argument to parameter 'str' here
ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
^
/Users/paulp/tmp/php-git/git2.c:147:60: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
add_property_stringl_ex(m_entry, "oid", sizeof("oid"), (const char *)entry_oid, strlen(entry_oid), 1 TSRMLS_CC);
^~~~~~~~~~~~~~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:416:87: note: passing argument to parameter 'str' here
ZEND_API int add_property_stringl_ex(zval *arg, const char *key, uint key_len, char *str, uint length, int duplicate TSRMLS_DC);
^
/Users/paulp/tmp/php-git/git2.c:251:2: warning: implicit declaration of function 'git_threads_init' is invalid in C99 [-Wimplicit-function-declaration]
git_threads_init();
^
/Users/paulp/tmp/php-git/git2.c:258:2: warning: implicit declaration of function 'git_threads_shutdown' is invalid in C99 [-Wimplicit-function-declaration]
git_threads_shutdown();
^
9 warnings generated.
/bin/sh /Users/paulp/tmp/php-git/libtool --mode=compile cc -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -I/Users/paulp/tmp/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/paulp/tmp/php-git/repository.c -o repository.lo
cc -I. -I/Users/paulp/tmp/php-git -DPHP_ATOM_INC -I/Users/paulp/tmp/php-git/include -I/Users/paulp/tmp/php-git/main -I/Users/paulp/tmp/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -I/Users/paulp/tmp/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/paulp/tmp/php-git/repository.c -fno-common -DPIC -o .libs/repository.o
In file included from /Users/paulp/tmp/php-git/repository.c:25:
./php_git2.h:280:2: warning: implicit declaration of function 'git_oid_tostr' is invalid in C99 [-Wimplicit-function-declaration]
git_oid_tostr(buf,GIT_OID_HEXSZ+1,oid);
^
./php_git2.h:284:43: warning: implicit declaration of function 'git_tree_entry_filemode' is invalid in C99 [-Wimplicit-function-declaration]
add_property_long(*object, "attributes", git_tree_entry_filemode(entry));
^
/opt/local/include/php/Zend/zend_API.h:419:98: note: expanded from macro 'add_property_long'
#define add_property_long(__arg, __key, __n) add_property_long_ex(__arg, __key, strlen(__key)+1, __n TSRMLS_CC)
^
In file included from /Users/paulp/tmp/php-git/repository.c:25:
./php_git2.h:296:54: warning: passing 'const char *' to parameter of type 'char *' discards qualifiers [-Wincompatible-pointer-types]
add_property_string_ex(tmp, "path", sizeof("path"), entry->path, 1 TSRMLS_CC);
^~~~~~~~~~~
/opt/local/include/php/Zend/zend_API.h:415:85: note: passing argument to parameter 'str' here
ZEND_API int add_property_string_ex(zval *arg, const char *key, uint key_len, char *str, int duplicate TSRMLS_DC);
^
In file included from /Users/paulp/tmp/php-git/repository.c:25:
./php_git2.h:322:68: warning: implicit declaration of function 'giterr_last' is invalid in C99 [-Wimplicit-function-declaration]
zend_throw_exception_ex(NULL, 0 TSRMLS_CC,"%d\n(error code %d)", giterr_last(), errorcode);
^
./php_git2.h:323:3: warning: implicit declaration of function 'giterr_clear' is invalid in C99 [-Wimplicit-function-declaration]
giterr_clear();
^
/Users/paulp/tmp/php-git/repository.c:104:2: warning: implicit declaration of function 'git_repository_odb' is invalid in C99 [-Wimplicit-function-declaration]
git_repository_odb(&m_odb->odb,repository);
^
/Users/paulp/tmp/php-git/repository.c:106:68: error: too few arguments to function call, expected 2, have 1
add_property_string(object, "path", git_repository_path(repository),1);
~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~^~~~
/opt/local/include/php/Zend/zend_API.h:424:117: note: expanded from macro 'add_property_string'
#define add_property_string(__arg, __key, __str, __duplicate) add_property_string_ex(__arg, __key, strlen(__key)+1, __str, __duplicate TSRMLS_CC)
^
/opt/local/include/git2/repository.h:282:1: note: 'git_repository_path' declared here
GIT_EXTERN(const char *) git_repository_path(git_repository *repo, git_repository_pathid id);
^
/opt/local/include/git2/common.h:44:27: note: expanded from macro 'GIT_EXTERN'
# define GIT_EXTERN(type) extern \
^
/Users/paulp/tmp/php-git/repository.c:190:54: error: too few arguments to function call, expected 2, have 1
path = git_repository_path(m_repository->repository);
~~~~~~~~~~~~~~~~~~~ ^
/opt/local/include/git2/repository.h:282:1: note: 'git_repository_path' declared here
GIT_EXTERN(const char *) git_repository_path(git_repository *repo, git_repository_pathid id);
^
/opt/local/include/git2/common.h:44:27: note: expanded from macro 'GIT_EXTERN'
# define GIT_EXTERN(type) extern \
^
/Users/paulp/tmp/php-git/repository.c:213:10: warning: implicit declaration of function 'git_repository_workdir' is invalid in C99 [-Wimplicit-function-declaration]
path = git_repository_workdir(m_repository->repository);
^
/Users/paulp/tmp/php-git/repository.c:213:8: warning: incompatible integer to pointer conversion assigning to 'const char *' from 'int';
path = git_repository_workdir(m_repository->repository);
^ ~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
/Users/paulp/tmp/php-git/repository.c:242:13: error: use of undeclared identifier 'GIT_OK'
if (ret == GIT_OK) {
^
/Users/paulp/tmp/php-git/repository.c:316:124: error: use of undeclared identifier 'GIT_OK'
if (git_repository_discover(path_buffer,path_size,(const char *)start_path,(int)across_fs, (const char *)ceiling_dirs) == GIT_OK) {
^
/Users/paulp/tmp/php-git/repository.c:344:36: error: use of undeclared identifier 'GIT_OK'
if (git_oid_fromstr(&id, hash) != GIT_OK) {
^
/Users/paulp/tmp/php-git/repository.c:374:49: error: use of undeclared identifier 'GIT_OK'
if (git_oid_fromstrn(&one_id, one, one_len) != GIT_OK) {
^
/Users/paulp/tmp/php-git/repository.c:378:49: error: use of undeclared identifier 'GIT_OK'
if (git_oid_fromstrn(&two_id, two, two_len) != GIT_OK) {
^
/Users/paulp/tmp/php-git/repository.c:382:10: warning: implicit declaration of function 'git_merge_base' is invalid in C99 [-Wimplicit-function-declaration]
error = git_merge_base(&out, m_repository->repository, &one_id, &two_id);
^
/Users/paulp/tmp/php-git/repository.c:383:15: error: use of undeclared identifier 'GIT_OK'
if (error == GIT_OK) {
^
/Users/paulp/tmp/php-git/repository.c:418:47: error: use of undeclared identifier 'GIT_OK'
if (git_oid_fromstrn(&id, hash, hash_len) != GIT_OK) {
^
/Users/paulp/tmp/php-git/repository.c:550:9: warning: macro is not used [-Wunused-macros]
#define lookup php_lookup
^
10 warnings and 9 errors generated.
make: *** [repository.lo] Error 1
How can I resolve this issue?
I'm getting the following compile error on kubuntu 12.04 with php 5.4.0 .
/bin/bash /home/geo/Sources/php-git/libtool --mode=compile cc -I. -I/home/geo/Sources/php-git -DPHP_ATOM_INC -I/home/geo/Sources/php-git/include -I/home/geo/Sources/php-git/main -I/home/geo/Sources/php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O0 -c /home/geo/Sources/php-git/remote.c -o remote.lo
cc -I. -I/home/geo/Sources/php-git -DPHP_ATOM_INC -I/home/geo/Sources/php-git/include -I/home/geo/Sources/php-git/main -I/home/geo/Sources/php-git -I/usr/local/include/php -I/usr/local/include/php/main -I/usr/local/include/php/TSRM -I/usr/local/include/php/Zend -I/usr/local/include/php/ext -I/usr/local/include/php/ext/date/lib -DHAVE_CONFIG_H -g -O0 -c /home/geo/Sources/php-git/remote.c -fPIC -DPIC -o .libs/remote.o
/home/geo/Sources/php-git/remote.c: In function ‘zim_git2_remote___construct’:
/home/geo/Sources/php-git/remote.c:81:3: error: too few arguments to function ‘git_remote_new’
/usr/local/include/git2/remote.h:46:17: note: declared here
/home/geo/Sources/php-git/remote.c: In function ‘php_git2_rename_packfile’:
/home/geo/Sources/php-git/remote.c:99:10: error: ‘GIT_EINVALIDARGS’ undeclared (first use in this function)
/home/geo/Sources/php-git/remote.c:99:10: note: each undeclared identifier is reported only once for each function it appears in
/home/geo/Sources/php-git/remote.c:106:11: error: ‘GIT_EOSERR’ undeclared (first use in this function)
/home/geo/Sources/php-git/remote.c: In function ‘zim_git2_remote_fetch’:
/home/geo/Sources/php-git/remote.c:144:2: warning: passing argument 1 of ‘git_remote_download’ from incompatible pointer type [enabled by default]
/usr/local/include/git2/remote.h:155:17: note: expected ‘struct git_remote *’ but argument is of type ‘char **’
/home/geo/Sources/php-git/remote.c:144:2: warning: passing argument 2 of ‘git_remote_download’ from incompatible pointer type [enabled by default]
/usr/local/include/git2/remote.h:155:17: note: expected ‘git_off_t *’ but argument is of type ‘struct git_remote *’
/home/geo/Sources/php-git/remote.c:144:2: error: too few arguments to function ‘git_remote_download’
/usr/local/include/git2/remote.h:155:17: note: declared here
/home/geo/Sources/php-git/remote.c:161:2: error: too few arguments to function ‘git_remote_update_tips’
/usr/local/include/git2/remote.h:193:17: note: declared here
make: *** [remote.lo] Error 1
Any ideas?
Cheers, George
how can i add a new username and password plain text? is there a binding for http://libgit2.github.com/libgit2/#HEAD/group/cred/git_cred_userpass_plaintext_new
The compilation of libgit2 works fine, but when I try to compile the PHP-GIT extension, I've this error during the make step.
I use the PHP 5.3.10 version compiled from macport repo:
php -v
PHP 5.3.10 (cli) (built: Mar 4 2012 12:36:34)
Copyright (c) 1997-2012 The PHP Group
Zend Engine v2.3.0, Copyright (c) 1998-2012 Zend Technologies
with Xdebug v2.1.2, Copyright (c) 2002-2011, by Derick Rethans
Any ideas?
/bin/sh /Users/Quentin/Sites/Boulot/PHPGIT/php-git/libtool --mode=compile cc -I. -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -DPHP_ATOM_INC -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/include -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/main -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c -o repository.lo
cc -I. -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -DPHP_ATOM_INC -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/include -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git/main -I/Users/Quentin/Sites/Boulot/PHPGIT/php-git -I/opt/local/include/php -I/opt/local/include/php/main -I/opt/local/include/php/TSRM -I/opt/local/include/php/Zend -I/opt/local/include/php/ext -I/opt/local/include/php/ext/date/lib -I/opt/local/include -DHAVE_CONFIG_H -g -O2 -c /Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c -fno-common -DPIC -o .libs/repository.o
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘php_git2_repository_initialize’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:98: warning: passing argument 4 of ‘add_property_string_ex’ discards qualifiers from pointer target type
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_init’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:237: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:237: error: (Each undeclared identifier is reported only once
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:237: error: for each function it appears in.)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_discover’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:313: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_exists’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:341: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c: In function ‘zim_git2_repository_lookup’:
/Users/Quentin/Sites/Boulot/PHPGIT/php-git/repository.c:377: error: ‘GIT_SUCCESS’ undeclared (first use in this function)
make: *** [repository.lo] Error 1
Thank you,
I have read a couple of other people's similar problems with this.
Shane-Pemmelaars-MacBook-Pro:php-git shanepemmelaar$ make
/bin/sh /Users/shanepemmelaar/Desktop/php-git/libtool --mode=compile cc -I. -I/Users/shanepemmelaar/Desktop/php-git -DPHP_ATOM_INC -I/Users/shanepemmelaar/Desktop/php-git/include -I/Users/shanepemmelaar/Desktop/php-git/main -I/Users/shanepemmelaar/Desktop/php-git -I/Applications/MAMP/bin/php5.3/include/php -I/Applications/MAMP/bin/php5.3/include/php/main -I/Applications/MAMP/bin/php5.3/include/php/TSRM -I/Applications/MAMP/bin/php5.3/include/php/Zend -I/Applications/MAMP/bin/php5.3/include/php/ext -I/Applications/MAMP/bin/php5.3/include/php/ext/date/lib -I/Users/shanepemmelaar/Desktop/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/shanepemmelaar/Desktop/php-git/git2.c -o git2.lo
mkdir .libs
cc -I. -I/Users/shanepemmelaar/Desktop/php-git -DPHP_ATOM_INC -I/Users/shanepemmelaar/Desktop/php-git/include -I/Users/shanepemmelaar/Desktop/php-git/main -I/Users/shanepemmelaar/Desktop/php-git -I/Applications/MAMP/bin/php5.3/include/php -I/Applications/MAMP/bin/php5.3/include/php/main -I/Applications/MAMP/bin/php5.3/include/php/TSRM -I/Applications/MAMP/bin/php5.3/include/php/Zend -I/Applications/MAMP/bin/php5.3/include/php/ext -I/Applications/MAMP/bin/php5.3/include/php/ext/date/lib -I/Users/shanepemmelaar/Desktop/php-git/libgit2/include -DHAVE_CONFIG_H -g -O2 -Wunused-variable -Wpointer-sign -Wimplicit-function-declaration -Winline -Wunused-macros -Wredundant-decls -Wstrict-aliasing=2 -Wswitch-enum -Wdeclaration-after-statement -c /Users/shanepemmelaar/Desktop/php-git/git2.c -fno-common -DPIC -o .libs/git2.o
In file included from /Users/shanepemmelaar/Desktop/php-git/git2.c:25:
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:35:19: error: php.h: No such file or directory
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:36:36: error: Zend/zend_interfaces.h: No such file or directory
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:37:36: error: Zend/zend_exceptions.h: No such file or directory
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:38:38: error: ext/spl/spl_exceptions.h: No such file or directory
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:39:39: error: ext/standard/php_string.h: No such file or directory
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:40:29: error: date/php_date.h: No such file or directory
In file included from /Users/shanepemmelaar/Desktop/php-git/git2.c:25:
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:45: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘git2_module_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:50: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:51: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:52: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:53: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:54: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:55: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:56: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:57: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:58: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:59: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:60: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:61: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:62: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:63: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:64: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:65: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:66: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘zend_class_entry’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:69: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:74: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:79: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:84: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:91: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:96: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:101: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:106: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:117: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:126: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:132: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:137: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:142: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:147: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:152: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:157: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:162: error: expected specifier-qualifier-list before ‘zend_object’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:168: error: expected specifier-qualifier-list before ‘zval’
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:204: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:205: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:206: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:207: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:208: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:210: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:212: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:225: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:267: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:287: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/php_git2.h:319: error: expected ‘;’, ‘,’ or ‘)’ before ‘TSRMLS_DC’
/Users/shanepemmelaar/Desktop/php-git/git2.c:26:31: error: ext/standard/info.h: No such file or directory
/Users/shanepemmelaar/Desktop/php-git/git2.c:28: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:29: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:30: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:31: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:32: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:33: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:34: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:35: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:36: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:37: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:38: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:39: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:40: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:41: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:42: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:43: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:44: warning: parameter names (without types) in function declaration
/Users/shanepemmelaar/Desktop/php-git/git2.c:46: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/git2.c:88: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/git2.c:170: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/git2.c:185: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/git2.c:200: error: expected ‘)’ before ‘’ token
/Users/shanepemmelaar/Desktop/php-git/git2.c: In function ‘PHP_MINIT_FUNCTION’:
/Users/shanepemmelaar/Desktop/php-git/git2.c:219: error: ‘TSRMLS_C’ undeclared (first use in this function)
/Users/shanepemmelaar/Desktop/php-git/git2.c:219: error: (Each undeclared identifier is reported only once
/Users/shanepemmelaar/Desktop/php-git/git2.c:219: error: for each function it appears in.)
/Users/shanepemmelaar/Desktop/php-git/git2.c:237: error: ‘SUCCESS’ undeclared (first use in this function)
/Users/shanepemmelaar/Desktop/php-git/git2.c: In function ‘PHP_MINFO_FUNCTION’:
/Users/shanepemmelaar/Desktop/php-git/git2.c:242: warning: implicit declaration of function ‘php_printf’
/Users/shanepemmelaar/Desktop/php-git/git2.c:243: warning: implicit declaration of function ‘php_info_print_table_start’
/Users/shanepemmelaar/Desktop/php-git/git2.c:244: warning: implicit declaration of function ‘php_info_print_table_row’
/Users/shanepemmelaar/Desktop/php-git/git2.c:246: warning: implicit declaration of function ‘php_info_print_table_end’
/Users/shanepemmelaar/Desktop/php-git/git2.c: In function ‘PHP_RINIT_FUNCTION’:
/Users/shanepemmelaar/Desktop/php-git/git2.c:253: error: ‘SUCCESS’ undeclared (first use in this function)
/Users/shanepemmelaar/Desktop/php-git/git2.c: In function ‘PHP_RSHUTDOWN_FUNCTION’:
/Users/shanepemmelaar/Desktop/php-git/git2.c:259: error: ‘SUCCESS’ undeclared (first use in this function)
/Users/shanepemmelaar/Desktop/php-git/git2.c: At top level:
/Users/shanepemmelaar/Desktop/php-git/git2.c:262: error: expected ‘=’, ‘,’, ‘;’, ‘asm’ or ‘attribute’ before ‘git2_module_entry’
/Users/shanepemmelaar/Desktop/php-git/git2.c: In function ‘ZEND_GET_MODULE’:
/Users/shanepemmelaar/Desktop/php-git/git2.c:280: error: expected ‘{’ at end of input
make: ** [git2.lo] Error 1
Cheers,
Shane
The links to the project documentation in the README do not point to anything useful. Chobie's website is offline (I just get the default "It works!" page from Apache), and the wiki on Chobie's repository is disabled for some reason.
Documentation for this project would be fantastic. I'm planning on building a Drupal 7 based clone of Github and would really love to use this library.
Thanks!
reported by @vissi. thanks!
straight forward test code.
<?php
define("REPOSITORY_NAME","/git_index_test");
use Git\Repository;
$repository = new Repository(__DIR__ . REPOSITORY_NAME . "/.git");
$index = $repository->getIndex();
$entry = $index->getEntry(0);
Program received signal SIGSEGV, Segmentation fault.
zend_do_fcall_common_helper_SPEC (execute_data=0x7fff00000000) at /build/buildd/php5-5.3.5/Zend/zend_vm_execute.h:383
383 in /build/buildd/php5-5.3.5/Zend/zend_vm_execute.h
i've spend several hours but i couldn't fixed yet.
perhaps some function brake PHP mermoy.so i'll more trace deeply.
How do I retrieve a list for all the references of a repository ?
Should $tree->path() be able to traverse a path such as "subdir1/README".
ex. $tree->path('subdir1/README');
The example currently returns null yet the directory and file exists.
Hi,
I'm trying to do an example/diff.php but I have an error:
Warning: git_tree_lookup(): WARNING -3 git_commit_lookup - The requested type does not match the type in the ODB in /srv/www/htdocs/index.php on line 6
Warning: git_diff_tree_to_workdir() expects parameter 2 to be resource, boolean given in /srv/www/htdocs/index.php on line 7
Warning: git_diff_print() expects parameter 1 to be resource, null given in /srv/www/htdocs/index.php on line 15
Source code:
<?php
//phpinfo();
echo '<pre>';
$repo = git_repository_open("/home/michal/git/base-app");
$tree = git_tree_lookup($repo, "96b38d2751d00bae12f42e6331140076d6f79a3c");
$diff = git_diff_tree_to_workdir($repo, $tree, git_diff_options_init());
$p = array();
git_diff_print($diff, GIT_DIFF_FORMAT_PATCH, function($diff_delta, $diff_hunk, $diff_line, $payload){
if ($diff_line['origin'] == "-" || $diff_line['origin'] == "+") {
echo $diff_line['origin'];
}
echo $diff_line['content'];
}, $p);
echo '</pre>';
The error is in this line:
$tree = git_tree_lookup($repo, "96b38d2751d00bae12f42e6331140076d6f79a3c");
This hash is one of my commit hash.
Hi all,
For some time I'm tryin' to use this extension in a little project of mine. I like the functionality so far and really appreciate the work you guys did.
But if i'm not mistaking the project is dead for about 7 months now, and there is still pretty much work to be done to fully couple libgit2. I'll try to do some coding myself and I hope there's gonna be some activity here again!
Cheers!
When getEntryByName is used the resulting tree_entry is missing a character. I get a 39 character sha rather than 40 character.
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.