public function place($ID) { if (!isset($this->_commits[$ID])) { return false; } $content = ''; for ($v = 0; $v <= $ID; $v++) { $content = Versionning::apply($content, $this->_commits[$v]); } return $content; }
public function apply($files, $to) { for ($i = 0; $i < $to; $i++) { foreach ($this->_commits[$i]['files'] as $file => $diff) { if (isset($diff['type']) && $diff['type'] === 'deleted') { unset($files[$file]); } else { $files[$file] = Versionning::apply(isset($files[$file]) ? $files[$file] : '', $diff, $this->_commits[$i]['deletedLineMarker']); if (!count($files[$file])) { unset($files[$file]); } } } } return $files; }