Skip to content

Commit dd90a8e

Browse files
committed
add basic save functionality
1 parent 22d7bb1 commit dd90a8e

12 files changed

Lines changed: 2620 additions & 6 deletions

.gitignore

Lines changed: 0 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,6 @@
11
/vendor/
22
/.idea/
33
/coverage-clover.xml
4-
/composer.lock
54
/.php_cs
65
/.php_cs.cache
76
/php-cs-fixer

README.md

Lines changed: 10 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -15,9 +15,11 @@ A utility library for working with [Data Package](https://specs.frictionlessdata
1515
### Installation
1616

1717
```bash
18-
$ composer require frictionlessdata/datapackage
18+
composer require frictionlessdata/datapackage
1919
```
2020

21+
Optionally, to create zip files you will need the PHP zip extension. On ubuntu it can be enabled with `sudo apt-get install php-zip`
22+
2123
### Package
2224

2325
Load a data package conforming to the specs
@@ -98,6 +100,13 @@ $package->resource("resource-name", [
98100
$package->saveDescriptor("datapackage.json");
99101
```
100102

103+
Save the entire datapackage including any local data to a zip file
104+
105+
```php
106+
$package->save("datapackage.zip");
107+
```
108+
109+
101110
### Resource
102111

103112
Resource objects can be accessed from a Package as described above

composer.json

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,8 @@
55
"require": {
66
"php": ">=5.4",
77
"justinrainbow/json-schema": "^5.2",
8-
"frictionlessdata/tableschema": "^0.1.6"
8+
"frictionlessdata/tableschema": "^0.1.6",
9+
"alchemy/zippy": "=0.3.5"
910
},
1011
"require-dev": {
1112
"phpunit/phpunit": "^4.8.35",

0 commit comments

Comments
 (0)