Elgg  Version 2.2
 All Classes Namespaces Files Functions Variables Pages
InMemory.php
Go to the documentation of this file.
1 <?php
3 
5 
13 final class InMemory {
14 
22  public static function fromArray(array $files) /*: Directory*/ {
23  $dir = Fly::createInMemory();
24 
25  foreach ($files as $file => $content) {
26  $dir->putContents($file, $content);
27  }
28 
29  return $dir;
30  }
31 }
A simple directory abstraction.
Definition: Directory.php:13
if(!array_key_exists($filename, $text_files)) $file
static createInMemory()
Shorthand for generating a new in-memory-only filesystem.
Definition: Fly.php:166
static fromArray(array $files)
Shorthand for generating a new in-memory-only filesystem.
Definition: InMemory.php:22
$content
Set robots.txt action.
Definition: set_robots.php:6
foreach($resources as $id=> $href) if(!empty($resources_html)) $files
Definition: details.php:141
Namespace for generating in-memory filesystems.
Definition: InMemory.php:13