Inject cache instance into manager instead of relying on singleton
[gitphp.git] / include / git / projectlist / ProjectListArrayLegacy.class.php
blob:a/include/git/projectlist/ProjectListArrayLegacy.class.php -> blob:b/include/git/projectlist/ProjectListArrayLegacy.class.php
--- a/include/git/projectlist/ProjectListArrayLegacy.class.php
+++ b/include/git/projectlist/ProjectListArrayLegacy.class.php
@@ -12,7 +12,7 @@
 	/**
 	 * No category indicator
 	 *
-	 * @const
+	 * @var string
 	 */
 	const NoCategory = 'none';
 
@@ -39,17 +39,17 @@
 	 */
 	protected function PopulateProjects()
 	{
-		foreach ($this->projectConfig as $cat => $plist) {
+		foreach ($this->projectConfig as $plist) {
 			if (is_array($plist)) {
-				foreach ($plist as $pname => $ppath) {
+				foreach ($plist as $ppath) {
 					try {
-						$projObj = $this->InstantiateProject($ppath);
+						$projObj = $this->LoadProject($ppath);
 						if ($projObj) {
 							$this->projects[$ppath] = $projObj;
 							unset($projObj);
 						}
 					} catch (Exception $e) {
-						GitPHP_DebugLog::GetInstance()->Log($e->getMessage());
+						$this->Log('Project error', $e->getMessage());
 					}
 				}
 			}
@@ -57,12 +57,12 @@
 	}
 
 	/**
-	 * Instantiates project object
+	 * Loads a project
 	 *
 	 * @param string $proj project
 	 * @return GitPHP_Project project
 	 */
-	protected function InstantiateProject($proj)
+	protected function LoadProject($proj)
 	{
 		$found = false;
 		$projectCat = GitPHP_ProjectListArrayLegacy::NoCategory;
@@ -80,8 +80,6 @@
 
 		$projectObj = new GitPHP_Project($this->projectRoot, $proj);
 
-		$this->InjectProjectDependencies($projectObj);
-
 		$this->ApplyGlobalConfig($projectObj);
 
 		$this->ApplyGitConfig($projectObj);
@@ -89,6 +87,8 @@
 		if ($projectCat != GitPHP_ProjectListArrayLegacy::NoCategory)
 			$projectObj->SetCategory($projectCat);
 
+		$this->InjectProjectDependencies($projectObj);
+
 		return $projectObj;
 	}
 

comments