From c253b2f96b5230c73d27407ca70f2f33b505fb3a Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Prochowski?= Date: Wed, 4 Jul 2012 17:02:06 +0200 Subject: [PATCH 1/2] Fix warnings: - Warning: parse_ini_file(config.ini) [function.parse-ini-file]: failed to open stream: No such file or directory in /home/mablo/www/gitlist/index.php on line 8 - Warning: file_exists() [function.file-exists]: open_basedir restriction in effect. File(/home/mablo/git/index.php/.git/HEAD) is not within the allowed path(s): (/usr/local/php5) in /home/mablo/www/gitlist/lib/Git/Client.php on line 90 --- index.php | 4 ++++ lib/Git/Client.php | 40 +++++++++++++++++++++------------------- 2 files changed, 25 insertions(+), 19 deletions(-) diff --git a/index.php b/index.php index c9147cf..52bb1fc 100644 --- a/index.php +++ b/index.php @@ -5,6 +5,10 @@ * https://github.com/klaussilveira/gitlist */ +if (!file_exists('config.ini')) { + die("Please, create the config.ini file."); +} + $config = parse_ini_file('config.ini', true); if (empty($config['git']['repositories']) || !is_dir($config['git']['repositories'])) { diff --git a/lib/Git/Client.php b/lib/Git/Client.php index 252e636..b94cc92 100644 --- a/lib/Git/Client.php +++ b/lib/Git/Client.php @@ -85,28 +85,30 @@ class Client continue; } - $isBare = file_exists($file->getPathname() . '/HEAD'); - $isRepository = file_exists($file->getPathname() . '/.git/HEAD'); + if ($file->isDir()) { + $isBare = file_exists($file->getPathname() . '/HEAD'); + $isRepository = file_exists($file->getPathname() . '/.git/HEAD'); - if ($file->isDir() && $isRepository || $isBare) { - if (in_array($file->getPathname(), $this->app['hidden'])) { + if ($isRepository || $isBare) { + if (in_array($file->getPathname(), $this->app['hidden'])) { + continue; + } + + if ($isBare) { + $description = $file->getPathname() . '/description'; + } else { + $description = $file->getPathname() . '/.git/description'; + } + + if (file_exists($description)) { + $description = file_get_contents($description); + } else { + $description = 'There is no repository description file. Please, create one to remove this message.'; + } + + $repositories[] = array('name' => $file->getFilename(), 'path' => $file->getPathname(), 'description' => $description); continue; } - - if ($isBare) { - $description = $file->getPathname() . '/description'; - } else { - $description = $file->getPathname() . '/.git/description'; - } - - if (file_exists($description)) { - $description = file_get_contents($description); - } else { - $description = 'There is no repository description file. Please, create one to remove this message.'; - } - - $repositories[] = array('name' => $file->getFilename(), 'path' => $file->getPathname(), 'description' => $description); - continue; } } From b782ffa7a9a9956865f26477b7a5a7afe144e91d Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Micha=C5=82=20Prochowski?= Date: Thu, 5 Jul 2012 11:04:52 +0200 Subject: [PATCH 2/2] Update installation section in README.md file. --- README.md | 12 ++++++++++++ 1 file changed, 12 insertions(+) diff --git a/README.md b/README.md index 748f2e5..4c66e99 100644 --- a/README.md +++ b/README.md @@ -48,6 +48,18 @@ Download the GitList latest package and decompress to your `/var/www/gitlist` fo git clone https://github.com/klaussilveira/gitlist.git /var/www/gitlist ``` +Download composer.phar: + +``` +curl -s http://getcomposer.org/installer | php +``` + +Install vendors using composer: + +``` +php composer.phar install +``` + Rename the `config.ini-example` file to `config.ini`. Now open up the `config.ini` and configure your installation. You'll have to provide where your repositories are located and the base GitList URL (in our case, http://localhost/gitlist). Now, let's create the cache folder and give the correct permissions: ```