public function createItem($detail = [])
{
// Default options
$defaults = ['@type' => 'dir'];
$detail = array_merge($defaults, $detail);
$old = umask(0);
$type = $detail['@type'];
if ($type === 'dir' && !file_exists($this->path)) {
mkdir($this->path, 0777, true);
} elseif ($type === 'file') {
$content = $detail['@content'];
$handle = fopen($this->path, "wb");
fwrite($handle, $content);
fclose($handle);
} elseif ($type === 'link') {
$target = $detail['@destination'];
$link = $this->path;
symlink($target, $link);
}
umask($old);
}