On my windows under eclipse with EGit there is a directory named .git,
but that gives warning, when read with file_get_contents:
Warning: file_get_contents(/.git) [function.file-get-contents]: failed
to open stream: Permission denied in \includes\GitInfo.php on line 49
Follow up Ieb79c0b4
Change-Id: I7c3ba323460a2fd3739d3912ee6420aa29311f4f
*/
public function __construct( $dir ) {
$this->basedir = "{$dir}/.git";
- if ( is_readable( $this->basedir ) ) {
+ if ( is_readable( $this->basedir ) && !is_dir( $this->basedir ) ) {
$GITfile = file_get_contents( $this->basedir );
if ( strlen( $GITfile ) > 8 && substr( $GITfile, 0, 8 ) === 'gitdir: ' ) {
$path = rtrim( substr( $GITfile, 8 ), "\r\n" );