Download the PHP package goez/drafter-php without Composer

On this page you can find all versions of the php package goez/drafter-php. 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 drafter-php

Drafter PHP Wrapper

PHP wrapper for Drafter API Blueprint Parser harness.

Minimum PHP Version codecov.io

What is Drafter-php?

Drafter-php allows you to use use the drafter API Blueprint Parser harness with your PHP application.

In a nutshell: you can convert API Blueprint files to parse result.

API Blueprint is a webservice documentation language built on top of Markdown.

Requirements

What Is What

Drafter is a C++ tool to parse API Blueprint.
Drafter-php is a PHP wrapper around the Drafter command line tool.

Installation

The recommended way to install Drafter-php is by using composer:

This will install the PHP package with your application.
Please keep in mind that Drafter is not included.

Install Drafter Command Line Tool using Composer

Head over to hmaus/drafter-installer.

Usage of Drafter-php

  1. Get an instance of the \DrafterPhp\DrafterInterface implementation, \DrafterPhp\Drafter 1.1 You will need to pass the path to your drafter binary to the constructor 1.2 It is recommended to solve this using a dependency injection container
  2. Set the input file and options on your \DrafterPhp\Drafter instance 2.1 Drafter-php currently does not support passing blueprint code directly to Drafter; it has to be stored in a file at this time
  3. Run your command

Input / Output Examples

Note: drafter-php does not assert the structure of the output. If you see differences in the examples to your actual output, please refer to the official drafter docs.

Given this api blueprint source:

The result will look similar (json refract):

Code Examples

Found something wrong? Feel free to contribute

Make sure it works

To make sure it works, we'll ask Drafter for the current version.

$version should now contain a string like v1.0.0. If something is wrong, an exception will have been thrown most likely.

Keep in mind that Drafter-php is designed to keep its state, run \DrafterPhp\DrafterInterface::resetOptions to get rid of the version option you just set for the next call on the instance.

Parse your-service.apib into your-service.refract.json

Make sure your input path is correct and readable, and your output path is writable.

Parse your-service.apib into your-service.ast.json

Make sure your input path is correct and readable, and your output path is writable.

Parse your-service.apib into a PHP data structure

Parse your-service.apib into YAML format

Get Process before it is run

Feature Roadmap

Do not hesitate to contribute.

License

Drafter-php is licensed under the MIT License - see the LICENSE file for details


All versions of drafter-php with dependencies

PHP Build Version
Package Version
Requires php Version >=8.0
symfony/process Version >=5.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 goez/drafter-php contains the following files

Loading the files please wait ....