FOSSology  4.4.0
Open Source License Compliance by Open Source Software
common-compare.php File Reference

These are common functions for the file picker and the diff tools. More...

Go to the source code of this file.

Functions

 FuzzyCmp ($Master1, $Master2)
 FuzzyName comparison function for diff tools. More...
 
 MakeMaster ($Children1, $Children2)
 Generate the master array with aligned children. More...
 
 FileList (&$Master, $agent_pk1, $agent_pk2, $filter, $plugin, $uploadtree_pk1, $uploadtree_pk2)
 Adds the element linkurl to the $Master elements. More...
 
 GetDiffLink ($MasterRow, $side, $agent_pk, $filter, $plugin, $ModLicView, $uploadtree_pk1, $uploadtree_pk2)
 Generate the link for one side of a diff element. More...
 
 NextUploadtree_pk ($A_pk, $B_pk)
 Given an uploadtree_pk in tree A ($A_pk), find the similarly named one that is immediately under the uploadtree_pk in tree B ($B_pk). More...
 
 FuzzyName (&$Children)
 Add fuzzyname and fuzzynameext to $Children. More...
 
 Dir2BrowseDiff ($Path1, $Path2, $filter, $Column, $plugin)
 Return a string which is a linked path to the file. More...
 

Detailed Description

These are common functions for the file picker and the diff tools.

Definition in file common-compare.php.

Function Documentation

◆ Dir2BrowseDiff()

Dir2BrowseDiff (   $Path1,
  $Path2,
  $filter,
  $Column,
  $plugin 
)

Return a string which is a linked path to the file.

This is a modified Dir2Browse() to support browsediff links.

Parameters
array$Path1Path array for tree 1
array$Path2Path array for tree 2
string$filterFilter portion of URL, optional
int$ColumnWhich path is being emitted, column 1 or 2
Plugin$pluginPlugin pointer of the caller ($this)

Definition at line 336 of file common-compare.php.

◆ FileList()

FileList ( $Master,
  $agent_pk1,
  $agent_pk2,
  $filter,
  $plugin,
  $uploadtree_pk1,
  $uploadtree_pk2 
)

Adds the element linkurl to the $Master elements.

linkurl - this is the entire formatted href inclusive <a to /a>

Parameters
array$MasterMaster
int$agent_pk1Agent id 1
int$agent_pk2Agent id 2
string$filterFilter
string$pluginMod name
int$uploadtree_pk1Uploadtree id 1
int$uploadtree_pk2Uploadtree id 2

Definition at line 142 of file common-compare.php.

◆ FuzzyCmp()

FuzzyCmp (   $Master1,
  $Master2 
)

FuzzyName comparison function for diff tools.

Parameters
array$Master1Master1 to compare
array$Master2Master2 to compare
Returns
fuzzyname string

Definition at line 23 of file common-compare.php.

◆ FuzzyName()

FuzzyName ( $Children)

Add fuzzyname and fuzzynameext to $Children.

The fuzzy name is used to do fuzzy matches. In this implementation the fuzzyname is just the filename with numbers, punctuation, and the file extension removed. fuzzynameext is the same as fuzzyname but with the file extension.

Parameters
$Childrenchild list

Definition at line 304 of file common-compare.php.

◆ GetDiffLink()

GetDiffLink (   $MasterRow,
  $side,
  $agent_pk,
  $filter,
  $plugin,
  $ModLicView,
  $uploadtree_pk1,
  $uploadtree_pk2 
)

Generate the link for one side of a diff element.

Parameters
array$MasterRowMaster row
int$side
int$agent_pkAgent id
string$filterFilter
string$pluginMod name
Plugin$ModLicView
int$uploadtree_pk1Uploadtree pk1
int$uploadtree_pk2Uploadtree pk2
Returns
The link for one side of a diff element

Definition at line 178 of file common-compare.php.

◆ MakeMaster()

MakeMaster (   $Children1,
  $Children2 
)

Generate the master array with aligned children.

Each row contains aligning child records.
$Master[n][1] = child 1 row
$Master[n][2] = child 2 row
If $Sort is true, the master rows are sorted by fuzzy name.
If $Sort is false, the master rows are unsorted.

Parameters
array$Children1Child 1 row
array$Children2Child 2 row
Returns
master array with aligned children

Definition at line 47 of file common-compare.php.

◆ NextUploadtree_pk()

NextUploadtree_pk (   $A_pk,
  $B_pk 
)

Given an uploadtree_pk in tree A ($A_pk), find the similarly named one that is immediately under the uploadtree_pk in tree B ($B_pk).

Parameters
int$A_pkTree A uploadtree_pk
int$B_pkTree B uploadtree_pk
Returns
int New uploadtree_pk in Tree B

Definition at line 256 of file common-compare.php.