src/includes/mock-fs.php
function setfs( $paths ) {
		if ( ! is_array($paths) )
			$paths = explode( "\n", $paths );

		$paths = array_filter( array_map( 'trim', $paths ) );

		foreach ( $paths as $path ) {
			// Allow for comments
			if ( '#' == $path[0] )
				continue;

			// Directories
			if ( '/' == $path[ strlen($path) -1 ] )
				$this->mkdir( $path );
			else // Files (with dummy content for now)
				$this->put_contents( $path, 'This is a test file' );
		}

	}
function setfs( $paths ) {
		if ( ! is_array($paths) )
			$paths = explode( "\n", $paths );

		$paths = array_filter( array_map( 'trim', $paths ) );

		foreach ( $paths as $path ) {
			// Allow for comments
			if ( '#' == $path[0] )
				continue;

			// Directories
			if ( '/' == $path[ strlen($path) -1 ] )
				$this->mkdir( $path );
			else // Files (with dummy content for now)
				$this->put_contents( $path, 'This is a test file' );
		}

	}
function setfs ( $ paths ) { if ( ! is_array ( $ paths ) ) $ paths = explode ( "\n" , $ paths ) ; $ paths = array_filter ( array_map ( 'trim' , $ paths ) ) ; foreach ( $ paths as $ path ) { // Allow for comments if ( '#' == $ path [ 0 ] ) continue ; // Directories if ( '/' == $ path [ strlen ( $ path ) - 1 ] ) $ this -> mkdir ( $ path ) ; else // Files (with dummy content for now) $ this -> put_contents ( $ path , 'This is a test file' ) ; } }
"Bulk Loads" a filesystem into the internal virtual filesystem
Bulk Loads a filesystem into the internal virtual filesystem