Bump fractal version to development one.

This commit is contained in:
Benoît Burnichon
2016-05-16 18:19:14 +02:00
parent e995085fd6
commit 148568080f
7 changed files with 79 additions and 59 deletions

View File

@@ -25,6 +25,10 @@
{ {
"type": "vcs", "type": "vcs",
"url": "https://github.com/alchemy-fr/embed-bundle.git" "url": "https://github.com/alchemy-fr/embed-bundle.git"
},
{
"type": "git",
"url": "https://github.com/bburnichon/fractal.git"
} }
], ],
"require": { "require": {
@@ -38,7 +42,7 @@
"alchemy/oauth2php": "1.0.0", "alchemy/oauth2php": "1.0.0",
"alchemy/phlickr": "0.2.9", "alchemy/phlickr": "0.2.9",
"alchemy/phpexiftool": "^0.5.0", "alchemy/phpexiftool": "^0.5.0",
"alchemy/rest-bundle": "^0.0.4", "alchemy/rest-bundle": "^0.0.5",
"alchemy/symfony-cors": "^0.1.0", "alchemy/symfony-cors": "^0.1.0",
"alchemy/task-manager": "2.0.x-dev@dev", "alchemy/task-manager": "2.0.x-dev@dev",
"alchemy/zippy": "^0.3.0", "alchemy/zippy": "^0.3.0",
@@ -69,6 +73,7 @@
"justinrainbow/json-schema": "2.0.3 as 1.6.1", "justinrainbow/json-schema": "2.0.3 as 1.6.1",
"league/flysystem": "^1.0", "league/flysystem": "^1.0",
"league/flysystem-aws-s3-v2": "^1.0", "league/flysystem-aws-s3-v2": "^1.0",
"league/fractal": "dev-bug/null-resource-serialization#d84aa1e as 0.13.0",
"media-alchemyst/media-alchemyst": "^0.5", "media-alchemyst/media-alchemyst": "^0.5",
"monolog/monolog": "~1.3", "monolog/monolog": "~1.3",
"mrclay/minify": "~2.1.6", "mrclay/minify": "~2.1.6",

86
composer.lock generated
View File

@@ -4,8 +4,8 @@
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "c98d08093630862a0d52ee8602c6e6a9", "hash": "83be69ebf62477a152ab89fbc95a390b",
"content-hash": "1269d6d77008c7eb964b2e9c76d02b4f", "content-hash": "4c319cccb54a0e94b0e3cb47b9c71011",
"packages": [ "packages": [
{ {
"name": "alchemy-fr/tcpdf-clone", "name": "alchemy-fr/tcpdf-clone",
@@ -489,20 +489,21 @@
}, },
{ {
"name": "alchemy/rest-bundle", "name": "alchemy/rest-bundle",
"version": "0.0.4", "version": "0.0.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/alchemy-fr/rest-bundle.git", "url": "https://github.com/alchemy-fr/rest-bundle.git",
"reference": "9048a99dd328cd2d01efaad16e6af648d11ad2b4" "reference": "e795b3cd565086d575ee919d1b23279656c982ad"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/rest-bundle/zipball/9048a99dd328cd2d01efaad16e6af648d11ad2b4", "url": "https://api.github.com/repos/alchemy-fr/rest-bundle/zipball/e795b3cd565086d575ee919d1b23279656c982ad",
"reference": "9048a99dd328cd2d01efaad16e6af648d11ad2b4", "reference": "e795b3cd565086d575ee919d1b23279656c982ad",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"league/fractal": "^0.12.0", "league/fractal": "^0.12.0|^0.13.0",
"php": ">=5.4",
"willdurand/negotiation": "~2.0@dev" "willdurand/negotiation": "~2.0@dev"
}, },
"require-dev": { "require-dev": {
@@ -536,7 +537,7 @@
} }
], ],
"description": "Simple REST utility bundle", "description": "Simple REST utility bundle",
"time": "2016-02-20 22:35:16" "time": "2016-05-16 09:37:34"
}, },
{ {
"name": "alchemy/symfony-cors", "name": "alchemy/symfony-cors",
@@ -546,6 +547,12 @@
"url": "https://github.com/alchemy-fr/symfony-cors.git", "url": "https://github.com/alchemy-fr/symfony-cors.git",
"reference": "dbf7fcff1ce9fc1265db12955476ff169eab7375" "reference": "dbf7fcff1ce9fc1265db12955476ff169eab7375"
}, },
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/symfony-cors/zipball/dbf7fcff1ce9fc1265db12955476ff169eab7375",
"reference": "dbf7fcff1ce9fc1265db12955476ff169eab7375",
"shasum": ""
},
"require": { "require": {
"symfony/http-kernel": "^2.3.0|^3.0.0" "symfony/http-kernel": "^2.3.0|^3.0.0"
}, },
@@ -566,11 +573,7 @@
"Alchemy\\CorsBundle\\": "src/Bundle/" "Alchemy\\CorsBundle\\": "src/Bundle/"
} }
}, },
"autoload-dev": { "notification-url": "https://packagist.org/downloads/",
"psr-4": {
"Alchemy\\Cors\\Tests\\": "tests/unit/Component/"
}
},
"license": [ "license": [
"MIT" "MIT"
], ],
@@ -593,7 +596,7 @@
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/task-manager/zipball/2b199e842551a1137640c822f433751a9f402099", "url": "https://api.github.com/repos/alchemy-fr/task-manager/zipball/cefd59cad3ac9b26243f551e704e7142fca79522",
"reference": "cefd59cad3ac9b26243f551e704e7142fca79522", "reference": "cefd59cad3ac9b26243f551e704e7142fca79522",
"shasum": "" "shasum": ""
}, },
@@ -1873,6 +1876,7 @@
"facebook", "facebook",
"sdk" "sdk"
], ],
"abandoned": "facebook/php-sdk-v4",
"time": "2013-11-19 23:11:14" "time": "2013-11-19 23:11:14"
}, },
{ {
@@ -2714,12 +2718,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/hoaproject/Stream.git", "url": "https://github.com/hoaproject/Stream.git",
"reference": "011ab91d942f1d7096deade4c8a10fe57d51c5b3" "reference": "3bc446bc00849bf51166adc415d77aa375d48d8c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/hoaproject/Stream/zipball/3bc446bc00849bf51166adc415d77aa375d48d8c", "url": "https://api.github.com/repos/hoaproject/Stream/zipball/3bc446bc00849bf51166adc415d77aa375d48d8c",
"reference": "011ab91d942f1d7096deade4c8a10fe57d51c5b3", "reference": "3bc446bc00849bf51166adc415d77aa375d48d8c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2764,7 +2768,7 @@
"stream", "stream",
"wrapper" "wrapper"
], ],
"time": "2015-10-22 06:30:43" "time": "2015-10-26 12:21:43"
}, },
{ {
"name": "hoa/ustring", "name": "hoa/ustring",
@@ -3356,23 +3360,23 @@
}, },
{ {
"name": "justinrainbow/json-schema", "name": "justinrainbow/json-schema",
"version": "dev-master", "version": "2.0.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/justinrainbow/json-schema.git", "url": "https://github.com/justinrainbow/json-schema.git",
"reference": "6dad7bf4a76954a4798197810d6425ec0b145fa3" "reference": "c21534c635f03428e92254333fab4ae35b2cdfd9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/6dad7bf4a76954a4798197810d6425ec0b145fa3", "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/c21534c635f03428e92254333fab4ae35b2cdfd9",
"reference": "6dad7bf4a76954a4798197810d6425ec0b145fa3", "reference": "c21534c635f03428e92254333fab4ae35b2cdfd9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"php": ">=5.3.3" "php": ">=5.3.3"
}, },
"require-dev": { "require-dev": {
"json-schema/json-schema-test-suite": "1.2.0", "json-schema/json-schema-test-suite": "1.1.2",
"phpdocumentor/phpdocumentor": "~2", "phpdocumentor/phpdocumentor": "~2",
"phpunit/phpunit": "^4.8.22" "phpunit/phpunit": "^4.8.22"
}, },
@@ -3418,7 +3422,7 @@
"json", "json",
"schema" "schema"
], ],
"time": "2016-05-11 21:39:50" "time": "2016-05-10 20:38:51"
}, },
{ {
"name": "league/flysystem", "name": "league/flysystem",
@@ -3553,17 +3557,11 @@
}, },
{ {
"name": "league/fractal", "name": "league/fractal",
"version": "0.12.0", "version": "dev-bug/null-resource-serialization",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/thephpleague/fractal.git", "url": "https://github.com/bburnichon/fractal.git",
"reference": "0a51dcb6398dc2377d086210d0624996a1df8322" "reference": "d84aa1e"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/thephpleague/fractal/zipball/0a51dcb6398dc2377d086210d0624996a1df8322",
"reference": "0a51dcb6398dc2377d086210d0624996a1df8322",
"shasum": ""
}, },
"require": { "require": {
"php": ">=5.4" "php": ">=5.4"
@@ -3592,7 +3590,11 @@
"League\\Fractal\\": "src" "League\\Fractal\\": "src"
} }
}, },
"notification-url": "https://packagist.org/downloads/", "autoload-dev": {
"psr-4": {
"League\\Fractal\\Test\\": "test"
}
},
"license": [ "license": [
"MIT" "MIT"
], ],
@@ -3612,7 +3614,7 @@
"league", "league",
"rest" "rest"
], ],
"time": "2015-03-19 15:16:43" "time": "2016-05-16 14:18:29"
}, },
{ {
"name": "media-alchemyst/media-alchemyst", "name": "media-alchemyst/media-alchemyst",
@@ -4612,9 +4614,7 @@
"authors": [ "authors": [
{ {
"name": "Fabien Potencier", "name": "Fabien Potencier",
"email": "fabien@symfony.com", "email": "fabien@symfony.com"
"homepage": "http://fabien.potencier.org",
"role": "Lead Developer"
} }
], ],
"description": "Pimple is a simple Dependency Injection Container for PHP 5.3", "description": "Pimple is a simple Dependency Injection Container for PHP 5.3",
@@ -4850,7 +4850,7 @@
} }
], ],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2016-02-14 18:50:07" "time": "2016-04-21 06:36:58"
}, },
{ {
"name": "seld/jsonlint", "name": "seld/jsonlint",
@@ -7401,8 +7401,14 @@
{ {
"alias": "1.6.1", "alias": "1.6.1",
"alias_normalized": "1.6.1.0", "alias_normalized": "1.6.1.0",
"version": "9999999-dev", "version": "2.0.3.0",
"package": "justinrainbow/json-schema" "package": "justinrainbow/json-schema"
},
{
"alias": "0.13.0",
"alias_normalized": "0.13.0.0",
"version": "dev-bug/null-resource-serialization",
"package": "league/fractal"
} }
], ],
"minimum-stability": "stable", "minimum-stability": "stable",
@@ -7410,7 +7416,7 @@
"alchemy/task-manager": 20, "alchemy/task-manager": 20,
"imagine/imagine": 20, "imagine/imagine": 20,
"jms/translation-bundle": 20, "jms/translation-bundle": 20,
"justinrainbow/json-schema": 20, "league/fractal": 20,
"neutron/process-manager": 20, "neutron/process-manager": 20,
"roave/security-advisories": 20, "roave/security-advisories": 20,
"willdurand/negotiation": 15 "willdurand/negotiation": 15

View File

@@ -1212,9 +1212,7 @@ class V1Controller extends Controller
$subdefViews = $this->buildSubdefsViews($allChildren, $names, $urlTTL); $subdefViews = $this->buildSubdefsViews($allChildren, $names, $urlTTL);
$technicalDatasets = $this->app['service.technical_data']->fetchRecordsTechnicalData($allChildren); $technicalDatasets = $this->app['service.technical_data']->fetchRecordsTechnicalData($allChildren);
$newHashes = [];
foreach ($childrenViews as $index => $recordView) { foreach ($childrenViews as $index => $recordView) {
$newHashes[spl_object_hash($recordView)] = $recordView;
$recordView->setSubdefs($subdefViews[$index]); $recordView->setSubdefs($subdefViews[$index]);
$recordView->setTechnicalDataView(new TechnicalDataView($technicalDatasets[$index])); $recordView->setTechnicalDataView(new TechnicalDataView($technicalDatasets[$index]));
} }

View File

@@ -53,7 +53,9 @@ class MediaSubdefService
/** @var RecordReferenceInterface $reference */ /** @var RecordReferenceInterface $reference */
foreach ($references as $index => $reference) { foreach ($references as $index => $reference) {
$carry[$index] = $subdefsByRecordId[$reference->getRecordId()]; if (isset($subdefsByRecordId[$reference->getRecordId()])) {
$carry[$index] = $subdefsByRecordId[$reference->getRecordId()];
};
} }
return $carry; return $carry;

View File

@@ -24,7 +24,12 @@ class ArraySerializer extends SerializerAbstract
public function item($resourceKey, array $data) public function item($resourceKey, array $data)
{ {
return $data ?: null; return $data;
}
public function null($resourceKey)
{
return null;
} }
public function includedData(ResourceInterface $resource, array $data) public function includedData(ResourceInterface $resource, array $data)

View File

@@ -43,20 +43,20 @@ class SubdefTransformer extends TransformerAbstract
$media = $subdefView->getSubdef(); $media = $subdefView->getSubdef();
if (!$media->is_physically_present()) { if (!$media->is_physically_present()) {
return []; return null;
} }
$acl = $this->aclProvider->get($this->user); $acl = $this->aclProvider->get($this->user);
$record = $media->get_record(); $record = $media->get_record();
if ($media->get_name() !== 'document' && false === $acl->has_access_to_subdef($record, $media->get_name())) { if ($media->get_name() !== 'document' && false === $acl->has_access_to_subdef($record, $media->get_name())) {
return []; return null;
} }
if ($media->get_name() === 'document' if ($media->get_name() === 'document'
&& !$acl->has_right_on_base($record->getBaseId(), 'candwnldhd') && !$acl->has_right_on_base($record->getBaseId(), 'candwnldhd')
&& !$acl->has_hd_grant($record) && !$acl->has_hd_grant($record)
) { ) {
return []; return null;
} }
$permalink = $subdefView->getPermalinkView() $permalink = $subdefView->getPermalinkView()

View File

@@ -800,25 +800,29 @@ class ApiJsonTest extends ApiTestCase
public function testSearchRoute() public function testSearchRoute()
{ {
self::$DI['app']['manipulator.user'] = $this->getMockBuilder('Alchemy\Phrasea\Model\Manipulator\UserManipulator') $app = $this->getApplication();
$app['manipulator.user'] = $this->getMockBuilder('Alchemy\Phrasea\Model\Manipulator\UserManipulator')
->setConstructorArgs([ ->setConstructorArgs([
self::$DI['app']['model.user-manager'], $app['model.user-manager'],
self::$DI['app']['auth.password-encoder'], $app['auth.password-encoder'],
self::$DI['app']['geonames.connector'], $app['geonames.connector'],
self::$DI['app']['repo.users'], $app['repo.users'],
self::$DI['app']['random.low'], $app['random.low'],
self::$DI['app']['dispatcher'], $app['dispatcher'],
]) ])
->setMethods(['logQuery']) ->setMethods(['logQuery'])
->getMock(); ->getMock();
self::$DI['app']['manipulator.user']->expects($this->once())->method('logQuery'); $app['manipulator.user']->expects($this->once())->method('logQuery');
$this->setToken($this->userAccessToken); $this->setToken($this->userAccessToken);
self::$DI['client']->request('POST', '/api/v1/search/', $this->getParameters(), [], ['HTTP_Accept' => $this->getAcceptMimeType()]); $response = $this->request('POST', '/api/v1/search/', $this->getParameters(), [
$content = $this->unserialize(self::$DI['client']->getResponse()->getContent()); 'HTTP_Accept' => $this->getAcceptMimeType(),
]);
$content = $this->unserialize($response->getContent());
$this->evaluateResponse200(self::$DI['client']->getResponse()); $this->evaluateResponse200($response);
$this->evaluateMeta200($content); $this->evaluateMeta200($content);
$response = $content['response']; $response = $content['response'];