mirror of
https://github.com/klaussilveira/gitlist.git
synced 2025-11-18 03:30:55 +01:00
@@ -5,6 +5,10 @@
|
|||||||
* https://github.com/klaussilveira/gitlist
|
* https://github.com/klaussilveira/gitlist
|
||||||
*/
|
*/
|
||||||
|
|
||||||
|
if (!file_exists('config.ini')) {
|
||||||
|
die("Please, create the config.ini file.");
|
||||||
|
}
|
||||||
|
|
||||||
$config = parse_ini_file('config.ini', true);
|
$config = parse_ini_file('config.ini', true);
|
||||||
|
|
||||||
if (empty($config['git']['repositories']) || !is_dir($config['git']['repositories'])) {
|
if (empty($config['git']['repositories']) || !is_dir($config['git']['repositories'])) {
|
||||||
|
|||||||
@@ -85,28 +85,30 @@ class Client
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$isBare = file_exists($file->getPathname() . '/HEAD');
|
if ($file->isDir()) {
|
||||||
$isRepository = file_exists($file->getPathname() . '/.git/HEAD');
|
$isBare = file_exists($file->getPathname() . '/HEAD');
|
||||||
|
$isRepository = file_exists($file->getPathname() . '/.git/HEAD');
|
||||||
|
|
||||||
if ($file->isDir() && $isRepository || $isBare) {
|
if ($isRepository || $isBare) {
|
||||||
if (in_array($file->getPathname(), $this->app['hidden'])) {
|
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;
|
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;
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|||||||
Reference in New Issue
Block a user