Example #1
0
 /**
  * Amend a file
  *
  * @param $path
  *
  * @param $content
  *
  * @return null
  */
 public static function AmendFile($path, $content)
 {
     /**
      * Gets the corrected path
      */
     $corrected_path = Path::Get($path);
     /**
      * If it exists
      */
     if (file_exists($corrected_path)) {
         /**
          * Open the contents
          */
         $opened_contents = File::Read($path);
         /**
          * Join the two
          */
         $merged_contents = $opened_contents . "\n" . $content;
         /**
          * Write this to file
          */
         File::WriteFile($path, $merged_contents);
     }
     /**
      * Else return null
      */
     return null;
 }