|
| filterChangedFiles (array $changes, $remoteAlias, $remoteBranch, $changesType=self::CHANGE_TYPE_ALL) |
|
Definition at line 198 of file get_github_changes.php.
◆ __construct()
- Parameters
-
string | $workTree | absolute path to git project |
Definition at line 232 of file get_github_changes.php.
236 if (empty($workTree) || !
is_dir($workTree)) {
237 throw new UnexpectedValueException(
'Working tree should be a valid path to directory');
◆ addRemote()
addRemote |
( |
|
$alias, |
|
|
|
$url |
|
) |
| |
◆ compareChanges()
compareChanges |
( |
|
$remoteAlias, |
|
|
|
$remoteBranch, |
|
|
|
$changesType = self::CHANGE_TYPE_ALL |
|
) |
| |
Returns files changes between branch and HEAD
- Parameters
-
string | $remoteAlias | |
string | $remoteBranch | |
int | $changesType | |
- Returns
- array
Definition at line 304 of file get_github_changes.php.
308 if (!isset($this->remoteList[$remoteAlias])) {
309 throw new LogicException(
'Alias "' . $remoteAlias .
'" is not defined');
312 $result = $this->call(sprintf(
'log %s/%s..HEAD --name-status --oneline', $remoteAlias, $remoteBranch));
filterChangedFiles(array $changes, $remoteAlias, $remoteBranch, $changesType=self::CHANGE_TYPE_ALL)
◆ fetch()
Fetches remote
- Parameters
-
Definition at line 274 of file get_github_changes.php.
278 if (!isset($this->remoteList[$remoteAlias])) {
279 throw new LogicException(
'Alias "' . $remoteAlias .
'" is not defined');
◆ filterChangedFiles()
filterChangedFiles |
( |
array |
$changes, |
|
|
|
$remoteAlias, |
|
|
|
$remoteBranch, |
|
|
|
$changesType = self::CHANGE_TYPE_ALL |
|
) |
| |
|
protected |
Makes a diff of file for specified remote/branch and filters only those have real changes
- Parameters
-
array | $changes | |
string | $remoteAlias | |
string | $remoteBranch | |
int | $changesType | |
- Returns
- array
Definition at line 331 of file get_github_changes.php.
339 $countScannedFiles = 0;
340 $changedFilesMasks = $this->buildChangedFilesMask($changesType);
341 $filteredChanges = [];
343 $countScannedFiles++;
344 if (($countScannedFiles % 5000) == 0) {
345 echo $countScannedFiles .
" files scanned so far\n";
348 $changeTypeMask = $this->detectChangeTypeMask(
$fileName, $changedFilesMasks);
349 if (
null === $changeTypeMask) {
354 if (in_array(
$fileName, $filteredChanges)) {
358 $fileChanges = $this->getFileChangeDetails(
$fileName, $remoteAlias, $remoteBranch);
359 if (empty($fileChanges)) {
363 if (!(isset($this->changedContentFiles[
$fileName]))) {
364 $this->setChangedContentFile($fileChanges,
$fileName);
368 echo $countScannedFiles .
" files scanned\n";
◆ getBranches()
getBranches |
( |
|
$source = '--all' | ) |
|
◆ getChangedContentFiles()
getChangedContentFiles |
( |
| ) |
|
◆ removeRemote()
◆ CHANGE_TYPE_ADDED
const CHANGE_TYPE_ADDED = 1 |
◆ CHANGE_TYPE_ALL
const CHANGE_TYPE_ALL = 3 |
◆ CHANGE_TYPE_MODIFIED
const CHANGE_TYPE_MODIFIED = 2 |
The documentation for this class was generated from the following file: