Airship\Engine\Continuum\Updaters\Airship::replaceFile PHP Method

replaceFile() protected method

Unique to Airship updating; replace a file with one in the archive
protected replaceFile ( string $filename ) : boolean
$filename string
return boolean
    protected function replaceFile(string $filename) : bool
    {
        if (\file_exists(\dirname(ROOT) . DIRECTORY_SEPARATOR . $filename . '.backup')) {
            \unlink(\dirname(ROOT) . DIRECTORY_SEPARATOR . $filename . '.backup');
        }
        // Make backup copies of the old file, just in case someone
        // decided to edit the core files against medical advice.
        \rename(\dirname(ROOT) . DIRECTORY_SEPARATOR . $filename, \dirname(ROOT) . DIRECTORY_SEPARATOR . $filename . '.backup');
        return \file_put_contents(\dirname(ROOT) . DIRECTORY_SEPARATOR . $filename, \file_get_contents('phar://' . $this->pharAlias . '/' . $filename)) !== false;
    }