Horde_Vcs_File_Base::getPath PHP Méthode

getPath() public méthode

Return the "base" filename (i.e. the filename needed by the various command line utilities).
public getPath ( ) : string
Résultat string A filename.
    public function getPath()
    {
        return $this->_rep->sourceroot . '/' . $this->getSourcerootPath();
    }

Usage Example

Exemple #1
0
 /**
  * Obtain the differences between two revisions of a file.
  *
  * @param Horde_Vcs_File_Cvs $file  The desired file.
  * @param string $rev1              Original revision number to compare
  *                                  from.
  * @param string $rev2              New revision number to compare against.
  * @param array $opts               The following optional options:
  *                                  - 'num': (integer) DEFAULT: 3
  *                                  - 'type': (string) DEFAULT: 'unified'
  *                                  - 'ws': (boolean) DEFAULT: true
  *
  * @return string|boolean  False on failure, or a string containing the
  *                         diff on success.
  */
 protected function _diff(Horde_Vcs_File_Base $file, $rev1, $rev2, $opts)
 {
     $fullName = $file->getPath();
     $diff = array();
     $flags = '-kk ';
     if (!$opts['ws']) {
         $flags .= ' -bB ';
     }
     switch ($opts['type']) {
         case 'context':
             $flags .= '-p --context=' . escapeshellarg((int) $opts['num']);
             break;
         case 'unified':
             $flags .= '-p --unified=' . escapeshellarg((int) $opts['num']);
             break;
         case 'column':
             $flags .= '--side-by-side --width=120';
             break;
         case 'ed':
             $flags .= '-e';
             break;
     }
     // Windows versions of cvs always return $where with forwards slashes.
     if (VC_WINDOWS) {
         $fullName = str_replace(DIRECTORY_SEPARATOR, '/', $fullName);
     }
     // TODO: add options for $hr options - however these may not be
     // compatible with some diffs.
     $command = escapeshellcmd($this->getPath('rcsdiff')) . ' ' . $flags . ' -r' . escapeshellarg($rev1) . ' -r' . escapeshellarg($rev2) . ' ' . escapeshellarg($fullName) . ' 2>&1';
     if (VC_WINDOWS) {
         $command .= ' < ' . escapeshellarg(__FILE__);
     }
     exec($command, $diff, $retval);
     return $retval > 0 ? $diff : array();
 }
All Usage Examples Of Horde_Vcs_File_Base::getPath