src/Bandolier/Type/Paths.php
public static function filePutContents($filePath, $content = null)
    {
        // https://stackoverflow.com/a/282140/405758
        if (!file_exists(dirname($filePath))) {
            mkdir(dirname($filePath), 0775, true);
        }
        return file_put_contents($filePath, $content);
    }
public static function filePutContents($filePath, $content = null)
    {
        // https://stackoverflow.com/a/282140/405758
        if (!file_exists(dirname($filePath))) {
            mkdir(dirname($filePath), 0775, true);
        }
        return file_put_contents($filePath, $content);
    }
public static function filePutContents ( $ filePath , $ content = null ) { // https://stackoverflow.com/a/282140/405758 if ( ! file_exists ( dirname ( $ filePath ) ) ) { mkdir ( dirname ( $ filePath ) , 0775 , true ) ; } return file_put_contents ( $ filePath , $ content ) ; }
Traverse path to make file
@param string $filePath path to file to check if it exists
@param string|null $content content of file to be written
@return bool|int
Traverse path to make file