diff admin/application/libraries/hgphp.php @ 41:2cf4300b3541

- hgweb.config and the repositories can now exist in separate directories - error suppression when invalid absolute paths set - auto-insertion bug which re-added all folders in the repo directory on create/delete, even if not formally registered - blacklists creation of a repo derived from config 'base_url' instead of value "admin" where $config['base_url'] = http://www.contoso.com/hgadmin will blacklist "hgadmin" - missed translation items in hgdir controller - add the default /lock directory to source controll
author joshjcarrier
date Thu, 03 Jun 2010 20:37:04 -0700
parents 4543c151a667
children 46961a5f545c
line wrap: on
line diff
--- a/admin/application/libraries/hgphp.php	Wed May 19 14:56:57 2010 -0700
+++ b/admin/application/libraries/hgphp.php	Thu Jun 03 20:37:04 2010 -0700
@@ -62,7 +62,16 @@
 		$realdir = $this->__realdirscan();
 		$hgwebdir_compat = $this->_ci->hgconf2ini->getHgWebDirCollections($ofl_lock_hgwebconf);
 				
-		$allrepo = array_merge($realdir, $hgwebdir_compat);
+		$allrepo = $realdir;
+		if(!is_integer($hgwebdir_compat))
+		{
+			$allrepo = array_merge($realdir, $hgwebdir_compat);
+		}
+		else
+		{
+			// error code
+			return $hgwebdir_compat;
+		}
 		
 		$hgrepos = array();
 		foreach($allrepo as $repo)
@@ -104,11 +113,22 @@
 		
 		$create_status = HGPHP_OK;
 		$ofl_dummylock_hgwebconf = '';
-		$lsdir = $this->lsdir($ofl_dummylock_hgwebconf); // don't want to update the lock yet
+		$lsdir = $this->_ci->hgconf2ini->getHgWebDirCollections($ofl_dummylock_hgwebconf); // don't want to update the lock yet
 
 		// simplifies repo list into array where name is both key and value
 		// this is how hgweb.config wants it
-		$existingdir = array_keys($lsdir);
+		$existingdir = array();
+		
+		if(!is_integer($lsdir))
+		{
+			$existingdir = array_keys($lsdir);
+		}
+		else
+		{
+			// error code
+			return $lsdir;
+		}
+		
 		$tempexistingdir = array();
 		foreach($existingdir as $repo_name)
 		{
@@ -170,7 +190,7 @@
 		
 		$del_status = HGPHP_OK;
 		$ofl_dummylock_hgwebconf = '';
-		$lsdir = $this->lsdir($ofl_dummylock_hgwebconf); // don't want to update lock yet
+		$lsdir = $this->_ci->hgconf2ini->getHgWebDirCollections($ofl_dummylock_hgwebconf); // don't want to update lock yet
 		
 		// simplifies repo list into array where name is both key and value
 		// this is how hgweb.config wants it
@@ -346,12 +366,15 @@
 		$realdir = directory_map($this->_repositories_abs_dir, TRUE);
 		
 		$verifiedrealdir = array();
-		foreach($realdir as $file)
+		if(is_array($realdir))
 		{
-			// checks if we detected a folder
-			if(is_dir($this->_repositories_abs_dir . $file))
+			foreach($realdir as $file)
 			{
-				$verifiedrealdir[$file] = $file;
+				// checks if we detected a folder
+				if(is_dir($this->_repositories_abs_dir . $file))
+				{
+					$verifiedrealdir[$file] = $file;
+				}
 			}
 		}