Back to Patcher class

Method add

public \Joomla\CMS\Filesystem\Patcher
add
(mixed $udiff, mixed $root = JPATH_BASE, mixed $strip = 0)
Add a unified diff string to the patcher
Parameters
  • string $udiff Unified diff input string
  • string $root The files root path
  • int $strip The number of '/' to strip
Returns
  • \Joomla\CMS\Filesystem\Patcher $this for chaining
Since
  • 3.0.0
Class: Patcher
Project: Joomla

Method add - Source code

/**
 * Add a unified diff string to the patcher
 *
 * @param   string   $udiff  Unified diff input string
 * @param   string   $root   The files root path
 * @param   integer  $strip  The number of '/' to strip
 *
 * @return  Patcher  $this for chaining
 *
 * @since   3.0.0
 */
public function add($udiff, $root = JPATH_BASE, $strip = 0)
{
    $this->patches[] = array('udiff' => $udiff, 'root' => isset($root) ? rtrim($root, DIRECTORY_SEPARATOR) . DIRECTORY_SEPARATOR : '', 'strip' => $strip);
    return $this;
}