+
Skip to content

PhataPak/PhataPak

Repository files navigation

PhataPak

The main (mono) repository for PhataPak

About

  • The main goal of this project is to provide reusable data for usage in and the development of PHP software.

  • Data in this project is not limited to data about PHP (development) itself but can contain information about other languages, infrastructure and IT ecosystems.

  • The data in this project is made available in the Data Package format and under the PDDL license.

  • The data packages in this project are not meant to be comprehensive, complete or 'correct'. They are meant to be reference points to apply DRY principle on a data level and to support data driven development approaches.

Usage

  • Data packages will be able to be obtained as single composer packages or as or as composer packages containing all data packages of a specific (sub-)category (e.g: vcs).

  • A datapackage in the packages root directory contains information about individual datapackages in the project and acts as a registry for them.

  • To work with the datapackages in your PHP project you can use the Data Package or Table Schema libraries provided by Frictionless Data

  • To import datapackages into your project or into any other format we recommend the PortPHP library in conjunction with above packages.

Example

A quick example on how to import a Data Package into your Database via Doctrine ORM using Table Schema and PortPHP Doctrine:

use Port\Doctrine\DoctrineWriter;
use Port\Reader\IteratorReader;
use Port\Steps\StepAggregator as Workflow;
use frictionlessdata\tableschema\Table;
// create a table object from the source files
$table = new Table("data.csv", "datapackage.json");
// since the Table class implements (SPL) Iterator, we can use a IteratorReader
$reader = new IteratorReader($table);
// create the Doctrine ObjectManager (please, see Doctrine's documentation)
[...]
// create a Doctrine Writer
/** @var \Doctrine\Common\Persistence\ObjectManager $objectManager */
$writer = new DoctrineWriter($objectManager, 'YourNamespace:EntityName');
$writer->prepare();
// create a workflow object to wire up the reader and writer
$workflow = (new Workflow($reader))->addWriter($writer);
// import the data
$result = $workflow->process()

Guidelines

Licenses

Third Party Copyrights

  • The Icon used as a Logo for PhetaPak is copyright Icons8 and licensed under CC BY-ND 3.0

About

the main (mono) repository for PhataPak

Resources

License

Code of conduct

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages

点击 这是indexloc提供的php浏览器服务,不要输入任何密码和下载