original_string: protected function saveCompiledFile($filename)
      {
          $file = PhpFile::instance($filename);
  
          // Attempt to lock the file for writing.
          try {
              $file->lock(false);
          } catch (\Exception $e) {
              // Another process has locked the file; we will check this in a bit.
          }
  
          if ($file->locked() === false) {
              // File was already locked by another process.
              return;
          }
  
          $cache = [
              '@class' => \get_class($this),
              'timestamp' => time(),
              'checksum' => $this->checksum(),
              'files' => $this->files,
              'data' => $this->getState()
          ];
  
          $file->save($cache);
          $file->unlock();
          $file->free();
  
          $this->modified();
      }
code: protected function saveCompiledFile($filename)
      {
          $file = PhpFile::instance($filename);
  
          // Attempt to lock the file for writing.
          try {
              $file->lock(false);
          } catch (\Exception $e) {
              // Another process has locked the file; we will check this in a bit.
          }
  
          if ($file->locked() === false) {
              // File was already locked by another process.
              return;
          }
  
          $cache = [
              '@class' => \get_class($this),
              'timestamp' => time(),
              'checksum' => $this->checksum(),
              'files' => $this->files,
              'data' => $this->getState()
          ];
  
          $file->save($cache);
          $file->unlock();
          $file->free();
  
          $this->modified();
      }
code_tokens: protected function saveCompiledFile ( $ filename ) { $ file = PhpFile :: instance ( $ filename ) ; // Attempt to lock the file for writing. try { $ file -> lock ( false ) ; } catch ( \ Exception $ e ) { // Another process has locked the file; we will check this in a bit. } if ( $ file -> locked ( ) === false ) { // File was already locked by another process. return ; } $ cache = [ '@class' => \ get_class ( $ this ) , 'timestamp' => time ( ) , 'checksum' => $ this -> checksum ( ) , 'files' => $ this -> files , 'data' => $ this -> getState ( ) ] ; $ file -> save ( $ cache ) ; $ file -> unlock ( ) ; $ file -> free ( ) ; $ this -> modified ( ) ; }
docstring: Save compiled file.
  
  @param  string  $filename
  @throws \RuntimeException
  @internal
docstring_tokens: Save compiled file .