/** * GetSlug * * Gets the project as a filename/url friendly slug * * @access public * @return string the slug */ public function GetSlug() { $project = $this->project; if (substr($project, -4) == '.git') { $project = substr($project, 0, -4); } return GitPHP_Util::MakeSlug($project); }
/** * GetFilename * * Gets the filename for this archive * * @access public * @return string filename */ public function GetFilename() { if (!empty($this->fileName)) { return $this->fileName; } $fname = $this->GetProject()->GetSlug(); if (!empty($this->path)) { $fname .= '-' . GitPHP_Util::MakeSlug($this->path); } $fname .= '.' . $this->GetExtension(); return $fname; }
public function testMakeSlug() { $this->assertEquals('some-path', GitPHP_Util::MakeSlug('some/path')); $this->assertEquals('somepath', GitPHP_Util::MakeSlug('somepath')); }
/** * Gets the filename for this archive * * @return string filename */ public function GetFilename() { if (!empty($this->fileName)) { return $this->fileName; } $fname = $this->GetProject()->GetSlug(); if (!empty($this->path)) { $fname .= '-' . GitPHP_Util::MakeSlug($this->path); } if (!empty($this->objectHash)) { $fname .= '-' . $this->GetProject()->AbbreviateHash($this->objectHash); } $fname .= '.' . $this->strategy->Extension(); return $fname; }