Cake\Upgrade\Shell\Task\StageTask::change PHP Метод

change() публичный Метод

Store a change for a file
public change ( string $filePath, string $original, string $updated ) : boolean
$filePath string (unused, for future reference)
$original string
$updated string
Результат boolean
    public function change($filePath, $original, $updated)
    {
        if ($original === $updated) {
            return false;
        }
        $oHash = sha1($original);
        if (empty($this->_staged['change'][$filePath])) {
            $this->_staged['change'][$filePath][] = $oHash;
            $o = new File(TMP . 'upgrade' . DS . $oHash, true);
            $o->write($original);
        } else {
            $oHash = reset($this->_staged['change'][$filePath]);
        }
        $uHash = sha1($updated);
        if ($uHash === end($this->_staged['change'][$filePath])) {
            return false;
        }
        $u = new File(TMP . 'upgrade' . DS . $uHash, true);
        $u->write($updated);
        $this->_staged['change'][$filePath][] = $uHash;
        return true;
    }