Skip to main content
Drupal API
User account menu
  • Log in

Breadcrumb

  1. Drupal Core 11.1.x
  2. Filesystem.php

function Filesystem::filePutContentsIfModified

Return value

int|false

File

vendor/composer/composer/src/Composer/Util/Filesystem.php, line 909

Class

Filesystem
@author Jordi Boggiano <j.boggiano@seld.be> @author Johannes M. Schmitt <schmittjoh@gmail.com>

Namespace

Composer\Util

Code

public function filePutContentsIfModified(string $path, string $content) {
    $currentContent = Silencer::call('file_get_contents', $path);
    if (false === $currentContent || $currentContent !== $content) {
        return file_put_contents($path, $content);
    }
    return 0;
}

API Navigation

  • Drupal Core 11.1.x
  • Topics
  • Classes
  • Functions
  • Constants
  • Globals
  • Files
  • Namespaces
  • Deprecated
  • Services
RSS feed
Powered by Drupal