Download the PHP package ecourty/okf without Composer

On this page you can find all versions of the php package ecourty/okf. It is possible to download/install these versions without Composer. Possible dependencies are resolved automatically.

FAQ

After the download, you have to make one include require_once('vendor/autoload.php');. After that you have to import the classes with use statements.

Example:
If you use only one package a project is not needed. But if you use more then one package, without a project it is not possible to import the classes with use statements.

In general, it is recommended to use always a project to download your libraries. In an application normally there is more than one library needed.
Some PHP packages are not free to download and because of that hosted in private repositories. In this case some credentials are needed to access such packages. Please use the auth.json textarea to insert credentials, if a package is coming from a private repository. You can look here for more information.

  • Some hosting areas are not accessible by a terminal or SSH. Then it is not possible to use Composer.
  • To use Composer is sometimes complicated. Especially for beginners.
  • Composer needs much resources. Sometimes they are not available on a simple webspace.
  • If you are using private repositories you don't need to share your credentials. You can set up everything on our site and then you provide a simple download link to your team member.
  • Simplify your Composer build process. Use our own command line tool to download the vendor folder as binary. This makes your build process faster and you don't need to expose your credentials for private repositories.
Please rate this library. Is it a good library?

Informations about the package okf

OKF for PHP

PHP CI

A typed PHP parser and writer for the Open Knowledge Format (OKF) — directories of Markdown files with YAML frontmatter for documenting knowledge as versionable, human- and agent-readable text.

OKF is specified by Google Cloud's knowledge-catalog repository — see okf/SPEC.md for the full spec (currently version 0.1, draft). This library is an independent PHP implementation of that spec, not an official Google product.

Requirements

Installation

Quick Start

The Okf facade is the simplest way to use the library — read a bundle from disk, walk its concepts, and write it back:

Reading a Single Concept

Reading index.md and log.md

index.md and log.md are reserved filenames — the library exposes their raw Markdown body directly rather than parsing their loosely-conventional structure, so nothing is ever silently dropped:

Lazy Iteration

For large bundles, iterate concepts one at a time instead of building the whole Bundle aggregate in memory:

Modifying and Writing a Concept

All models are immutable — "modifying" a concept means constructing a new one:

Creating a New Concept

Validation

Neither reading nor writing ever validates — a concept missing type parses and writes back out without error, matching the OKF spec's permissive consumption model. Validation is a separate, explicit, opt-in step:

Linting a whole bundle:

Unknown Keys and Round-Trip Fidelity

Producer-defined frontmatter keys — and known keys whose value doesn't match the expected type (e.g. tags given as a scalar instead of a list) — are preserved rather than dropped, so a read → write cycle never silently loses data:

Error Handling

All exceptions extend OkfException (a RuntimeException) and carry structured context:

Custom Filesystem

BundleParser/BundleWriter read and write through a single FilesystemInterface seam (exists/read/write/listFiles), defaulting to LocalFilesystem. Provide your own implementation to read from a zip archive, an in-memory store, a remote object store, etc.:

Examples

See the examples/ directory for runnable scripts:

Development

License

This library is released under the MIT License.


All versions of okf with dependencies

PHP Build Version
Package Version
Requires php Version >=8.3
symfony/yaml Version ^6.4 || ^7.0 || ^8.0
Composer command for our command line client (download client) This client runs in each environment. You don't need a specific PHP version etc. The first 20 API calls are free. Standard composer command

The package ecourty/okf contains the following files

Loading the files please wait ...