Text_Diff::__construct()
Computes diffs between sequences of strings.
Метод класса: Text_Diff{}
Хуков нет.
Возвращает
null
. Ничего.
Использование
$Text_Diff = new Text_Diff(); $Text_Diff->__construct( $engine, $params );
- $engine(строка) (обязательный)
- Name of the diffing engine to use. 'auto' will automatically select the best.
- $params(массив) (обязательный)
- Parameters to pass to the diffing engine. Normally an array of two arrays, each containing the lines from a file.
Код Text_Diff::__construct() Text Diff:: construct WP 6.2.2
function __construct( $engine, $params ) { // Backward compatibility workaround. if (!is_string($engine)) { $params = array($engine, $params); $engine = 'auto'; } if ($engine == 'auto') { $engine = extension_loaded('xdiff') ? 'xdiff' : 'native'; } else { $engine = basename($engine); } // WP #7391 require_once dirname(__FILE__).'/Diff/Engine/' . $engine . '.php'; $class = 'Text_Diff_Engine_' . $engine; $diff_engine = new $class(); $this->_edits = call_user_func_array(array($diff_engine, 'diff'), $params); }