public static function filePutContents($filepath, $contents, $message, $usedate = true)
    {
        $suffix = '';

        // Check date
        if ($usedate) {
            $suffix = ' on '.date('l jS \of F Y h:i:s A');
        }

        // Update contents
        $contents = !empty($contents) ? $contents."\n" : $contents;

        // Copy file contents
        file_put_contents($filepath, "/**\n * ".$message.$suffix.".\n */\n\n".$contents);
    }
public static function filePutContents($filepath, $contents, $message, $usedate = true)
    {
        $suffix = '';

        // Check date
        if ($usedate) {
            $suffix = ' on '.date('l jS \of F Y h:i:s A');
        }

        // Update contents
        $contents = !empty($contents) ? $contents."\n" : $contents;

        // Copy file contents
        file_put_contents($filepath, "/**\n * ".$message.$suffix.".\n */\n\n".$contents);
    }
public static function filePutContents ( $ filepath , $ contents , $ message , $ usedate = true ) { $ suffix = '' ; // Check date if ( $ usedate ) { $ suffix = ' on ' . date ( 'l jS \of F Y h:i:s A' ) ; } // Update contents $ contents = ! empty ( $ contents ) ? $ contents . "\n" : $ contents ; // Copy file contents file_put_contents ( $ filepath , "/**\n * " . $ message . $ suffix . ".\n */\n\n" . $ contents ) ; }
Helper function to create a file in a target path with its contents.

@param string $targetFilepath
@param string $message
@param boolean $useDate
Helper function to create a file in a target path with its contents .