Skip to content

Commit

Permalink
removed unnecessary directory handle
Browse files Browse the repository at this point in the history
  • Loading branch information
dirk-thomas committed Aug 1, 2011
1 parent 6a8b1a9 commit e83d00f
Showing 1 changed file with 17 additions and 20 deletions.
37 changes: 17 additions & 20 deletions include/configclass.php
Original file line number Diff line number Diff line change
Expand Up @@ -133,30 +133,27 @@ function &findRepository($name) {
return $null;
}
}
if ($handle = @opendir($this->path)) {
// is there a directory named $name?
$fullpath = $this->path.DIRECTORY_SEPARATOR.$name;
if (is_dir($fullpath) && is_readable($fullpath)) {
// And that contains a db directory (in an attempt to not include non svn repositories.
$dbfullpath = $fullpath.DIRECTORY_SEPARATOR.'db';
if (is_dir($dbfullpath) && is_readable($dbfullpath)) {
// And matches the pattern if specified
if ($this->pattern === false || preg_match($this->pattern, $name)) {
$url = 'file:///'.$fullpath;
$url = str_replace(DIRECTORY_SEPARATOR, '/', $url);
if ($url{strlen($url) - 1} == '/') {
$url = substr($url, 0, -1);
}
// is there a directory named $name?
$fullpath = $this->path.DIRECTORY_SEPARATOR.$name;
if (is_dir($fullpath) && is_readable($fullpath)) {
// And that contains a db directory (in an attempt to not include non svn repositories.
$dbfullpath = $fullpath.DIRECTORY_SEPARATOR.'db';
if (is_dir($dbfullpath) && is_readable($dbfullpath)) {
// And matches the pattern if specified
if ($this->pattern === false || preg_match($this->pattern, $name)) {
$url = 'file:///'.$fullpath;
$url = str_replace(DIRECTORY_SEPARATOR, '/', $url);
if ($url{strlen($url) - 1} == '/') {
$url = substr($url, 0, -1);
}

if (!in_array($url, $config->_excluded, true)) {
$clientRootURL = ($this->clientRootURL) ? $this->clientRootURL.'/'.$name : '';
$rep = new Repository($name, $name, $url, $this->group, null, null, null, $clientRootURL);
return $rep;
}
if (!in_array($url, $config->_excluded, true)) {
$clientRootURL = ($this->clientRootURL) ? $this->clientRootURL.'/'.$name : '';
$rep = new Repository($name, $name, $url, $this->group, null, null, null, $clientRootURL);
return $rep;
}
}
}
closedir($handle);
}
$null = null;
return $null;
Expand Down

0 comments on commit e83d00f

Please sign in to comment.