public function load($path)
{
$r = array();
$path = $this->configuration['basepath'] . $path;
if (is_dir($path)) {
if (false !== ($d = @opendir($path))) {
while (false !== ($f = @readdir($d))) {
if (0 == strncmp($f, '.', 1)) {
continue;
}
$full_path = $path . '/' . $f;
$r2 = array();
$r2['basename'] = $f;
$is_collection = is_dir($full_path);
$r2['is_collection'] = $is_collection ? '1' : '0';
$r2['size'] = $is_collection ? 0 : @filesize($full_path);
$r2['date_created'] = $is_collection ? 0 : @filectime($full_path);
$r2['date_modified'] = $r2['date_created'];
$r2['content_type'] = amy_mime_content_type($full_path);
$r2['version'] = 1;
$r[] = $r2;
}
@closedir($d);
}
} else {
$r = @file_get_contents($path);
}
return $r;
}