protected function get_default_atts( $atts ) {

		if ( false === isset( $atts['type'] ) ) {
			$atts['type'] = 'file';
		}

		if ( 'file' === $atts['type'] ) {
			$defaults = array( 'contents' => '', 'mode' => 0644, 'size' => 0, );
		} elseif ( 'dir' === $atts['type'] ) {
			$defaults = array( 'contents' => new stdClass(), 'mode' => 0755 );
		} else {
			$defaults = array();
		}

		$atts = array_merge(
			array(
				'atime' => time(),
				'mtime' => time(),
				'owner' => '',
				'group' => '',
			)
			, $defaults
			, $atts
		);

		if ( ! empty( $atts['contents'] ) && 'file' === $atts['type'] ) {
			$atts['size'] = mb_strlen( $atts['contents'], '8bit' );
		}

		return (object) $atts;
	}
protected function get_default_atts( $atts ) {

		if ( false === isset( $atts['type'] ) ) {
			$atts['type'] = 'file';
		}

		if ( 'file' === $atts['type'] ) {
			$defaults = array( 'contents' => '', 'mode' => 0644, 'size' => 0, );
		} elseif ( 'dir' === $atts['type'] ) {
			$defaults = array( 'contents' => new stdClass(), 'mode' => 0755 );
		} else {
			$defaults = array();
		}

		$atts = array_merge(
			array(
				'atime' => time(),
				'mtime' => time(),
				'owner' => '',
				'group' => '',
			)
			, $defaults
			, $atts
		);

		if ( ! empty( $atts['contents'] ) && 'file' === $atts['type'] ) {
			$atts['size'] = mb_strlen( $atts['contents'], '8bit' );
		}

		return (object) $atts;
	}
protected function get_default_atts ( $ atts ) { if ( false === isset ( $ atts [ 'type' ] ) ) { $ atts [ 'type' ] = 'file' ; } if ( 'file' === $ atts [ 'type' ] ) { $ defaults = array ( 'contents' => '' , 'mode' => 0644 , 'size' => 0 , ) ; } elseif ( 'dir' === $ atts [ 'type' ] ) { $ defaults = array ( 'contents' => new stdClass ( ) , 'mode' => 0755 ) ; } else { $ defaults = array ( ) ; } $ atts = array_merge ( array ( 'atime' => time ( ) , 'mtime' => time ( ) , 'owner' => '' , 'group' => '' , ) , $ defaults , $ atts ) ; if ( ! empty ( $ atts [ 'contents' ] ) && 'file' === $ atts [ 'type' ] ) { $ atts [ 'size' ] = mb_strlen ( $ atts [ 'contents' ] , '8bit' ) ; } return ( object ) $ atts ; }
Get the default attributes for a file.

@since 0.1.0

@param string $atts

@return object The attributes.
Get the default attributes for a file .