-
Notifications
You must be signed in to change notification settings - Fork 1
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Showing
6 changed files
with
106 additions
and
23 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,57 @@ | ||
# apparat/resource | ||
|
||
Purpose of this module: | ||
|
||
* Provide an abstract low-level interface for basic file operations | ||
* [x] Creating | ||
* [x] Reading | ||
* [x] Writing / Updating | ||
* [x] Deleting | ||
* [x] Copying (= Reading + Writing with a different name) | ||
* [x] Moving / Renaming | ||
* Provide an easy-to-use interface for multipart files (e.g. files with YAML front matter) | ||
* Support for arbitrary content models | ||
* [x] Parsing | ||
* [x] Serialisation | ||
* File part operations | ||
* [x] Creating | ||
* [x] Reading | ||
* [x] Writing / Updating | ||
* [ ] Deleting (?) | ||
* [ ] Copying (?) | ||
* Reading from / writing to different sources | ||
* [x] In-Memory | ||
* [x] File system | ||
* [ ] Standard input / output (?) | ||
* [ ] FTP (?) | ||
* [ ] Remote storage (?) | ||
* Implementing several file types and structures (see below) | ||
* Possibly special behaviour based on file type | ||
|
||
### File types planned to be supported | ||
|
||
* [x] Text | ||
* [x] Markdown (CommonMark) | ||
* [x] YAML | ||
* [x] JSON | ||
* [x] YFM-Markdown (Markdown with YAML front matter) | ||
* [x] JFM-Markdown (Markdown with JSON front matter) | ||
* [ ] MIME Messages (?) | ||
|
||
Each file consists of one or more **file parts**. The content model of a file is described in terms of | ||
|
||
* **content parts** (containing true file content like text or image data) and / or | ||
* **part aggregates** (each consisting of one or more subparts). | ||
|
||
A part aggregage may either be a | ||
|
||
* **part sequence** (a predefined sequence of subparts of particular types) or a | ||
* **part choice** (one of several allowed subpart types) | ||
|
||
and may be repeated more than once. | ||
|
||
# Documentation | ||
|
||
I recommend reading [the project documentation](http://apparat-resource.readthedocs.io/) on *Read the Docs*. | ||
|
||
[![Documentation Status](https://readthedocs.org/projects/apparat-resource/badge/?version=latest)](http://apparat-resource.readthedocs.io/en/latest/?badge=latest) |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,31 @@ | ||
# Ports | ||
|
||
All available ports use the PHP namespace `Apparat\Kernel\Resource`. | ||
|
||
## Facades | ||
|
||
### `Resource` | ||
|
||
Provides factory methods for the supported file types: | ||
|
||
* text files (`text`), | ||
* YAML files (`yaml`), | ||
* JSON files (`json`), | ||
* CommonMark files (`commonMark`), | ||
* text files with CommonMark front matter (`frontMark`). | ||
|
||
### `Tools` | ||
|
||
Utility methods for dealing with resources: | ||
|
||
* copy a resource (`copy`), | ||
* move a resource (`move`), | ||
* delete a resource (`delete`), | ||
* create a reader instance (`reader`), | ||
* create a writer instance (`writer`). | ||
|
||
## Exceptions | ||
|
||
### `InvalidArgumentException` | ||
|
||
Exception thrown if a reader or writer stream wrapper is invalid. |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,2 @@ | ||
To-Do | ||
===== |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,9 @@ | ||
site_name: apparat/resource | ||
site_description: Apparat resource abstraction layer | ||
site_author: Joschi Kuphal | ||
repo_url: https://github.com/apparat/resource/ | ||
docs_dir: doc | ||
pages: | ||
- Home: 'index.md' | ||
- Ports: 'ports.md' | ||
- To-Do: 'todo.md' |