code: private function writeToWebDir($file, $contents)
      {
          if (!$this->webDir) {
              return;
          }
  
          if (!is_writable($this->webDir)) {
              trigger_error(sprintf('Directory %s is not writeable', $this->webDir));
  
              return;
          }
  
          $destFile = $this->webDir . $file;
          $destDir  = dirname($destFile);
  
          if (!is_dir($destDir)) {
              mkdir($destDir, 0777, true);
          }
  
          file_put_contents($destFile, $contents);
      }
docs: Writes the file in the web_dir so next time web server serve it
  
  @param string $file
  @param string $contents
  @return null