You appear to be a bot. Output may be restricted
Description
Create a file with the specified name in the specified directory
Usage
bw_create_file( $base, $path, $default );
Parameters
- $base
- ( mixed ) required –
- $path
- ( mixed ) required –
- $default
- ( mixed ) required –
Returns
voidSource
File name: oik/admin/oik-admin.phpLines:
1 to 16 of 16
function bw_create_file( $base, $path, $default ) { $target = path_join( $base, $path ); if ( !file_exists( $target ) ) { // create an empty file - or copy the original // $info = pathinfo( $target ); // $name = basename( $target ); if ( $default ) { $success = copy( $default, $target ); } else { // write an empty file $resource = fopen( $target, 'xb' ); fclose( $resource ); } } }View on GitHub View on Trac