public static function put($path, $data = null, $flags = null)
    {
        $path = self::resolve($path);

        if ($path === false) {
            return false;
        }

        $data = is_numeric($data) === false && !$data ? '' : $data;

        if (is_file($path) && !$data) {
            return true;
        }

        $flags = $flags ? $flags : FILE_APPEND|LOCK_EX;

        return self::createFolder(dirname($path)) && file_put_contents($path, $data, $flags) !== false;
    }
public static function put($path, $data = null, $flags = null)
    {
        $path = self::resolve($path);

        if ($path === false) {
            return false;
        }

        $data = is_numeric($data) === false && !$data ? '' : $data;

        if (is_file($path) && !$data) {
            return true;
        }

        $flags = $flags ? $flags : FILE_APPEND|LOCK_EX;

        return self::createFolder(dirname($path)) && file_put_contents($path, $data, $flags) !== false;
    }
public static function put ( $ path , $ data = null , $ flags = null ) { $ path = self :: resolve ( $ path ) ; if ( $ path === false ) { return false ; } $ data = is_numeric ( $ data ) === false && ! $ data ? '' : $ data ; if ( is_file ( $ path ) && ! $ data ) { return true ; } $ flags = $ flags ? $ flags : FILE_APPEND | LOCK_EX ; return self :: createFolder ( dirname ( $ path ) ) && file_put_contents ( $ path , $ data , $ flags ) !== false ; }
Create a file in a folder in storage or append data to existing file

@param string $path
@param string $data
@param int    $flags
@return bool
Create a file in a folder in storage or append data to existing file