Gittern\Transport\Packfile::setIndex PHP Method

setIndex() public method

public setIndex ( PackfileIndex $index = null )
$index PackfileIndex
    public function setIndex(PackfileIndex $index = null)
    {
        $this->index = $index;
    }

Usage Example

Example #1
0
 protected function getPackfiles()
 {
     $packfiles = array();
     foreach ($this->getPackfileNames() as $packfile_name) {
         $packfile = new Packfile(new FileReader($this->git_dir . '/objects/pack/' . $packfile_name . '.pack'), $this);
         $packfile->setIndex(new PackfileIndex(new FileReader($this->git_dir . '/objects/pack/' . $packfile_name . '.idx')));
         $packfiles[] = $packfile;
     }
     return $packfiles;
 }