trellis-ldp/static-ldp 问题修复 & 功能扩展

解决BUG、新增功能、兼容多环境部署,快速响应你的开发需求

邮箱:yvsm@zunyunkeji.com | QQ:316430983 | 微信:yvsm316

trellis-ldp/static-ldp

Composer 安装命令:

composer create-project trellis-ldp/static-ldp

包简介

LDP Server for static assets

关键字:

README 文档

README

A simple way to expose static assets as a read-only LDP server.

Minimum PHP Version Build Status

Requirements

Installation

To install static-ldp, follow these steps:

  1. run composer create-project trellis-ldp/static-ldp
  2. create a ./.env.local file like this:
TRELLIS_SOURCE_DIR='/path/to/resources'

Basics

By installing static-ldp and configuring the TRELLIS_SOURCE_DIR to point to the location of your static resources, you have a simple, read-only linked data server.

The web content will be served from the ./public directory.

LDP Resources

Individual files are served as ldp:NonRDFSource resources, and directories are served as ldp:BasicContainer resources. If a static file is a RDF file, then it is served as an ldp:RDFSource.

Describing LDP Non-RDF Resources

It is also possible to describe an ldp:NonRDFSource via the Link: <IRI>; rel="describedby" header. For example, if a JPEG file is named rosid_rosaceae.jpg, then by adding an RDF file with the name rosid_rosaceae.jpg.ttl (or any valid RDF format such as rosid_rosaceae.jpg.jsonld), then requests to rosid_rosaceae.jpg will include a link header pointing to the ldp:RDFSource. Similarly, the ldp:RDFSource will contain a link header (rel="describes") pointing to the ldp:NonRDFSource.

Support for instance digests

All resources support instance digests as defined in RFC 3230. What this means is that the response can include a Digest header so that it is possible to ensure end-to-end data integrity. Requests that include the header: Want-Digest: md5 or Want-Digest: sha1 will include responses that contain a digest corresponding to the on-disk resource.

Only md5 and sha1 algorithms are supported; other algorithms will be ignored. It should be noted that, for large files, Want-Digest requests may perform considerably slower, as the digest will need to be computed before a response is sent.

Configuration

There are many configuration options available. Only the sourceDirectory must be defined. Other options include:

template: default.twig

If you wish to override the HTML template with one of your own design, you can change this value to point to a different location. Alternately, you can edit the default.twig file in the templates directory. Though if you plan to customize the template, it is recommended that you use a separate file.

defaultRdfFormat: turtle

For requests without an Accept header, this is the RDF format used in responses (for ldp:RDFSource and ldp:BasicContainer resources).

contentDisposition: false

For ldp:NonRDFSource resources, this controls whether to include a Content-Disposition header in responses.

extraPropertiesFilename: properties

For each directory that becomes a ldp:BasicContainer resource, an RDF file within that directory with this name will have its contents added to the RDF presented as a response for that resource (instead of becoming a child resource in its own right). This provides a means by which to add user-controlled properties to ldp:BasicContainers.

validRdfFormats:
    turtle:
        mimeType: text/turtle
        extension: ttl
    jsonld:
        mimeType: application/ld+json
        extension: jsonld
    ntriples:
        mimeType: application/n-triples
        extension: nt

Generally speaking, the RDF formats should not be changed unless there is a need to support a serialization that is not included here. The RDF format (e.g. turtle, jsonld) must be an RDF serialization format supported by EasyRdf.

prefixes:
    dc: "http://purl.org/dc/terms/"
    rdf: "http://www.w3.org/1999/02/22-rdf-syntax-ns#"
    ...

The default HTML display template will present IRIs in short (prefixed) form if those prefixes are registered. By default a number of common prefixes are included, but any prefix may be registered here.

trellis-ldp/static-ldp 适用场景与选型建议

trellis-ldp/static-ldp 是一款 基于 PHP 开发的 Composer 扩展包,目前已累计 24 次下载、GitHub Stars 达 12, 最近一次更新时间为 2017 年 04 月 11 日, 在 PHP 生态内属于活跃度较高的组件。

它主要适用于以下技术方向: 「ldp」 等业务场景。在实际项目中,围绕这些方向常见需要落地的问题包括:接口对接、性能调优、并发安全、与既有框架(Laravel / ThinkPHP / Yii / Webman 等)的兼容适配,以及生产环境的日志埋点与稳定性保障。

我们在过去多个企业项目中使用过 trellis-ldp/static-ldp 或与其功能相近的方案,如果你在选型或落地过程中遇到问题,例如 版本兼容、二次改造、私有化封装、与内部系统对接、生产 BUG 排查,欢迎联系我们协助评估。

围绕 trellis-ldp/static-ldp 我们能提供哪些服务?
定制开发 / 二次开发

基于 trellis-ldp/static-ldp 在你已有业务上做功能扩展、字段裁剪、UI 适配、与内部账号 / 权限 / 日志系统的深度对接。

BUG 修复 & 性能优化

线上偶发问题、内存泄漏、慢查询、并发异常等排查修复;针对高流量场景做缓存、队列、索引层面的调优。

项目外包 & 长期维护

承接完整的项目从需求 → 设计 → 开发 → 上线 → 长期运维;也可按月提供技术保姆服务。

yvsm@zunyunkeji.com QQ:316430983 微信:yvsm316 西安尊云信息科技 · 专注 PHP / Go / 分布式系统研发

统计信息

  • 总下载量: 24
  • 月度下载量: 0
  • 日度下载量: 0
  • 收藏数: 12
  • 点击次数: 14
  • 依赖项目数: 0
  • 推荐数: 0

GitHub 信息

  • Stars: 12
  • Watchers: 5
  • Forks: 2
  • 开发语言: PHP

其他信息

  • 授权协议: Apache-2.0
  • 更新时间: 2017-04-11