Inject cache instance into manager instead of relying on singleton
[gitphp.git] / include / git / projectlist / ProjectListBase.class.php
blob:a/include/git/projectlist/ProjectListBase.class.php -> blob:b/include/git/projectlist/ProjectListBase.class.php
--- a/include/git/projectlist/ProjectListBase.class.php
+++ b/include/git/projectlist/ProjectListBase.class.php
@@ -137,6 +137,8 @@
 	{
 		$project = new GitPHP_Project(GitPHP_Util::AddSlash($this->projectRoot), $proj);
 
+		$this->InjectProjectDependencies($project);
+
 		$this->ApplyGlobalConfig($project);
 
 		$this->ApplyGitConfig($project);
@@ -146,6 +148,19 @@
 		}
 
 		return $project;
+	}
+
+	/**
+	 * Inject project dependency objects
+	 *
+	 * @param GitPHP_Project $project project object
+	 */
+	protected function InjectProjectDependencies($project)
+	{
+		if (!$project)
+			return;
+
+		$project->GetObjectManager()->SetCache(GitPHP_Cache::GetObjectCacheInstance());
 	}
 
 	/**

comments