diff --git a/.gitignore b/.gitignore
index f95b1a4b7e..a039125aae 100644
--- a/.gitignore
+++ b/.gitignore
@@ -55,7 +55,7 @@ composer.phar
behat.yml
# Exclude vagrant configuration file
-.vagrant
+/.vagrant
# Exclude crossdomain.xml file it's generated
/www/crossdomain.xml
diff --git a/Vagrantfile b/Vagrantfile
index 15e6f9d388..c8278ecfa0 100644
--- a/Vagrantfile
+++ b/Vagrantfile
@@ -7,7 +7,7 @@ end
root = File.dirname(File.expand_path(__FILE__))
Vagrant.configure("2") do |config|
- Dir.glob(root+"/vagrant/vms/**/puphpet/config.yaml").each do|f|
+ Dir.glob(root+"/resources/vagrant/vms/**/puphpet/config.yaml").each do|f|
dir = File.dirname(File.expand_path(f+"/.."))
base_path = dir
configValues = YAML.load_file(f)
@@ -26,7 +26,7 @@ Vagrant.configure("2") do |config|
end
if data['vm']['network']['private_network'].to_s != ''
- node.vm.network "private_network", ip: "#{data['vm']['network']['private_network']}"
+ node.vm.network :private_network, ip: "#{data['vm']['network']['private_network']}"
end
data['vm']['network']['forwarded_port'].each do |i, port|
diff --git a/bin/console b/bin/console
index 05f610d68c..35a6240fae 100755
--- a/bin/console
+++ b/bin/console
@@ -15,7 +15,6 @@ use Alchemy\Phrasea\Command\Plugin\ListPlugin;
use Alchemy\Phrasea\Command\Setup\H264ConfigurationDumper;
use Alchemy\Phrasea\Command\Setup\H264MappingGenerator;
use Alchemy\Phrasea\Command\Setup\StaticConfigurationDumper;
-use Alchemy\Phrasea\Command\Setup\StaticMappingGenerator;
use Alchemy\Phrasea\Command\SearchEngine\IndexFull;
use Alchemy\Phrasea\Command\WebsocketServer;
use Alchemy\Phrasea\Core\Version;
@@ -32,6 +31,7 @@ use Alchemy\Phrasea\Command\Plugin\RemovePlugin;
use Alchemy\Phrasea\Command\CheckConfig;
use Alchemy\Phrasea\Command\Setup\XSendFileMappingGenerator;
use Alchemy\Phrasea\Command\Setup\XSendFileConfigurationDumper;
+use Alchemy\Phrasea\Command\Setup\StaticMappingGenerator;
use Alchemy\Phrasea\Command\Task\SchedulerResumeTasks;
use Alchemy\Phrasea\Command\Task\SchedulerState;
use Alchemy\Phrasea\Command\Task\SchedulerPauseTasks;
@@ -120,12 +120,6 @@ $cli->command(new XSendFileMappingGenerator());
$cli->command(new StaticConfigurationDumper());
$cli->command(new StaticMappingGenerator());
-if ($cli['phraseanet.SE']->getName() === 'ElasticSearch') {
- $cli->command(new IndexFull('searchengine:index'));
-}
-
-$cli->command(new WebsocketServer('ws-server:run'));
-
$cli->loadPlugins();
exit(is_int($cli->run()) ? : 1);
diff --git a/composer.lock b/composer.lock
index c345db308d..1bdc24a8a6 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,7 +4,7 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "2ddab4a9d0ebb3a7ff949171dd62a1d2",
+ "hash": "69bf40de460d2f7a3407f1b905dde913",
"packages": [
{
"name": "alchemy-fr/tcpdf-clone",
@@ -372,12 +372,12 @@
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/Zippy.git",
- "reference": "d2f5e88f2436b9c1294e8819d951822abe39e9a7"
+ "reference": "08008f82957b7dc2b54574b506687b33ecfe0589"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/alchemy-fr/Zippy/zipball/d2f5e88f2436b9c1294e8819d951822abe39e9a7",
- "reference": "d2f5e88f2436b9c1294e8819d951822abe39e9a7",
+ "url": "https://api.github.com/repos/alchemy-fr/Zippy/zipball/08008f82957b7dc2b54574b506687b33ecfe0589",
+ "reference": "08008f82957b7dc2b54574b506687b33ecfe0589",
"shasum": ""
},
"require": {
@@ -426,26 +426,26 @@
"tar",
"zip"
],
- "time": "2014-05-05 13:39:00"
+ "time": "2014-09-03 08:10:41"
},
{
"name": "cboden/ratchet",
- "version": "v0.3.0",
+ "version": "v0.3.2",
"source": {
"type": "git",
"url": "https://github.com/ratchetphp/Ratchet.git",
- "reference": "d756e0b507a5f3cdbf8c59dbb7baf68574dc7d58"
+ "reference": "d36a8699df04354147a4f47845035b1ea8239189"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/d756e0b507a5f3cdbf8c59dbb7baf68574dc7d58",
- "reference": "d756e0b507a5f3cdbf8c59dbb7baf68574dc7d58",
+ "url": "https://api.github.com/repos/ratchetphp/Ratchet/zipball/d36a8699df04354147a4f47845035b1ea8239189",
+ "reference": "d36a8699df04354147a4f47845035b1ea8239189",
"shasum": ""
},
"require": {
- "guzzle/http": ">=3.6.0,<3.8.0-dev",
+ "guzzle/http": "~3.6",
"php": ">=5.3.9",
- "react/socket": "0.3.*",
+ "react/socket": "0.3.*|0.4.*",
"symfony/http-foundation": "~2.2",
"symfony/routing": "~2.2"
},
@@ -475,20 +475,20 @@
"server",
"sockets"
],
- "time": "2013-10-14 14:38:12"
+ "time": "2014-06-08 15:19:45"
},
{
"name": "dailymotion/sdk",
- "version": "1.5.1",
+ "version": "1.6",
"source": {
"type": "git",
"url": "https://github.com/dailymotion/dailymotion-sdk-php.git",
- "reference": "00c2a539874ada11fe0f2c7c9bbc42a56e7b53cf"
+ "reference": "670ce8c536077a17ac31096d4c61372c35caa713"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/dailymotion/dailymotion-sdk-php/zipball/00c2a539874ada11fe0f2c7c9bbc42a56e7b53cf",
- "reference": "00c2a539874ada11fe0f2c7c9bbc42a56e7b53cf",
+ "url": "https://api.github.com/repos/dailymotion/dailymotion-sdk-php/zipball/670ce8c536077a17ac31096d4c61372c35caa713",
+ "reference": "670ce8c536077a17ac31096d4c61372c35caa713",
"shasum": ""
},
"type": "library",
@@ -508,20 +508,20 @@
"dailymotion",
"sdk"
],
- "time": "2013-07-08 13:56:27"
+ "time": "2014-09-11 15:14:39"
},
{
"name": "data-uri/data-uri",
- "version": "0.1.0",
+ "version": "0.1.1",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/PHP-dataURI.git",
- "reference": "4aa0ab6946455aaaf0c96250b76a1034150f9850"
+ "reference": "6b84ac5b57af163d30a18cdb145928a1b90526ac"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/alchemy-fr/PHP-dataURI/zipball/4aa0ab6946455aaaf0c96250b76a1034150f9850",
- "reference": "4aa0ab6946455aaaf0c96250b76a1034150f9850",
+ "url": "https://api.github.com/repos/alchemy-fr/PHP-dataURI/zipball/6b84ac5b57af163d30a18cdb145928a1b90526ac",
+ "reference": "6b84ac5b57af163d30a18cdb145928a1b90526ac",
"shasum": ""
},
"require": {
@@ -553,20 +553,20 @@
"data-uri",
"uri"
],
- "time": "2013-02-11 11:12:52"
+ "time": "2014-08-22 15:01:57"
},
{
"name": "doctrine/annotations",
- "version": "v1.2.0",
+ "version": "v1.2.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/annotations.git",
- "reference": "d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd"
+ "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/annotations/zipball/d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd",
- "reference": "d9b1a37e9351ddde1f19f09a02e3d6ee92e82efd",
+ "url": "https://api.github.com/repos/doctrine/annotations/zipball/6a6bec0670bb6e71a263b08bc1b98ea242928633",
+ "reference": "6a6bec0670bb6e71a263b08bc1b98ea242928633",
"shasum": ""
},
"require": {
@@ -593,17 +593,6 @@
"MIT"
],
"authors": [
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com",
- "homepage": "http://www.jwage.com/",
- "role": "Creator"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com",
- "homepage": "http://www.instaclick.com"
- },
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
@@ -612,11 +601,17 @@
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
{
"name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com",
- "homepage": "https://github.com/schmittjoh",
- "role": "Developer of wrapped JMSSerializerBundle"
+ "email": "schmittjoh@gmail.com"
}
],
"description": "Docblock Annotations Parser",
@@ -626,20 +621,20 @@
"docblock",
"parser"
],
- "time": "2014-07-06 15:52:21"
+ "time": "2014-09-25 16:45:30"
},
{
"name": "doctrine/cache",
- "version": "v1.3.0",
+ "version": "v1.3.1",
"source": {
"type": "git",
"url": "https://github.com/doctrine/cache.git",
- "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449"
+ "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/cache/zipball/e16d7adf45664a50fa86f515b6d5e7f670130449",
- "reference": "e16d7adf45664a50fa86f515b6d5e7f670130449",
+ "url": "https://api.github.com/repos/doctrine/cache/zipball/cf483685798a72c93bf4206e3dd6358ea07d64e7",
+ "reference": "cf483685798a72c93bf4206e3dd6358ea07d64e7",
"shasum": ""
},
"require": {
@@ -655,7 +650,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.4.x-dev"
}
},
"autoload": {
@@ -668,17 +663,6 @@
"MIT"
],
"authors": [
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com",
- "homepage": "http://www.jwage.com/",
- "role": "Creator"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com",
- "homepage": "http://www.instaclick.com"
- },
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
@@ -687,11 +671,17 @@
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
},
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
+ },
{
"name": "Johannes Schmitt",
- "email": "schmittjoh@gmail.com",
- "homepage": "https://github.com/schmittjoh",
- "role": "Developer of wrapped JMSSerializerBundle"
+ "email": "schmittjoh@gmail.com"
}
],
"description": "Caching library offering an object-oriented API for many cache backends",
@@ -700,7 +690,7 @@
"cache",
"caching"
],
- "time": "2013-10-25 19:04:14"
+ "time": "2014-09-17 14:24:04"
},
{
"name": "doctrine/collections",
@@ -1036,12 +1026,12 @@
"source": {
"type": "git",
"url": "https://github.com/doctrine/migrations.git",
- "reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8"
+ "reference": "1a9dffa64e33fdc10f4b4c3f5d7230b74d4a1021"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/migrations/zipball/4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
- "reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
+ "url": "https://api.github.com/repos/doctrine/migrations/zipball/1a9dffa64e33fdc10f4b4c3f5d7230b74d4a1021",
+ "reference": "1a9dffa64e33fdc10f4b4c3f5d7230b74d4a1021",
"shasum": ""
},
"require": {
@@ -1071,15 +1061,13 @@
"LGPL"
],
"authors": [
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com",
- "homepage": "http://www.jwage.com/",
- "role": "Creator"
- },
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
}
],
"description": "Database Schema migrations using Doctrine DBAL",
@@ -1088,20 +1076,20 @@
"database",
"migrations"
],
- "time": "2014-07-09 07:58:02"
+ "time": "2014-08-18 18:03:07"
},
{
"name": "doctrine/orm",
- "version": "v2.4.3",
+ "version": "v2.4.6",
"source": {
"type": "git",
"url": "https://github.com/doctrine/doctrine2.git",
- "reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29"
+ "reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/8a13376d42b5ea467727ffe730aa0e14ca3c5e29",
- "reference": "8a13376d42b5ea467727ffe730aa0e14ca3c5e29",
+ "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9",
+ "reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9",
"shasum": ""
},
"require": {
@@ -1138,17 +1126,6 @@
"MIT"
],
"authors": [
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com",
- "homepage": "http://www.jwage.com/",
- "role": "Creator"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com",
- "homepage": "http://www.instaclick.com"
- },
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
@@ -1156,6 +1133,14 @@
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
}
],
"description": "Object-Relational-Mapper for PHP",
@@ -1164,20 +1149,20 @@
"database",
"orm"
],
- "time": "2014-06-10 11:49:08"
+ "time": "2014-10-06 13:22:50"
},
{
"name": "elasticsearch/elasticsearch",
- "version": "v1.0",
+ "version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/elasticsearch/elasticsearch-php.git",
- "reference": "09a81a85ab015cd1350c622bebe9111941259782"
+ "reference": "fd304b1c12778c9eab9b1c1a9e07d791f40bd56d"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/elasticsearch/elasticsearch-php/zipball/09a81a85ab015cd1350c622bebe9111941259782",
- "reference": "09a81a85ab015cd1350c622bebe9111941259782",
+ "url": "https://api.github.com/repos/elasticsearch/elasticsearch-php/zipball/fd304b1c12778c9eab9b1c1a9e07d791f40bd56d",
+ "reference": "fd304b1c12778c9eab9b1c1a9e07d791f40bd56d",
"shasum": ""
},
"require": {
@@ -1190,12 +1175,12 @@
},
"require-dev": {
"athletic/athletic": "~0.1",
- "elasticsearch/elasticsearch_src": "dev-master",
+ "cpliakas/git-wrapper": "~1.0",
"mikey179/vfsstream": "~1.2",
"mockery/mockery": "dev-master@dev",
"phpunit/phpunit": "3.7.*",
"satooshi/php-coveralls": "dev-master",
- "symfony/yaml": "2.4.*@dev",
+ "symfony/yaml": "2.4.3 as 2.4.2",
"twig/twig": "1.*"
},
"type": "library",
@@ -1221,7 +1206,7 @@
"elasticsearch",
"search"
],
- "time": "2014-02-12 14:57:02"
+ "time": "2014-05-07 15:54:46"
},
{
"name": "evenement/evenement",
@@ -1448,22 +1433,22 @@
},
{
"name": "guzzle/guzzle",
- "version": "v3.7.4",
+ "version": "v3.9.2",
"source": {
"type": "git",
- "url": "https://github.com/guzzle/guzzle.git",
- "reference": "b170b028c6bb5799640e46c8803015b0f9a45ed9"
+ "url": "https://github.com/guzzle/guzzle3.git",
+ "reference": "54991459675c1a2924122afbb0e5609ade581155"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/guzzle/guzzle/zipball/b170b028c6bb5799640e46c8803015b0f9a45ed9",
- "reference": "b170b028c6bb5799640e46c8803015b0f9a45ed9",
+ "url": "https://api.github.com/repos/guzzle/guzzle3/zipball/54991459675c1a2924122afbb0e5609ade581155",
+ "reference": "54991459675c1a2924122afbb0e5609ade581155",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=5.3.3",
- "symfony/event-dispatcher": ">=2.1"
+ "symfony/event-dispatcher": "~2.1"
},
"replace": {
"guzzle/batch": "self.version",
@@ -1490,24 +1475,24 @@
"guzzle/stream": "self.version"
},
"require-dev": {
- "doctrine/cache": "*",
- "monolog/monolog": "1.*",
+ "doctrine/cache": "~1.3",
+ "monolog/monolog": "~1.0",
"phpunit/phpunit": "3.7.*",
- "psr/log": "1.0.*",
- "symfony/class-loader": "*",
- "zendframework/zend-cache": "2.0.*",
- "zendframework/zend-log": "2.0.*"
+ "psr/log": "~1.0",
+ "symfony/class-loader": "~2.1",
+ "zendframework/zend-cache": "2.*,<2.3",
+ "zendframework/zend-log": "2.*,<2.3"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "3.7-dev"
+ "dev-master": "3.9-dev"
}
},
"autoload": {
"psr-0": {
- "Guzzle\\Tests": "tests/",
- "Guzzle": "src/"
+ "Guzzle": "src/",
+ "Guzzle\\Tests": "tests/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -1536,20 +1521,20 @@
"rest",
"web service"
],
- "time": "2013-10-02 20:47:00"
+ "time": "2014-08-11 04:32:36"
},
{
"name": "igorw/get-in",
- "version": "v1.0.0",
+ "version": "v1.0.2",
"source": {
"type": "git",
"url": "https://github.com/igorw/get-in.git",
- "reference": "ba9ab6e41d0819db138d52f6431587f56698f121"
+ "reference": "bdb5d48edf562d4e6c125d4918579f3f54650107"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/igorw/get-in/zipball/ba9ab6e41d0819db138d52f6431587f56698f121",
- "reference": "ba9ab6e41d0819db138d52f6431587f56698f121",
+ "url": "https://api.github.com/repos/igorw/get-in/zipball/bdb5d48edf562d4e6c125d4918579f3f54650107",
+ "reference": "bdb5d48edf562d4e6c125d4918579f3f54650107",
"shasum": ""
},
"require": {
@@ -1573,8 +1558,7 @@
"authors": [
{
"name": "Igor Wiedler",
- "email": "igor@wiedler.ch",
- "homepage": "http://wiedler.ch/igor/"
+ "email": "igor@wiedler.ch"
}
],
"description": "Functions for for hash map (assoc array) traversal.",
@@ -1582,20 +1566,20 @@
"assoc-array",
"hash-map"
],
- "time": "2014-01-08 02:24:41"
+ "time": "2014-09-03 08:34:03"
},
{
"name": "imagine/imagine",
- "version": "dev-flatten-layer",
+ "version": "dev-0.6.1-flatten-layer",
"source": {
"type": "git",
- "url": "https://github.com/nlegoff/Imagine.git",
- "reference": "df2d9d8834d32943082fc52b89c5b11fde279b5a"
+ "url": "https://github.com/alchemy-fr/Imagine.git",
+ "reference": "e75d9495677b40e0868836e3510667178b2bd90a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nlegoff/Imagine/zipball/df2d9d8834d32943082fc52b89c5b11fde279b5a",
- "reference": "df2d9d8834d32943082fc52b89c5b11fde279b5a",
+ "url": "https://api.github.com/repos/alchemy-fr/Imagine/zipball/e75d9495677b40e0868836e3510667178b2bd90a",
+ "reference": "e75d9495677b40e0868836e3510667178b2bd90a",
"shasum": ""
},
"require": {
@@ -1641,7 +1625,7 @@
"support": {
"source": "https://github.com/nlegoff/Imagine/tree/flatten-layer"
},
- "time": "2014-07-07 17:04:15"
+ "time": "2014-10-08 16:23:33"
},
{
"name": "ircmaxell/random-lib",
@@ -1826,16 +1810,16 @@
},
{
"name": "jms/serializer",
- "version": "0.15.0",
+ "version": "0.16.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/serializer.git",
- "reference": "4a49caf0a20babcf8040fb1cf84f26faff6e7d85"
+ "reference": "c8a171357ca92b6706e395c757f334902d430ea9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/4a49caf0a20babcf8040fb1cf84f26faff6e7d85",
- "reference": "4a49caf0a20babcf8040fb1cf84f26faff6e7d85",
+ "url": "https://api.github.com/repos/schmittjoh/serializer/zipball/c8a171357ca92b6706e395c757f334902d430ea9",
+ "reference": "c8a171357ca92b6706e395c757f334902d430ea9",
"shasum": ""
},
"require": {
@@ -1843,17 +1827,17 @@
"jms/metadata": "~1.1",
"jms/parser-lib": "1.*",
"php": ">=5.3.2",
- "phpcollection/phpcollection": ">=0.1,<0.3-dev"
+ "phpcollection/phpcollection": "~0.1"
},
"require-dev": {
- "doctrine/orm": ">=2.1,<2.4-dev",
+ "doctrine/orm": "~2.1",
"doctrine/phpcr-odm": "~1.0.1",
"jackalope/jackalope-doctrine-dbal": "1.0.*",
"propel/propel1": "~1.7",
"symfony/filesystem": "2.*",
- "symfony/form": ">=2.1,<=2.4-dev",
- "symfony/translation": ">=2.0,<2.2-dev",
- "symfony/validator": ">=2.0,<2.2-dev",
+ "symfony/form": "~2.1",
+ "symfony/translation": "~2.0",
+ "symfony/validator": "~2.0",
"symfony/yaml": "2.*",
"twig/twig": ">=1.8,<2.0-dev"
},
@@ -1863,7 +1847,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "0.14-dev"
+ "dev-master": "0.15-dev"
}
},
"autoload": {
@@ -1892,7 +1876,7 @@
"serialization",
"xml"
],
- "time": "2014-02-10 11:00:05"
+ "time": "2014-03-18 08:39:00"
},
{
"name": "jms/translation-bundle",
@@ -1970,16 +1954,16 @@
},
{
"name": "justinrainbow/json-schema",
- "version": "1.3.5",
+ "version": "1.3.7",
"source": {
"type": "git",
"url": "https://github.com/justinrainbow/json-schema.git",
- "reference": "01949f6d2130e9737ffae5d3952909a8de70d114"
+ "reference": "87b54b460febed69726c781ab67462084e97a105"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/01949f6d2130e9737ffae5d3952909a8de70d114",
- "reference": "01949f6d2130e9737ffae5d3952909a8de70d114",
+ "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/87b54b460febed69726c781ab67462084e97a105",
+ "reference": "87b54b460febed69726c781ab67462084e97a105",
"shasum": ""
},
"require": {
@@ -2009,11 +1993,6 @@
"BSD-3-Clause"
],
"authors": [
- {
- "name": "Igor Wiedler",
- "email": "igor@wiedler.ch",
- "homepage": "http://wiedler.ch/igor/"
- },
{
"name": "Bruno Prieto Reis",
"email": "bruno.p.reis@gmail.com"
@@ -2022,10 +2001,13 @@
"name": "Justin Rainbow",
"email": "justin.rainbow@gmail.com"
},
+ {
+ "name": "Igor Wiedler",
+ "email": "igor@wiedler.ch"
+ },
{
"name": "Robert Schönthal",
- "email": "robert.schoenthal@gmail.com",
- "homepage": "http://digitalkaoz.net"
+ "email": "seroscho@googlemail.com"
}
],
"description": "A library to validate a json schema.",
@@ -2034,30 +2016,30 @@
"json",
"schema"
],
- "time": "2013-12-13 15:21:04"
+ "time": "2014-08-25 02:48:14"
},
{
"name": "media-alchemyst/media-alchemyst",
- "version": "dev-master",
+ "version": "0.4.6",
"source": {
"type": "git",
- "url": "https://github.com/nlegoff/Media-Alchemyst.git",
- "reference": "be5c7cd4e207c469fb88d88397bd220c4db323d8"
+ "url": "https://github.com/alchemy-fr/Media-Alchemyst.git",
+ "reference": "0145a40c01b67268a29ee3863e1ce7be4ad60ac8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nlegoff/Media-Alchemyst/zipball/be5c7cd4e207c469fb88d88397bd220c4db323d8",
- "reference": "be5c7cd4e207c469fb88d88397bd220c4db323d8",
+ "url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/0145a40c01b67268a29ee3863e1ce7be4ad60ac8",
+ "reference": "0145a40c01b67268a29ee3863e1ce7be4ad60ac8",
"shasum": ""
},
"require": {
"alchemy/ghostscript": "~0.4.0",
"imagine/imagine": "0.6.x@dev",
- "mediavorus/mediavorus": "dev-fix-video-dim as 0.4.3",
+ "mediavorus/mediavorus": ">=0.4.2,<0.5",
"monolog/monolog": "~1.0",
"neutron/temporary-filesystem": "~2.1",
"php": ">=5.3.3",
- "php-ffmpeg/php-ffmpeg": "dev-fix-aspect-ratio as 0.4.4",
+ "php-ffmpeg/php-ffmpeg": ">=0.4.2,<0.6",
"php-mp4box/php-mp4box": "~0.3.0",
"php-unoconv/php-unoconv": "~0.3.0",
"pimple/pimple": "~1.0",
@@ -2082,6 +2064,7 @@
"MediaAlchemyst": "src"
}
},
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2106,23 +2089,20 @@
"video",
"video processing"
],
- "support": {
- "source": "https://github.com/nlegoff/Media-Alchemyst/tree/master"
- },
- "time": "2014-07-07 16:54:32"
+ "time": "2014-09-10 09:44:33"
},
{
"name": "mediavorus/mediavorus",
- "version": "dev-fix-video-dim",
+ "version": "0.4.4",
"source": {
"type": "git",
- "url": "https://github.com/nlegoff/MediaVorus.git",
- "reference": "f11cd2453d5acbc6ac52421dc4edd760433b1515"
+ "url": "https://github.com/romainneutron/MediaVorus.git",
+ "reference": "2df98b5b180c50b1bc7be838e36bc6ecc573e646"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nlegoff/MediaVorus/zipball/f11cd2453d5acbc6ac52421dc4edd760433b1515",
- "reference": "f11cd2453d5acbc6ac52421dc4edd760433b1515",
+ "url": "https://api.github.com/repos/romainneutron/MediaVorus/zipball/2df98b5b180c50b1bc7be838e36bc6ecc573e646",
+ "reference": "2df98b5b180c50b1bc7be838e36bc6ecc573e646",
"shasum": ""
},
"require": {
@@ -2145,16 +2125,12 @@
"symfony/yaml": "To serialize Medias in Yaml format"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.5.x-dev"
- }
- },
"autoload": {
"psr-0": {
"MediaVorus": "src"
}
},
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2169,55 +2145,58 @@
"keywords": [
"metadata"
],
- "support": {
- "source": "https://github.com/nlegoff/Mediavorus/tree/fix-video-dim"
- },
- "time": "2014-06-10 14:03:47"
+ "time": "2014-08-26 12:32:10"
},
{
"name": "monolog/monolog",
- "version": "1.7.0",
+ "version": "1.11.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "6225b22de9dcf36546be3a0b2fa8e3d986153f57"
+ "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/6225b22de9dcf36546be3a0b2fa8e3d986153f57",
- "reference": "6225b22de9dcf36546be3a0b2fa8e3d986153f57",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
+ "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
"shasum": ""
},
"require": {
"php": ">=5.3.0",
"psr/log": "~1.0"
},
+ "provide": {
+ "psr/log-implementation": "1.0.0"
+ },
"require-dev": {
- "aws/aws-sdk-php": "~2.4.8",
- "doctrine/couchdb": "dev-master",
- "mlehner/gelf-php": "1.0.*",
+ "aws/aws-sdk-php": "~2.4, >2.4.8",
+ "doctrine/couchdb": "~1.0@dev",
+ "graylog2/gelf-php": "~1.0",
"phpunit/phpunit": "~3.7.0",
- "raven/raven": "0.5.*",
- "ruflin/elastica": "0.90.*"
+ "raven/raven": "~0.5",
+ "ruflin/elastica": "0.90.*",
+ "videlalvaro/php-amqplib": "~2.4"
},
"suggest": {
"aws/aws-sdk-php": "Allow sending log messages to AWS services like DynamoDB",
"doctrine/couchdb": "Allow sending log messages to a CouchDB server",
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server",
- "mlehner/gelf-php": "Allow sending log messages to a GrayLog2 server",
+ "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"raven/raven": "Allow sending log messages to a Sentry server",
- "ruflin/elastica": "Allow sending log messages to an Elastic Search server"
+ "rollbar/rollbar": "Allow sending log messages to Rollbar",
+ "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
+ "videlalvaro/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.7.x-dev"
+ "dev-master": "1.11.x-dev"
}
},
"autoload": {
- "psr-0": {
- "Monolog": "src/"
+ "psr-4": {
+ "Monolog\\": "src/Monolog"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -2228,8 +2207,7 @@
{
"name": "Jordi Boggiano",
"email": "j.boggiano@seld.be",
- "homepage": "http://seld.be",
- "role": "Developer"
+ "homepage": "http://seld.be"
}
],
"description": "Sends your logs to files, sockets, inboxes, databases and various web services",
@@ -2239,7 +2217,7 @@
"logging",
"psr-3"
],
- "time": "2013-11-14 19:48:31"
+ "time": "2014-09-30 13:30:58"
},
{
"name": "mrclay/minify",
@@ -2621,16 +2599,16 @@
},
{
"name": "php-ffmpeg/php-ffmpeg",
- "version": "dev-fix-aspect-ratio",
+ "version": "0.5.1",
"source": {
"type": "git",
- "url": "https://github.com/nlegoff/PHP-FFmpeg.git",
- "reference": "c2ea1ca7ab0a4da0e876e36c8cddbfa4d92dbba6"
+ "url": "https://github.com/PHP-FFMpeg/PHP-FFMpeg.git",
+ "reference": "c8949fe3df89edd7692368cc110a51a27971f28a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/nlegoff/PHP-FFmpeg/zipball/c2ea1ca7ab0a4da0e876e36c8cddbfa4d92dbba6",
- "reference": "c2ea1ca7ab0a4da0e876e36c8cddbfa4d92dbba6",
+ "url": "https://api.github.com/repos/PHP-FFMpeg/PHP-FFMpeg/zipball/c8949fe3df89edd7692368cc110a51a27971f28a",
+ "reference": "c8949fe3df89edd7692368cc110a51a27971f28a",
"shasum": ""
},
"require": {
@@ -2659,6 +2637,7 @@
"FFMpeg": "src"
}
},
+ "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2685,10 +2664,7 @@
"video",
"video processing"
],
- "support": {
- "source": "https://github.com/nlegoff/PHP-FFmpeg/tree/fix-aspect-ratio"
- },
- "time": "2014-06-10 10:27:04"
+ "time": "2014-08-26 08:46:56"
},
{
"name": "php-mp4box/php-mp4box",
@@ -2845,16 +2821,16 @@
},
{
"name": "phpcollection/phpcollection",
- "version": "0.2.0",
+ "version": "0.4.0",
"source": {
"type": "git",
"url": "https://github.com/schmittjoh/php-collection.git",
- "reference": "acb02a921bb364f360ce786b13455345063c4a07"
+ "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/acb02a921bb364f360ce786b13455345063c4a07",
- "reference": "acb02a921bb364f360ce786b13455345063c4a07",
+ "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/b8bf55a0a929ca43b01232b36719f176f86c7e83",
+ "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83",
"shasum": ""
},
"require": {
@@ -2863,7 +2839,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "0.2-dev"
+ "dev-master": "0.3-dev"
}
},
"autoload": {
@@ -2891,20 +2867,20 @@
"sequence",
"set"
],
- "time": "2013-01-23 15:16:14"
+ "time": "2014-03-11 13:46:42"
},
{
"name": "phpexiftool/exiftool",
- "version": "9.15",
+ "version": "9.70",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/exiftool.git",
- "reference": "0b05edb639d032181f3fae7df8dc1194e9210dc4"
+ "reference": "fd7e64947dd628f8b7cc28dc06fd59848f2caca7"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/alchemy-fr/exiftool/zipball/0b05edb639d032181f3fae7df8dc1194e9210dc4",
- "reference": "0b05edb639d032181f3fae7df8dc1194e9210dc4",
+ "url": "https://api.github.com/repos/alchemy-fr/exiftool/zipball/fd7e64947dd628f8b7cc28dc06fd59848f2caca7",
+ "reference": "fd7e64947dd628f8b7cc28dc06fd59848f2caca7",
"shasum": ""
},
"require": {
@@ -2927,20 +2903,20 @@
"exiftool",
"metadatas"
],
- "time": "2013-01-30 18:48:32"
+ "time": "2014-09-15 08:05:30"
},
{
"name": "phpexiftool/phpexiftool",
- "version": "0.3.0",
+ "version": "dev-0.4.1-mwg-metadata-copy",
"source": {
"type": "git",
- "url": "https://github.com/romainneutron/PHPExiftool.git",
- "reference": "5c7d6124729eb34f2d86f730e534067e6be31ab9"
+ "url": "https://github.com/alchemy-fr/PHPExiftool.git",
+ "reference": "9a1ec0c98d5a3903411c554a7274b3163705b5b2"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/romainneutron/PHPExiftool/zipball/5c7d6124729eb34f2d86f730e534067e6be31ab9",
- "reference": "5c7d6124729eb34f2d86f730e534067e6be31ab9",
+ "url": "https://api.github.com/repos/alchemy-fr/PHPExiftool/zipball/9a1ec0c98d5a3903411c554a7274b3163705b5b2",
+ "reference": "9a1ec0c98d5a3903411c554a7274b3163705b5b2",
"shasum": ""
},
"require": {
@@ -2948,14 +2924,14 @@
"doctrine/collections": "~1.0",
"monolog/monolog": "~1.3",
"php": ">=5.3.3",
- "phpexiftool/exiftool": "9.15",
+ "phpexiftool/exiftool": "9.70",
+ "symfony/console": "~2.0",
"symfony/process": "~2.0"
},
"require-dev": {
"jms/serializer": "~0.10",
"sami/sami": "~1.0",
"silex/silex": "~1.0",
- "symfony/console": "~2.0",
"symfony/css-selector": "~2.0",
"symfony/dom-crawler": "~2.0",
"symfony/finder": "~2.0",
@@ -2966,17 +2942,11 @@
"symfony/yaml": "To serialize tags in Yaml format"
},
"type": "library",
- "extra": {
- "branch-alias": {
- "dev-master": "0.3-dev"
- }
- },
"autoload": {
"psr-0": {
"PHPExiftool": "lib"
}
},
- "notification-url": "https://packagist.org/downloads/",
"license": [
"MIT"
],
@@ -2992,7 +2962,10 @@
"exiftool",
"metadata"
],
- "time": "2013-08-07 13:54:27"
+ "support": {
+ "source": "https://github.com/alchemy-fr/PHPExiftool/tree/dev"
+ },
+ "time": "2014-10-08 16:09:02"
},
{
"name": "phpoption/phpoption",
@@ -3306,16 +3279,16 @@
},
{
"name": "rhumsaa/uuid",
- "version": "2.7.1",
+ "version": "2.7.3",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
- "reference": "8569983a11ed96087cdf94c7aa65866138681beb"
+ "reference": "b976326ca5977d7333f34e3c828ae7c22a49a65a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ramsey/uuid/zipball/8569983a11ed96087cdf94c7aa65866138681beb",
- "reference": "8569983a11ed96087cdf94c7aa65866138681beb",
+ "url": "https://api.github.com/repos/ramsey/uuid/zipball/b976326ca5977d7333f34e3c828ae7c22a49a65a",
+ "reference": "b976326ca5977d7333f34e3c828ae7c22a49a65a",
"shasum": ""
},
"require": {
@@ -3324,7 +3297,8 @@
"require-dev": {
"doctrine/dbal": ">=2.3",
"moontoast/math": "~1.1",
- "phpunit/phpunit": "~3.7",
+ "phpunit/phpunit": "~4.1",
+ "satooshi/php-coveralls": "~0.6",
"symfony/console": "~2.3"
},
"suggest": {
@@ -3342,8 +3316,8 @@
}
},
"autoload": {
- "psr-0": {
- "Rhumsaa\\Uuid": "src/"
+ "psr-4": {
+ "Rhumsaa\\Uuid\\": "src/"
}
},
"notification-url": "https://packagist.org/downloads/",
@@ -3357,8 +3331,7 @@
},
{
"name": "Ben Ramsey",
- "homepage": "http://benramsey.com",
- "role": "Developer"
+ "homepage": "http://benramsey.com"
}
],
"description": "A PHP 5.3+ library for generating RFC 4122 version 1, 3, 4, and 5 universally unique identifiers (UUID).",
@@ -3368,7 +3341,7 @@
"identifier",
"uuid"
],
- "time": "2014-02-22 00:08:43"
+ "time": "2014-08-27 22:39:41"
},
{
"name": "silex/silex",
@@ -3701,16 +3674,16 @@
},
{
"name": "symfony/symfony",
- "version": "v2.4.2",
+ "version": "v2.4.10",
"source": {
"type": "git",
"url": "https://github.com/symfony/symfony.git",
- "reference": "b70633f92ff71ef490af4c17e7ca3f3bf3d0f304"
+ "reference": "daed178afd4700dd18f4fb0ea6b72dcfd9a4792a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/symfony/symfony/zipball/b70633f92ff71ef490af4c17e7ca3f3bf3d0f304",
- "reference": "b70633f92ff71ef490af4c17e7ca3f3bf3d0f304",
+ "url": "https://api.github.com/repos/symfony/symfony/zipball/daed178afd4700dd18f4fb0ea6b72dcfd9a4792a",
+ "reference": "daed178afd4700dd18f4fb0ea6b72dcfd9a4792a",
"shasum": ""
},
"require": {
@@ -3718,7 +3691,7 @@
"php": ">=5.3.3",
"psr/log": "~1.0",
"symfony/icu": "~1.0",
- "twig/twig": "~1.11"
+ "twig/twig": "~1.12"
},
"replace": {
"symfony/browser-kit": "self.version",
@@ -3796,15 +3769,13 @@
"MIT"
],
"authors": [
- {
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
- },
{
"name": "Symfony Community",
"homepage": "http://symfony.com/contributors"
+ },
+ {
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
}
],
"description": "The Symfony PHP framework",
@@ -3812,20 +3783,20 @@
"keywords": [
"framework"
],
- "time": "2014-02-12 19:27:03"
+ "time": "2014-09-28 17:03:37"
},
{
"name": "themattharris/tmhoauth",
- "version": "0.8.3",
+ "version": "0.8.4",
"source": {
"type": "git",
"url": "https://github.com/themattharris/tmhOAuth.git",
- "reference": "47dcee2ac74f8c032d2a1afb836e65108bf582b7"
+ "reference": "455552d6c57549632644b6c9ac9204766be2b5ee"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/themattharris/tmhOAuth/zipball/47dcee2ac74f8c032d2a1afb836e65108bf582b7",
- "reference": "47dcee2ac74f8c032d2a1afb836e65108bf582b7",
+ "url": "https://api.github.com/repos/themattharris/tmhOAuth/zipball/455552d6c57549632644b6c9ac9204766be2b5ee",
+ "reference": "455552d6c57549632644b6c9ac9204766be2b5ee",
"shasum": ""
},
"require": {
@@ -3854,29 +3825,29 @@
"oauth",
"twitter"
],
- "time": "2013-08-19 23:46:08"
+ "time": "2014-08-06 22:29:35"
},
{
"name": "twig/extensions",
- "version": "v1.0.1",
+ "version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/fabpot/Twig-extensions.git",
- "reference": "f91a82ec225e5bb108e01a0f93c9be04f84dcfa0"
+ "reference": "c0ab818595338dd5569369bfce2552d02cec5d50"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Twig-extensions/zipball/f91a82ec225e5bb108e01a0f93c9be04f84dcfa0",
- "reference": "f91a82ec225e5bb108e01a0f93c9be04f84dcfa0",
+ "url": "https://api.github.com/repos/fabpot/Twig-extensions/zipball/c0ab818595338dd5569369bfce2552d02cec5d50",
+ "reference": "c0ab818595338dd5569369bfce2552d02cec5d50",
"shasum": ""
},
"require": {
- "twig/twig": "~1.0"
+ "twig/twig": "~1.12"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.1.x-dev"
}
},
"autoload": {
@@ -3899,24 +3870,23 @@
"description": "Common additional features for Twig that do not directly belong in core",
"homepage": "https://github.com/fabpot/Twig-extensions",
"keywords": [
- "debug",
"i18n",
"text"
],
- "time": "2013-10-18 19:37:15"
+ "time": "2014-07-05 10:01:35"
},
{
"name": "twig/twig",
- "version": "v1.15.1",
+ "version": "v1.16.0",
"source": {
"type": "git",
"url": "https://github.com/fabpot/Twig.git",
- "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed"
+ "reference": "8ce37115802e257a984a82d38254884085060024"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Twig/zipball/1fb5784662f438d7d96a541e305e28b812e2eeed",
- "reference": "1fb5784662f438d7d96a541e305e28b812e2eeed",
+ "url": "https://api.github.com/repos/fabpot/Twig/zipball/8ce37115802e257a984a82d38254884085060024",
+ "reference": "8ce37115802e257a984a82d38254884085060024",
"shasum": ""
},
"require": {
@@ -3925,7 +3895,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.15-dev"
+ "dev-master": "1.16-dev"
}
},
"autoload": {
@@ -3960,7 +3930,7 @@
"keywords": [
"templating"
],
- "time": "2014-02-13 10:19:29"
+ "time": "2014-07-05 12:19:05"
},
{
"name": "vierbergenlars/php-semver",
@@ -4012,16 +3982,16 @@
},
{
"name": "willdurand/negotiation",
- "version": "1.3.3",
+ "version": "1.3.4",
"source": {
"type": "git",
"url": "https://github.com/willdurand/Negotiation.git",
- "reference": "a98fb6b9808610c1aa326c736893d3d77d9383b6"
+ "reference": "d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/a98fb6b9808610c1aa326c736893d3d77d9383b6",
- "reference": "a98fb6b9808610c1aa326c736893d3d77d9383b6",
+ "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c",
+ "reference": "d7fa4ce4a0436915b9ba9f7cb5ff37719f0a834c",
"shasum": ""
},
"require": {
@@ -4045,8 +4015,7 @@
"authors": [
{
"name": "William Durand",
- "email": "william.durand1@gmail.com",
- "homepage": "http://www.willdurand.fr"
+ "email": "william.durand1@gmail.com"
}
],
"description": "Content Negotiation tools for PHP provided as a standalone library.",
@@ -4058,7 +4027,7 @@
"header",
"negotiation"
],
- "time": "2014-05-16 12:34:51"
+ "time": "2014-10-02 07:26:00"
},
{
"name": "zend/gdata",
@@ -4228,16 +4197,16 @@
},
{
"name": "behat/mink",
- "version": "v1.5.0",
+ "version": "v1.6.0",
"source": {
"type": "git",
"url": "https://github.com/Behat/Mink.git",
- "reference": "0769e6d9726c140a54dbf827a438c0f9912749fe"
+ "reference": "090900a0049c441f1e072bbd837db4079b2250c5"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/Mink/zipball/0769e6d9726c140a54dbf827a438c0f9912749fe",
- "reference": "0769e6d9726c140a54dbf827a438c0f9912749fe",
+ "url": "https://api.github.com/repos/Behat/Mink/zipball/090900a0049c441f1e072bbd837db4079b2250c5",
+ "reference": "090900a0049c441f1e072bbd837db4079b2250c5",
"shasum": ""
},
"require": {
@@ -4253,7 +4222,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-develop": "1.5.x-dev"
+ "dev-master": "1.6.x-dev"
}
},
"autoload": {
@@ -4279,35 +4248,35 @@
"testing",
"web"
],
- "time": "2013-04-13 23:39:27"
+ "time": "2014-09-26 09:25:05"
},
{
"name": "behat/mink-browserkit-driver",
- "version": "v1.1.0",
+ "version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/Behat/MinkBrowserKitDriver.git",
- "reference": "63960c8fcad4529faad1ff33e950217980baa64c"
+ "reference": "aed8f4a596b79014a75254c3e337511c33e38cbd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/MinkBrowserKitDriver/zipball/63960c8fcad4529faad1ff33e950217980baa64c",
- "reference": "63960c8fcad4529faad1ff33e950217980baa64c",
+ "url": "https://api.github.com/repos/Behat/MinkBrowserKitDriver/zipball/aed8f4a596b79014a75254c3e337511c33e38cbd",
+ "reference": "aed8f4a596b79014a75254c3e337511c33e38cbd",
"shasum": ""
},
"require": {
- "behat/mink": "~1.5.0",
+ "behat/mink": "~1.6@dev",
"php": ">=5.3.1",
"symfony/browser-kit": "~2.0",
"symfony/dom-crawler": "~2.0"
},
"require-dev": {
- "silex/silex": "@dev"
+ "silex/silex": "~1.2"
},
"type": "mink-driver",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "1.2.x-dev"
}
},
"autoload": {
@@ -4334,36 +4303,33 @@
"browser",
"testing"
],
- "time": "2013-04-13 23:46:30"
+ "time": "2014-09-26 11:35:19"
},
{
"name": "behat/mink-extension",
- "version": "v1.2.0",
+ "version": "v1.3.3",
"source": {
"type": "git",
"url": "https://github.com/Behat/MinkExtension.git",
- "reference": "0b7223826341fad69b4600afe27722d2a2f9a306"
+ "reference": "b885b9407cba50a954f72c69ed1b2f8d3bc694f8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/0b7223826341fad69b4600afe27722d2a2f9a306",
- "reference": "0b7223826341fad69b4600afe27722d2a2f9a306",
+ "url": "https://api.github.com/repos/Behat/MinkExtension/zipball/b885b9407cba50a954f72c69ed1b2f8d3bc694f8",
+ "reference": "b885b9407cba50a954f72c69ed1b2f8d3bc694f8",
"shasum": ""
},
"require": {
"behat/behat": "~2.5.0",
- "behat/mink": ">=1.4.3,<1.6-dev",
- "php": ">=5.3.2"
+ "behat/mink": "~1.5",
+ "php": ">=5.3.2",
+ "symfony/config": "~2.2"
},
"require-dev": {
- "behat/mink-goutte-driver": "~1.0"
+ "behat/mink-goutte-driver": "~1.0",
+ "fabpot/goutte": "~1.0"
},
"type": "behat-extension",
- "extra": {
- "branch-alias": {
- "dev-master": "1.1.x-dev"
- }
- },
"autoload": {
"psr-0": {
"Behat\\MinkExtension": "src/"
@@ -4388,31 +4354,32 @@
"test",
"web"
],
- "time": "2013-08-17 19:01:06"
+ "time": "2014-05-15 19:27:39"
},
{
"name": "behat/mink-goutte-driver",
- "version": "v1.0.9",
+ "version": "v1.1.0",
"source": {
"type": "git",
"url": "https://github.com/Behat/MinkGoutteDriver.git",
- "reference": "fa1b073b48761464feb0b05e6825da44b20118d8"
+ "reference": "2bf327b4166694ecaa8ae7f956cb6ae252ecf03e"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/MinkGoutteDriver/zipball/fa1b073b48761464feb0b05e6825da44b20118d8",
- "reference": "fa1b073b48761464feb0b05e6825da44b20118d8",
+ "url": "https://api.github.com/repos/Behat/MinkGoutteDriver/zipball/2bf327b4166694ecaa8ae7f956cb6ae252ecf03e",
+ "reference": "2bf327b4166694ecaa8ae7f956cb6ae252ecf03e",
"shasum": ""
},
"require": {
- "behat/mink-browserkit-driver": ">=1.0.5,<1.2.0",
- "fabpot/goutte": "~1.0.1",
+ "behat/mink": "~1.6@dev",
+ "behat/mink-browserkit-driver": "~1.2@dev",
+ "fabpot/goutte": "~1.0.4|~2.0",
"php": ">=5.3.1"
},
"type": "mink-driver",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.1.x-dev"
}
},
"autoload": {
@@ -4439,31 +4406,31 @@
"headless",
"testing"
],
- "time": "2013-07-03 18:43:54"
+ "time": "2014-10-09 09:21:12"
},
{
"name": "behat/mink-selenium2-driver",
- "version": "v1.1.1",
+ "version": "v1.2.0",
"source": {
"type": "git",
"url": "https://github.com/Behat/MinkSelenium2Driver.git",
- "reference": "bcf1b537de37db6db0822d9e7bd97e600fd7a476"
+ "reference": "8018fee80bf6573f909ece3e0dfc07d0eb352210"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Behat/MinkSelenium2Driver/zipball/bcf1b537de37db6db0822d9e7bd97e600fd7a476",
- "reference": "bcf1b537de37db6db0822d9e7bd97e600fd7a476",
+ "url": "https://api.github.com/repos/Behat/MinkSelenium2Driver/zipball/8018fee80bf6573f909ece3e0dfc07d0eb352210",
+ "reference": "8018fee80bf6573f909ece3e0dfc07d0eb352210",
"shasum": ""
},
"require": {
- "behat/mink": "~1.5.0",
- "instaclick/php-webdriver": "~1.0.12",
+ "behat/mink": "~1.6@dev",
+ "instaclick/php-webdriver": "~1.1",
"php": ">=5.3.1"
},
"type": "mink-driver",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "1.2.x-dev"
}
},
"autoload": {
@@ -4497,20 +4464,20 @@
"testing",
"webdriver"
],
- "time": "2013-06-02 19:09:45"
+ "time": "2014-09-29 13:12:12"
},
{
"name": "fabpot/goutte",
- "version": "v1.0.5",
+ "version": "v1.0.7",
"source": {
"type": "git",
"url": "https://github.com/fabpot/Goutte.git",
- "reference": "a30e84e28fbaf14909d2d007249c24cd0ecd425e"
+ "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Goutte/zipball/a30e84e28fbaf14909d2d007249c24cd0ecd425e",
- "reference": "a30e84e28fbaf14909d2d007249c24cd0ecd425e",
+ "url": "https://api.github.com/repos/fabpot/Goutte/zipball/794b196e76bdd37b5155cdecbad311f0a3b07625",
+ "reference": "794b196e76bdd37b5155cdecbad311f0a3b07625",
"shasum": ""
},
"require": {
@@ -4545,9 +4512,7 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
}
],
"description": "A simple PHP Web Scraper",
@@ -4555,33 +4520,33 @@
"keywords": [
"scraper"
],
- "time": "2014-01-31 18:02:50"
+ "time": "2014-10-09 15:52:51"
},
{
"name": "instaclick/php-webdriver",
- "version": "1.0.17",
+ "version": "1.4.0",
"source": {
"type": "git",
"url": "https://github.com/instaclick/php-webdriver.git",
- "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5"
+ "reference": "3cf130283b054b50119f887e11b9b5a648d785a9"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/47a6019553a7a5b42d35493276ffc2c9252c53d5",
- "reference": "47a6019553a7a5b42d35493276ffc2c9252c53d5",
+ "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/3cf130283b054b50119f887e11b9b5a648d785a9",
+ "reference": "3cf130283b054b50119f887e11b9b5a648d785a9",
"shasum": ""
},
"require": {
"ext-curl": "*",
"php": ">=5.3.2"
},
- "bin": [
- "bin/webunit"
- ],
+ "require-dev": {
+ "satooshi/php-coveralls": "dev-master"
+ },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.0.x-dev"
+ "dev-master": "1.4.x-dev"
}
},
"autoload": {
@@ -4613,27 +4578,27 @@
"webdriver",
"webtest"
],
- "time": "2013-10-04 15:03:51"
+ "time": "2014-05-08 04:19:19"
},
{
"name": "phpunit/php-code-coverage",
- "version": "1.2.17",
+ "version": "1.2.18",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git",
- "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34"
+ "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/6ef2bf3a1c47eca07ea95f0d8a902a6340390b34",
- "reference": "6ef2bf3a1c47eca07ea95f0d8a902a6340390b34",
+ "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b",
+ "reference": "fe2466802556d3fe4e4d1d58ffd3ccfd0a19be0b",
"shasum": ""
},
"require": {
"php": ">=5.3.3",
"phpunit/php-file-iterator": ">=1.3.0@stable",
"phpunit/php-text-template": ">=1.2.0@stable",
- "phpunit/php-token-stream": ">=1.1.3@stable"
+ "phpunit/php-token-stream": ">=1.1.3,<1.3.0"
},
"require-dev": {
"phpunit/phpunit": "3.7.*@dev"
@@ -4674,7 +4639,7 @@
"testing",
"xunit"
],
- "time": "2014-03-28 10:53:45"
+ "time": "2014-09-02 10:13:14"
},
{
"name": "phpunit/php-file-iterator",
@@ -4986,20 +4951,14 @@
{
"alias": "0.6.1",
"alias_normalized": "0.6.1.0",
- "version": "dev-flatten-layer",
+ "version": "dev-0.6.1-flatten-layer",
"package": "imagine/imagine"
},
{
- "alias": "0.4.3",
- "alias_normalized": "0.4.3.0",
- "version": "dev-fix-video-dim",
- "package": "mediavorus/mediavorus"
- },
- {
- "alias": "0.4.4",
- "alias_normalized": "0.4.4.0",
- "version": "dev-fix-aspect-ratio",
- "package": "php-ffmpeg/php-ffmpeg"
+ "alias": "0.4.1",
+ "alias_normalized": "0.4.1.0",
+ "version": "dev-0.4.1-mwg-metadata-copy",
+ "package": "phpexiftool/phpexiftool"
}
],
"minimum-stability": "stable",
@@ -5007,10 +4966,8 @@
"alchemy/task-manager": 20,
"alchemy/zippy": 20,
"imagine/imagine": 20,
- "mediavorus/mediavorus": 20,
- "media-alchemyst/media-alchemyst": 20,
"neutron/process-manager": 20,
- "php-ffmpeg/php-ffmpeg": 20,
+ "phpexiftool/phpexiftool": 20,
"silex/silex": 20,
"silex/web-profiler": 20,
"doctrine/migrations": 20,
diff --git a/lib/Alchemy/Phrasea/Application.php b/lib/Alchemy/Phrasea/Application.php
index a8557fd430..5d1398c71a 100644
--- a/lib/Alchemy/Phrasea/Application.php
+++ b/lib/Alchemy/Phrasea/Application.php
@@ -939,7 +939,7 @@ class Application extends SilexApplication
// if ($app->getEnvironment() !== Application::ENV_PROD) {
// return $this['cache.dev.path'];
// }
- $path = $this['root.path'].'/cache';
+ $path = $app['root.path'].'/cache';
if ($app['phraseanet.configuration']->isSetup()) {
$path = $app['conf']->get(['main', 'storage', 'cache'], $path);
}
diff --git a/lib/Alchemy/Phrasea/Command/Developer/IniReset.php b/lib/Alchemy/Phrasea/Command/Developer/IniReset.php
index 525304e1c7..2749229bfe 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/IniReset.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/IniReset.php
@@ -112,7 +112,7 @@ class IniReset extends Command
}
// get data paths
- $dataPath = $this->container['phraseanet.registry']->get('GV_base_datapath_noweb', $this->container['root.path'].'/datas');
+ $dataPath = $this->container['conf']->get(['main', 'storage', 'subdefs'], $this->container['root.path'].'/datas');
$schema = $this->container['EM']->getConnection()->getSchemaManager();
$output->writeln('Creating database "'.$dbs['ab'].'"...OK');
@@ -122,12 +122,28 @@ class IniReset extends Command
// inject v3.1 fixtures
if ($input->getOption('run-patches')) {
- $this->container['filesystem']->copy($this->container['root.path'].'/hudson/connexion.inc', $this->container['root.path'].'/config/connexion.inc');
- $this->container['filesystem']->copy($this->container['root.path'].'/hudson/_GV.php', $this->container['root.path'].'/config/_GV.php');
+ $content = file_get_contents($this->container['root.path'].'/resources/hudson/connexion.inc');
- $content = file_get_contents($this->container['root.path'] . '/hudson/fixtures.sql');
+ $content = str_replace('{{dbname}}', $conf['main']['database']['dbname'], $content);
+ $content = str_replace('{{hostname}}', $conf['main']['database']['host'], $content);
+ $content = str_replace('{{port}}', $conf['main']['database']['port'], $content);
+ $content = str_replace('{{user}}', $conf['main']['database']['user'], $content);
+ $content = str_replace('{{password}}', $conf['main']['database']['password'], $content);
+
+ $tmpFile = tempnam(sys_get_temp_dir(), 'connexion.inc-v3.1-');
+ $this->container['filesystem']->dumpFile($tmpFile, $content);
+
+ $this->container['filesystem']->copy($tmpFile, $this->container['root.path'].'/config/connexion.inc');
+ $this->container['filesystem']->copy($this->container['root.path'].'/resources/hudson/_GV.php', $this->container['root.path'].'/config/_GV.php');
+
+ $content = file_get_contents($this->container['root.path'] . '/resources/hudson/fixtures.sql');
$content = str_replace('{{APPLICATION_BOX}}', $dbs['ab'], $content);
$content = str_replace('{{DATA_BOX}}', $dbName, $content);
+ $content = str_replace('{{DB_HOST}}', $conf['main']['database']['host'], $content);
+ $content = str_replace('{{DB_PORT}}', $conf['main']['database']['port'], $content);
+ $content = str_replace('{{DB_USER}}', $conf['main']['database']['user'], $content);
+ $content = str_replace('{{DB_PASSWORD}}', $conf['main']['database']['password'], $content);
+ $content = str_replace('{{DATA_BOX}}', $dbName, $content);
$content = str_replace('{{USER_EMAIL}}', $input->getOption('email'), $content);
$content = str_replace('{{USER_PASSWORD}}', hash('sha256', $input->getOption('password')), $content);
@@ -191,7 +207,7 @@ class IniReset extends Command
));
$command->run($input, $output);
- $this->container['phraseanet.registry']->set('GV_base_datapath_noweb', $dataPath, \registry::TYPE_STRING);
+ $this->container['conf']->set(['main', 'storage', 'subdefs'], $dataPath);
return 0;
}
diff --git a/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php b/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php
index c6ada1b311..53473c3b53 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php
@@ -379,8 +379,9 @@ class RegenerateSqliteDb extends Command
private function generateCollection(\Pimple $DI)
{
$coll = $collection_no_acces = $collection_no_acces_by_status = $db = null;
+ $databoxes = $this->container['phraseanet.appbox']->get_databoxes();
- foreach ($this->container['phraseanet.appbox']->get_databoxes() as $databox) {
+ foreach ($databoxes as $databox) {
foreach ($databox->get_collections() as $collection) {
if ($collection_no_acces instanceof \collection && !$collection_no_acces_by_status) {
$collection_no_acces_by_status = $collection;
@@ -403,13 +404,13 @@ class RegenerateSqliteDb extends Command
$DI['coll'] = $coll;
if (!$collection_no_acces instanceof collection) {
- $collection_no_acces = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'BIBOO', $DI['user']);
+ $collection_no_acces = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'COLL_TEST_NO_ACCESS', $DI['user']);
}
$DI['coll_no_access'] = $collection_no_acces;
if (!$collection_no_acces_by_status instanceof collection) {
- $collection_no_acces_by_status = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'BIBOONOACCESBYSTATUS', $DI['user']);
+ $collection_no_acces_by_status = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], 'COLL_TEST_NO_ACCESS_BY_STATUS', $DI['user']);
}
$DI['coll_no_status'] = $collection_no_acces_by_status;
diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1.php b/lib/Alchemy/Phrasea/Controller/Api/V1.php
index 01cb902961..b95fca3071 100644
--- a/lib/Alchemy/Phrasea/Controller/Api/V1.php
+++ b/lib/Alchemy/Phrasea/Controller/Api/V1.php
@@ -45,17 +45,13 @@ use Alchemy\Phrasea\Model\Entities\LazaretSession;
class V1 implements ControllerProviderInterface
{
- const VERSION = '1.3';
+ const VERSION = '1.4.1';
const OBJECT_TYPE_USER = 'http://api.phraseanet.com/api/objects/user';
const OBJECT_TYPE_STORY = 'http://api.phraseanet.com/api/objects/story';
const OBJECT_TYPE_STORY_METADATA_BAG = 'http://api.phraseanet.com/api/objects/story-metadata-bag';
- public static $extendedContentTypes = array(
- 'json' => array('application/vnd.phraseanet.record-extended+json'),
- 'yaml' => array('application/vnd.phraseanet.record-extended+yaml'),
- 'jsonp' => array('application/vnd.phraseanet.record-extended+jsonp'),
- );
+ public static $extendedContentTypes = array('json' => array('application/vnd.phraseanet.record-extended+json'), 'yaml' => array('application/vnd.phraseanet.record-extended+yaml'), 'jsonp' => array('application/vnd.phraseanet.record-extended+jsonp'),);
public function connect(SilexApplication $app)
{
@@ -65,7 +61,8 @@ class V1 implements ControllerProviderInterface
$controllers->before(function ($request) use ($app) {
return $this->authenticate($app, $request);
- });
+ })
+ ;
$controllers->after(function (Request $request, Response $response) use ($app) {
$token = $app['session']->get('token');
@@ -75,54 +72,38 @@ class V1 implements ControllerProviderInterface
if (null !== $app['authentication']->getUser()) {
$app['authentication']->closeAccount();
}
- });
+ })
+ ;
- $controllers->get('/monitor/scheduler/', 'controller.api.v1:get_scheduler')
- ->before([$this, 'ensureAdmin']);
+ $controllers->get('/monitor/scheduler/', 'controller.api.v1:get_scheduler')->before([$this, 'ensureAdmin']);
- $controllers->get('/monitor/tasks/', 'controller.api.v1:get_task_list')
- ->before([$this, 'ensureAdmin']);
+ $controllers->get('/monitor/tasks/', 'controller.api.v1:get_task_list')->before([$this, 'ensureAdmin']);
- $controllers->get('/monitor/task/{task}/', 'controller.api.v1:get_task')
- ->convert('task', $app['converter.task-callback'])
- ->before([$this, 'ensureAdmin'])
- ->assert('task', '\d+');
+ $controllers->get('/monitor/task/{task}/', 'controller.api.v1:get_task')->convert('task', $app['converter.task-callback'])->before([$this, 'ensureAdmin'])->assert('task', '\d+');
- $controllers->post('/monitor/task/{task}/', 'controller.api.v1:set_task_property')
- ->convert('task', $app['converter.task-callback'])
- ->before([$this, 'ensureAdmin'])
- ->assert('task', '\d+');
+ $controllers->post('/monitor/task/{task}/', 'controller.api.v1:set_task_property')->convert('task', $app['converter.task-callback'])->before([$this, 'ensureAdmin'])->assert('task', '\d+');
- $controllers->post('/monitor/task/{task}/start/', 'controller.api.v1:start_task')
- ->convert('task', $app['converter.task-callback'])
- ->before([$this, 'ensureAdmin']);
+ $controllers->post('/monitor/task/{task}/start/', 'controller.api.v1:start_task')->convert('task', $app['converter.task-callback'])->before([$this, 'ensureAdmin']);
- $controllers->post('/monitor/task/{task}/stop/', 'controller.api.v1:stop_task')
- ->convert('task', $app['converter.task-callback'])
- ->before([$this, 'ensureAdmin']);
+ $controllers->post('/monitor/task/{task}/stop/', 'controller.api.v1:stop_task')->convert('task', $app['converter.task-callback'])->before([$this, 'ensureAdmin']);
- $controllers->get('/monitor/phraseanet/', 'controller.api.v1:get_phraseanet_monitor')
- ->before([$this, 'ensureAdmin']);
+ $controllers->get('/monitor/phraseanet/', 'controller.api.v1:get_phraseanet_monitor')->before([$this, 'ensureAdmin']);
$controllers->get('/databoxes/list/', 'controller.api.v1:get_databoxes');
- $controllers->get('/databoxes/{databox_id}/collections/', 'controller.api.v1:get_databox_collections')
- ->assert('databox_id', '\d+');
+ $controllers->get('/databoxes/{databox_id}/collections/', 'controller.api.v1:get_databox_collections')->before([$this, 'ensureAccessToDatabox'])->assert('databox_id', '\d+');
$controllers->get('/databoxes/{any_id}/collections/', 'controller.api.v1:getBadRequest');
- $controllers->get('/databoxes/{databox_id}/status/', 'controller.api.v1:get_databox_status')
- ->assert('databox_id', '\d+');
+ $controllers->get('/databoxes/{databox_id}/status/', 'controller.api.v1:get_databox_status')->before([$this, 'ensureAccessToDatabox'])->before([$this, 'ensureCanSeeDataboxStructure'])->assert('databox_id', '\d+');
$controllers->get('/databoxes/{any_id}/status/', 'controller.api.v1:getBadRequest');
- $controllers->get('/databoxes/{databox_id}/metadatas/', 'controller.api.v1:get_databox_metadatas')
- ->assert('databox_id', '\d+');
+ $controllers->get('/databoxes/{databox_id}/metadatas/', 'controller.api.v1:get_databox_metadatas')->before([$this, 'ensureAccessToDatabox'])->before([$this, 'ensureCanSeeDataboxStructure'])->assert('databox_id', '\d+');
$controllers->get('/databoxes/{any_id}/metadatas/', 'controller.api.v1:getBadRequest');
- $controllers->get('/databoxes/{databox_id}/termsOfUse/', 'controller.api.v1:get_databox_terms')
- ->assert('databox_id', '\d+');
+ $controllers->get('/databoxes/{databox_id}/termsOfUse/', 'controller.api.v1:get_databox_terms')->before([$this, 'ensureAccessToDatabox'])->assert('databox_id', '\d+');
$controllers->get('/databoxes/{any_id}/termsOfUse/', 'controller.api.v1:getBadRequest');
@@ -130,54 +111,47 @@ class V1 implements ControllerProviderInterface
$controllers->get('/quarantine/item/{lazaret_id}/', 'controller.api.v1:list_quarantine_item');
+ $controllers->get('/quarantine/item/{any_id}/', 'controller.api.v1:getBadRequest');
+
$controllers->post('/records/add/', 'controller.api.v1:add_record');
$controllers->match('/search/', 'controller.api.v1:search');
$controllers->match('/records/search/', 'controller.api.v1:search_records');
- $controllers->get('/records/{databox_id}/{record_id}/caption/', 'controller.api.v1:caption_records')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->get('/records/{databox_id}/{record_id}/caption/', 'controller.api.v1:caption_records')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/records/{any_id}/{anyother_id}/caption/', 'controller.api.v1:getBadRequest');
- $controllers->get('/records/{databox_id}/{record_id}/metadatas/', 'controller.api.v1:get_record_metadatas')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->get('/records/{databox_id}/{record_id}/metadatas/', 'controller.api.v1:get_record_metadatas')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/records/{any_id}/{anyother_id}/metadatas/', 'controller.api.v1:getBadRequest');
- $controllers->get('/records/{databox_id}/{record_id}/status/', 'controller.api.v1:get_record_status')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->get('/records/{databox_id}/{record_id}/status/', 'controller.api.v1:get_record_status')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/records/{any_id}/{anyother_id}/status/', 'controller.api.v1:getBadRequest');
- $controllers->get('/records/{databox_id}/{record_id}/related/', 'controller.api.v1:get_record_related')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->get('/records/{databox_id}/{record_id}/related/', 'controller.api.v1:get_record_related')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/records/{any_id}/{anyother_id}/related/', 'controller.api.v1:getBadRequest');
- $controllers->get('/records/{databox_id}/{record_id}/embed/', 'controller.api.v1:get_record_embed')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->get('/records/{databox_id}/{record_id}/embed/', 'controller.api.v1:get_record_embed')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/records/{any_id}/{anyother_id}/embed/', 'controller.api.v1:getBadRequest');
- $controllers->post('/records/{databox_id}/{record_id}/setmetadatas/', 'controller.api.v1:set_record_metadatas')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->post('/records/{databox_id}/{record_id}/setmetadatas/', 'controller.api.v1:set_record_metadatas')->before([$this, 'ensureCanAccessToRecord'])->before([$this, 'ensureCanModifyRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->post('/records/{any_id}/{anyother_id}/setmetadatas/', 'controller.api.v1:getBadRequest');
- $controllers->post('/records/{databox_id}/{record_id}/setstatus/', 'controller.api.v1:set_record_status')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->post('/records/{databox_id}/{record_id}/setstatus/', 'controller.api.v1:set_record_status')->before([$this, 'ensureCanAccessToRecord'])->before([$this, 'ensureCanModifyRecordStatus'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->post('/records/{any_id}/{anyother_id}/setstatus/', 'controller.api.v1:getBadRequest');
- $controllers->post('/records/{databox_id}/{record_id}/setcollection/', 'controller.api.v1:set_record_collection')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->post('/records/{databox_id}/{record_id}/setcollection/', 'controller.api.v1:set_record_collection')->before([$this, 'ensureCanAccessToRecord'])->before([$this, 'ensureCanMoveRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->post('/records/{wrong_databox_id}/{wrong_record_id}/setcollection/', 'controller.api.v1:getBadRequest');
- $controllers->get('/records/{databox_id}/{record_id}/', 'controller.api.v1:get_record')
- ->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $controllers->get('/records/{databox_id}/{record_id}/', 'controller.api.v1:get_record')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/records/{any_id}/{anyother_id}/', 'controller.api.v1:getBadRequest');
@@ -185,31 +159,19 @@ class V1 implements ControllerProviderInterface
$controllers->post('/baskets/add/', 'controller.api.v1:create_basket');
- $controllers->get('/baskets/{basket}/content/', 'controller.api.v1:get_basket')
- ->before($app['middleware.basket.converter'])
- ->before($app['middleware.basket.user-access'])
- ->assert('basket', '\d+');
+ $controllers->get('/baskets/{basket}/content/', 'controller.api.v1:get_basket')->before($app['middleware.basket.converter'])->before($app['middleware.basket.user-access'])->assert('basket', '\d+');
$controllers->get('/baskets/{wrong_basket}/content/', 'controller.api.v1:getBadRequest');
- $controllers->post('/baskets/{basket}/setname/', 'controller.api.v1:set_basket_title')
- ->before($app['middleware.basket.converter'])
- ->before($app['middleware.basket.user-is-owner'])
- ->assert('basket', '\d+');
+ $controllers->post('/baskets/{basket}/setname/', 'controller.api.v1:set_basket_title')->before($app['middleware.basket.converter'])->before($app['middleware.basket.user-is-owner'])->assert('basket', '\d+');
$controllers->post('/baskets/{wrong_basket}/setname/', 'controller.api.v1:getBadRequest');
- $controllers->post('/baskets/{basket}/setdescription/', 'controller.api.v1:set_basket_description')
- ->before($app['middleware.basket.converter'])
- ->before($app['middleware.basket.user-is-owner'])
- ->assert('basket', '\d+');
+ $controllers->post('/baskets/{basket}/setdescription/', 'controller.api.v1:set_basket_description')->before($app['middleware.basket.converter'])->before($app['middleware.basket.user-is-owner'])->assert('basket', '\d+');
$controllers->post('/baskets/{wrong_basket}/setdescription/', 'controller.api.v1:getBadRequest');
- $controllers->post('/baskets/{basket}/delete/', 'controller.api.v1:delete_basket')
- ->before($app['middleware.basket.converter'])
- ->before($app['middleware.basket.user-is-owner'])
- ->assert('basket', '\d+');
+ $controllers->post('/baskets/{basket}/delete/', 'controller.api.v1:delete_basket')->before($app['middleware.basket.converter'])->before($app['middleware.basket.user-is-owner'])->assert('basket', '\d+');
$controllers->post('/baskets/{wrong_basket}/delete/', 'controller.api.v1:getBadRequest');
@@ -217,28 +179,19 @@ class V1 implements ControllerProviderInterface
$controllers->get('/feeds/content/', 'controller.api.v1:get_publications');
- $controllers->get('/feeds/entry/{entry_id}/', 'controller.api.v1:get_feed_entry')
- ->assert('entry_id', '\d+');
+ $controllers->get('/feeds/entry/{entry_id}/', 'controller.api.v1:get_feed_entry')->assert('entry_id', '\d+');
$controllers->get('/feeds/entry/{entry_id}/', 'controller.api.v1:getBadRequest');
- $controllers->get('/feeds/{feed_id}/content/', 'controller.api.v1:get_publication')
- ->assert('feed_id', '\d+');
+ $controllers->get('/feeds/{feed_id}/content/', 'controller.api.v1:get_publication')->assert('feed_id', '\d+');
$controllers->get('/feeds/{wrong_feed_id}/content/', 'controller.api.v1:getBadRequest');
- $controllers->get('/stories/{databox_id}/{story_id}/embed/', 'controller.api.v1:get_story_embed')
- ->assert('databox_id', '\d+')->assert('story_id', '\d+');
+ $controllers->get('/stories/{databox_id}/{record_id}/embed/', 'controller.api.v1:get_story_embed')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/stories/{any_id}/{anyother_id}/embed/', 'controller.api.v1:getBadRequest');
- $controllers->get('/stories/{databox_id}/{story_id}/', 'controller.api.v1:get_story')
- ->assert('databox_id', '\d+')->assert('story_id', '\d+');
-
- $controllers->get('/stories/{any_id}/{anyother_id}/', 'controller.api.v1:getBadRequest');
-
- $controllers->get('/stories/{databox_id}/{story_id}/', 'controller.api.v1:get_story')
- ->assert('databox_id', '\d+')->assert('story_id', '\d+');
+ $controllers->get('/stories/{databox_id}/{record_id}/', 'controller.api.v1:get_story')->before([$this, 'ensureCanAccessToRecord'])->assert('databox_id', '\d+')->assert('record_id', '\d+');
$controllers->get('/stories/{any_id}/{anyother_id}/', 'controller.api.v1:getBadRequest');
@@ -259,21 +212,14 @@ class V1 implements ControllerProviderInterface
* Return an array of key-values informations about scheduler
*
* @param Application $app The silex application
+ *
* @return Response
*/
public function get_scheduler(Application $app, Request $request)
{
$data = $app['task-manager.live-information']->getManager();
- return Result::create($request, [
- 'scheduler' => [
- 'configuration' => $data['configuration'],
- 'state' => $data['actual'],
- 'status' => $data['actual'],
- 'pid' => $data['process-id'],
- 'process-id' => $data['process-id'],
- 'updated_on' => (new \DateTime())->format(DATE_ATOM),
- ]])->createResponse();
+ return Result::create($request, ['scheduler' => ['configuration' => $data['configuration'], 'state' => $data['actual'], 'status' => $data['actual'], 'pid' => $data['process-id'], 'process-id' => $data['process-id'], 'updated_on' => (new \DateTime())->format(DATE_ATOM),]])->createResponse();
}
/**
@@ -296,32 +242,15 @@ class V1 implements ControllerProviderInterface
{
$data = $app['task-manager.live-information']->getTask($task);
- return [
- 'id' => $task->getId(),
- 'title' => $task->getName(),
- 'name' => $task->getName(),
- 'state' => $task->getStatus(),
- 'status' => $task->getStatus(),
- 'actual-status' => $data['actual'],
- 'process-id' => $data['process-id'],
- 'pid' => $data['process-id'],
- 'jobId' => $task->getJobId(),
- 'period' => $task->getPeriod(),
- 'last_exec_time' => $task->getLastExecution() ? $task->getLastExecution()->format(DATE_ATOM) : null,
- 'last_execution' => $task->getLastExecution() ? $task->getLastExecution()->format(DATE_ATOM) : null,
- 'updated' => $task->getUpdated() ? $task->getUpdated()->format(DATE_ATOM) : null,
- 'created' => $task->getCreated() ? $task->getCreated()->format(DATE_ATOM) : null,
- 'auto_start' => $task->getStatus() === Task::STATUS_STARTED,
- 'crashed' => $task->getCrashed(),
- 'status' => $task->getStatus(),
- ];
+ return ['id' => $task->getId(), 'title' => $task->getName(), 'name' => $task->getName(), 'state' => $task->getStatus(), 'status' => $task->getStatus(), 'actual-status' => $data['actual'], 'process-id' => $data['process-id'], 'pid' => $data['process-id'], 'jobId' => $task->getJobId(), 'period' => $task->getPeriod(), 'last_exec_time' => $task->getLastExecution() ? $task->getLastExecution()->format(DATE_ATOM) : null, 'last_execution' => $task->getLastExecution() ? $task->getLastExecution()->format(DATE_ATOM) : null, 'updated' => $task->getUpdated() ? $task->getUpdated()->format(DATE_ATOM) : null, 'created' => $task->getCreated() ? $task->getCreated()->format(DATE_ATOM) : null, 'auto_start' => $task->getStatus() === Task::STATUS_STARTED, 'crashed' => $task->getCrashed(), 'status' => $task->getStatus(),];
}
/**
* Get informations about an identified task
*
- * @param \Silex\Application $app The API silex application
+ * @param \Silex\Application $app The API silex application
* @param Task $task
+ *
* @return Response
*/
public function get_task(Application $app, Request $request, Task $task)
@@ -334,6 +263,7 @@ class V1 implements ControllerProviderInterface
*
* @param \Silex\Application $app The API silex application
* @param Task $task The task to start
+ *
* @return Response
*/
public function start_task(Application $app, Request $request, Task $task)
@@ -348,6 +278,7 @@ class V1 implements ControllerProviderInterface
*
* @param \Silex\Application $app The API silex application
* @param Task $task The task to stop
+ *
* @return Response
*/
public function stop_task(Application $app, Request $request, Task $task)
@@ -364,6 +295,7 @@ class V1 implements ControllerProviderInterface
*
* @param \Silex\Application $app Silex application
* @param Task $task The task
+ *
* @return Response
*/
public function set_task_property(Application $app, Request $request, $task)
@@ -389,27 +321,18 @@ class V1 implements ControllerProviderInterface
* Get Information the cache system used by the instance
*
* @param \Silex\Application $app the silex application
+ *
* @return array
*/
private function get_cache_info(Application $app)
{
- $caches = [
- 'main' => $app['cache'],
- 'op_code' => $app['opcode-cache'],
- 'doctrine_metadatas' => $app['EM']->getConfiguration()->getMetadataCacheImpl(),
- 'doctrine_query' => $app['EM']->getConfiguration()->getQueryCacheImpl(),
- 'doctrine_result' => $app['EM']->getConfiguration()->getResultCacheImpl(),
- ];
+ $caches = ['main' => $app['cache'], 'op_code' => $app['opcode-cache'], 'doctrine_metadatas' => $app['EM']->getConfiguration()->getMetadataCacheImpl(), 'doctrine_query' => $app['EM']->getConfiguration()->getQueryCacheImpl(), 'doctrine_result' => $app['EM']->getConfiguration()->getResultCacheImpl(),];
$ret = [];
foreach ($caches as $name => $service) {
if ($service instanceof CacheInterface) {
- $ret['cache'][$name] = [
- 'type' => $service->getName(),
- 'online' => $service->isOnline(),
- 'stats' => $service->getStats(),
- ];
+ $ret['cache'][$name] = ['type' => $service->getName(), 'online' => $service->isOnline(), 'stats' => $service->getStats(),];
} else {
$ret['cache'][$name] = null;
}
@@ -422,16 +345,14 @@ class V1 implements ControllerProviderInterface
* Provide information about phraseanet configuration
*
* @param \Silex\Application $app the silex application
+ *
* @return array
*/
private function get_config_info(Application $app)
{
$ret = [];
- $ret['phraseanet']['version'] = [
- 'name' => $app['phraseanet.version']::getName(),
- 'number' => $app['phraseanet.version']::getNumber(),
- ];
+ $ret['phraseanet']['version'] = ['name' => $app['phraseanet.version']::getName(), 'number' => $app['phraseanet.version']::getNumber(),];
$ret['phraseanet']['environment'] = $app->getEnvironment();
$ret['phraseanet']['debug'] = $app['debug'];
@@ -444,7 +365,9 @@ class V1 implements ControllerProviderInterface
/**
* Provide phraseanet global values
+ *
* @param \Silex\Application $app the silex application
+ *
* @return array
*/
private function get_gv_info(Application $app)
@@ -457,144 +380,7 @@ class V1 implements ControllerProviderInterface
$binaries = $app['conf']->get(['main', 'binaries']);
- return [
- 'global_values' => [
- 'serverName' => $app['conf']->get('servername'),
- 'title' => $app['conf']->get(['registry', 'general', 'title']),
- 'keywords' => $app['conf']->get(['registry', 'general', 'keywords']),
- 'description' => $app['conf']->get(['registry', 'general', 'description']),
- 'httpServer' => [
- 'phpTimezone' => ini_get('date.timezone'),
- 'siteId' => $app['conf']->get(['main', 'key']),
- 'defaultLanguage' => $app['conf']->get(['languages', 'default']),
- 'allowIndexing' => $app['conf']->get(['registry', 'general', 'allow-indexation']),
- 'modes' => [
- 'XsendFile' => $app['conf']->get(['xsendfile', 'enabled']),
- 'XsendFileMapping' => $app['conf']->get(['xsendfile', 'mapping']),
- 'h264Streaming' => $app['conf']->get(['registry', 'executables', 'h264-streaming-enabled']),
- 'authTokenDirectory' => $app['conf']->get(['registry', 'executables', 'auth-token-directory']),
- 'authTokenDirectoryPath' => $app['conf']->get(['registry', 'executables', 'auth-token-directory-path']),
- 'authTokenPassphrase' => $app['conf']->get(['registry', 'executables', 'auth-token-passphrase']),
- ]
- ],
- 'maintenance' => [
- 'alertMessage' => $app['conf']->get(['registry', 'maintenance', 'message']),
- 'displayMessage' => $app['conf']->get(['registry', 'maintenance', 'enabled']),
- ],
- 'webServices' => [
- 'googleApi' => $app['conf']->get(['registry', 'webservices', 'google-charts-enabled']),
- 'googleAnalyticsId' => $app['conf']->get(['registry', 'general', 'analytics']),
- 'i18nWebService' => $app['conf']->get(['registry', 'webservices', 'geonames-server']),
- 'recaptacha' => [
- 'active' => $app['conf']->get(['registry', 'webservices', 'captcha-enabled']),
- 'publicKey' => $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']),
- 'privateKey' => $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']),
- ],
- 'youtube' => [
- 'active' => $app['conf']->get(['main', 'bridge', 'youtube', 'enabled']),
- 'clientId' => $app['conf']->get(['main', 'bridge', 'youtube', 'client_id']),
- 'clientSecret' => $app['conf']->get(['main', 'bridge', 'youtube', 'client_secret']),
- 'devKey' => $app['conf']->get(['main', 'bridge', 'youtube', 'developer_key']),
- ],
- 'flickr' => [
- 'active' => $app['conf']->get(['main', 'bridge', 'flickr', 'enabled']),
- 'clientId' => $app['conf']->get(['main', 'bridge', 'flickr', 'client_id']),
- 'clientSecret' => $app['conf']->get(['main', 'bridge', 'flickr', 'client_secret']),
- ],
- 'dailymtotion' => [
- 'active' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'enabled']),
- 'clientId' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'client_id']),
- 'clientSecret' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'client_secret']),
- ]
- ],
- 'navigator' => [
- 'active' => $app['conf']->get(['registry', 'api-clients', 'navigator-enabled']),
- ],
- 'office-plugin' => [
- 'active' => $app['conf']->get(['registry', 'api-clients', 'office-enabled']),
- ],
- 'homepage' => [
- 'viewType' => $app['conf']->get(['registry', 'general', 'home-presentation-mode']),
- ],
- 'report' => [
- 'anonymous' => $app['conf']->get(['registry', 'modules', 'anonymous-report']),
- ],
- 'storage' => [
- 'documents' => $app['conf']->get(['main', 'storage', 'subdefs']),
- ],
- 'searchEngine' => [
- 'configuration' => [
- 'defaultQuery' => $app['conf']->get(['registry', 'searchengine', 'default-query']),
- 'defaultQueryType' => $app['conf']->get(['registry', 'searchengine', 'default-query-type']),
- 'minChar' => $app['conf']->get(['registry', 'searchengine', 'min-letters-truncation']),
- ],
- 'engine' => [
- 'type' => $app['phraseanet.SE']->getName(),
- 'status' => $SEStatus,
- 'configuration' => $app['phraseanet.SE']->getConfigurationPanel()->getConfiguration(),
- ],
- ],
- 'binary' => [
- 'phpCli' => isset($binaries['php_binary']) ? $binaries['php_binary'] : null,
- 'phpIni' => $app['conf']->get(['registry', 'executables', 'php-conf-path']),
- 'swfExtract' => isset($binaries['swf_extract_binary']) ? $binaries['swf_extract_binary'] : null,
- 'pdf2swf' => isset($binaries['pdf2swf_binary']) ? $binaries['pdf2swf_binary'] : null,
- 'swfRender' => isset($binaries['swf_render_binary']) ? $binaries['swf_render_binary'] : null,
- 'unoconv' => isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : null,
- 'ffmpeg' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null,
- 'ffprobe' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null,
- 'mp4box' => isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : null,
- 'pdftotext' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null,
- 'recess' => isset($binaries['recess_binary']) ? $binaries['recess_binary'] : null,
- 'pdfmaxpages' => $app['conf']->get(['registry', 'executables', 'pdf-max-pages']),],
- 'mainConfiguration' => [
- 'viewBasAndCollName' => $app['conf']->get(['registry', 'actions', 'collection-display']),
- 'chooseExportTitle' => $app['conf']->get(['registry', 'actions', 'export-title-choice']),
- 'defaultExportTitle' => $app['conf']->get(['registry', 'actions', 'default-export-title']),
- 'socialTools' => $app['conf']->get(['registry', 'actions', 'social-tools']),],
- 'modules' => [
- 'thesaurus' => $app['conf']->get(['registry', 'modules', 'thesaurus']),
- 'storyMode' => $app['conf']->get(['registry', 'modules', 'stories']),
- 'docSubsitution' => $app['conf']->get(['registry', 'modules', 'doc-substitution']),
- 'subdefSubstitution' => $app['conf']->get(['registry', 'modules', 'thumb-substitution']),],
- 'email' => [
- 'defaultMailAddress' => $app['conf']->get(['registry', 'email', 'emitter-email']),
- 'smtp' => [
- 'active' => $app['conf']->get(['registry', 'email', 'smtp-enabled']),
- 'auth' => $app['conf']->get(['registry', 'email', 'smtp-auth-enabled']),
- 'host' => $app['conf']->get(['registry', 'email', 'smtp-host']),
- 'port' => $app['conf']->get(['registry', 'email', 'smtp-port']),
- 'secure' => $app['conf']->get(['registry', 'email', 'smtp-secure-mode']),
- 'user' => $app['conf']->get(['registry', 'email', 'smtp-user']),
- 'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),
- ],
- ],
- 'ftp' => [
- 'active' => $app['conf']->get(['registry', 'ftp', 'ftp-enabled']),
- 'activeForUser' => $app['conf']->get(['registry', 'ftp', 'ftp-user-access']),],
- 'client' => [
- 'maxSizeDownload' => $app['conf']->get(['registry', 'actions', 'download-max-size']),
- 'tabSearchMode' => $app['conf']->get(['registry', 'classic', 'search-tab']),
- 'tabAdvSearchPosition' => $app['conf']->get(['registry', 'classic', 'adv-search-tab']),
- 'tabTopicsPosition' => $app['conf']->get(['registry', 'classic', 'topics-tab']),
- 'tabOngActifPosition' => $app['conf']->get(['registry', 'classic', 'active-tab']),
- 'renderTopicsMode' => $app['conf']->get(['registry', 'classic', 'render-topics']),
- 'displayRolloverPreview' => $app['conf']->get(['registry', 'classic', 'stories-preview']),
- 'displayRolloverBasket' => $app['conf']->get(['registry', 'classic', 'basket-rollover']),
- 'collRenderMode' => $app['conf']->get(['registry', 'classic', 'collection-presentation']),
- 'viewSizeBaket' => $app['conf']->get(['registry', 'classic', 'basket-size-display']),
- 'clientAutoShowProposals' => $app['conf']->get(['registry', 'classic', 'auto-show-proposals']),
- 'needAuth2DL' => $app['conf']->get(['registry', 'actions', 'auth-required-for-export']),],
- 'inscription' => [
- 'autoSelectDB' => $app['conf']->get(['registry', 'registration', 'auto-select-collections']),
- 'autoRegister' => $app['conf']->get(['registry', 'registration', 'auto-register-enabled']),
- ],
- 'push' => [
- 'validationReminder' => $app['conf']->get(['registry', 'actions', 'validation-reminder-days']),
- 'expirationValue' => $app['conf']->get(['registry', 'actions', 'validation-expiration-days']),
- ],
- ]
- ];
+ return ['global_values' => ['serverName' => $app['conf']->get('servername'), 'title' => $app['conf']->get(['registry', 'general', 'title']), 'keywords' => $app['conf']->get(['registry', 'general', 'keywords']), 'description' => $app['conf']->get(['registry', 'general', 'description']), 'httpServer' => ['phpTimezone' => ini_get('date.timezone'), 'siteId' => $app['conf']->get(['main', 'key']), 'defaultLanguage' => $app['conf']->get(['languages', 'default']), 'allowIndexing' => $app['conf']->get(['registry', 'general', 'allow-indexation']), 'modes' => ['XsendFile' => $app['conf']->get(['xsendfile', 'enabled']), 'XsendFileMapping' => $app['conf']->get(['xsendfile', 'mapping']), 'h264Streaming' => $app['conf']->get(['registry', 'executables', 'h264-streaming-enabled']), 'authTokenDirectory' => $app['conf']->get(['registry', 'executables', 'auth-token-directory']), 'authTokenDirectoryPath' => $app['conf']->get(['registry', 'executables', 'auth-token-directory-path']), 'authTokenPassphrase' => $app['conf']->get(['registry', 'executables', 'auth-token-passphrase']),]], 'maintenance' => ['alertMessage' => $app['conf']->get(['registry', 'maintenance', 'message']), 'displayMessage' => $app['conf']->get(['registry', 'maintenance', 'enabled']),], 'webServices' => ['googleApi' => $app['conf']->get(['registry', 'webservices', 'google-charts-enabled']), 'googleAnalyticsId' => $app['conf']->get(['registry', 'general', 'analytics']), 'i18nWebService' => $app['conf']->get(['registry', 'webservices', 'geonames-server']), 'recaptacha' => ['active' => $app['conf']->get(['registry', 'webservices', 'captcha-enabled']), 'publicKey' => $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']), 'privateKey' => $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']),], 'youtube' => ['active' => $app['conf']->get(['main', 'bridge', 'youtube', 'enabled']), 'clientId' => $app['conf']->get(['main', 'bridge', 'youtube', 'client_id']), 'clientSecret' => $app['conf']->get(['main', 'bridge', 'youtube', 'client_secret']), 'devKey' => $app['conf']->get(['main', 'bridge', 'youtube', 'developer_key']),], 'flickr' => ['active' => $app['conf']->get(['main', 'bridge', 'flickr', 'enabled']), 'clientId' => $app['conf']->get(['main', 'bridge', 'flickr', 'client_id']), 'clientSecret' => $app['conf']->get(['main', 'bridge', 'flickr', 'client_secret']),], 'dailymtotion' => ['active' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'enabled']), 'clientId' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'client_id']), 'clientSecret' => $app['conf']->get(['main', 'bridge', 'dailymotion', 'client_secret']),]], 'navigator' => ['active' => $app['conf']->get(['registry', 'api-clients', 'navigator-enabled']),], 'office-plugin' => ['active' => $app['conf']->get(['registry', 'api-clients', 'office-enabled']),], 'homepage' => ['viewType' => $app['conf']->get(['registry', 'general', 'home-presentation-mode']),], 'report' => ['anonymous' => $app['conf']->get(['registry', 'modules', 'anonymous-report']),], 'storage' => ['documents' => $app['conf']->get(['main', 'storage', 'subdefs']),], 'searchEngine' => ['configuration' => ['defaultQuery' => $app['conf']->get(['registry', 'searchengine', 'default-query']), 'defaultQueryType' => $app['conf']->get(['registry', 'searchengine', 'default-query-type']), 'minChar' => $app['conf']->get(['registry', 'searchengine', 'min-letters-truncation']),], 'engine' => ['type' => $app['phraseanet.SE']->getName(), 'status' => $SEStatus, 'configuration' => $app['phraseanet.SE']->getConfigurationPanel()->getConfiguration(),],], 'binary' => ['phpCli' => isset($binaries['php_binary']) ? $binaries['php_binary'] : null, 'phpIni' => $app['conf']->get(['registry', 'executables', 'php-conf-path']), 'swfExtract' => isset($binaries['swf_extract_binary']) ? $binaries['swf_extract_binary'] : null, 'pdf2swf' => isset($binaries['pdf2swf_binary']) ? $binaries['pdf2swf_binary'] : null, 'swfRender' => isset($binaries['swf_render_binary']) ? $binaries['swf_render_binary'] : null, 'unoconv' => isset($binaries['unoconv_binary']) ? $binaries['unoconv_binary'] : null, 'ffmpeg' => isset($binaries['ffmpeg_binary']) ? $binaries['ffmpeg_binary'] : null, 'ffprobe' => isset($binaries['ffprobe_binary']) ? $binaries['ffprobe_binary'] : null, 'mp4box' => isset($binaries['mp4box_binary']) ? $binaries['mp4box_binary'] : null, 'pdftotext' => isset($binaries['pdftotext_binary']) ? $binaries['pdftotext_binary'] : null, 'recess' => isset($binaries['recess_binary']) ? $binaries['recess_binary'] : null, 'pdfmaxpages' => $app['conf']->get(['registry', 'executables', 'pdf-max-pages']),], 'mainConfiguration' => ['viewBasAndCollName' => $app['conf']->get(['registry', 'actions', 'collection-display']), 'chooseExportTitle' => $app['conf']->get(['registry', 'actions', 'export-title-choice']), 'defaultExportTitle' => $app['conf']->get(['registry', 'actions', 'default-export-title']), 'socialTools' => $app['conf']->get(['registry', 'actions', 'social-tools']),], 'modules' => ['thesaurus' => $app['conf']->get(['registry', 'modules', 'thesaurus']), 'storyMode' => $app['conf']->get(['registry', 'modules', 'stories']), 'docSubsitution' => $app['conf']->get(['registry', 'modules', 'doc-substitution']), 'subdefSubstitution' => $app['conf']->get(['registry', 'modules', 'thumb-substitution']),], 'email' => ['defaultMailAddress' => $app['conf']->get(['registry', 'email', 'emitter-email']), 'smtp' => ['active' => $app['conf']->get(['registry', 'email', 'smtp-enabled']), 'auth' => $app['conf']->get(['registry', 'email', 'smtp-auth-enabled']), 'host' => $app['conf']->get(['registry', 'email', 'smtp-host']), 'port' => $app['conf']->get(['registry', 'email', 'smtp-port']), 'secure' => $app['conf']->get(['registry', 'email', 'smtp-secure-mode']), 'user' => $app['conf']->get(['registry', 'email', 'smtp-user']), 'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),],], 'ftp' => ['active' => $app['conf']->get(['registry', 'ftp', 'ftp-enabled']), 'activeForUser' => $app['conf']->get(['registry', 'ftp', 'ftp-user-access']),], 'client' => ['maxSizeDownload' => $app['conf']->get(['registry', 'actions', 'download-max-size']), 'tabSearchMode' => $app['conf']->get(['registry', 'classic', 'search-tab']), 'tabAdvSearchPosition' => $app['conf']->get(['registry', 'classic', 'adv-search-tab']), 'tabTopicsPosition' => $app['conf']->get(['registry', 'classic', 'topics-tab']), 'tabOngActifPosition' => $app['conf']->get(['registry', 'classic', 'active-tab']), 'renderTopicsMode' => $app['conf']->get(['registry', 'classic', 'render-topics']), 'displayRolloverPreview' => $app['conf']->get(['registry', 'classic', 'stories-preview']), 'displayRolloverBasket' => $app['conf']->get(['registry', 'classic', 'basket-rollover']), 'collRenderMode' => $app['conf']->get(['registry', 'classic', 'collection-presentation']), 'viewSizeBaket' => $app['conf']->get(['registry', 'classic', 'basket-size-display']), 'clientAutoShowProposals' => $app['conf']->get(['registry', 'classic', 'auto-show-proposals']), 'needAuth2DL' => $app['conf']->get(['registry', 'actions', 'auth-required-for-export']),], 'inscription' => ['autoSelectDB' => $app['conf']->get(['registry', 'registration', 'auto-select-collections']), 'autoRegister' => $app['conf']->get(['registry', 'registration', 'auto-register-enabled']),], 'push' => ['validationReminder' => $app['conf']->get(['registry', 'actions', 'validation-reminder-days']), 'expirationValue' => $app['conf']->get(['registry', 'actions', 'validation-expiration-days']),],]];
}
/**
@@ -604,6 +390,7 @@ class V1 implements ControllerProviderInterface
* - configuration informations
*
* @param \Silex\Application $app the silex application
+ *
* @return Response
*/
public function get_phraseanet_monitor(Application $app, Request $request)
@@ -690,15 +477,9 @@ class V1 implements ControllerProviderInterface
$record = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id);
$fields = $record->get_caption()->get_fields();
- $ret = [
- 'caption_metadatas' => array_map(function ($field) {
- return [
- 'meta_structure_id' => $field->get_meta_struct_id(),
- 'name' => $field->get_name(),
- 'value' => $field->get_serialized_values(";"),
- ];
- }, $fields)
- ];
+ $ret = ['caption_metadatas' => array_map(function ($field) {
+ return ['meta_structure_id' => $field->get_meta_struct_id(), 'name' => $field->get_name(), 'value' => $field->get_serialized_values(";"),];
+ }, $fields)];
return Result::create($request, $ret)->createResponse();
}
@@ -772,9 +553,7 @@ class V1 implements ControllerProviderInterface
$app['border-manager']->process($session, $Package, $callback, $behavior);
- $ret = [
- 'entity' => null,
- ];
+ $ret = ['entity' => null,];
if ($output instanceof \record_adapter) {
$ret['entity'] = '0';
@@ -807,11 +586,7 @@ class V1 implements ControllerProviderInterface
return $this->list_lazaret_file($app, $lazaretFile);
}, $lazaretFiles);
- $ret = [
- 'offset_start' => $offset_start,
- 'per_page' => $per_page,
- 'quarantine_items' => $ret,
- ];
+ $ret = ['offset_start' => $offset_start, 'per_page' => $per_page, 'quarantine_items' => $ret,];
return Result::create($request, $ret)->createResponse();
}
@@ -846,30 +621,16 @@ class V1 implements ControllerProviderInterface
$usr_id = $user->getId();
}
- $session = [
- 'id' => $file->getSession()->getId(),
- 'usr_id' => $usr_id,
- 'user' => $user ? $this->list_user($user) : null,
- ];
+ $session = ['id' => $file->getSession()->getId(), 'usr_id' => $usr_id, 'user' => $user ? $this->list_user($user) : null,];
- return [
- 'id' => $file->getId(),
- 'quarantine_session' => $session,
- 'base_id' => $file->getBaseId(),
- 'original_name' => $file->getOriginalName(),
- 'sha256' => $file->getSha256(),
- 'uuid' => $file->getUuid(),
- 'forced' => $file->getForced(),
- 'checks' => $file->getForced() ? [] : $checks,
- 'created_on' => $file->getCreated()->format(DATE_ATOM),
- 'updated_on' => $file->getUpdated()->format(DATE_ATOM),
- ];
+ return ['id' => $file->getId(), 'quarantine_session' => $session, 'base_id' => $file->getBaseId(), 'original_name' => $file->getOriginalName(), 'sha256' => $file->getSha256(), 'uuid' => $file->getUuid(), 'forced' => $file->getForced(), 'checks' => $file->getForced() ? [] : $checks, 'created_on' => $file->getCreated()->format(DATE_ATOM), 'updated_on' => $file->getUpdated()->format(DATE_ATOM),];
}
/**
* Search for results
*
- * @param Request $request
+ * @param Request $request
+ *
* @return Response
*/
public function search(Application $app, Request $request)
@@ -913,8 +674,8 @@ class V1 implements ControllerProviderInterface
{
$options = SearchEngineOptions::fromRequest($app, $request);
- $offsetStart = (int) ($request->get('offset_start') ? : 0);
- $perPage = (int) $request->get('per_page') ? : 10;
+ $offsetStart = (int) ($request->get('offset_start') ?: 0);
+ $perPage = (int) $request->get('per_page') ?: 10;
$query = (string) $request->get('query');
$app['phraseanet.SE']->resetCache();
@@ -927,29 +688,17 @@ class V1 implements ControllerProviderInterface
$colls = array_map(function (\collection $collection) {
return $collection->get_coll_id();
}, array_filter($options->getCollections(), function (\collection $collection) use ($databox) {
- return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
- }));
+ return $collection->get_databox()->get_sbas_id() == $databox->get_sbas_id();
+ }));
$app['phraseanet.SE.logger']->log($databox, $search_result->getQuery(), $search_result->getTotal(), $colls);
}
$app['phraseanet.SE']->clearCache();
- $ret = [
- 'offset_start' => $offsetStart,
- 'per_page' => $perPage,
- 'available_results' => $search_result->getAvailable(),
- 'total_results' => $search_result->getTotal(),
- 'error' => $search_result->getError(),
- 'warning' => $search_result->getWarning(),
- 'query_time' => $search_result->getDuration(),
- 'search_indexes' => $search_result->getIndexes(),
- 'suggestions' => array_map(function (SearchEngineSuggestion $suggestion) {
- return $suggestion->toArray();
- }, $search_result->getSuggestions()->toArray()),
- 'results' => [],
- 'query' => $search_result->getQuery(),
- ];
+ $ret = ['offset_start' => $offsetStart, 'per_page' => $perPage, 'available_results' => $search_result->getAvailable(), 'total_results' => $search_result->getTotal(), 'error' => $search_result->getError(), 'warning' => $search_result->getWarning(), 'query_time' => $search_result->getDuration(), 'search_indexes' => $search_result->getIndexes(), 'suggestions' => array_map(function (SearchEngineSuggestion $suggestion) {
+ return $suggestion->toArray();
+ }, $search_result->getSuggestions()->toArray()), 'results' => [], 'query' => $search_result->getQuery(),];
return [$ret, $search_result];
}
@@ -967,12 +716,8 @@ class V1 implements ControllerProviderInterface
{
$that = $this;
$baskets = array_map(function (Basket $basket) use ($that, $app) {
- return $that->list_basket($app, $basket);
- }, (array) $app['phraseanet.appbox']
- ->get_databox($databox_id)
- ->get_record($record_id)
- ->get_container_baskets($app['EM'], $app['authentication']->getUser())
- );
+ return $that->list_basket($app, $basket);
+ }, (array) $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id)->get_container_baskets($app['EM'], $app['authentication']->getUser()));
$record = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id);
@@ -1011,9 +756,7 @@ class V1 implements ControllerProviderInterface
*/
public function get_record_status(Application $app, Request $request, $databox_id, $record_id)
{
- $record = $app['phraseanet.appbox']
- ->get_databox($databox_id)
- ->get_record($record_id);
+ $record = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id);
$ret = ["status" => $this->list_record_status($app['phraseanet.appbox']->get_databox($databox_id), $record->get_status())];
@@ -1054,11 +797,9 @@ class V1 implements ControllerProviderInterface
*
* @return Response
*/
- public function get_story_embed(Application $app, Request $request, $databox_id, $story_id)
+ public function get_story_embed(Application $app, Request $request, $databox_id, $record_id)
{
- $record = $app['phraseanet.appbox']
- ->get_databox($databox_id)
- ->get_record($story_id);
+ $record = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id);
$devices = $request->get('devices', []);
$mimes = $request->get('mimes', []);
@@ -1089,13 +830,25 @@ class V1 implements ControllerProviderInterface
$record->set_metadatas($metadatas);
- /**
- * Check wether the current user is Admin or not
- */
- $mustBeAdmin = function (Request $request) use ($app) {
- $user = $app['token']->get_account()->get_user();
- if (!$user->ACL()->is_admin()) {
- throw new \API_V1_exception_unauthorized('You are not authorized');
+ return Result::create($request, ["record_metadatas" => $this->list_record_caption($record->get_caption())])->createResponse();
+ }
+
+ public function set_record_status(Application $app, Request $request, $databox_id, $record_id)
+ {
+ $databox = $app['phraseanet.appbox']->get_databox($databox_id);
+ $record = $databox->get_record($record_id);
+ $status_bits = $databox->get_statusbits();
+
+ $status = $request->get('status');
+
+ $datas = strrev($record->get_status());
+
+ if (!is_array($status)) {
+ return $this->getBadRequest($app, $request);
+ }
+ foreach ($status as $n => $value) {
+ if ($n > 31 || $n < 4) {
+ return $this->getBadRequest($app, $request);
}
if (!in_array($value, ['0', '1'])) {
return $this->getBadRequest($app, $request);
@@ -1104,19 +857,8 @@ class V1 implements ControllerProviderInterface
return $this->getBadRequest($app, $request);
}
- /**
- * Get scheduler informations
- *
- * Route : /monitor/scheduler/
- *
- * Method : GET
- *
- * Parameters :
- *
- */
- $controllers->get('/monitor/scheduler/', function (SilexApplication $app, Request $request) {
- return $app['api']->get_scheduler($app)->get_response();
- })->before($mustBeAdmin);
+ $datas = substr($datas, 0, ($n)) . $value . substr($datas, ($n + 2));
+ }
$record->set_binary_status(strrev($datas));
$app['phraseanet.SE']->updateRecord($record);
@@ -1129,9 +871,10 @@ class V1 implements ControllerProviderInterface
/**
* Move a record to another collection
*
- * @param Request $request
- * @param int $databox_id
- * @param int $record_id
+ * @param Request $request
+ * @param int $databox_id
+ * @param int $record_id
+ *
* @return Response
*/
public function set_record_collection(Application $app, Request $request, $databox_id, $record_id)
@@ -1152,9 +895,10 @@ class V1 implements ControllerProviderInterface
/**
* Return detailed informations about one record
*
- * @param Request $request
- * @param int $databox_id
- * @param int $record_id
+ * @param Request $request
+ * @param int $databox_id
+ * @param int $record_id
+ *
* @return Response
*/
public function get_record(Application $app, Request $request, $databox_id, $record_id)
@@ -1162,52 +906,41 @@ class V1 implements ControllerProviderInterface
try {
$record = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id);
- /**
- * Route /databoxes/DATABOX_ID/collections/
- *
- * Method : GET
- *
- * Parameters ;
- * DATABOX_ID : required INT
- */
- $controllers->get('/databoxes/{databox_id}/collections/', function (SilexApplication $app, $databox_id) {
- return $app['api']
- ->get_databox_collections($app['request'], $databox_id)
- ->get_response();
- })->assert('databox_id', '\d+');
+ return Result::create($request, ['record' => $this->list_record($app, $record)])->createResponse();
+ } catch (NotFoundHttpException $e) {
+ return Result::createError($request, 404, $app->trans('Record Not Found'))->createResponse();
+ } catch (\Exception $e) {
+ return $this->getBadRequest($app, $request, $app->trans('An error occured'));
+ }
+ }
/**
* Return detailed informations about one story
*
- * @param Request $request
- * @param int $databox_id
- * @param int $story_id
+ * @param Request $request
+ * @param int $databox_id
+ * @param int $record_id
+ *
* @return Response
*/
- public function get_story(Application $app, Request $request, $databox_id, $story_id)
+ public function get_story(Application $app, Request $request, $databox_id, $record_id)
{
try {
- $story = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($story_id);
+ $story = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id);
- /**
- * Route /databoxes/DATABOX_ID/status/
- *
- * Method : GET
- *
- * Parameters ;
- * DATABOX_ID : required INT
- *
- */
- $controllers->get('/databoxes/{databox_id}/status/', function (SilexApplication $app, $databox_id) {
- return $app['api']
- ->get_databox_status($app['request'], $databox_id)
- ->get_response();
- })->assert('databox_id', '\d+');
+ return Result::create($request, ['story' => $this->list_story($app, $request, $story)])->createResponse();
+ } catch (NotFoundHttpException $e) {
+ return Result::createError($request, 404, $app->trans('Story Not Found'))->createResponse();
+ } catch (\Exception $e) {
+ return $this->getBadRequest($app, $request, $app->trans('An error occured'));
+ }
+ }
/**
* Return the baskets list of the authenticated user
*
- * @param Request $request
+ * @param Request $request
+ *
* @return Response
*/
public function search_baskets(Application $app, Request $request)
@@ -1218,12 +951,14 @@ class V1 implements ControllerProviderInterface
/**
* Return a baskets list
*
- * @param int $usr_id
+ * @param int $usr_id
+ *
* @return array
*/
private function list_baskets(Application $app)
{
$repo = $app['repo.baskets'];
+
/* @var $repo BasketRepository */
return array_map(function (Basket $basket) use ($app) {
@@ -1234,7 +969,8 @@ class V1 implements ControllerProviderInterface
/**
* Create a new basket
*
- * @param Request $request
+ * @param Request $request
+ *
* @return Response
*/
public function create_basket(Application $app, Request $request)
@@ -1245,31 +981,22 @@ class V1 implements ControllerProviderInterface
return $this->getBadRequest($app, $request, 'Missing basket name parameter');
}
- $controllers->get('/quarantine/list/', function (SilexApplication $app, Request $request) {
- return $app['api']->list_quarantine($app, $request)->get_response();
- });
+ $Basket = new Basket();
+ $Basket->setUser($app['authentication']->getUser());
+ $Basket->setName($name);
- $controllers->get('/quarantine/item/{lazaret_id}/', function ($lazaret_id, SilexApplication $app, Request $request) {
- return $app['api']->list_quarantine_item($lazaret_id, $app, $request)->get_response();
- });
+ $app['EM']->persist($Basket);
+ $app['EM']->flush();
- /**
- * Route : /records/add/
- *
- * Method : POST
- *
- * Parameters :
- *
- */
- $controllers->post('/records/add/', function (SilexApplication $app, Request $request) {
- return $app['api']->add_record($app, $request)->get_response();
- });
+ return Result::create($request, ["basket" => $this->list_basket($app, $Basket)])->createResponse();
+ }
/**
* Delete a basket
*
* @param Request $request
* @param Basket $basket
+ *
* @return array
*/
public function delete_basket(Application $app, Request $request, Basket $basket)
@@ -1280,189 +1007,111 @@ class V1 implements ControllerProviderInterface
return $this->search_baskets($app, $request);
}
- $controllers->get('/records/{databox_id}/{record_id}/caption/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->caption_records($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ /**
+ * Retrieve a basket
+ *
+ * @param Request $request
+ * @param Basket $basket
+ *
+ * @return Response
+ */
+ public function get_basket(Application $app, Request $request, Basket $basket)
+ {
+ $ret = ["basket" => $this->list_basket($app, $basket), "basket_elements" => $this->list_basket_content($app, $basket)];
return Result::create($request, $ret)->createResponse();
}
- /**
- * Route : /records/DATABOX_ID/RECORD_ID/metadatas/
- *
- * Method : GET
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->get('/records/{databox_id}/{record_id}/metadatas/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->get_record_metadatas($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ public function get_current_user(Application $app, Request $request)
+ {
+ $ret = ["user" => $this->list_user($app['authentication']->getUser())];
return Result::create($request, $ret)->createResponse();
}
- /**
- * Route : /records/DATABOX_ID/RECORD_ID/status/
- *
- * Method : GET
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->get('/records/{databox_id}/{record_id}/status/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->get_record_status($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ /**
+ * Retrieve elements of one basket
+ *
+ * @param Basket $Basket
+ *
+ * @return type
+ */
+ private function list_basket_content(Application $app, Basket $Basket)
+ {
+ return array_map(function (BasketElement $element) use ($app) {
+ return $this->list_basket_element($app, $element);
+ }, iterator_to_array($Basket->getElements()));
+ }
/**
* Retrieve detailled informations about a basket element
*
* @param BasketElement $basket_element
+ *
* @return type
*/
private function list_basket_element(Application $app, BasketElement $basket_element)
{
- $ret = [
- 'basket_element_id' => $basket_element->getId(),
- 'order' => $basket_element->getOrd(),
- 'record' => $this->list_record($app, $basket_element->getRecord($app)),
- 'validation_item' => null != $basket_element->getBasket()->getValidation(),
- ];
+ $ret = ['basket_element_id' => $basket_element->getId(), 'order' => $basket_element->getOrd(), 'record' => $this->list_record($app, $basket_element->getRecord($app)), 'validation_item' => null != $basket_element->getBasket()->getValidation(),];
- /**
- * Route : /records/DATABOX_ID/RECORD_ID/related/
- *
- * Method : GET
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->get('/records/{databox_id}/{record_id}/related/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->get_record_related($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ if ($basket_element->getBasket()->getValidation()) {
+ $choices = [];
+ $agreement = null;
+ $note = '';
foreach ($basket_element->getValidationDatas() as $validation_datas) {
$participant = $validation_datas->getParticipant();
$user = $participant->getUser();
/* @var $validation_datas ValidationData */
- $choices[] = [
- 'validation_user' => [
- 'usr_id' => $user->getId(),
- 'usr_name' => $user->getDisplayName(),
- 'confirmed' => $participant->getIsConfirmed(),
- 'can_agree' => $participant->getCanAgree(),
- 'can_see_others' => $participant->getCanSeeOthers(),
- 'readonly' => $user->getId() != $app['authentication']->getUser()->getId(),
- 'user' => $this->list_user($user),
- ],
- 'agreement' => $validation_datas->getAgreement(),
- 'updated_on' => $validation_datas->getUpdated()->format(DATE_ATOM),
- 'note' => null === $validation_datas->getNote() ? '' : $validation_datas->getNote(),
- ];
+ $choices[] = ['validation_user' => ['usr_id' => $user->getId(), 'usr_name' => $user->getDisplayName(), 'confirmed' => $participant->getIsConfirmed(), 'can_agree' => $participant->getCanAgree(), 'can_see_others' => $participant->getCanSeeOthers(), 'readonly' => $user->getId() != $app['authentication']->getUser()->getId(), 'user' => $this->list_user($user),], 'agreement' => $validation_datas->getAgreement(), 'updated_on' => $validation_datas->getUpdated()->format(DATE_ATOM), 'note' => null === $validation_datas->getNote() ? '' : $validation_datas->getNote(),];
- /**
- * Route : /records/DATABOX_ID/RECORD_ID/embed/
- *
- * Method : GET
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->get('/records/{databox_id}/{record_id}/embed/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->get_record_embed($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ if ($user->getId() == $app['authentication']->getUser()->getId()) {
+ $agreement = $validation_datas->getAgreement();
+ $note = null === $validation_datas->getNote() ? '' : $validation_datas->getNote();
+ }
$ret['validation_choices'] = $choices;
}
- /**
- * Route : /records/DATABOX_ID/RECORD_ID/setmetadatas/
- *
- * Method : POST
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->post('/records/{databox_id}/{record_id}/setmetadatas/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->set_record_metadatas($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $ret['agreement'] = $agreement;
+ $ret['note'] = $note;
+ }
return $ret;
}
- /**
- * Route : /records/DATABOX_ID/RECORD_ID/setstatus/
- *
- * Method : POST
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->post('/records/{databox_id}/{record_id}/setstatus/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->set_record_status($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ /**
+ * Change the name of one basket
+ *
+ * @param Request $request
+ * @param Basket $basket
+ *
+ * @return Response
+ */
+ public function set_basket_title(Application $app, Request $request, Basket $basket)
+ {
+ $basket->setName($request->get('name'));
$app['EM']->persist($basket);
$app['EM']->flush();
- /**
- * Route : /records/DATABOX_ID/RECORD_ID/setcollection/
- *
- * Method : POST
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->post('/records/{databox_id}/{record_id}/setcollection/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->set_record_collection($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ return Result::create($request, ["basket" => $this->list_basket($app, $basket)])->createResponse();
+ }
/**
* Change the description of one basket
*
- * @param Request $request
- * @param Basket $basket
+ * @param Request $request
+ * @param Basket $basket
+ *
* @return Response
*/
public function set_basket_description(Application $app, Request $request, Basket $basket)
{
$basket->setDescription($request->get('description'));
- $controllers->get('/records/{databox_id}/{record_id}/', function (SilexApplication $app, $databox_id, $record_id) {
- return $app['api']
- ->get_record($app['request'], $databox_id, $record_id)
- ->get_response();
- })->assert('databox_id', '\d+')->assert('record_id', '\d+');
+ $app['EM']->persist($basket);
+ $app['EM']->flush();
return Result::create($request, ["basket" => $this->list_basket($app, $basket)])->createResponse();
}
@@ -1470,8 +1119,9 @@ class V1 implements ControllerProviderInterface
/**
* List all avalaible feeds
*
- * @param Request $request
- * @param User $user
+ * @param Request $request
+ * @param User $user
+ *
* @return Response
*/
public function search_publications(Application $app, Request $request)
@@ -1489,9 +1139,10 @@ class V1 implements ControllerProviderInterface
/**
* Retrieve one feed
*
- * @param Request $request
- * @param int $publication_id
- * @param User $user
+ * @param Request $request
+ * @param int $publication_id
+ * @param User $user
+ *
* @return Response
*/
public function get_publication(Application $app, Request $request, $feed_id)
@@ -1508,12 +1159,7 @@ class V1 implements ControllerProviderInterface
$per_page = (($per_page >= 1) && ($per_page <= 100)) ? $per_page : 100;
- $data = [
- 'feed' => $this->list_publication($feed, $user),
- 'offset_start' => $offset_start,
- 'per_page' => $per_page,
- 'entries' => $this->list_publications_entries($app, $feed, $offset_start, $per_page),
- ];
+ $data = ['feed' => $this->list_publication($feed, $user), 'offset_start' => $offset_start, 'per_page' => $per_page, 'entries' => $this->list_publications_entries($app, $feed, $offset_start, $per_page),];
return Result::create($request, $data)->createResponse();
}
@@ -1521,28 +1167,16 @@ class V1 implements ControllerProviderInterface
public function get_publications(Application $app, Request $request)
{
$user = $app['authentication']->getUser();
- $restrictions = (array) ($request->get('feeds') ? : []);
+ $restrictions = (array) ($request->get('feeds') ?: []);
$feed = Aggregate::createFromUser($app, $user, $restrictions);
- $controllers->get('/feeds/content/', function (SilexApplication $app) {
- return $app['api']
- ->get_publications($app['request'], $app['authentication']->getUser())
- ->get_response();
- });
+ $offset_start = (int) ($request->get('offset_start') ?: 0);
+ $per_page = (int) ($request->get('per_page') ?: 5);
- $controllers->get('/feeds/entry/{entry_id}/', function (SilexApplication $app, $entry_id) {
- return $app['api']
- ->get_feed_entry($app['request'], $entry_id, $app['authentication']->getUser())
- ->get_response();
- })->assert('entry_id', '\d+');
+ $per_page = (($per_page >= 1) && ($per_page <= 20)) ? $per_page : 20;
- $data = [
- 'total_entries' => $feed->getCountTotalEntries(),
- 'offset_start' => $offset_start,
- 'per_page' => $per_page,
- 'entries' => $this->list_publications_entries($app, $feed, $offset_start, $per_page),
- ];
+ $data = ['total_entries' => $feed->getCountTotalEntries(), 'offset_start' => $offset_start, 'per_page' => $per_page, 'entries' => $this->list_publications_entries($app, $feed, $offset_start, $per_page),];
return Result::create($request, $data)->createResponse();
}
@@ -1553,18 +1187,9 @@ class V1 implements ControllerProviderInterface
$entry = $app['repo.feed-entries']->find($entry_id);
$collection = $entry->getFeed()->getCollection($app);
- /**
- * Route : /stories/DATABOX_ID/RECORD_ID/embed/
- *
- * Method : GET
- *
- * Parameters :
- * DATABOX_ID : required INT
- * RECORD_ID : required INT
- *
- */
- $controllers->get('/stories/{databox_id}/{story_id}/embed/', function ($databox_id, $story_id) use ($app) {
- $result = $app['api']->get_story_embed($app['request'], $databox_id, $story_id);
+ if (null !== $collection && !$app['acl']->get($user)->has_access_to_base($collection->get_base_id())) {
+ return Result::createError($request, 403, 'You have not access to the parent feed')->createResponse();
+ }
return Result::create($request, ['entry' => $this->list_publication_entry($app, $entry)])->createResponse();
}
@@ -1572,24 +1197,14 @@ class V1 implements ControllerProviderInterface
/**
* Retrieve detailled informations about one feed
*
- * @param Feed $feed
- * @param type $user
+ * @param Feed $feed
+ * @param type $user
+ *
* @return array
*/
private function list_publication(Feed $feed, $user)
{
- return [
- 'id' => $feed->getId(),
- 'title' => $feed->getTitle(),
- 'subtitle' => $feed->getSubtitle(),
- 'total_entries' => $feed->getCountTotalEntries(),
- 'icon' => $feed->getIconUrl(),
- 'public' => $feed->isPublic(),
- 'readonly' => !$feed->isPublisher($user),
- 'deletable' => $feed->isOwner($user),
- 'created_on' => $feed->getCreatedOn()->format(DATE_ATOM),
- 'updated_on' => $feed->getUpdatedOn()->format(DATE_ATOM),
- ];
+ return ['id' => $feed->getId(), 'title' => $feed->getTitle(), 'subtitle' => $feed->getSubtitle(), 'total_entries' => $feed->getCountTotalEntries(), 'icon' => $feed->getIconUrl(), 'public' => $feed->isPublic(), 'readonly' => !$feed->isPublisher($user), 'deletable' => $feed->isOwner($user), 'created_on' => $feed->getCreatedOn()->format(DATE_ATOM), 'updated_on' => $feed->getUpdatedOn()->format(DATE_ATOM),];
}
/**
@@ -1598,6 +1213,7 @@ class V1 implements ControllerProviderInterface
* @param FeedInterface $feed
* @param int $offset_start
* @param int $how_many
+ *
* @return array
*/
private function list_publications_entries(Application $app, FeedInterface $feed, $offset_start = 0, $how_many = 5)
@@ -1611,6 +1227,7 @@ class V1 implements ControllerProviderInterface
* Retrieve detailled information about one feed entry
*
* @param FeedEntry $entry
+ *
* @return array
*/
private function list_publication_entry(Application $app, FeedEntry $entry)
@@ -1619,40 +1236,26 @@ class V1 implements ControllerProviderInterface
return $this->list_publication_entry_item($app, $item);
}, iterator_to_array($entry->getItems()));
- return [
- 'id' => $entry->getId(),
- 'author_email' => $entry->getAuthorEmail(),
- 'author_name' => $entry->getAuthorName(),
- 'created_on' => $entry->getCreatedOn()->format(DATE_ATOM),
- 'updated_on' => $entry->getUpdatedOn()->format(DATE_ATOM),
- 'title' => $entry->getTitle(),
- 'subtitle' => $entry->getSubtitle(),
- 'items' => $items,
- 'feed_id' => $entry->getFeed()->getId(),
- 'feed_title' => $entry->getFeed()->getTitle(),
- 'feed_url' => '/feeds/' . $entry->getFeed()->getId() . '/content/',
- 'url' => '/feeds/entry/' . $entry->getId() . '/',
- ];
+ return ['id' => $entry->getId(), 'author_email' => $entry->getAuthorEmail(), 'author_name' => $entry->getAuthorName(), 'created_on' => $entry->getCreatedOn()->format(DATE_ATOM), 'updated_on' => $entry->getUpdatedOn()->format(DATE_ATOM), 'title' => $entry->getTitle(), 'subtitle' => $entry->getSubtitle(), 'items' => $items, 'feed_id' => $entry->getFeed()->getId(), 'feed_title' => $entry->getFeed()->getTitle(), 'feed_url' => '/feeds/' . $entry->getFeed()->getId() . '/content/', 'url' => '/feeds/entry/' . $entry->getId() . '/',];
}
/**
* Retrieve detailled informations about one feed entry item
*
* @param FeedItem $item
+ *
* @return array
*/
private function list_publication_entry_item(Application $app, FeedItem $item)
{
- return [
- 'item_id' => $item->getId(),
- 'record' => $this->list_record($app, $item->getRecord($app)),
- ];
+ return ['item_id' => $item->getId(), 'record' => $this->list_record($app, $item->getRecord($app)),];
}
/**
* @retrieve detailled informations about one suddef
*
* @param media_subdef $media
+ *
* @return array
*/
private function list_embedable_media(Application $app, \record_adapter $record, \media_subdef $media)
@@ -1665,7 +1268,10 @@ class V1 implements ControllerProviderInterface
if ($media->get_name() !== 'document' && false === $app['acl']->get($app['authentication']->getUser())->has_access_to_subdef($record, $media->get_name())) {
return null;
}
- )->assert('databox_id', '\d+')->assert('story_id', '\d+');
+ if ($media->get_name() === 'document' && !$app['acl']->get($app['authentication']->getUser())->has_right_on_base($record->get_base_id(), 'candwnldhd') && !$app['acl']->get($app['authentication']->getUser())->has_hd_grant($record)) {
+ return null;
+ }
+ }
if ($media->get_permalink() instanceof \media_Permalink_Adapter) {
$permalink = $this->list_permalink($media->get_permalink());
@@ -1673,39 +1279,50 @@ class V1 implements ControllerProviderInterface
$permalink = null;
}
- $controllers->get('/stories/{databox_id}/{story_id}/', function ($databox_id, $story_id) use ($app) {
- $result = $app['api']->get_story($app['request'], $databox_id, $story_id);
-
- return $result->get_response();
- })->assert('databox_id', '\d+')->assert('story_id', '\d+');
-
- return [
- 'created_on' => $permalink->get_created_on()->format(DATE_ATOM),
- 'id' => $permalink->get_id(),
- 'is_activated' => $permalink->get_is_activated(),
- /** @Ignore */
- 'label' => $permalink->get_label(),
- 'updated_on' => $permalink->get_last_modified()->format(DATE_ATOM),
- 'page_url' => $permalink->get_page(),
- 'download_url' => (string) $downloadUrl,
- 'url' => (string) $permalink->get_url()
- ];
+ return ['name' => $media->get_name(), 'permalink' => $permalink, 'height' => $media->get_height(), 'width' => $media->get_width(), 'filesize' => $media->get_size(), 'devices' => $media->getDevices(), 'player_type' => $media->get_type(), 'mime_type' => $media->get_mime(),];
}
- $controllers->get('/stories/{databox_id}/{story_id}/', function ($databox_id, $story_id) use ($app) {
- $result = $app['api']->get_story($app['request'], $databox_id, $story_id);
+ /**
+ * Retrieve detailled information about one permalink
+ *
+ * @param media_Permalink_Adapter $permalink
+ *
+ * @return type
+ */
+ private function list_permalink(\media_Permalink_Adapter $permalink)
+ {
+ $downloadUrl = $permalink->get_url();
+ $downloadUrl->getQuery()->set('download', '1');
- return $result->get_response();
- })->assert('databox_id', '\d+')->assert('story_id', '\d+');
- $controllers->get('/stories/{any_id}/{anyother_id}/', $bad_request_exception);
+ return ['created_on' => $permalink->get_created_on()->format(DATE_ATOM), 'id' => $permalink->get_id(), 'is_activated' => $permalink->get_is_activated(), /** @Ignore */
+ 'label' => $permalink->get_label(), 'updated_on' => $permalink->get_last_modified()->format(DATE_ATOM), 'page_url' => $permalink->get_page(), 'download_url' => (string) $downloadUrl, 'url' => (string) $permalink->get_url()];
+ }
- $controllers->get('/me/', function (SilexApplication $app, Request $request) {
- $result = $app['api']->get_current_user($app, $request);
+ /**
+ * Retrieve detailled information about one status
+ *
+ * @param \databox $databox
+ * @param string $status
+ *
+ * @return array
+ */
+ private function list_record_status(\databox $databox, $status)
+ {
+ $status = strrev($status);
+
+ $ret = [];
+ foreach ($databox->get_statusbits() as $bit => $status_datas) {
+ $ret[] = ['bit' => $bit, 'state' => !!substr($status, ($bit - 1), 1)];
+ }
+
+ return $ret;
+ }
/**
* List all field about a specified caption
*
* @param caption_record $caption
+ *
* @return array
*/
private function list_record_caption(\caption_record $caption)
@@ -1724,58 +1341,30 @@ class V1 implements ControllerProviderInterface
* Retrieve information about a caption field
*
* @param caption_field $field
+ *
* @return array
*/
private function list_record_caption_field(\caption_Field_Value $value, \caption_field $field)
{
- return [
- 'meta_id' => $value->getId(),
- 'meta_structure_id' => $field->get_meta_struct_id(),
- 'name' => $field->get_name(),
- 'labels' => [
- 'fr' => $field->get_databox_field()->get_label('fr'),
- 'en' => $field->get_databox_field()->get_label('en'),
- 'de' => $field->get_databox_field()->get_label('de'),
- 'nl' => $field->get_databox_field()->get_label('nl'),
- ],
- 'value' => $value->getValue(),
- ];
+ return ['meta_id' => $value->getId(), 'meta_structure_id' => $field->get_meta_struct_id(), 'name' => $field->get_name(), 'labels' => ['fr' => $field->get_databox_field()->get_label('fr'), 'en' => $field->get_databox_field()->get_label('en'), 'de' => $field->get_databox_field()->get_label('de'), 'nl' => $field->get_databox_field()->get_label('nl'),], 'value' => $value->getValue(),];
}
/**
* Retrieve information about one basket
*
* @param Basket $basket
+ *
* @return array
*/
private function list_basket(Application $app, Basket $basket)
{
- $ret = [
- 'basket_id' => $basket->getId(),
- 'owner' => $this->list_user($basket->getUser()),
- 'created_on' => $basket->getCreated()->format(DATE_ATOM),
- 'description' => (string) $basket->getDescription(),
- 'name' => $basket->getName(),
- 'pusher_usr_id' => $basket->getPusher() ? $basket->getPusher()->getId() : null,
- 'pusher' => $basket->getPusher() ? $this->list_user($basket->getPusher()) : null,
- 'updated_on' => $basket->getUpdated()->format(DATE_ATOM),
- 'unread' => !$basket->getIsRead(),
- 'validation_basket' => !!$basket->getValidation()
- ];
+ $ret = ['basket_id' => $basket->getId(), 'owner' => $this->list_user($basket->getUser()), 'created_on' => $basket->getCreated()->format(DATE_ATOM), 'description' => (string) $basket->getDescription(), 'name' => $basket->getName(), 'pusher_usr_id' => $basket->getPusher() ? $basket->getPusher()->getId() : null, 'pusher' => $basket->getPusher() ? $this->list_user($basket->getPusher()) : null, 'updated_on' => $basket->getUpdated()->format(DATE_ATOM), 'unread' => !$basket->getIsRead(), 'validation_basket' => !!$basket->getValidation()];
if ($basket->getValidation()) {
$users = array_map(function ($participant) use ($app) {
$user = $participant->getUser();
- return [
- 'usr_id' => $user->getId(),
- 'usr_name' => $user->getDisplayName(),
- 'confirmed' => $participant->getIsConfirmed(),
- 'can_agree' => $participant->getCanAgree(),
- 'can_see_others' => $participant->getCanSeeOthers(),
- 'readonly' => $user->getId() != $app['authentication']->getUser()->getId(),
- 'user' => $this->list_user($user),
- ];
+ return ['usr_id' => $user->getId(), 'usr_name' => $user->getDisplayName(), 'confirmed' => $participant->getIsConfirmed(), 'can_agree' => $participant->getCanAgree(), 'can_see_others' => $participant->getCanSeeOthers(), 'readonly' => $user->getId() != $app['authentication']->getUser()->getId(), 'user' => $this->list_user($user),];
}, iterator_to_array($basket->getValidation()->getParticipants()));
$expires_on_atom = $basket->getValidation()->getExpires();
@@ -1784,16 +1373,7 @@ class V1 implements ControllerProviderInterface
$expires_on_atom = $expires_on_atom->format(DATE_ATOM);
}
- $ret = array_merge(
- [
- 'validation_users' => $users,
- 'expires_on' => $expires_on_atom,
- 'validation_infos' => $basket->getValidation()->getValidationString($app, $app['authentication']->getUser()),
- 'validation_confirmed' => $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsConfirmed(),
- 'validation_initiator' => $basket->getValidation()->isInitiator($app['authentication']->getUser()),
- 'validation_initiator_user' => $this->list_user($basket->getValidation()->getInitiator()),
- ], $ret
- );
+ $ret = array_merge(['validation_users' => $users, 'expires_on' => $expires_on_atom, 'validation_infos' => $basket->getValidation()->getValidationString($app, $app['authentication']->getUser()), 'validation_confirmed' => $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsConfirmed(), 'validation_initiator' => $basket->getValidation()->isInitiator($app['authentication']->getUser()), 'validation_initiator_user' => $this->list_user($basket->getValidation()->getInitiator()),], $ret);
}
return $ret;
@@ -1803,33 +1383,17 @@ class V1 implements ControllerProviderInterface
* Retrieve detailled informations about one record
*
* @param \record_adapter $record
+ *
* @return array
*/
public function list_record(Application $app, \record_adapter $record)
{
$technicalInformation = [];
foreach ($record->get_technical_infos() as $name => $value) {
- $technicalInformation[] = [
- 'name' => $name,
- 'value' => $value
- ];
+ $technicalInformation[] = ['name' => $name, 'value' => $value];
}
- return [
- 'databox_id' => $record->get_sbas_id(),
- 'record_id' => $record->get_record_id(),
- 'mime_type' => $record->get_mime(),
- 'title' => $record->get_title(),
- 'original_name' => $record->get_original_name(),
- 'updated_on' => $record->get_modification_date()->format(DATE_ATOM),
- 'created_on' => $record->get_creation_date()->format(DATE_ATOM),
- 'collection_id' => \phrasea::collFromBas($app, $record->get_base_id()),
- 'sha256' => $record->get_sha256(),
- 'thumbnail' => $this->list_embedable_media($app, $record, $record->get_thumbnail()),
- 'technical_informations' => $technicalInformation,
- 'phrasea_type' => $record->get_type(),
- 'uuid' => $record->get_uuid(),
- ];
+ return ['databox_id' => $record->get_sbas_id(), 'record_id' => $record->get_record_id(), 'mime_type' => $record->get_mime(), 'title' => $record->get_title(), 'original_name' => $record->get_original_name(), 'updated_on' => $record->get_modification_date()->format(DATE_ATOM), 'created_on' => $record->get_creation_date()->format(DATE_ATOM), 'collection_id' => \phrasea::collFromBas($app, $record->get_base_id()), 'sha256' => $record->get_sha256(), 'thumbnail' => $this->list_embedable_media($app, $record, $record->get_thumbnail()), 'technical_informations' => $technicalInformation, 'phrasea_type' => $record->get_type(), 'uuid' => $record->get_uuid(),];
}
/**
@@ -1863,35 +1427,7 @@ class V1 implements ControllerProviderInterface
return $field->get_serialized_values();
};
- return [
- '@entity@' => self::OBJECT_TYPE_STORY,
- 'databox_id' => $story->get_sbas_id(),
- 'story_id' => $story->get_record_id(),
- 'updated_on' => $story->get_modification_date()->format(DATE_ATOM),
- 'created_on' => $story->get_creation_date()->format(DATE_ATOM),
- 'collection_id' => \phrasea::collFromBas($app, $story->get_base_id()),
- 'thumbnail' => $this->list_embedable_media($app, $story, $story->get_thumbnail()),
- 'uuid' => $story->get_uuid(),
- 'metadatas' => [
- '@entity@' => self::OBJECT_TYPE_STORY_METADATA_BAG,
- 'dc:contributor' => $format($caption, \databox_Field_DCESAbstract::Contributor),
- 'dc:coverage' => $format($caption, \databox_Field_DCESAbstract::Coverage),
- 'dc:creator' => $format($caption, \databox_Field_DCESAbstract::Creator),
- 'dc:date' => $format($caption, \databox_Field_DCESAbstract::Date),
- 'dc:description' => $format($caption, \databox_Field_DCESAbstract::Description),
- 'dc:format' => $format($caption, \databox_Field_DCESAbstract::Format),
- 'dc:identifier' => $format($caption, \databox_Field_DCESAbstract::Identifier),
- 'dc:language' => $format($caption, \databox_Field_DCESAbstract::Language),
- 'dc:publisher' => $format($caption, \databox_Field_DCESAbstract::Publisher),
- 'dc:relation' => $format($caption, \databox_Field_DCESAbstract::Relation),
- 'dc:rights' => $format($caption, \databox_Field_DCESAbstract::Rights),
- 'dc:source' => $format($caption, \databox_Field_DCESAbstract::Source),
- 'dc:subject' => $format($caption, \databox_Field_DCESAbstract::Subject),
- 'dc:title' => $format($caption, \databox_Field_DCESAbstract::Title),
- 'dc:type' => $format($caption, \databox_Field_DCESAbstract::Type),
- ],
- 'records' => $records,
- ];
+ return ['@entity@' => self::OBJECT_TYPE_STORY, 'databox_id' => $story->get_sbas_id(), 'story_id' => $story->get_record_id(), 'updated_on' => $story->get_modification_date()->format(DATE_ATOM), 'created_on' => $story->get_creation_date()->format(DATE_ATOM), 'collection_id' => \phrasea::collFromBas($app, $story->get_base_id()), 'thumbnail' => $this->list_embedable_media($app, $story, $story->get_thumbnail()), 'uuid' => $story->get_uuid(), 'metadatas' => ['@entity@' => self::OBJECT_TYPE_STORY_METADATA_BAG, 'dc:contributor' => $format($caption, \databox_Field_DCESAbstract::Contributor), 'dc:coverage' => $format($caption, \databox_Field_DCESAbstract::Coverage), 'dc:creator' => $format($caption, \databox_Field_DCESAbstract::Creator), 'dc:date' => $format($caption, \databox_Field_DCESAbstract::Date), 'dc:description' => $format($caption, \databox_Field_DCESAbstract::Description), 'dc:format' => $format($caption, \databox_Field_DCESAbstract::Format), 'dc:identifier' => $format($caption, \databox_Field_DCESAbstract::Identifier), 'dc:language' => $format($caption, \databox_Field_DCESAbstract::Language), 'dc:publisher' => $format($caption, \databox_Field_DCESAbstract::Publisher), 'dc:relation' => $format($caption, \databox_Field_DCESAbstract::Relation), 'dc:rights' => $format($caption, \databox_Field_DCESAbstract::Rights), 'dc:source' => $format($caption, \databox_Field_DCESAbstract::Source), 'dc:subject' => $format($caption, \databox_Field_DCESAbstract::Subject), 'dc:title' => $format($caption, \databox_Field_DCESAbstract::Title), 'dc:type' => $format($caption, \databox_Field_DCESAbstract::Type),], 'records' => $records,];
}
/**
@@ -1910,13 +1446,14 @@ class V1 implements ControllerProviderInterface
* Retrieve CGU's for the specified \databox
*
* @param \databox $databox
+ *
* @return array
*/
private function list_databox_terms(\databox $databox)
{
$ret = [];
foreach ($databox->get_cgus() as $locale => $array_terms) {
- $ret[] = ['locale' => $locale, 'terms' => $array_terms['value']];
+ $ret[] = ['locale' => $locale, 'terms' => $array_terms['value']];
}
return $ret;
@@ -1924,29 +1461,21 @@ class V1 implements ControllerProviderInterface
/**
* Retrieve detailled informations about one \databox
+ *
* @param \databox $databox
+ *
* @return array
*/
private function list_databox(\databox $databox)
{
- return [
- 'databox_id' => $databox->get_sbas_id(),
- 'name' => $databox->get_dbname(),
- 'viewname' => $databox->get_viewname(),
- 'labels' => [
- 'en' => $databox->get_label('en'),
- 'de' => $databox->get_label('de'),
- 'fr' => $databox->get_label('fr'),
- 'nl' => $databox->get_label('nl'),
- ],
- 'version' => $databox->get_version(),
- ];
+ return ['databox_id' => $databox->get_sbas_id(), 'name' => $databox->get_dbname(), 'viewname' => $databox->get_viewname(), 'labels' => ['en' => $databox->get_label('en'), 'de' => $databox->get_label('de'), 'fr' => $databox->get_label('fr'), 'nl' => $databox->get_label('nl'),], 'version' => $databox->get_version(),];
}
/**
* List all available collections for a specified \databox
*
* @param \databox $databox
+ *
* @return array
*/
private function list_databox_collections(\databox $databox)
@@ -1960,49 +1489,26 @@ class V1 implements ControllerProviderInterface
* Retrieve detailled informations about one collection
*
* @param collection $collection
+ *
* @return array
*/
private function list_collection(\collection $collection)
{
- return [
- 'base_id' => $collection->get_base_id(),
- 'collection_id' => $collection->get_coll_id(),
- 'name' => $collection->get_name(),
- 'labels' => [
- 'fr' => $collection->get_label('fr'),
- 'en' => $collection->get_label('en'),
- 'de' => $collection->get_label('de'),
- 'nl' => $collection->get_label('nl'),
- ],
- 'record_amount' => $collection->get_record_amount(),
- ];
+ return ['base_id' => $collection->get_base_id(), 'collection_id' => $collection->get_coll_id(), 'name' => $collection->get_name(), 'labels' => ['fr' => $collection->get_label('fr'), 'en' => $collection->get_label('en'), 'de' => $collection->get_label('de'), 'nl' => $collection->get_label('nl'),], 'record_amount' => $collection->get_record_amount(),];
}
/**
* Retrieve informations for a list of status
*
* @param array $status
+ *
* @return array
*/
private function list_databox_status(array $status)
{
$ret = [];
foreach ($status as $n => $datas) {
- $ret[] = [
- 'bit' => $n,
- 'label_on' => $datas['labelon'],
- 'label_off' => $datas['labeloff'],
- 'labels' => [
- 'en' => $datas['labels_on_i18n']['en'],
- 'fr' => $datas['labels_on_i18n']['fr'],
- 'de' => $datas['labels_on_i18n']['de'],
- 'nl' => $datas['labels_on_i18n']['nl'],
- ],
- 'img_on' => $datas['img_on'],
- 'img_off' => $datas['img_off'],
- 'searchable' => !!$datas['searchable'],
- 'printable' => !!$datas['printable'],
- ];
+ $ret[] = ['bit' => $n, 'label_on' => $datas['labelon'], 'label_off' => $datas['labeloff'], 'labels' => ['en' => $datas['labels_on_i18n']['en'], 'fr' => $datas['labels_on_i18n']['fr'], 'de' => $datas['labels_on_i18n']['de'], 'nl' => $datas['labels_on_i18n']['nl'],], 'img_on' => $datas['img_on'], 'img_off' => $datas['img_off'], 'searchable' => !!$datas['searchable'], 'printable' => !!$datas['printable'],];
}
return $ret;
@@ -2012,6 +1518,7 @@ class V1 implements ControllerProviderInterface
* List all metadatas field using a \databox meta structure
*
* @param \databox_descriptionStructure $meta_struct
+ *
* @return array
*/
private function list_databox_metadatas_fields(\databox_descriptionStructure $meta_struct)
@@ -2022,33 +1529,15 @@ class V1 implements ControllerProviderInterface
}
/**
- * Retirve informations about one \databox metadata field
+ * Retrieve informations about one \databox metadata field
*
* @param \databox_field $databox_field
+ *
* @return array
*/
private function list_databox_metadata_field_properties(\databox_field $databox_field)
{
- return [
- 'id' => $databox_field->get_id(),
- 'namespace' => $databox_field->get_tag()->getGroupName(),
- 'source' => $databox_field->get_tag()->getTagname(),
- 'tagname' => $databox_field->get_tag()->getName(),
- 'name' => $databox_field->get_name(),
- 'labels' => [
- 'fr' => $databox_field->get_label('fr'),
- 'en' => $databox_field->get_label('en'),
- 'de' => $databox_field->get_label('de'),
- 'nl' => $databox_field->get_label('nl'),
- ],
- 'separator' => $databox_field->get_separator(),
- 'thesaurus_branch' => $databox_field->get_tbranch(),
- 'type' => $databox_field->get_type(),
- 'indexable' => $databox_field->is_indexable(),
- 'multivalue' => $databox_field->is_multi(),
- 'readonly' => $databox_field->is_readonly(),
- 'required' => $databox_field->is_required(),
- ];
+ return ['id' => $databox_field->get_id(), 'namespace' => $databox_field->get_tag()->getGroupName(), 'source' => $databox_field->get_tag()->getTagname(), 'tagname' => $databox_field->get_tag()->getName(), 'name' => $databox_field->get_name(), 'labels' => ['fr' => $databox_field->get_label('fr'), 'en' => $databox_field->get_label('en'), 'de' => $databox_field->get_label('de'), 'nl' => $databox_field->get_label('nl'),], 'separator' => $databox_field->get_separator(), 'thesaurus_branch' => $databox_field->get_tbranch(), 'type' => $databox_field->get_type(), 'indexable' => $databox_field->is_indexable(), 'multivalue' => $databox_field->is_multi(), 'readonly' => $databox_field->is_readonly(), 'required' => $databox_field->is_required(),];
}
private function authenticate(Application $app, Request $request)
@@ -2068,13 +1557,11 @@ class V1 implements ControllerProviderInterface
$oAuth2Account = $token->getAccount();
$oAuth2App = $oAuth2Account->getApplication();
- if ($oAuth2App->getClientId() == \API_OAuth2_Application_Navigator::CLIENT_ID
- && !$app['conf']->get(['registry', 'api-clients', 'navigator-enabled'])) {
+ if ($oAuth2App->getClientId() == \API_OAuth2_Application_Navigator::CLIENT_ID && !$app['conf']->get(['registry', 'api-clients', 'navigator-enabled'])) {
return Result::createError($request, 403, 'The use of Phraseanet Navigator is not allowed')->createResponse();
}
- if ($oAuth2App->getClientId() == \API_OAuth2_Application_OfficePlugin::CLIENT_ID
- && ! $app['conf']->get(['registry', 'api-clients', 'office-enabled'])) {
+ if ($oAuth2App->getClientId() == \API_OAuth2_Application_OfficePlugin::CLIENT_ID && !$app['conf']->get(['registry', 'api-clients', 'office-enabled'])) {
return Result::createError($request, 403, 'The use of Office Plugin is not allowed.')->createResponse();
}
@@ -2091,6 +1578,60 @@ class V1 implements ControllerProviderInterface
}
}
+ public function ensureAccessToDatabox(Request $request, Application $app)
+ {
+ $user = $app['session']->get('token')->getAccount()->getUser();
+ $databox = $app['phraseanet.appbox']->get_databox($request->attributes->get('databox_id'));
+
+ if (!$app['acl']->get($user)->has_access_to_sbas($databox->get_sbas_id())) {
+ return Result::createError($request, 401, 'You are not authorized')->createResponse();
+ }
+ }
+
+ public function ensureCanAccessToRecord(Request $request, Application $app)
+ {
+ $user = $app['session']->get('token')->getAccount()->getUser();
+ $record = $app['phraseanet.appbox']->get_databox($request->attributes->get('databox_id'))->get_record($request->attributes->get('record_id'));
+ if (!$app['acl']->get($user)->has_access_to_record($record)) {
+ return Result::createError($request, 401, 'You are not authorized')->createResponse();
+ }
+ }
+
+ public function ensureCanModifyRecord(Request $request, Application $app)
+ {
+ $user = $app['session']->get('token')->getAccount()->getUser();
+ if (!$app['acl']->get($user)->has_right('modifyrecord')) {
+ return Result::createError($request, 401, 'You are not authorized')->createResponse();
+ }
+ }
+
+ public function ensureCanModifyRecordStatus(Request $request, Application $app)
+ {
+ $user = $app['session']->get('token')->getAccount()->getUser();
+ $record = $app['phraseanet.appbox']->get_databox($request->attributes->get('databox_id'))->get_record($request->attributes->get('record_id'));
+ if (!$app['acl']->get($user)->has_right_on_base($record->get_base_id(), 'chgstatus')) {
+ return Result::createError($request, 401, 'You are not authorized')->createResponse();
+ }
+ }
+
+ public function ensureCanSeeDataboxStructure(Request $request, Application $app)
+ {
+ $user = $app['session']->get('token')->getAccount()->getUser();
+ $databox = $app['phraseanet.appbox']->get_databox($request->attributes->get('databox_id'));
+ if (!$app['acl']->get($user)->has_right_on_sbas($databox->get_sbas_id(), 'bas_modify_struct')) {
+ return Result::createError($request, 401, 'You are not authorized')->createResponse();
+ }
+ }
+
+ public function ensureCanMoveRecord(Request $request, Application $app)
+ {
+ $user = $app['session']->get('token')->getAccount()->getUser();
+ $record = $app['phraseanet.appbox']->get_databox($request->attributes->get('databox_id'))->get_record($request->attributes->get('record_id'));
+ if ((!$app['acl']->get($user)->has_right('addrecord') && !$app['acl']->get($user)->has_right('deleterecord')) || !$app['acl']->get($user)->has_right_on_base($record->get_base_id(), 'candeleterecord')) {
+ return Result::createError($request, 401, 'You are not authorized')->createResponse();
+ }
+ }
+
private function list_user(User $user)
{
switch ($user->getGender()) {
@@ -2130,4 +1671,4 @@ class V1 implements ControllerProviderInterface
'locale' => $user->getLocale() ?: null,
];
}
-}
+}
\ No newline at end of file
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Export.php b/lib/Alchemy/Phrasea/Controller/Prod/Export.php
index 509fdc627f..f2b41ab2a5 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Export.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Export.php
@@ -36,24 +36,8 @@ class Export implements ControllerProviderInterface
$app['firewall']->addMandatoryAuthentication($controllers);
- $controllers->before(function (Request $request) use ($app) {
- $app['firewall']->requireNotGuest();
- });
- /**
- * Display multi export
- *
- * name : export_multi_export
- *
- * description : Display multi export
- *
- * method : POST
- *
- * parameters : none
- *
- * return : HTML Response
- */
- $controllers->post('/multi-export/', $this->call('displayMultiExport'))
+ $controllers->post('/multi-export/', 'controller.prod.export:displayMultiExport')
->bind('export_multi_export');
$controllers->post('/mail/', 'controller.prod.export:exportMail')
diff --git a/lib/Alchemy/Phrasea/Helper/Prod.php b/lib/Alchemy/Phrasea/Helper/Prod.php
index a142248fa8..d867b5e295 100644
--- a/lib/Alchemy/Phrasea/Helper/Prod.php
+++ b/lib/Alchemy/Phrasea/Helper/Prod.php
@@ -11,57 +11,40 @@
namespace Alchemy\Phrasea\Helper;
-use Alchemy\Phrasea\Model\Entities\User;
-
+/**
+ *
+ * @license http://opensource.org/licenses/gpl-3.0 GPLv3
+ * @link www.phraseanet.com
+ */
class Prod extends Helper
{
public function get_search_datas()
{
- $search_datas = [
- 'bases' => [],
- 'dates' => [],
- 'fields' => []
- ];
+ $searchData = array('bases' => array(), 'dates' => array(), 'fields' => array(), 'sort' => array(),);
- $bases = $fields = $dates = [];
+ $bases = $fields = $dates = $sort = array();
- if (! $this->app['authentication']->getUser() instanceof User) {
- return $search_datas;
+ if (!$this->app['authentication']->getUser() instanceof \User_Adapter) {
+ return $searchData;
}
$searchSet = json_decode($this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'search'), true);
$saveSettings = $this->app['settings']->getUserSetting($this->app['authentication']->getUser(), 'advanced_search_reload');
foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_sbas() as $databox) {
- $sbas_id = $databox->get_sbas_id();
+ $sbasId = $databox->get_sbas_id();
- $bases[$sbas_id] = [
- 'thesaurus' => (trim($databox->get_thesaurus()) != ""),
- 'cterms' => false,
- 'collections' => [],
- 'sbas_id' => $sbas_id
- ];
+ $bases[$sbasId] = array('thesaurus' => (trim($databox->get_thesaurus()) !== ""), 'cterms' => false, 'collections' => array(), 'sbas_id' => $sbasId);
foreach ($this->app['acl']->get($this->app['authentication']->getUser())->get_granted_base([], [$databox->get_sbas_id()]) as $coll) {
- $selected = $saveSettings ? ((isset($searchSet['bases']) && isset($searchSet['bases'][$sbas_id])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbas_id])) : true) : true;
- $bases[$sbas_id]['collections'][] =
- [
- 'selected' => $selected,
- 'base_id' => $coll->get_base_id()
- ];
+ $selected = $saveSettings ? ((isset($searchSet['bases']) && isset($searchSet['bases'][$sbasId])) ? (in_array($coll->get_base_id(), $searchSet['bases'][$sbasId])) : true) : true;
+ $bases[$sbasId]['collections'][] = array('selected' => $selected, 'base_id' => $coll->get_base_id());
}
foreach ($databox->get_meta_structure() as $fieldMeta) {
if (!$fieldMeta->is_indexable()) {
continue;
- $id = $meta->get_id();
- $name = $meta->get_name();
- if ($meta->get_type() == 'date') {
- if (isset($dates[$id]))
- $dates[$id]['sbas'][] = $sbas_id;
- else
- $dates[$id] = ['sbas' => [$sbas_id], 'fieldname' => $name];
}
$id = $fieldMeta->get_id();
$name = $fieldMeta->get_name();
@@ -88,19 +71,14 @@ class Prod extends Helper
if (isset($fields[$name])) {
$fields[$name]['sbas'][] = $sbasId;
} else {
- $fields[$name] = [
- 'sbas' => [$sbas_id]
- , 'fieldname' => $name
- , 'type' => $meta->get_type()
- , 'id' => $id
- ];
+ $fields[$name] = $data;
}
}
if (!$bases[$sbasId]['thesaurus']) {
continue;
}
- if ( ! $this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbas_id, 'bas_modif_th')) {
+ if (!$this->app['acl']->get($this->app['authentication']->getUser())->has_right_on_sbas($sbasId, 'bas_modif_th')) {
continue;
}
@@ -119,6 +97,6 @@ class Prod extends Helper
public function getRandom()
{
- return $this->app['random.low']->generateString(16);
+ return md5(time() . mt_rand(100000, 999999));
}
-}
+}
\ No newline at end of file
diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php
index a1cf3bf92e..ab151ad722 100644
--- a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php
+++ b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php
@@ -27,19 +27,17 @@ class SymLinker
protected $encoder;
protected $fs;
protected $symlinkDir;
- protected $registry;
public static function create(Application $app)
{
return new SymLinker(
$app['phraseanet.thumb-symlinker-encoder'],
$app['filesystem'],
- $app['phraseanet.registry'],
isset($app['phraseanet.configuration']['static-file']['symlink-directory']) ? $app['phraseanet.configuration']['static-file']['symlink-directory'] : $app['root.path'] . '/tmp/symlinks'
);
}
- public function __construct(SymLinkerEncoder $encoder, Filesystem $fs, \registryInterface $registry, $symlinkDir)
+ public function __construct(SymLinkerEncoder $encoder, Filesystem $fs, $symlinkDir)
{
$this->encoder = $encoder;
$this->fs = $fs;
diff --git a/lib/Alchemy/Phrasea/Setup/Installer.php b/lib/Alchemy/Phrasea/Setup/Installer.php
index 021672ec1a..5051f46844 100644
--- a/lib/Alchemy/Phrasea/Setup/Installer.php
+++ b/lib/Alchemy/Phrasea/Setup/Installer.php
@@ -33,10 +33,9 @@ class Installer
{
$this->rollbackInstall($abConn, $dbConn);
- $this->createConfigFile($abConn, $serverName, $binaryData);
+ $this->createConfigFile($abConn, $serverName, $binaryData, $dataPath);
try {
$this->createAB();
- $this->populateRegistryData($serverName, $dataPath, $binaryData);
$user = $this->createUser($email, $password);
$this->createDefaultUsers();
if (null !== $dbConn) {
@@ -57,22 +56,6 @@ class Installer
$this->phraseaIndexer = $path;
}
- private function populateRegistryData($serverName, $dataPath)
- {
- if (null === $dataPath = realpath($dataPath)) {
- throw new \InvalidArgumentException(sprintf('Path %s does not exist.', $dataPath));
- }
-
- $this->app['conf']->set(['main', 'storage', 'subdefs'], $dataPath);
- $this->app['conf']->set(['main', 'storage', 'cache'], realpath(__DIR__ . '/../../../../cache'));
- $this->app['conf']->set(['main', 'storage', 'log'], realpath(__DIR__ . '/../../../../logs'));
- $this->app['conf']->set(['main', 'storage', 'download'], realpath(__DIR__ . '/../../../../tmp/download'));
- $this->app['conf']->set(['main', 'storage', 'lazaret'], realpath(__DIR__ . '/../../../../tmp/lazaret'));
- $this->app['conf']->set(['main', 'storage', 'caption'], realpath(__DIR__ . '/../../../../tmp/caption'));
- $this->app['conf']->set('servername', $serverName);
- $this->app['conf']->set('registry', $this->app['registry.manipulator']->getRegistryData());
- }
-
private function createDB(Connection $dbConn = null, $template)
{
$template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml');
@@ -177,7 +160,7 @@ class Installer
$this->app['phraseanet.appbox']->insert_datas($this->app);
}
- private function createConfigFile(Connection $abConn, $serverName, $binaryData)
+ private function createConfigFile(Connection $abConn, $serverName, $binaryData, $dataPath)
{
$config = $this->app['configuration.store']->initialize()->getConfig();
@@ -195,6 +178,20 @@ class Installer
$config['servername'] = $serverName;
$config['main']['key'] = $this->app['random.medium']->generateString(16);
+ if (null === $dataPath = realpath($dataPath)) {
+ throw new \InvalidArgumentException(sprintf('Path %s does not exist.', $dataPath));
+ }
+
+ $config['main']['storage']['subdefs'] = $dataPath;
+
+ $config['main']['storage']['cache'] = realpath(__DIR__ . '/../../../../cache');
+ $config['main']['storage']['log'] = realpath(__DIR__ . '/../../../../logs');
+ $config['main']['storage']['download'] = realpath(__DIR__ . '/../../../../tmp/download');
+ $config['main']['storage']['lazaret'] = realpath(__DIR__ . '/../../../../tmp/lazaret');
+ $config['main']['storage']['caption'] = realpath(__DIR__ . '/../../../../tmp/caption');
+
+ $config['registry'] = $this->app['registry.manipulator']->getRegistryData();
+
$this->app['configuration.store']->setConfig($config);
}
}
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php
index 865a2ea4db..00d896e3bc 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php
@@ -496,7 +496,7 @@ class Migration31 implements MigrationInterface
$stmt->execute([
':key' => 'GV_sit',
- ':value' => GV_sit,
+ ':value' => constant("GV_sit"),
':type' => 'string',
]);
@@ -505,7 +505,6 @@ class Migration31 implements MigrationInterface
rename(__DIR__ . '/../../../../../../config/_GV.php', __DIR__ . '/../../../../../../config/_GV.php.old');
$servername = defined('GV_ServerName') ? constant('GV_ServerName') : '';
file_put_contents(__DIR__ . '/../../../../../../config/config.inc', "to->status['mask'];
+ $x = trim($sxtask->to->status['mask']);
+ $x = preg_replace('/[^0-1]/', 'x', $x);
+
$mx = str_replace(' ', '0', ltrim(str_replace(array('0', 'x'), array(' ', ' '), $x)));
$ma = str_replace(' ', '0', ltrim(str_replace(array('x', '0'), array(' ', '1'), $x)));
if ($mx && $ma) {
- $tws[] = '((status ^ ' . $connbas->quote('0b'.$mx) . ') & ' . $connbas->quote('0b'.$ma) . ')!=0';
+ $tws[] = '((status ^ 0b' . $mx . ') & 0b' . $ma . ')!=0';
}
elseif ($mx) {
- $tws[] = '(status ^ ' . $connbas->quote('0b'.$mx) . ')!=0';
+ $tws[] = '(status ^ 0b' . $mx . ')!=0';
}
elseif ($ma) {
- $tws[] = '(status & ' . $connbas->quote('0b'.$ma) . ')!=0';
+ $tws[] = '(status & 0b' . $ma . ')!=0';
}
// compute the 'where' clause
@@ -432,15 +434,17 @@ class RecordMoverJob extends AbstractJob
}
// criteria
- $x = $sxtask->from->status['mask'];
+ $x = trim($sxtask->from->status['mask']);
+ $x = preg_replace('/[^0-1]/', 'x', $x);
+
$mx = str_replace(' ', '0', ltrim(str_replace(array('0', 'x'), array(' ', ' '), $x)));
$ma = str_replace(' ', '0', ltrim(str_replace(array('x', '0'), array(' ', '1'), $x)));
if ($mx && $ma) {
- $tw[] = '((status ^ ' . $connbas->quote('0b'.$mx) . ') & ' . $connbas->quote('0b'.$ma) . ')=0';
+ $tw[] = '((status ^ 0b'. $mx . ') & 0b'. $ma . ')=0';
} elseif ($mx) {
- $tw[] = '(status ^ ' . $connbas->quote('0b'.$mx) . ')=0';
+ $tw[] = '(status ^ 0b' . $mx . ')=0';
} elseif ($ma) {
- $tw[] = '(status & ' . $connbas->quote('0b'.$ma) . ")=0";
+ $tw[] = '(status & 0b' . $ma . ")=0";
}
return array($tw, $join);
diff --git a/lib/classes/databox.php b/lib/classes/databox.php
index 54b312a70a..8f8c0ed585 100644
--- a/lib/classes/databox.php
+++ b/lib/classes/databox.php
@@ -583,20 +583,16 @@ class databox extends base
$stmt->execute();
$row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor();
- if ($row)
+ if ($row) {
$ord = $row['ord'] + 1;
+ }
+
+ $params[':ord'] = $ord;
$sql = 'INSERT INTO sbas (sbas_id, ord, host, port, dbname, sqlengine, user, pwd)
VALUES (null, :ord, :host, :port, :dbname, "MYSQL", :user, :password)';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
- $stmt->execute([
- ':ord' => $ord
- , ':host' => $host
- , ':port' => $port
- , ':dbname' => $dbname
- , ':user' => $user
- , ':password' => $password
- ]);
+ $stmt->execute($params);
$stmt->closeCursor();
$sbas_id = (int) $app['phraseanet.appbox']->get_connection()->lastInsertId();
diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php
index 77493c4064..e28e82763d 100644
--- a/lib/classes/media/subdef.php
+++ b/lib/classes/media/subdef.php
@@ -765,7 +765,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
. "/" . $this->record->get_record_id() . "/"
. $this->get_name() . "/");
-
return;
}
diff --git a/lib/classes/patch/386alpha3a.php b/lib/classes/patch/386alpha3a.php
index 61dc61612b..11df672f35 100644
--- a/lib/classes/patch/386alpha3a.php
+++ b/lib/classes/patch/386alpha3a.php
@@ -45,6 +45,16 @@ class patch_386alpha3a implements patchInterface
return $this->concern;
}
+ /**
+ * Returns doctrine migrations needed for the patch.
+ *
+ * @return array
+ */
+ public function getDoctrineMigrations()
+ {
+ return array();
+ }
+
/**
* {@inheritdoc}
*/
diff --git a/resources/hudson/connexion.inc b/resources/hudson/connexion.inc
index 00d61d686b..1f3f164496 100644
--- a/resources/hudson/connexion.inc
+++ b/resources/hudson/connexion.inc
@@ -1,6 +1,6 @@
\n\n10101\n',-1),(3,0,0,'stopped',0,1,'Metadatas Writing','0000-00-00 00:00:00','0000-00-00 00:00:00','task_writemeta','\n\n 10\n 1\n \n \n 0\n\n',-1),(4,0,0,'stopped',0,1,'Subdefs','0000-00-00 00:00:00','0000-00-00 00:00:00','task_subdef','\n\n10101\n',-1),(5,0,0,'stopped',0,1,'Indexer','0000-00-00 00:00:00','0000-00-00 00:00:00','task_cindexer','\n\n/usr/local/bin127.0.0.13306ab_test31root25200100utf8\n',-1);
+INSERT INTO `task2` VALUES (2,0,0,'stopped',0,1,'Metadatas Reading','0000-00-00 00:00:00','0000-00-00 00:00:00','task_readmeta','\n\n10101\n',-1),(3,0,0,'stopped',0,1,'Metadatas Writing','0000-00-00 00:00:00','0000-00-00 00:00:00','task_writemeta','\n\n 10\n 1\n \n \n 0\n\n',-1),(4,0,0,'stopped',0,1,'Subdefs','0000-00-00 00:00:00','0000-00-00 00:00:00','task_subdef','\n\n10101\n',-1),(5,0,0,'stopped',0,1,'Indexer','0000-00-00 00:00:00','0000-00-00 00:00:00','task_cindexer','\n\n/usr/local/bin127.0.0.13306{{APPLICATION_BOX}}31root25200100utf8\n',-1);
/*!40000 ALTER TABLE `task2` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1053,7 +1053,7 @@ CREATE TABLE `usr` (
LOCK TABLES `usr` WRITE;
/*!40000 ALTER TABLE `usr` DISABLE KEYS */;
-INSERT INTO `usr` VALUES (1,2,'',0,'','','autoregister','autoregister','',NULL,'2012-10-02 09:45:22','2012-10-02 09:45:22','','','','','','','','',0,0,'','0000-00-00 00:00:00',0,0,0,0,'',0,'','','',0,5,5,'',1,'',0,0,0,0,NULL,0,NULL,1,1,'',''),(2,2,'',0,'','','invite','invite','',NULL,'2012-10-02 09:45:22','2012-10-02 09:45:22','','','','','','','','',0,0,'','0000-00-00 00:00:00',0,0,0,0,'',0,'','','',0,5,5,'',1,'',0,0,0,0,NULL,0,NULL,1,1,'',''),(4,0,'',0,'','','admin','8c6976e5b5410415bde908bd4dee15dfb167a9c873fc4bb8a81f6f2ab448a918','','legoff@alchemy.fr','2012-10-02 09:46:40','2012-10-02 09:46:40','','','','','','','','',0,0,'','0000-00-00 00:00:00',0,0,1,0,'',0,'','','',0,5,0,'',0,'',1,1,0,0,NULL,0,NULL,1,1,'','');
+INSERT INTO `usr` VALUES (1,2,'',0,'','','autoregister','autoregister','',NULL,'2012-10-02 09:45:22','2012-10-02 09:45:22','','','','','','','','',0,0,'','0000-00-00 00:00:00',0,0,0,0,'',0,'','','',0,5,5,'',1,'',0,0,0,0,NULL,0,NULL,1,1,'',''),(2,2,'',0,'','','invite','invite','',NULL,'2012-10-02 09:45:22','2012-10-02 09:45:22','','','','','','','','',0,0,'','0000-00-00 00:00:00',0,0,0,0,'',0,'','','',0,5,5,'',1,'',0,0,0,0,NULL,0,NULL,1,1,'',''),(4,0,'',0,'','','{{USER_EMAIL}}','{{USER_PASSWORD}}','','{{USER_EMAIL}}','2012-10-02 09:46:40','2012-10-02 09:46:40','','','','','','','','',0,0,'','0000-00-00 00:00:00',0,0,1,0,'',0,'','','',0,5,0,'',0,'',1,1,0,0,NULL,0,NULL,1,1,'','');
/*!40000 ALTER TABLE `usr` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1194,12 +1194,12 @@ LOCK TABLES `validate_datas` WRITE;
UNLOCK TABLES;
--
--- Current Database: `db_test`
+-- Current Database: `{{DATA_BOX}}`
--
-CREATE DATABASE /*!32312 IF NOT EXISTS*/ `db_test` /*!40100 DEFAULT CHARACTER SET utf8 */;
+CREATE DATABASE /*!32312 IF NOT EXISTS*/ `{{DATA_BOX}}` /*!40100 DEFAULT CHARACTER SET utf8 */;
-USE `db_test`;
+USE `{{DATA_BOX}}`;
--
-- Table structure for table `clients`
@@ -1642,7 +1642,7 @@ CREATE TABLE `pref` (
LOCK TABLES `pref` WRITE;
/*!40000 ALTER TABLE `pref` DISABLE KEYS */;
-INSERT INTO `pref` VALUES (1,'thesaurus','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(2,'structure','\n\n /tmp/db_test/documents\n1\n \n \n \n /tmp/db_test/subdefs\n 800\n resample\n 72\n no\n 75\n yes\n image\n \n \n \n \n /tmp/db_test/subdefs\n 200\n resample\n 72\n yes\n 75\n no\n image\n \n \n \n \n \n \n /tmp/db_test/subdefs\n 800\n video\n yes\n libvo_aacenc\n libx264\n 1000\n 8\n 15\n \n \n \n \n /tmp/db_test/subdefs\n 200\n gif\n 500\n no\n \n \n \n \n /tmp/db_test/subdefs\n 200\n image\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n audio\n yes\n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n flexpaper\n no\n \n \n \n \n /tmp/db_test/subdefs\n image\n resample\n 72\n 200\n no\n \n \n \n \n \n \n /tmp/db_test/subdefs\n image\n 200\n no\n resample\n 72\n \n \n \n \n /tmp/db_test/subdefs\n image\n no\n resample\n 72\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Online\n \n\n','','2012-04-27 02:06:34','2012-04-27 02:06:31'),(3,'cterms','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(4,'indexes','1','','2012-04-27 02:06:31','2012-04-27 02:06:31'),(5,'ToU','','fr_FR','0000-00-00 00:00:00','2012-04-27 02:06:31'),(6,'ToU','','nl_NL','0000-00-00 00:00:00','2012-04-27 02:06:31'),(7,'ToU','','de_DE','0000-00-00 00:00:00','2012-04-27 02:06:31'),(8,'ToU','','en_GB','0000-00-00 00:00:00','2012-04-27 02:06:31'),(9,'version','3.1.21','','2012-04-27 02:06:33','0000-00-00 00:00:00');
+INSERT INTO `pref` VALUES (1,'thesaurus','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(2,'structure','\n\n /tmp/{{DATA_BOX}}/documents\n1\n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n 800\n resample\n 72\n no\n 75\n yes\n image\n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n 200\n resample\n 72\n yes\n 75\n no\n image\n \n \n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n 800\n video\n yes\n libvo_aacenc\n libx264\n 1000\n 8\n 15\n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n 200\n gif\n 500\n no\n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n 200\n image\n no\n \n \n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n audio\n yes\n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n image\n no\n \n \n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n flexpaper\n no\n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n image\n resample\n 72\n 200\n no\n \n \n \n \n \n \n /tmp/{{DATA_BOX}}/subdefs\n image\n 200\n no\n resample\n 72\n \n \n \n \n /tmp/{{DATA_BOX}}usr/subdefs\n image\n no\n resample\n 72\n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n \n Online\n \n\n','','2012-04-27 02:06:34','2012-04-27 02:06:31'),(3,'cterms','','','0000-00-00 00:00:00','2012-04-27 02:06:31'),(4,'indexes','1','','2012-04-27 02:06:31','2012-04-27 02:06:31'),(5,'ToU','','fr_FR','0000-00-00 00:00:00','2012-04-27 02:06:31'),(6,'ToU','','ar_SA','0000-00-00 00:00:00','2012-04-27 02:06:31'),(7,'ToU','','de_DE','0000-00-00 00:00:00','2012-04-27 02:06:31'),(8,'ToU','','en_GB','0000-00-00 00:00:00','2012-04-27 02:06:31'),(9,'version','3.1.21','','2012-04-27 02:06:33','0000-00-00 00:00:00');
/*!40000 ALTER TABLE `pref` ENABLE KEYS */;
UNLOCK TABLES;
@@ -1927,4 +1927,4 @@ UNLOCK TABLES;
/*!40101 SET COLLATION_CONNECTION=@OLD_COLLATION_CONNECTION */;
/*!40111 SET SQL_NOTES=@OLD_SQL_NOTES */;
--- Dump completed on 2012-10-02 11:10:10
+-- Dump completed on 2012-10-02 11:10:10
\ No newline at end of file
diff --git a/resources/vagrant/config/bower/.bowerrc b/resources/vagrant/config/bower/.bowerrc
index 310d792895..f303864386 100644
--- a/resources/vagrant/config/bower/.bowerrc
+++ b/resources/vagrant/config/bower/.bowerrc
@@ -1,4 +1,4 @@
{
- "directory" : "tmp-assets",
+ "directory": "www/assets",
"interactive": false
}
diff --git a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml
index bae47fc8ff..30c1ce0c05 100644
--- a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml
+++ b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml
@@ -60,7 +60,6 @@ server:
- imagemagick
- libevent-dev
- ufraw
- - ffmpeg
- ghostscript
- xpdf
- unoconv
@@ -86,6 +85,38 @@ server:
- libgif-dev
- libjpeg62-dev
- cachefilesd
+ - autoconf
+ - automake
+ - build-essential
+ - libass-dev
+ - libfreetype6-dev
+ - libgpac-dev
+ - libsdl1.2-dev
+ - libtheora-dev
+ - libtool
+ - libva-dev
+ - libvdpau-dev
+ - libvorbis-dev
+ - libx11-dev
+ - libxext-dev
+ - libx264-dev
+ - libxfixes-dev
+ - libgsm1-dev
+ - pkg-config
+ - texi2html
+ - zlib1g-dev
+ - yasm
+ - unzip
+ - libopus-dev
+ - libvpx-dev
+ - libvorbis-dev
+ - libmp3lame-dev
+ - libxvidcore-dev
+ - libfaad-dev
+ - libopencore-amrnb-dev
+ - libopencore-amrwb-dev
+ - libxvidcore-dev
+ - libdc1394-22-dev
dot_files:
-
bash_aliases: null
diff --git a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-always/setup b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-always/setup
old mode 100644
new mode 100755
diff --git a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup
index 580514b84a..a413eae0c5 100644
--- a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup
+++ b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup
@@ -16,6 +16,51 @@ sudo sh -c 'echo "nl_NL.UTF-8 UTF-8" >> /etc/locale.gen'
sudo locale-gen en_US en_US.UTF-8 en_GB en_GB.UTF-8 fr_FR fr_FR.UTF-8 de_DE de_DE.UTF-8 nl_NL nl_NL.UTF-8
sudo dpkg-reconfigure -f noninteractive locales
+#ffmpeg
+sudo sh -c 'echo "deb http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list'
+sudo sh -c 'echo "deb-src http://www.deb-multimedia.org wheezy main non-free" >> /etc/apt/sources.list'
+
+sudo apt-get update
+sudo apt-get install --force-yes -y deb-multimedia-keyring
+sudo apt-get update
+sudo apt-get install --force-yes -y libfaac-dev
+
+cd /tmp
+wget –quiet https://www.ffmpeg.org/releases/ffmpeg-1.2.8.tar.gz
+tar -zxvf ffmpeg-1.2.8.tar.gz
+cd ffmpeg-1.2.8
+
+wget –quiet -O fdk-aac.zip https://github.com/mstorsjo/fdk-aac/zipball/master
+sudo -u vagrant unzip fdk-aac.zip
+cd mstorsjo-fdk-aac*
+autoreconf -fiv
+./configure --disable-shared
+make
+sudo make install
+make distclean
+cd ..
+
+./configure --enable-gpl \
+ --enable-nonfree \
+ --enable-libfaac \
+ --enable-libgsm \
+ --enable-libmp3lame \
+ --enable-libtheora \
+ --enable-libvorbis \
+ --enable-libx264 \
+ --enable-libxvid \
+ --enable-zlib \
+ --enable-postproc \
+ --enable-swscale \
+ --enable-pthreads \
+ --enable-x11grab \
+ --enable-libdc1394 \
+ --enable-version3 \
+ --enable-libopencore-amrnb \
+ --enable-libopencore-amrwb
+make
+sudo make install
+
# node + npm
cd /tmp
wget –quiet "http://nodejs.org/dist/v0.10.29/node-v0.10.29-linux-x64.tar.gz"
@@ -28,6 +73,7 @@ sudo cp -rf * /usr/local/
sudo npm install -g recess
sudo npm install -g grunt-cli
sudo npm install -g bower
+sudo npm install -g uglify-js
# python tools
sudo easy_install -U taschenmesser scour boto
@@ -107,7 +153,7 @@ fi
sudo sh -c 'echo "RUN=yes" > /etc/default/cachefilesd'
# copy www.conf
-sudo sh -c "cat /vagrant/resources/vagrant/config/nginx/php5-fpm-www.conf > /etc/php5/fpm/pool.d/www.conf"
+sudo sh -c 'cat /vagrant/resources/vagrant/config/nginx/php5-fpm-www.conf > /etc/php5/fpm/pool.d/www.conf'
#setup phraseanet
if [ ! -f /var/www/phraseanet/config/configuration.yml ]
@@ -116,13 +162,13 @@ then
mv /var/www/phraseanet/lib/conf.d/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml.bkp
cp /vagrant/resources/vagrant/config/phraseanet/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml
mv /var/www/phraseanet/.bowerrc /var/www/phraseanet/.bowerrc.bkp
- cp /vagrant/resources/vagrant/config/bower/.bower.rc /var/www/phraseanet/.bowerrc
+ cp /vagrant/resources/vagrant/config/bower/.bowerrc /var/www/phraseanet/.bowerrc
cd /var/www/phraseanet
- composer install -n --prefer-source --dev
- npm install
- grunt install-assets
- bin/developer assets:compile-less
- rm -f /var/www/phraseanet/lib/conf.d/configuration.yml
+ sudo -u vagrant composer install -n --prefer-source --dev
+ sudo -u vagrant npm install
+ sudo -u vagrant grunt install-assets
+ sudo -u vagrant bin/developer assets:compile-less
+ sudo -u vagrant rm -f /var/www/phraseanet/lib/conf.d/configuration.yml
rm -f /var/www/phraseanet/.bowerrc
mv /www/phraseanet/.bowerrc.bkp /www/phraseanet/.bowerrc
mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml
diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig
index 8973ff9c0b..be779f77cb 100644
--- a/templates/web/prod/index.html.twig
+++ b/templates/web/prod/index.html.twig
@@ -340,7 +340,7 @@
diff --git a/templates/web/prod/results/record.html.twig b/templates/web/prod/results/record.html.twig
index 6161b8fe3f..5c514e8e92 100644
--- a/templates/web/prod/results/record.html.twig
+++ b/templates/web/prod/results/record.html.twig
@@ -1,99 +1,105 @@
-{% macro block(record, highlight, searchEngine, prefix, entry_id)%}
+{% macro block(record, highlight, searchEngine, prefix, entry_id) %}
{% import 'common/thumbnail.html.twig' as thumbnail %}
{% import 'common/doctype_icons.html.twig' as doctype_icons %}
{% import 'common/drop_down_options.html.twig' as drop_down %}
- {% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size')%}
+ {% set th_size = app['settings'].getUserSetting(app['authentication'].getUser(), 'images_size') %}
{% set sbas_id = record.get_sbas_id %}
- {% set lazyload = not app['phraseanet.static-file-factory'].isStaticFileModeEnabled and app['phraseanet.configuration']['lazyload']|default(false) %}
- {% if entry_id %}
-
- {% elseif record.is_grouping() %}
-
- {% else %}
-
- {% endif %}
-
-
-
- {{ record.get_title() }}
-
-
- {{record.get_status_icons|raw}}
-
-
- {% set rollover_gif = record.get_rollover_thumbnail() %}
+ {% set lazyload = app['phraseanet.configuration']['lazyload']|default(false) %}
+ {% set container_attributes %}
+ {% if entry_id %}
+ class="IMGT diapo type-{{ record.get_type }}"
+ onDblClick="openPreview('FEED',{{ record.get_number() }},{{ entry_id }});"
+ {% elseif record.is_grouping() %}
+ class="IMGT diapo grouping type-{{ record.get_type }}"
+ onDblClick="openPreview('REG','0','{{ record.get_serialize_key() }}');"
+ {% else %}
+ class="IMGT diapo type-{{ record.get_type }}"
+ onDblClick="openPreview('RESULT',{{ record.get_number }});"
+ {% endif %}
+ {% endset %}
- {% set user_technical_display = app['settings'].getUserSetting(app['authentication'].getUser(), 'technical_display') %}
- {% set user_rollover_thumbnail = app['settings'].getUserSetting(app['authentication'].getUser(), 'rollover_thumbnail') %}
-
- {% set extraclass = '' %}
- {% if user_rollover_thumbnail == 'caption' and searchEngine is not null %}
- {% set extraclass = extraclass ~ ' captionTips' %}
- {% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'answer', 'number' : record.get_number() }) %}
- {% elseif user_rollover_thumbnail == 'caption' and searchEngine is null %}
- {% set extraclass = extraclass ~ ' captionTips' %}
- {% set tooltipsrc = path('prod_tooltip_caption', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id(), 'context' : 'publi' }) %}
- {% elseif user_rollover_thumbnail == 'preview' %}
- {% set extraclass = extraclass ~ ' captionTips' %}
- {% set tooltipsrc = path('prod_tooltip_preview', { 'sbas_id' : record.get_sbas_id(), 'record_id' : record.get_record_id() }) %}
- {% endif %}
-