for testing and deploying your application
for finding and fixing issues
for empowering human code reviews
<?php
namespace frictionlessdata\datapackage;
use Exception;
use ZipArchive;
class Package
{
/**
* @param $source
* @param null $basePath
*
* @return \frictionlessdata\datapackage\Datapackages\BaseDatapackage
* @throws \Exception
* @throws \frictionlessdata\datapackage\Exceptions\DatapackageInvalidSourceException
*/
public static function load($source, $basePath = null)
return Factory::datapackage($source, $basePath);
}
* @return \frictionlessdata\datapackage\Validators\DatapackageValidationError[]
public static function validate($source, $basePath = null)
return Factory::validate($source, $basePath);
* @param null $descriptor
* @return mixed
public static function create($descriptor = null, $basePath = null)
$descriptor = Utils::objectify($descriptor);
if ($descriptor && !isset($descriptor->resources)) {
$descriptor->resources = [];
$packageClass = Factory::getDatapackageClass($descriptor);
return new $packageClass($descriptor, $basePath, true);
public static function isZipPresent()
//If ZipArchive is not available throw Exception.
if (!class_exists('ZipArchive')) {
throw new Exception('Error: Your PHP version is not compiled with zip support');