本文整理匯總了PHP中FileModel::realpath方法的典型用法代碼示例。如果您正苦於以下問題:PHP FileModel::realpath方法的具體用法?PHP FileModel::realpath怎麽用?PHP FileModel::realpath使用的例子?那麽, 這裏精選的方法代碼示例或許可以為您提供幫助。您也可以進一步了解該方法所在類FileModel
的用法示例。
在下文中一共展示了FileModel::realpath方法的1個代碼示例,這些例子默認根據受歡迎程度排序。您可以為喜歡或者感覺有用的代碼點讚,您的評價將有助於係統推薦出更棒的PHP代碼示例。
示例1: TableRow
$rows[] = new TableRow(new FileModel($row), $fields);
}
}
$middle = render_str('foobar/table', compact('fields', 'rows'));
} else {
$file = new FileModel($f);
if (is_dir($f)) {
$fields = array(new TableFieldIcon(), new TableFieldLink('Name', 'basename', function (FileModel $file) {
return url(array('q' => false, 'f' => $file->path()));
}), new TableField('Type', 'type'), new TableFieldFormat('Size', 'size', 'format_bytes'), new TableField('MIME', 'mime'), new TableField('Owner', 'owner'), new TableField('Group', 'group'), new TableField('Permissions', 'perms'));
$rows = $file->rows();
$middle = render_str('foobar/table', array('fields' => $fields, 'rows' => new TableRowGenerator($rows, $fields)));
} else {
switch ($file->mime()) {
case 'audio/mpeg':
if (begins($file->realpath(), $_SERVER['DOCUMENT_ROOT'])) {
$middle = render_str('foobar/audio', array('src' => replace_prefix($file->realpath(), $_SERVER['DOCUMENT_ROOT'], '/')));
} else {
$middle = render_str('foobar/audio', array('src' => 'image.php?' . http_build_query(array('f' => $file->realpath()))));
}
break;
case 'video/mp4':
if (begins($file->realpath(), $_SERVER['DOCUMENT_ROOT'])) {
$middle = render_str('foobar/video', array('src' => replace_prefix($file->realpath(), $_SERVER['DOCUMENT_ROOT'], '/')));
} else {
$middle = render_str('foobar/video', array('src' => 'image.php?' . http_build_query(array('f' => $file->realpath()))));
}
break;
case 'image/svg+xml':
case 'image/png':
case 'image/jpeg':