src/configs/Config.php
protected static function putFile($path, $content): void
    {
        if (file_exists($path) && $content === file_get_contents($path)) {
            return;
        }
        if (!file_exists(dirname($path))) {
            mkdir(dirname($path), 0777, true);
        }
        if (false === file_put_contents($path, $content)) {
            throw new FailedWriteException("Failed write file $path");
        }
    }
protected static function putFile($path, $content): void
    {
        if (file_exists($path) && $content === file_get_contents($path)) {
            return;
        }
        if (!file_exists(dirname($path))) {
            mkdir(dirname($path), 0777, true);
        }
        if (false === file_put_contents($path, $content)) {
            throw new FailedWriteException("Failed write file $path");
        }
    }
protected static function putFile ( $ path , $ content ) : void { if ( file_exists ( $ path ) && $ content === file_get_contents ( $ path ) ) { return ; } if ( ! file_exists ( dirname ( $ path ) ) ) { mkdir ( dirname ( $ path ) , 0777 , true ) ; } if ( false === file_put_contents ( $ path , $ content ) ) { throw new FailedWriteException ( "Failed write file $path" ) ; } }
Writes file if content changed.
@param string $path
@param string $content
@throws FailedWriteException
Writes file if content changed .