diff --git a/Makefile b/Makefile index 369f5ca8b0..c490fe30f0 100644 --- a/Makefile +++ b/Makefile @@ -1,16 +1,23 @@ install: make install_composer + make clean_assets + make install_asset_dependencies make install_assets install_composer: composer install +install_asset_dependencies: + npm install + ./node_modules/.bin/gulp build + install_assets: + ./node_modules/.bin/gulp install-assets + +clean_assets: rm -rf ./node_modules rm -rf ./www/assets rm -rf ./www/bower_components - npm install - ./node_modules/bin/gulp build config: @php bin/console compile:configuration diff --git a/Vagrantfile b/Vagrantfile index d0e96206eb..84884aceed 100644 --- a/Vagrantfile +++ b/Vagrantfile @@ -26,12 +26,10 @@ def config_net(config) "dev." + $hostname + ".vb" ] - #config.vm.network :public_network, type: "dhcp", bridge: "en0: Ethernet" - # Assign static IP if present in network config if File.file?($root + "/.network.conf") ipAddress = File.read($root + "/.network.conf") - config.vm.network :private_network, ip: ipAddress + #config.vm.network :private_network, ip: ipAddress else # vboxnet0 can be changed to use a specific private_network config.vm.network :private_network, type: "dhcp" @@ -48,6 +46,7 @@ end # By default, the name of the VM is the project's directory name $hostname = File.basename($root).downcase +$hostIps = `ip addr show | grep inet | grep -v inet6 | cut -d' ' -f6 | cut -d'/' -f1`.split("\n"); Vagrant.configure("2") do |config| @@ -80,9 +79,10 @@ Vagrant.configure("2") do |config| config.vm.provision "ansible" do |ansible| ansible.playbook = "resources/ansible/playbook.yml" ansible.limit = 'all' - ansible.verbose = 'v' + ansible.verbose = 'vvv' ansible.extra_vars = { hostname: $hostname, + host_addresses: $hostIps, postfix: { postfix_domain: $hostname + ".vb" } @@ -92,7 +92,9 @@ Vagrant.configure("2") do |config| config.vm.provision "ansible", run: "always" do |ansible| ansible.playbook = "resources/ansible/playbook-always.yml" ansible.limit = 'all' + ansible.verbose = 'vvv' ansible.extra_vars = { + host_addresses: $hostIps, hostname: $hostname } end diff --git a/bin/setup b/bin/setup index 64ad41a435..b0d7defead 100755 --- a/bin/setup +++ b/bin/setup @@ -11,6 +11,7 @@ namespace KonsoleKommander; +use Alchemy\Phrasea\Command\Setup\ConfigurationEditor; use Alchemy\Phrasea\Core\Version; use Alchemy\Phrasea\Command\UpgradeDBDatas; use Alchemy\Phrasea\Command\Setup\Install; @@ -24,6 +25,7 @@ use Alchemy\Phrasea\Command\Plugin\DisablePlugin; use Alchemy\Phrasea\CLI; use Alchemy\Phrasea\Command\Setup\CheckEnvironment; use Alchemy\Phrasea\Core\CLIProvider\DoctrineMigrationServiceProvider; +use Alchemy\Phrasea\Setup\ConfigurationTester; require_once __DIR__ . '/../vendor/autoload.php'; @@ -53,16 +55,16 @@ $app->register(new DoctrineMigrationServiceProvider()); $app->command(new \module_console_aboutAuthors('about:authors')); $app->command(new \module_console_aboutLicense('about:license')); -if( - $app['phraseanet.configuration-tester']->isMigrable() - || $app['phraseanet.configuration-tester']->isUpgradable() - || $app['phraseanet.configuration-tester']->isInstalled() - ) { +/** @var ConfigurationTester $configurationTester */ +$configurationTester = $app['phraseanet.configuration-tester']; + +if($configurationTester->isMigrable() || $configurationTester->isUpgradable() || $configurationTester->isInstalled()) { $app->command(new \module_console_systemUpgrade('system:upgrade')); } -if ($app['phraseanet.configuration-tester']->isInstalled()) { +if ($configurationTester->isInstalled()) { $app->command(new UpgradeDBDatas('system:upgrade-datas')); + $app->command(new ConfigurationEditor('system:config')); } $app->command(new AddPlugin()); diff --git a/composer.lock b/composer.lock index 51695bc8e5..5cb7d25d91 100644 --- a/composer.lock +++ b/composer.lock @@ -4,8 +4,8 @@ "Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "This file is @generated automatically" ], - "hash": "19164414a7dd4683f8d99d828456fb19", - "content-hash": "b908509f786ac7437d41055fbd021bef", + "hash": "e87832949ae7b20d258aceb271577c5c", + "content-hash": "35f87700aa4cbe3c2903fe166676cc74", "packages": [ { "name": "alchemy-fr/tcpdf-clone", @@ -132,16 +132,16 @@ }, { "name": "alchemy/embed-bundle", - "version": "v0.4.1", + "version": "v0.4.4", "source": { "type": "git", "url": "https://github.com/alchemy-fr/embed-bundle.git", - "reference": "edbbb7f0b9de199d5a67ce19fbc41bb94168352d" + "reference": "2eea6602825f41ac7e24f293305b73145823d5b1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/embed-bundle/zipball/edbbb7f0b9de199d5a67ce19fbc41bb94168352d", - "reference": "edbbb7f0b9de199d5a67ce19fbc41bb94168352d", + "url": "https://api.github.com/repos/alchemy-fr/embed-bundle/zipball/2eea6602825f41ac7e24f293305b73145823d5b1", + "reference": "2eea6602825f41ac7e24f293305b73145823d5b1", "shasum": "" }, "require-dev": { @@ -163,11 +163,7 @@ "Alchemy\\EmbedProvider\\": "src/Provider" } }, - "autoload-dev": { - "psr-4": { - "Alchemy\\EmbedBundle\\Tests\\": "tests/unit/Bundle" - } - }, + "notification-url": "https://packagist.org/downloads/", "license": [ "MIT" ], @@ -178,11 +174,7 @@ } ], "description": "Embed resources bundle", - "support": { - "source": "https://github.com/alchemy-fr/embed-bundle/tree/v0.4.1", - "issues": "https://github.com/alchemy-fr/embed-bundle/issues" - }, - "time": "2016-06-16 09:35:17" + "time": "2016-07-07 10:02:43" }, { "name": "alchemy/geonames-api-consumer", @@ -276,16 +268,16 @@ }, { "name": "alchemy/google-plus-api-client", - "version": "0.6.5", + "version": "0.6.6", "source": { "type": "git", "url": "https://github.com/alchemy-fr/google-plus-api-client.git", - "reference": "54dd23b7b5a3e78db9182acbe46c773fd5020a40" + "reference": "d375b00e963984744b8a91bde2c8b87b3ee7d6f1" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/google-plus-api-client/zipball/54dd23b7b5a3e78db9182acbe46c773fd5020a40", - "reference": "54dd23b7b5a3e78db9182acbe46c773fd5020a40", + "url": "https://api.github.com/repos/alchemy-fr/google-plus-api-client/zipball/d375b00e963984744b8a91bde2c8b87b3ee7d6f1", + "reference": "d375b00e963984744b8a91bde2c8b87b3ee7d6f1", "shasum": "" }, "require": { @@ -310,34 +302,36 @@ ], "description": "PHP Client for Google APIs", "homepage": "https://code.google.com/p/google-api-php-client/", - "time": "2013-08-06 09:10:01" + "time": "2016-07-06 13:47:16" }, { "name": "alchemy/mediavorus", - "version": "0.4.4", + "version": "0.4.5", "source": { "type": "git", "url": "https://github.com/alchemy-fr/MediaVorus.git", - "reference": "2df98b5b180c50b1bc7be838e36bc6ecc573e646" + "reference": "ee7d1279a024130fc82fde9eabad86a667ed3630" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/2df98b5b180c50b1bc7be838e36bc6ecc573e646", - "reference": "2df98b5b180c50b1bc7be838e36bc6ecc573e646", + "url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/ee7d1279a024130fc82fde9eabad86a667ed3630", + "reference": "ee7d1279a024130fc82fde9eabad86a667ed3630", "shasum": "" }, "require": { + "alchemy/phpexiftool": "~0.1", "doctrine/collections": "~1.0", "monolog/monolog": "~1.0", "php": ">=5.3.0", "php-ffmpeg/php-ffmpeg": "~0.3", - "phpexiftool/phpexiftool": "~0.1", "symfony/console": "~2.0", "symfony/http-foundation": "~2.0" }, + "replace": { + "mediavorus/mediavorus": "<=0.4.4" + }, "require-dev": { "jms/serializer": "~0.12.0", - "phpunit/phpunit": "~3.7", "silex/silex": "~1.0", "symfony/yaml": "~2.0" }, @@ -346,6 +340,11 @@ "symfony/yaml": "To serialize Medias in Yaml format" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "0.4.x-dev" + } + }, "autoload": { "psr-0": { "MediaVorus": "src" @@ -366,7 +365,7 @@ "keywords": [ "metadata" ], - "time": "2014-08-26 12:32:10" + "time": "2016-05-02 15:08:36" }, { "name": "alchemy/oauth2php", @@ -713,16 +712,16 @@ }, { "name": "aws/aws-sdk-php", - "version": "2.8.30", + "version": "2.8.31", "source": { "type": "git", "url": "https://github.com/aws/aws-sdk-php.git", - "reference": "2d7183cd22381237bce25f11d741a77bdeb2d0b8" + "reference": "64fa4b07f056e338a5f0f29eece75babaa83af68" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/2d7183cd22381237bce25f11d741a77bdeb2d0b8", - "reference": "2d7183cd22381237bce25f11d741a77bdeb2d0b8", + "url": "https://api.github.com/repos/aws/aws-sdk-php/zipball/64fa4b07f056e338a5f0f29eece75babaa83af68", + "reference": "64fa4b07f056e338a5f0f29eece75babaa83af68", "shasum": "" }, "require": { @@ -772,20 +771,20 @@ "s3", "sdk" ], - "time": "2016-05-03 17:42:24" + "time": "2016-07-25 18:03:20" }, { "name": "beberlei/assert", - "version": "v2.5", + "version": "v2.6.3", "source": { "type": "git", "url": "https://github.com/beberlei/assert.git", - "reference": "91e2690c4ecc8a4e3e2d333430069f6a0c694a7a" + "reference": "51e9d654481fc00c8a376641c390ec4e35d8c1fc" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/beberlei/assert/zipball/91e2690c4ecc8a4e3e2d333430069f6a0c694a7a", - "reference": "91e2690c4ecc8a4e3e2d333430069f6a0c694a7a", + "url": "https://api.github.com/repos/beberlei/assert/zipball/51e9d654481fc00c8a376641c390ec4e35d8c1fc", + "reference": "51e9d654481fc00c8a376641c390ec4e35d8c1fc", "shasum": "" }, "require": { @@ -798,7 +797,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3-dev" + "dev-master": "2.5-dev" } }, "autoload": { @@ -816,7 +815,13 @@ "authors": [ { "name": "Benjamin Eberlei", - "email": "kontakt@beberlei.de" + "email": "kontakt@beberlei.de", + "role": "Lead Developer" + }, + { + "name": "Richard Quadling", + "email": "rquadling@gmail.com", + "role": "Collaborator" } ], "description": "Thin assertion library for input validation in business models.", @@ -825,7 +830,7 @@ "assertion", "validation" ], - "time": "2016-03-22 14:34:51" + "time": "2016-07-28 19:35:30" }, { "name": "behat/transliterator", @@ -869,16 +874,16 @@ }, { "name": "cocur/slugify", - "version": "v2.1.1", + "version": "v2.3", "source": { "type": "git", "url": "https://github.com/cocur/slugify.git", - "reference": "eee9879958875921082293dbdbf4866b641864f2" + "reference": "57a00e06a382928e350cc7bbb13b19f1b8f4e73a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/cocur/slugify/zipball/eee9879958875921082293dbdbf4866b641864f2", - "reference": "eee9879958875921082293dbdbf4866b641864f2", + "url": "https://api.github.com/repos/cocur/slugify/zipball/57a00e06a382928e350cc7bbb13b19f1b8f4e73a", + "reference": "57a00e06a382928e350cc7bbb13b19f1b8f4e73a", "shasum": "" }, "require": { @@ -887,6 +892,7 @@ "require-dev": { "laravel/framework": "~5.1", "latte/latte": "~2.2", + "league/container": "^2.2.0", "mikey179/vfsstream": "~1.6", "mockery/mockery": "~0.9", "nette/di": "~2.2", @@ -928,7 +934,7 @@ "slug", "slugify" ], - "time": "2016-04-08 18:57:21" + "time": "2016-08-09 20:10:17" }, { "name": "dailymotion/sdk", @@ -1349,16 +1355,16 @@ }, { "name": "doctrine/dbal", - "version": "v2.5.4", + "version": "v2.5.5", "source": { "type": "git", "url": "https://github.com/doctrine/dbal.git", - "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769" + "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/dbal/zipball/abbdfd1cff43a7b99d027af3be709bc8fc7d4769", - "reference": "abbdfd1cff43a7b99d027af3be709bc8fc7d4769", + "url": "https://api.github.com/repos/doctrine/dbal/zipball/9f8c05cd5225a320d56d4bfdb4772f10d045a0c9", + "reference": "9f8c05cd5225a320d56d4bfdb4772f10d045a0c9", "shasum": "" }, "require": { @@ -1367,7 +1373,7 @@ }, "require-dev": { "phpunit/phpunit": "4.*", - "symfony/console": "2.*" + "symfony/console": "2.*||^3.0" }, "suggest": { "symfony/console": "For helpful console commands such as SQL execution and import of files." @@ -1416,7 +1422,7 @@ "persistence", "queryobject" ], - "time": "2016-01-05 22:11:12" + "time": "2016-09-09 19:13:33" }, { "name": "doctrine/inflector", @@ -1668,16 +1674,16 @@ }, { "name": "doctrine/orm", - "version": "v2.5.4", + "version": "v2.5.5", "source": { "type": "git", "url": "https://github.com/doctrine/doctrine2.git", - "reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab" + "reference": "73e4be7c7b3ba26f96b781a40b33feba4dfa6d45" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bc4ddbfb0114cb33438cc811c9a740d8aa304aab", - "reference": "bc4ddbfb0114cb33438cc811c9a740d8aa304aab", + "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/73e4be7c7b3ba26f96b781a40b33feba4dfa6d45", + "reference": "73e4be7c7b3ba26f96b781a40b33feba4dfa6d45", "shasum": "" }, "require": { @@ -1740,20 +1746,20 @@ "database", "orm" ], - "time": "2016-01-05 21:34:58" + "time": "2016-09-10 18:51:13" }, { "name": "elasticsearch/elasticsearch", - "version": "v2.2.0", + "version": "v2.2.1", "source": { "type": "git", "url": "https://github.com/elastic/elasticsearch-php.git", - "reference": "11ebdf2c847d0e2c4a47ac993485beb5a19d5dc4" + "reference": "7b34186a58730d0a8963741bd62fa5ab45658ada" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/11ebdf2c847d0e2c4a47ac993485beb5a19d5dc4", - "reference": "11ebdf2c847d0e2c4a47ac993485beb5a19d5dc4", + "url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/7b34186a58730d0a8963741bd62fa5ab45658ada", + "reference": "7b34186a58730d0a8963741bd62fa5ab45658ada", "shasum": "" }, "require": { @@ -1794,7 +1800,7 @@ "elasticsearch", "search" ], - "time": "2016-06-03 21:09:29" + "time": "2016-07-14 14:13:40" }, { "name": "evenement/evenement", @@ -2154,6 +2160,7 @@ "rest", "web service" ], + "abandoned": "guzzlehttp/guzzle", "time": "2015-03-18 18:23:50" }, { @@ -3137,30 +3144,31 @@ }, { "name": "ircmaxell/random-lib", - "version": "v1.1.0", + "version": "v1.2.0", "source": { "type": "git", "url": "https://github.com/ircmaxell/RandomLib.git", - "reference": "13efa4368bb2ac88bb3b1459b487d907de4dbf7c" + "reference": "e9e0204f40e49fa4419946c677eccd3fa25b8cf4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/RandomLib/zipball/13efa4368bb2ac88bb3b1459b487d907de4dbf7c", - "reference": "13efa4368bb2ac88bb3b1459b487d907de4dbf7c", + "url": "https://api.github.com/repos/ircmaxell/RandomLib/zipball/e9e0204f40e49fa4419946c677eccd3fa25b8cf4", + "reference": "e9e0204f40e49fa4419946c677eccd3fa25b8cf4", "shasum": "" }, "require": { - "ircmaxell/security-lib": "1.0.*@dev", + "ircmaxell/security-lib": "^1.1", "php": ">=5.3.2" }, "require-dev": { - "mikey179/vfsstream": "1.1.*", - "phpunit/phpunit": "3.7.*" + "friendsofphp/php-cs-fixer": "^1.11", + "mikey179/vfsstream": "^1.6", + "phpunit/phpunit": "^4.8|^5.0" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0.x-dev" + "dev-master": "1.1.x-dev" } }, "autoload": { @@ -3187,20 +3195,20 @@ "random-numbers", "random-strings" ], - "time": "2015-01-15 16:31:45" + "time": "2016-09-07 15:52:06" }, { "name": "ircmaxell/security-lib", - "version": "1.0.0", + "version": "v1.1.0", "source": { "type": "git", "url": "https://github.com/ircmaxell/SecurityLib.git", - "reference": "80934de3c482dcafb46b5756e59ebece082b6dc7" + "reference": "f3db6de12c20c9bcd1aa3db4353a1bbe0e44e1b5" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ircmaxell/SecurityLib/zipball/80934de3c482dcafb46b5756e59ebece082b6dc7", - "reference": "80934de3c482dcafb46b5756e59ebece082b6dc7", + "url": "https://api.github.com/repos/ircmaxell/SecurityLib/zipball/f3db6de12c20c9bcd1aa3db4353a1bbe0e44e1b5", + "reference": "f3db6de12c20c9bcd1aa3db4353a1bbe0e44e1b5", "shasum": "" }, "require": { @@ -3210,6 +3218,11 @@ "mikey179/vfsstream": "1.1.*" }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { "psr-0": { "SecurityLib": "lib" @@ -3227,8 +3240,8 @@ } ], "description": "A Base Security Library", - "homepage": "https://github.com/ircmaxell/PHP-SecurityLib", - "time": "2013-04-30 18:00:34" + "homepage": "https://github.com/ircmaxell/SecurityLib", + "time": "2015-03-20 14:31:23" }, { "name": "jms/metadata", @@ -3531,16 +3544,16 @@ }, { "name": "league/flysystem", - "version": "1.0.24", + "version": "1.0.27", "source": { "type": "git", "url": "https://github.com/thephpleague/flysystem.git", - "reference": "9aca859a303fdca30370f42b8c611d9cf0dedf4b" + "reference": "50e2045ed70a7e75a5e30bc3662904f3b67af8a9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/9aca859a303fdca30370f42b8c611d9cf0dedf4b", - "reference": "9aca859a303fdca30370f42b8c611d9cf0dedf4b", + "url": "https://api.github.com/repos/thephpleague/flysystem/zipball/50e2045ed70a7e75a5e30bc3662904f3b67af8a9", + "reference": "50e2045ed70a7e75a5e30bc3662904f3b67af8a9", "shasum": "" }, "require": { @@ -3553,7 +3566,7 @@ "ext-fileinfo": "*", "mockery/mockery": "~0.9", "phpspec/phpspec": "^2.2", - "phpunit/phpunit": "~4.8 || ~5.0" + "phpunit/phpunit": "~4.8" }, "suggest": { "ext-fileinfo": "Required for MimeType", @@ -3610,7 +3623,7 @@ "sftp", "storage" ], - "time": "2016-06-03 19:11:39" + "time": "2016-08-10 08:55:11" }, { "name": "league/flysystem-aws-s3-v2", @@ -3796,16 +3809,16 @@ }, { "name": "monolog/monolog", - "version": "1.19.0", + "version": "1.21.0", "source": { "type": "git", "url": "https://github.com/Seldaek/monolog.git", - "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf" + "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/monolog/zipball/5f56ed5212dc509c8dc8caeba2715732abb32dbf", - "reference": "5f56ed5212dc509c8dc8caeba2715732abb32dbf", + "url": "https://api.github.com/repos/Seldaek/monolog/zipball/f42fbdfd53e306bda545845e4dbfd3e72edb4952", + "reference": "f42fbdfd53e306bda545845e4dbfd3e72edb4952", "shasum": "" }, "require": { @@ -3824,8 +3837,8 @@ "php-console/php-console": "^3.1.3", "phpunit/phpunit": "~4.5", "phpunit/phpunit-mock-objects": "2.3.0", - "raven/raven": "^0.13", "ruflin/elastica": ">=0.90 <3.0", + "sentry/sentry": "^0.13", "swiftmailer/swiftmailer": "~5.3" }, "suggest": { @@ -3837,9 +3850,9 @@ "mongodb/mongodb": "Allow sending log messages to a MongoDB server via PHP Driver", "php-amqplib/php-amqplib": "Allow sending log messages to an AMQP server using php-amqplib", "php-console/php-console": "Allow sending log messages to Google Chrome", - "raven/raven": "Allow sending log messages to a Sentry server", "rollbar/rollbar": "Allow sending log messages to Rollbar", - "ruflin/elastica": "Allow sending log messages to an Elastic Search server" + "ruflin/elastica": "Allow sending log messages to an Elastic Search server", + "sentry/sentry": "Allow sending log messages to a Sentry server" }, "type": "library", "extra": { @@ -3870,7 +3883,7 @@ "logging", "psr-3" ], - "time": "2016-04-12 18:29:35" + "time": "2016-07-29 03:23:52" }, { "name": "mrclay/minify", @@ -4564,16 +4577,16 @@ }, { "name": "php-xpdf/php-xpdf", - "version": "0.2.2", + "version": "0.2.3", "source": { "type": "git", "url": "https://github.com/alchemy-fr/PHP-XPDF.git", - "reference": "61633a5cba2bf3bfc800a9c10f8e525bda35dde1" + "reference": "d5e73960108704e0063b81ae777d01b8fb91ae08" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/alchemy-fr/PHP-XPDF/zipball/61633a5cba2bf3bfc800a9c10f8e525bda35dde1", - "reference": "61633a5cba2bf3bfc800a9c10f8e525bda35dde1", + "url": "https://api.github.com/repos/alchemy-fr/PHP-XPDF/zipball/d5e73960108704e0063b81ae777d01b8fb91ae08", + "reference": "d5e73960108704e0063b81ae777d01b8fb91ae08", "shasum": "" }, "require": { @@ -4612,20 +4625,20 @@ "pdf", "xpdf" ], - "time": "2015-12-10 16:22:47" + "time": "2016-07-04 07:30:16" }, { "name": "phpcollection/phpcollection", - "version": "0.4.0", + "version": "0.5.0", "source": { "type": "git", "url": "https://github.com/schmittjoh/php-collection.git", - "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83" + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/b8bf55a0a929ca43b01232b36719f176f86c7e83", - "reference": "b8bf55a0a929ca43b01232b36719f176f86c7e83", + "url": "https://api.github.com/repos/schmittjoh/php-collection/zipball/f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", + "reference": "f2bcff45c0da7c27991bbc1f90f47c4b7fb434a6", "shasum": "" }, "require": { @@ -4634,7 +4647,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "0.3-dev" + "dev-master": "0.4-dev" } }, "autoload": { @@ -4648,10 +4661,8 @@ ], "authors": [ { - "name": "Johannes Schmitt", - "email": "schmittjoh@gmail.com", - "homepage": "https://github.com/schmittjoh", - "role": "Developer of wrapped JMSSerializerBundle" + "name": "Johannes M. Schmitt", + "email": "schmittjoh@gmail.com" } ], "description": "General-Purpose Collection Library for PHP", @@ -4662,7 +4673,7 @@ "sequence", "set" ], - "time": "2014-03-11 13:46:42" + "time": "2015-05-17 12:39:23" }, { "name": "phpexiftool/exiftool", @@ -4795,22 +4806,30 @@ }, { "name": "psr/log", - "version": "1.0.0", + "version": "1.0.1", "source": { "type": "git", "url": "https://github.com/php-fig/log.git", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b" + "reference": "5277094ed527a1c4477177d102fe4c53551953e0" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/php-fig/log/zipball/fe0936ee26643249e916849d48e3a51d5f5e278b", - "reference": "fe0936ee26643249e916849d48e3a51d5f5e278b", + "url": "https://api.github.com/repos/php-fig/log/zipball/5277094ed527a1c4477177d102fe4c53551953e0", + "reference": "5277094ed527a1c4477177d102fe4c53551953e0", "shasum": "" }, + "require": { + "php": ">=5.3.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, "autoload": { - "psr-0": { - "Psr\\Log\\": "" + "psr-4": { + "Psr\\Log\\": "Psr/Log/" } }, "notification-url": "https://packagist.org/downloads/", @@ -4824,25 +4843,26 @@ } ], "description": "Common interface for logging libraries", + "homepage": "https://github.com/php-fig/log", "keywords": [ "log", "psr", "psr-3" ], - "time": "2012-12-21 11:40:51" + "time": "2016-09-19 16:02:08" }, { "name": "ramsey/uuid", - "version": "3.4.1", + "version": "3.5.0", "source": { "type": "git", "url": "https://github.com/ramsey/uuid.git", - "reference": "b4fe3b7387cb323fd15ad5837cae992422c9fa5c" + "reference": "a6d15c8618ea3951fd54d34e326b68d3d0bc0786" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/ramsey/uuid/zipball/b4fe3b7387cb323fd15ad5837cae992422c9fa5c", - "reference": "b4fe3b7387cb323fd15ad5837cae992422c9fa5c", + "url": "https://api.github.com/repos/ramsey/uuid/zipball/a6d15c8618ea3951fd54d34e326b68d3d0bc0786", + "reference": "a6d15c8618ea3951fd54d34e326b68d3d0bc0786", "shasum": "" }, "require": { @@ -4860,7 +4880,7 @@ "jakub-onderka/php-parallel-lint": "^0.9.0", "mockery/mockery": "^0.9.4", "moontoast/math": "^1.1", - "phpunit/phpunit": "^4.7|^5.0", + "phpunit/phpunit": "^4.7|>=5.0 <5.4", "satooshi/php-coveralls": "^0.6.1", "squizlabs/php_codesniffer": "^2.3" }, @@ -4909,7 +4929,7 @@ "identifier", "uuid" ], - "time": "2016-04-24 00:30:41" + "time": "2016-08-02 18:39:32" }, { "name": "react/promise", @@ -4961,20 +4981,24 @@ "source": { "type": "git", "url": "https://github.com/Roave/SecurityAdvisories.git", - "reference": "96f1ef760845211c8acbb15970e706db1e4b2c5e" + "reference": "a73923249fdfe996f2b625c3f3fcb311e84e3447" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/96f1ef760845211c8acbb15970e706db1e4b2c5e", - "reference": "96f1ef760845211c8acbb15970e706db1e4b2c5e", + "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a73923249fdfe996f2b625c3f3fcb311e84e3447", + "reference": "a73923249fdfe996f2b625c3f3fcb311e84e3447", "shasum": "" }, "conflict": { + "amphp/artax": ">=2,<2.0.4|>0.7.1,<1.0.4", "aws/aws-sdk-php": ">=3,<3.2.1", - "cakephp/cakephp": ">=3,<3.0.15|>=2,<2.4.99|>=2.5,<2.5.90|>=2.6,<2.6.12|>=1.3,<1.3.18|>=2.7,<2.7.6|>=3.1,<3.1.3", - "codeigniter/framework": "<3.0.3", + "bugsnag/bugsnag-laravel": ">=2,<2.0.2", + "cakephp/cakephp": ">=3,<3.0.15|>=2,<2.4.99|>=2.5,<2.5.99|>=2.6,<2.6.12|>=1.3,<1.3.18|>=2.7,<2.7.6|>=3.1,<3.1.4", + "cartalyst/sentry": "<2.1", + "codeigniter/framework": "<=3.0.6", "composer/composer": "<=1.0.0-alpha11", - "contao/core": ">=2.11,<3|>=3,<3.1|>=3.1,<3.2|>=3.2,<3.2.19|>=3.3,<3.4|>=3.4,<3.4.4", + "contao-components/mediaelement": ">=2.14.2,<2.21.1", + "contao/core": ">=2.11,<3.5.15", "doctrine/annotations": ">=1,<1.2.7", "doctrine/cache": ">=1,<1.3.2|>=1.4,<1.4.2", "doctrine/common": ">=2,<2.4.3|>=2.5,<2.5.1", @@ -4985,14 +5009,18 @@ "doctrine/mongodb-odm-bundle": ">=2,<3.0.1", "doctrine/orm": ">=2,<2.4.8|>=2.5,<2.5.1", "dompdf/dompdf": ">=0.6,<0.6.2", + "drupal/core": ">=8,<8.1.7", + "drupal/drupal": ">=8,<8.1.7", "firebase/php-jwt": "<2", "friendsofsymfony/rest-bundle": ">=1.2,<1.2.2", - "friendsofsymfony/user-bundle": ">=1.2,<1.3|>=1.3,<1.3.5", + "friendsofsymfony/user-bundle": ">=1.2,<1.3.5", + "guzzlehttp/guzzle": ">=6,<6.2.1|>=4.0.0-rc2,<4.2.4|>=5,<5.3.1", "illuminate/auth": ">=4,<4.0.99|>=4.1,<4.1.26", "illuminate/database": ">=4,<4.0.99|>=4.1,<4.1.29", "joomla/session": "<1.3.1", "laravel/framework": ">=4,<4.0.99|>=4.1,<4.1.29", "laravel/socialite": ">=1,<1.0.99|>=2,<2.0.10", + "magento/magento2ce": ">=2,<2.2", "monolog/monolog": ">=1.8,<1.12", "namshi/jose": "<2.2", "oro/crm": ">=1.7,<1.7.4", @@ -5000,33 +5028,33 @@ "phpmailer/phpmailer": ">=5,<5.2.14", "pusher/pusher-php-server": "<2.2.1", "sabre/dav": ">=1.6,<1.6.99|>=1.7,<1.7.11|>=1.8,<1.8.9", - "shopware/shopware": "<4.3.7|>=5,<5.1|>=5.1,<5.1.5", + "shopware/shopware": "<4.3.7|>=5,<5.1.5", "silverstripe/cms": ">=3.1,<3.1.11|>=3,<=3.0.11", "silverstripe/forum": "<=0.6.1|>=0.7,<=0.7.3", - "silverstripe/framework": ">=3,<3.1|>=3.1,<3.2|>=3.2,<3.3", + "silverstripe/framework": ">=3,<3.3", "silverstripe/userforms": "<3", - "simplesamlphp/simplesamlphp": "<=1.14.1", + "simplesamlphp/simplesamlphp": "<1.14.4", "socalnick/scn-social-auth": "<1.15.2", "swiftmailer/swiftmailer": ">=4,<4.99.99|>=5,<5.2.1", "symfony/dependency-injection": ">=2,<2.0.17", - "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.5|>=2.5,<2.6|>=2.6,<2.6.12|>=2.7,<2.7.7", - "symfony/framework-bundle": ">=2,<2.1|>=2.1,<2.2|>=2.2,<2.3|>=2.3,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", - "symfony/http-foundation": ">=2,<2.1|>=2.1,<2.2|>=2.2,<2.3|>=2.3,<2.3.27|>=2.4,<2.5|>=2.5,<2.5.11|>=2.6,<2.6.6", - "symfony/http-kernel": ">=2,<2.1|>=2.1,<2.2|>=2.2,<2.3|>=2.3,<2.3.29|>=2.4,<2.5|>=2.5,<2.5.12|>=2.6,<2.6.8", + "symfony/form": ">=2.3,<2.3.35|>=2.4,<2.6.12|>=2.7,<2.7.7", + "symfony/framework-bundle": ">=2,<2.3.18|>=2.4,<2.4.8|>=2.5,<2.5.2", + "symfony/http-foundation": ">=2,<2.3.27|>=2.4,<2.5.11|>=2.6,<2.6.6", + "symfony/http-kernel": ">=2,<2.3.29|>=2.4,<2.5.12|>=2.6,<2.6.8", "symfony/routing": ">=2,<2.0.19", - "symfony/security": ">=2.3,<2.3.37|>=2.4,<2.5|>=2.5,<2.6|>=2.6,<2.6.13|>=2.7,<2.7.9|>=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9", - "symfony/security-core": ">=2.8,<2.8.6|>=3,<3.0.6|>=2.4,<2.5|>=2.5,<2.6|>=2.6,<2.6.13|>=2.7,<2.7.9", - "symfony/security-http": ">=2.4,<2.5|>=2.5,<2.6|>=2.6,<2.7|>=2.7,<2.7.13|>=2.3,<2.3.41|>=2.8,<2.8.6|>=3,<3.0.6", + "symfony/security": ">=2.3,<2.3.37|>=2.4,<2.6.13|>=2.7,<2.7.9|>=2,<2.0.25|>=2.1,<2.1.13|>=2.2,<2.2.9", + "symfony/security-core": ">=2.8,<2.8.6|>=3,<3.0.6|>=2.4,<2.6.13|>=2.7,<2.7.9", + "symfony/security-http": ">=2.4,<2.7.13|>=2.3,<2.3.41|>=2.8,<2.8.6|>=3,<3.0.6", "symfony/serializer": ">=2,<2.0.11", - "symfony/symfony": ">=2,<2.1|>=2.1,<2.2|>=2.2,<2.3|>=2.3,<2.3.41|>=2.4,<2.5|>=2.5,<2.6|>=2.6,<2.7|>=2.7,<2.7.13|>=2.8,<2.8.6|>=3,<3.0.6", + "symfony/symfony": ">=2,<2.3.41|>=2.4,<2.7.13|>=2.8,<2.8.6|>=3,<3.0.6", "symfony/translation": ">=2,<2.0.17", "symfony/validator": ">=2,<2.0.24|>=2.1,<2.1.12|>=2.2,<2.2.5|>=2.3,<2.3.3", - "symfony/web-profiler-bundle": ">=2,<2.1|>=2.1,<2.2|>=2.2,<2.3|>=2.3,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", + "symfony/web-profiler-bundle": ">=2,<2.3.19|>=2.4,<2.4.9|>=2.5,<2.5.4", "symfony/yaml": ">=2,<2.0.22|>=2.1,<2.1.7", "thelia/backoffice-default-template": ">=2.1,<2.1.2", "thelia/thelia": ">=2.1.0-beta1,<2.1.3|>=2.1,<2.1.2", "twig/twig": "<1.20", - "typo3/cms": ">=6.2,<6.2.25|>=7,<7.1|>=7.1,<7.2|>=7.2,<7.3|>=7.3,<7.4|>=7.4,<7.5|>=7.5,<7.6|>=7.6,<7.6.8|>=8,<8.1.1", + "typo3/cms": ">=6.2,<6.2.27|>=8,<8.3.1|>=7,<7.6.11", "typo3/flow": ">=1,<1.0.4|>=1.1,<1.1.1|>=2,<2.0.1|>=2.3,<2.3.7|>=3,<3.0.1", "typo3/neos": ">=1.1,<1.1.3|>=1.2,<1.2.13|>=2,<2.0.4", "willdurand/js-translation-bundle": "<2.1.1", @@ -5052,7 +5080,7 @@ "zendframework/zend-view": ">=2,<2.2.7|>=2.3,<2.3.1", "zendframework/zend-xmlrpc": ">=2.1,<2.1.6|>=2.2,<2.2.6", "zendframework/zendframework": ">=2,<2.4.9|>=2.5,<2.5.1", - "zendframework/zendframework1": ">=1,<1.11.15|>=1.12,<1.12.18", + "zendframework/zendframework1": "<1.12.20", "zendframework/zendopenid": ">=2,<2.0.2", "zendframework/zendxml": ">=1,<1.0.1", "zf-commons/zfc-user": "<1.2.2", @@ -5072,20 +5100,20 @@ } ], "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", - "time": "2016-05-25 05:33:34" + "time": "2016-09-16 14:00:30" }, { "name": "seld/jsonlint", - "version": "1.4.0", + "version": "1.4.1", "source": { "type": "git", "url": "https://github.com/Seldaek/jsonlint.git", - "reference": "66834d3e3566bb5798db7294619388786ae99394" + "reference": "e827b5254d3e58c736ea2c5616710983d80b0b70" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/66834d3e3566bb5798db7294619388786ae99394", - "reference": "66834d3e3566bb5798db7294619388786ae99394", + "url": "https://api.github.com/repos/Seldaek/jsonlint/zipball/e827b5254d3e58c736ea2c5616710983d80b0b70", + "reference": "e827b5254d3e58c736ea2c5616710983d80b0b70", "shasum": "" }, "require": { @@ -5118,7 +5146,7 @@ "parser", "validator" ], - "time": "2015-11-21 02:21:41" + "time": "2016-09-14 15:17:56" }, { "name": "silex/silex", @@ -6153,16 +6181,16 @@ }, { "name": "symfony/symfony", - "version": "v2.8.7", + "version": "v2.8.11", "source": { "type": "git", "url": "https://github.com/symfony/symfony.git", - "reference": "663b2d6202c3149515b39cfe50a174a130acb8e2" + "reference": "f588c92c3e263b2eaa2f96a7b1359199eb209b3d" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/symfony/symfony/zipball/663b2d6202c3149515b39cfe50a174a130acb8e2", - "reference": "663b2d6202c3149515b39cfe50a174a130acb8e2", + "url": "https://api.github.com/repos/symfony/symfony/zipball/f588c92c3e263b2eaa2f96a7b1359199eb209b3d", + "reference": "f588c92c3e263b2eaa2f96a7b1359199eb209b3d", "shasum": "" }, "require": { @@ -6236,7 +6264,7 @@ "doctrine/dbal": "~2.4", "doctrine/doctrine-bundle": "~1.2", "doctrine/orm": "~2.4,>=2.4.5", - "egulias/email-validator": "~1.2", + "egulias/email-validator": "~1.2,>=1.2.1", "monolog/monolog": "~1.11", "ocramius/proxy-manager": "~0.4|~1.0|~2.0", "phpdocumentor/reflection": "^1.0.7" @@ -6283,7 +6311,7 @@ "keywords": [ "framework" ], - "time": "2016-06-06 16:05:37" + "time": "2016-09-07 02:04:25" }, { "name": "themattharris/tmhoauth", @@ -6329,16 +6357,16 @@ }, { "name": "twig/extensions", - "version": "v1.3.0", + "version": "v1.4.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig-extensions.git", - "reference": "449e3c8a9ffad7c2479c7864557275a32b037499" + "reference": "531eaf4b9ab778b1d7cdd10d40fc6aa74729dfee" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/449e3c8a9ffad7c2479c7864557275a32b037499", - "reference": "449e3c8a9ffad7c2479c7864557275a32b037499", + "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/531eaf4b9ab778b1d7cdd10d40fc6aa74729dfee", + "reference": "531eaf4b9ab778b1d7cdd10d40fc6aa74729dfee", "shasum": "" }, "require": { @@ -6353,7 +6381,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.3-dev" + "dev-master": "1.4-dev" } }, "autoload": { @@ -6377,20 +6405,20 @@ "i18n", "text" ], - "time": "2015-08-22 16:38:35" + "time": "2016-09-22 16:50:57" }, { "name": "twig/twig", - "version": "v1.24.1", + "version": "v1.25.0", "source": { "type": "git", "url": "https://github.com/twigphp/Twig.git", - "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512" + "reference": "f16a634ab08d87e520da5671ec52153d627f10f6" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/twigphp/Twig/zipball/3566d311a92aae4deec6e48682dc5a4528c4a512", - "reference": "3566d311a92aae4deec6e48682dc5a4528c4a512", + "url": "https://api.github.com/repos/twigphp/Twig/zipball/f16a634ab08d87e520da5671ec52153d627f10f6", + "reference": "f16a634ab08d87e520da5671ec52153d627f10f6", "shasum": "" }, "require": { @@ -6403,7 +6431,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "1.24-dev" + "dev-master": "1.25-dev" } }, "autoload": { @@ -6438,7 +6466,7 @@ "keywords": [ "templating" ], - "time": "2016-05-30 09:11:59" + "time": "2016-09-21 23:05:12" }, { "name": "vierbergenlars/php-semver", @@ -6490,28 +6518,29 @@ }, { "name": "webmozart/assert", - "version": "1.0.2", + "version": "1.1.0", "source": { "type": "git", "url": "https://github.com/webmozart/assert.git", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde" + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/webmozart/assert/zipball/30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", - "reference": "30eed06dd6bc88410a4ff7f77b6d22f3ce13dbde", + "url": "https://api.github.com/repos/webmozart/assert/zipball/bb2d123231c095735130cc8f6d31385a44c7b308", + "reference": "bb2d123231c095735130cc8f6d31385a44c7b308", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3|^7.0" }, "require-dev": { - "phpunit/phpunit": "^4.6" + "phpunit/phpunit": "^4.6", + "sebastian/version": "^1.0.1" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.0-dev" + "dev-master": "1.2-dev" } }, "autoload": { @@ -6535,7 +6564,7 @@ "check", "validate" ], - "time": "2015-08-24 13:29:44" + "time": "2016-08-09 15:02:57" }, { "name": "webmozart/json", @@ -6634,25 +6663,28 @@ }, { "name": "willdurand/negotiation", - "version": "v2.0.2", + "version": "v2.1.0", "source": { "type": "git", "url": "https://github.com/willdurand/Negotiation.git", - "reference": "a8ce6da7acdf07351ccd6a9359c571ebc0725a21" + "reference": "bc814293b153f543c99c89d94c8cc07b3259eef9" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/a8ce6da7acdf07351ccd6a9359c571ebc0725a21", - "reference": "a8ce6da7acdf07351ccd6a9359c571ebc0725a21", + "url": "https://api.github.com/repos/willdurand/Negotiation/zipball/bc814293b153f543c99c89d94c8cc07b3259eef9", + "reference": "bc814293b153f543c99c89d94c8cc07b3259eef9", "shasum": "" }, "require": { "php": ">=5.4.0" }, + "require-dev": { + "phpunit/phpunit": "~4.5" + }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.0-dev" + "dev-master": "2.1-dev" } }, "autoload": { @@ -6679,7 +6711,7 @@ "header", "negotiation" ], - "time": "2015-11-21 14:23:02" + "time": "2016-09-21 11:26:55" }, { "name": "zend/gdata", @@ -6832,16 +6864,16 @@ "packages-dev": [ { "name": "mikey179/vfsStream", - "version": "v1.6.3", + "version": "v1.6.4", "source": { "type": "git", "url": "https://github.com/mikey179/vfsStream.git", - "reference": "c19925cd0390d3c436a0203ae859afa460d0474b" + "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/c19925cd0390d3c436a0203ae859afa460d0474b", - "reference": "c19925cd0390d3c436a0203ae859afa460d0474b", + "url": "https://api.github.com/repos/mikey179/vfsStream/zipball/0247f57b2245e8ad2e689d7cee754b45fbabd592", + "reference": "0247f57b2245e8ad2e689d7cee754b45fbabd592", "shasum": "" }, "require": { @@ -6874,7 +6906,49 @@ ], "description": "Virtual file system to mock the real file system in unit tests.", "homepage": "http://vfs.bovigo.org/", - "time": "2016-04-09 09:42:01" + "time": "2016-07-18 14:02:57" + }, + { + "name": "myclabs/deep-copy", + "version": "1.5.4", + "source": { + "type": "git", + "url": "https://github.com/myclabs/DeepCopy.git", + "reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/myclabs/DeepCopy/zipball/ea74994a3dc7f8d2f65a06009348f2d63c81e61f", + "reference": "ea74994a3dc7f8d2f65a06009348f2d63c81e61f", + "shasum": "" + }, + "require": { + "php": ">=5.4.0" + }, + "require-dev": { + "doctrine/collections": "1.*", + "phpunit/phpunit": "~4.1" + }, + "type": "library", + "autoload": { + "psr-4": { + "DeepCopy\\": "src/DeepCopy/" + } + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "MIT" + ], + "description": "Create deep copies (clones) of your objects", + "homepage": "https://github.com/myclabs/DeepCopy", + "keywords": [ + "clone", + "copy", + "duplicate", + "object", + "object graph" + ], + "time": "2016-09-16 13:37:59" }, { "name": "phpdocumentor/reflection-common", @@ -7086,39 +7160,40 @@ }, { "name": "phpunit/php-code-coverage", - "version": "2.2.4", + "version": "4.0.1", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979" + "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/eabf68b476ac7d0f73793aada060f1c1a9bf8979", - "reference": "eabf68b476ac7d0f73793aada060f1c1a9bf8979", + "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/5f3f7e736d6319d5f1fc402aff8b026da26709a3", + "reference": "5f3f7e736d6319d5f1fc402aff8b026da26709a3", "shasum": "" }, "require": { - "php": ">=5.3.3", + "php": "^5.6 || ^7.0", "phpunit/php-file-iterator": "~1.3", "phpunit/php-text-template": "~1.2", - "phpunit/php-token-stream": "~1.3", - "sebastian/environment": "^1.3.2", - "sebastian/version": "~1.0" + "phpunit/php-token-stream": "^1.4.2", + "sebastian/code-unit-reverse-lookup": "~1.0", + "sebastian/environment": "^1.3.2 || ^2.0", + "sebastian/version": "~1.0|~2.0" }, "require-dev": { "ext-xdebug": ">=2.1.4", - "phpunit/phpunit": "~4" + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-dom": "*", - "ext-xdebug": ">=2.2.1", + "ext-xdebug": ">=2.4.0", "ext-xmlwriter": "*" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "2.2.x-dev" + "dev-master": "4.0.x-dev" } }, "autoload": { @@ -7144,7 +7219,7 @@ "testing", "xunit" ], - "time": "2015-10-06 15:47:00" + "time": "2016-07-26 14:39:29" }, { "name": "phpunit/php-file-iterator", @@ -7329,40 +7404,51 @@ }, { "name": "phpunit/phpunit", - "version": "4.8.26", + "version": "5.5.5", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit.git", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74" + "reference": "a57126dc681b08289fef6ac96a48e30656f84350" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/fc1d8cd5b5de11625979125c5639347896ac2c74", - "reference": "fc1d8cd5b5de11625979125c5639347896ac2c74", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/a57126dc681b08289fef6ac96a48e30656f84350", + "reference": "a57126dc681b08289fef6ac96a48e30656f84350", "shasum": "" }, "require": { "ext-dom": "*", "ext-json": "*", - "ext-pcre": "*", - "ext-reflection": "*", - "ext-spl": "*", - "php": ">=5.3.3", + "ext-libxml": "*", + "ext-mbstring": "*", + "ext-xml": "*", + "myclabs/deep-copy": "~1.3", + "php": "^5.6 || ^7.0", "phpspec/prophecy": "^1.3.1", - "phpunit/php-code-coverage": "~2.1", + "phpunit/php-code-coverage": "^4.0.1", "phpunit/php-file-iterator": "~1.4", "phpunit/php-text-template": "~1.2", "phpunit/php-timer": "^1.0.6", - "phpunit/phpunit-mock-objects": "~2.3", + "phpunit/phpunit-mock-objects": "^3.2", "sebastian/comparator": "~1.1", "sebastian/diff": "~1.2", - "sebastian/environment": "~1.3", + "sebastian/environment": "^1.3 || ^2.0", "sebastian/exporter": "~1.2", "sebastian/global-state": "~1.0", - "sebastian/version": "~1.0", + "sebastian/object-enumerator": "~1.0", + "sebastian/resource-operations": "~1.0", + "sebastian/version": "~1.0|~2.0", "symfony/yaml": "~2.1|~3.0" }, + "conflict": { + "phpdocumentor/reflection-docblock": "3.0.2" + }, + "require-dev": { + "ext-pdo": "*" + }, "suggest": { + "ext-tidy": "*", + "ext-xdebug": "*", "phpunit/php-invoker": "~1.1" }, "bin": [ @@ -7371,7 +7457,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "4.8.x-dev" + "dev-master": "5.5.x-dev" } }, "autoload": { @@ -7397,30 +7483,33 @@ "testing", "xunit" ], - "time": "2016-05-17 03:09:28" + "time": "2016-09-21 14:40:13" }, { "name": "phpunit/phpunit-mock-objects", - "version": "2.3.8", + "version": "3.2.7", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983" + "reference": "546898a2c0c356ef2891b39dd7d07f5d82c8ed0a" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/ac8e7a3db35738d56ee9a76e78a4e03d97628983", - "reference": "ac8e7a3db35738d56ee9a76e78a4e03d97628983", + "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/546898a2c0c356ef2891b39dd7d07f5d82c8ed0a", + "reference": "546898a2c0c356ef2891b39dd7d07f5d82c8ed0a", "shasum": "" }, "require": { "doctrine/instantiator": "^1.0.2", - "php": ">=5.3.3", - "phpunit/php-text-template": "~1.2", - "sebastian/exporter": "~1.2" + "php": "^5.6 || ^7.0", + "phpunit/php-text-template": "^1.2", + "sebastian/exporter": "^1.2" + }, + "conflict": { + "phpunit/phpunit": "<5.4.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^5.4" }, "suggest": { "ext-soap": "*" @@ -7428,7 +7517,7 @@ "type": "library", "extra": { "branch-alias": { - "dev-master": "2.3.x-dev" + "dev-master": "3.2.x-dev" } }, "autoload": { @@ -7453,7 +7542,52 @@ "mock", "xunit" ], - "time": "2015-10-02 06:51:40" + "time": "2016-09-06 16:07:45" + }, + { + "name": "sebastian/code-unit-reverse-lookup", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/code-unit-reverse-lookup.git", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/code-unit-reverse-lookup/zipball/c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "reference": "c36f5e7cfce482fde5bf8d10d41a53591e0198fe", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Looks up which function or method a line of code belongs to", + "homepage": "https://github.com/sebastianbergmann/code-unit-reverse-lookup/", + "time": "2016-02-13 06:45:14" }, { "name": "sebastian/comparator", @@ -7573,23 +7707,23 @@ }, { "name": "sebastian/environment", - "version": "1.3.7", + "version": "1.3.8", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/environment.git", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716" + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/4e8f0da10ac5802913afc151413bc8c53b6c2716", - "reference": "4e8f0da10ac5802913afc151413bc8c53b6c2716", + "url": "https://api.github.com/repos/sebastianbergmann/environment/zipball/be2c607e43ce4c89ecd60e75c6a85c126e754aea", + "reference": "be2c607e43ce4c89ecd60e75c6a85c126e754aea", "shasum": "" }, "require": { - "php": ">=5.3.3" + "php": "^5.3.3 || ^7.0" }, "require-dev": { - "phpunit/phpunit": "~4.4" + "phpunit/phpunit": "^4.8 || ^5.0" }, "type": "library", "extra": { @@ -7619,20 +7753,20 @@ "environment", "hhvm" ], - "time": "2016-05-17 03:18:57" + "time": "2016-08-18 05:49:44" }, { "name": "sebastian/exporter", - "version": "1.2.1", + "version": "1.2.2", "source": { "type": "git", "url": "https://github.com/sebastianbergmann/exporter.git", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e" + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/7ae5513327cb536431847bcc0c10edba2701064e", - "reference": "7ae5513327cb536431847bcc0c10edba2701064e", + "url": "https://api.github.com/repos/sebastianbergmann/exporter/zipball/42c4c2eec485ee3e159ec9884f95b431287edde4", + "reference": "42c4c2eec485ee3e159ec9884f95b431287edde4", "shasum": "" }, "require": { @@ -7640,12 +7774,13 @@ "sebastian/recursion-context": "~1.0" }, "require-dev": { + "ext-mbstring": "*", "phpunit/phpunit": "~4.4" }, "type": "library", "extra": { "branch-alias": { - "dev-master": "1.2.x-dev" + "dev-master": "1.3.x-dev" } }, "autoload": { @@ -7685,7 +7820,7 @@ "export", "exporter" ], - "time": "2015-06-21 07:55:53" + "time": "2016-06-17 09:04:28" }, { "name": "sebastian/global-state", @@ -7738,6 +7873,52 @@ ], "time": "2015-10-12 03:26:01" }, + { + "name": "sebastian/object-enumerator", + "version": "1.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/object-enumerator.git", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/object-enumerator/zipball/d4ca2fb70344987502567bc50081c03e6192fb26", + "reference": "d4ca2fb70344987502567bc50081c03e6192fb26", + "shasum": "" + }, + "require": { + "php": ">=5.6", + "sebastian/recursion-context": "~1.0" + }, + "require-dev": { + "phpunit/phpunit": "~5" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Traverses array structures and object graphs to enumerate all referenced objects", + "homepage": "https://github.com/sebastianbergmann/object-enumerator/", + "time": "2016-01-28 13:25:10" + }, { "name": "sebastian/recursion-context", "version": "1.0.2", @@ -7792,20 +7973,70 @@ "time": "2015-11-11 19:50:13" }, { - "name": "sebastian/version", - "version": "1.0.6", + "name": "sebastian/resource-operations", + "version": "1.0.0", "source": { "type": "git", - "url": "https://github.com/sebastianbergmann/version.git", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6" + "url": "https://github.com/sebastianbergmann/resource-operations.git", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52" }, "dist": { "type": "zip", - "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", - "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6", + "url": "https://api.github.com/repos/sebastianbergmann/resource-operations/zipball/ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", + "reference": "ce990bb21759f94aeafd30209e8cfcdfa8bc3f52", "shasum": "" }, + "require": { + "php": ">=5.6.0" + }, "type": "library", + "extra": { + "branch-alias": { + "dev-master": "1.0.x-dev" + } + }, + "autoload": { + "classmap": [ + "src/" + ] + }, + "notification-url": "https://packagist.org/downloads/", + "license": [ + "BSD-3-Clause" + ], + "authors": [ + { + "name": "Sebastian Bergmann", + "email": "sebastian@phpunit.de" + } + ], + "description": "Provides a list of PHP built-in functions that operate on resources", + "homepage": "https://www.github.com/sebastianbergmann/resource-operations", + "time": "2015-07-28 20:34:47" + }, + { + "name": "sebastian/version", + "version": "2.0.0", + "source": { + "type": "git", + "url": "https://github.com/sebastianbergmann/version.git", + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5" + }, + "dist": { + "type": "zip", + "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "reference": "c829badbd8fdf16a0bad8aa7fa7971c029f1b9c5", + "shasum": "" + }, + "require": { + "php": ">=5.6" + }, + "type": "library", + "extra": { + "branch-alias": { + "dev-master": "2.0.x-dev" + } + }, "autoload": { "classmap": [ "src/" @@ -7824,7 +8055,7 @@ ], "description": "Library that helps with managing the version number of Git-hosted PHP projects", "homepage": "https://github.com/sebastianbergmann/version", - "time": "2015-06-21 13:59:46" + "time": "2016-02-04 12:56:52" } ], "aliases": [ diff --git a/config/configuration.sample.yml b/config/configuration.sample.yml index f8498c8107..abbd5ca265 100644 --- a/config/configuration.sample.yml +++ b/config/configuration.sample.yml @@ -7,6 +7,7 @@ main: languages: [] key: '' api_require_ssl: true + api_disabled: true database: host: 127.0.0.1 port: 3306 @@ -191,6 +192,7 @@ api_cors: expose_headers: [] max_age: 0 hosts: [] +api_cors_paths: [] session: idle: 0 lifetime: 604800 # 1 week diff --git a/lib/Alchemy/Phrasea/Collection/CollectionService.php b/lib/Alchemy/Phrasea/Collection/CollectionService.php index de9d04c8e9..238aad9b47 100644 --- a/lib/Alchemy/Phrasea/Collection/CollectionService.php +++ b/lib/Alchemy/Phrasea/Collection/CollectionService.php @@ -11,9 +11,12 @@ namespace Alchemy\Phrasea\Collection; use Alchemy\Phrasea\Application; +use Alchemy\Phrasea\Authentication\ACLProvider; use Alchemy\Phrasea\Collection\Reference\CollectionReference; use Alchemy\Phrasea\Databox\DataboxConnectionProvider; +use Alchemy\Phrasea\Exception\RuntimeException; use Alchemy\Phrasea\Model\Entities\User; +use Alchemy\Phrasea\Model\Repositories\UserRepository; use Doctrine\DBAL\Connection; class CollectionService @@ -23,15 +26,31 @@ class CollectionService */ private $app; + /** + * @var Connection + */ private $connection; + /** + * @var DataboxConnectionProvider + */ private $connectionProvider; - public function __construct(Application $application, Connection $connection, DataboxConnectionProvider $connectionProvider) - { + /** + * @var callable + */ + private $userQueryFactory; + + public function __construct( + Application $application, + Connection $connection, + DataboxConnectionProvider $connectionProvider, + callable $userQueryFactory + ) { $this->app = $application; $this->connection = $connection; $this->connectionProvider = $connectionProvider; + $this->userQueryFactory = $userQueryFactory; } /** @@ -270,4 +289,53 @@ class CollectionService $this->app->getAclForUser($user)->update_rights_to_base($reference->getBaseId(), $rights); } + + public function setOrderMasters(CollectionReference $reference, array $userIds) + { + + /** @var UserRepository $userRepository */ + $userRepository = $this->app['repo.users']; + $users = $userRepository->findBy(['id' => $userIds]); + + $missingAdmins = array_diff($userIds, array_map(function (User $user) { + return $user->getId(); + }, $users)); + + if (! empty($missingAdmins)) { + throw new RuntimeException(sprintf('Invalid usrIds provided [%s].', implode(',', $missingAdmins))); + } + + $admins = $users; + + /** @var Connection $conn */ + $conn = $this->app->getApplicationBox()->get_connection(); + $conn->beginTransaction(); + + try { + $factory = $this->userQueryFactory; + /** @var \User_Query $userQuery */ + $userQuery = $factory(); + + $result = $userQuery->on_base_ids([ $reference->getBaseId()] ) + ->who_have_right(['order_master']) + ->execute()->get_results(); + + /** @var ACLProvider $acl */ + $acl = $this->app['acl']; + + foreach ($result as $user) { + $acl->get($user)->update_rights_to_base($reference->getBaseId(), ['order_master' => false]); + } + + foreach ($admins as $admin) { + $acl->get($admin)->update_rights_to_base($reference->getBaseId(), ['order_master' => true]); + } + + $conn->commit(); + } catch (\Exception $e) { + $conn->rollBack(); + throw $e; + } + + } } diff --git a/lib/Alchemy/Phrasea/Command/Setup/ConfigurationEditor.php b/lib/Alchemy/Phrasea/Command/Setup/ConfigurationEditor.php new file mode 100644 index 0000000000..c534a51be9 --- /dev/null +++ b/lib/Alchemy/Phrasea/Command/Setup/ConfigurationEditor.php @@ -0,0 +1,178 @@ +addArgument( + 'operation', + InputArgument::REQUIRED, + 'The operation to execute (get, set, or add)' + ); + + $this->addArgument( + 'parameter', + InputArgument::REQUIRED, + 'The name of the configuration parameter to get or set' + ); + + $this->addArgument( + 'value', + InputArgument::OPTIONAL, + 'The value to set when operation is "set" or "add", in YAML syntax' + ); + } + + protected function doExecute(InputInterface $input, OutputInterface $output) + { + $command = $input->getArgument('operation'); + $parameter = $input->getArgument('parameter'); + + $parameterNodes = explode('.', $parameter); + + if ($command == 'get') { + $this->readConfigurationValue($output, $parameter, $parameterNodes); + } + elseif ($command == 'set') { + $this->writeConfigurationValue($output, $parameter, $parameterNodes, $input->getArgument('value')); + } + elseif ($command == 'add') { + $this->appendConfigurationValue($output, $parameter, $parameterNodes, $input->getArgument('value')); + } + } + + private function readConfigurationValue(OutputInterface $output, $parameter, array $parameterNodes) + { + $app = $this->getContainer(); + /** @var Configuration $config */ + $config = $app['configuration.store']; + $values = $config->getConfig(); + $current = $values; + + foreach ($parameterNodes as $paramName) { + $current = $current[$paramName]; + } + + $output->writeln('Getting configuration entry ' . $parameter); + + $this->printConfigurationValue($output, $parameter, $current); + } + + private function writeConfigurationValue(OutputInterface $output, $parameter, array $parameterNodes, $value) + { + $app = $this->getContainer(); + /** @var Configuration $configurationStore */ + $configurationStore = $app['configuration.store']; + $lastParameter = end($parameterNodes); + + $configurationRoot = $configurationStore->getConfig(); + $configurationCurrent = & $configurationRoot; + + $output->writeln('Writing value to configuration entry ' . $parameter); + + foreach ($parameterNodes as $paramName) { + if (! isset($configurationCurrent[$paramName])) { + $configurationCurrent[$paramName] = array(); + } + + if ($lastParameter == $paramName) { + $configurationCurrent[$paramName] = Yaml::parse($value); + } + else { + $configurationCurrent = & $configurationCurrent[$paramName]; + } + } + + $configurationStore->setConfig($configurationRoot); + $configurationStore->compileAndWrite(); + + $output->writeln('Reading updated configuration value'); + + $this->readConfigurationValue($output, $parameter, $parameterNodes); + } + + private function appendConfigurationValue(OutputInterface $output, $parameter, array $parameterNodes, $value) + { + $app = $this->getContainer(); + /** @var Configuration $configurationStore */ + $configurationStore = $app['configuration.store']; + $lastParameter = end($parameterNodes); + + $configurationRoot = $configurationStore->getConfig(); + $configurationCurrent = & $configurationRoot; + + $output->writeln('Appending value to configuration entry ' . $parameter); + + foreach ($parameterNodes as $paramName) { + if (! isset($configurationCurrent[$paramName])) { + $configurationCurrent[$paramName] = array(); + } + + if ($lastParameter == $paramName) { + if (! is_array($configurationCurrent[$paramName])) { + $configurationCurrent[$paramName] = array($configurationCurrent[$paramName]); + } + + $parsedValue = Yaml::parse($value); + + if (! is_array($parsedValue)) { + $parsedValue = [ $parsedValue ]; + } + + $configurationCurrent[$paramName] = array_merge($configurationCurrent[$paramName], $parsedValue); + $configurationCurrent[$paramName] = array_unique($configurationCurrent[$paramName]); + } + else { + $configurationCurrent = & $configurationCurrent[$paramName]; + } + } + + $configurationStore->setConfig($configurationRoot); + $configurationStore->compileAndWrite(); + + $output->writeln('Reading updated configuration value'); + + $this->readConfigurationValue($output, $parameter, $parameterNodes); + } + + private function printConfigurationValue(OutputInterface $output, $name, $value, $indent = 0) + { + if ($indent > 0) { + $output->write(PHP_EOL); + } + + $output->write(str_repeat(' ', $indent * 4) . (is_numeric($name) ? '- ' : $name . ': ')); + + if (is_array($value)) { + if (empty($value)) { + $output->write('[]'); + } + + foreach ($value as $valueName => $valueItem) { + $this->printConfigurationValue($output, $valueName, $valueItem, $indent + 1); + } + } + else { + $output->write(var_export($value)); + } + + if ($indent == 0) { + $output->write(PHP_EOL); + } + } +} diff --git a/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php b/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php index ac082bb3ca..2ebe77a408 100644 --- a/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php +++ b/lib/Alchemy/Phrasea/Controller/Admin/CollectionController.php @@ -10,13 +10,10 @@ namespace Alchemy\Phrasea\Controller\Admin; +use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application\Helper\UserQueryAware; -use Alchemy\Phrasea\Authentication\ACLProvider; +use Alchemy\Phrasea\Collection\CollectionService; use Alchemy\Phrasea\Controller\Controller; -use Alchemy\Phrasea\Exception\RuntimeException; -use Alchemy\Phrasea\Model\Entities\User; -use Alchemy\Phrasea\Model\Repositories\UserRepository; -use Doctrine\DBAL\Connection; use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Response; @@ -24,6 +21,18 @@ class CollectionController extends Controller { use UserQueryAware; + /** + * @var CollectionService + */ + private $collectionService; + + public function __construct(Application $application, CollectionService $collectionService) + { + parent::__construct($application); + + $this->collectionService = $collectionService; + } + /** * Display collection information page * @@ -79,52 +88,23 @@ class CollectionController extends Controller */ public function setOrderAdmins(Request $request, $bas_id) { - $admins = array_values($request->request->get('admins', [])); + $admins = array_filter( + array_values($request->request->get('admins', [])), + function ($value) { return $value != false; } + ); - if (count($admins) === 0) { + if (false && count($admins) === 0) { $this->app->abort(400, 'No admins provided.'); } + if (!is_array($admins)) { $this->app->abort(400, 'Admins must be an array.'); } - /** @var UserRepository $userRepository */ - $userRepository = $this->app['repo.users']; - $users = $userRepository->findBy(['id' => $admins]); - $userIds = array_map(function (User $user) { - return $user->getId(); - }, $users); - $missingAdmins = array_diff($admins, $userIds); - if (!empty($missingAdmins)) { - throw new RuntimeException(sprintf('Invalid usrId %s provided.', reset($missingAdmins))); - } - $admins = $users; + $collection = $this->getApplicationBox()->get_collection($bas_id); + $collectionReference = $collection->getReference(); - /** @var Connection $conn */ - $conn = $this->app->getApplicationBox()->get_connection(); - $conn->beginTransaction(); - - try { - $userQuery = $this->createUserQuery(); - - $result = $userQuery->on_base_ids([$bas_id]) - ->who_have_right(['order_master']) - ->execute()->get_results(); - - /** @var ACLProvider $acl */ - $acl = $this->app['acl']; - foreach ($result as $user) { - $acl->get($user)->update_rights_to_base($bas_id, ['order_master' => false]); - } - - foreach ($admins as $admin) { - $acl->get($admin)->update_rights_to_base($bas_id, ['order_master' => true]); - } - $conn->commit(); - } catch (\Exception $e) { - $conn->rollBack(); - throw $e; - } + $this->collectionService->setOrderMasters($collectionReference, $admins); return $this->app->redirectPath('admin_display_collection', [ 'bas_id' => $bas_id, diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php index 981d26fe6c..feaa236e5d 100644 --- a/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php +++ b/lib/Alchemy/Phrasea/Controller/Api/V1Controller.php @@ -484,6 +484,16 @@ class V1Controller extends Controller private function listCollection(\collection $collection) { + $userQuery = new \User_Query($this->app); + $orderMasters = $userQuery->on_base_ids([ $collection->get_base_id() ] ) + ->who_have_right(['order_master']) + ->execute() + ->get_results() + ->map(function (User $user) { + return $user->getEmail(); + }) + ->toArray(); + return [ 'base_id' => $collection->get_base_id(), 'databox_id' => $collection->get_sbas_id(), @@ -496,6 +506,7 @@ class V1Controller extends Controller 'nl' => $collection->get_label('nl'), ], 'record_amount' => $collection->get_record_amount(), + 'order_managers' => $orderMasters ]; } @@ -1103,6 +1114,7 @@ class V1Controller extends Controller 'results.stories' => $storyTransformer, 'results.stories.thumbnail' => $subdefTransformer, 'results.stories.metadatas' => new CallbackTransformer(), + 'results.stories.caption' => new CallbackTransformer(), 'results.stories.records' => $recordTransformer, 'results.stories.records.thumbnail' => $subdefTransformer, 'results.stories.records.technical_informations' => $technicalDataTransformer, @@ -1118,6 +1130,7 @@ class V1Controller extends Controller 'results.records.status' => new CallbackTransformer(), 'results.records.caption' => new CallbackTransformer(), ]); + $includeResolver = new IncludeResolver($transformerResolver); $fractal = new \League\Fractal\Manager(); @@ -1244,7 +1257,8 @@ class V1Controller extends Controller } } - if (in_array('results.stories.metadatas', $includes, true)) { + if (in_array('results.stories.metadatas', $includes, true) || + in_array('results.stories.caption', $includes, true)) { $captions = $this->app['service.caption']->findByReferenceCollection($stories); $canSeeBusiness = $this->retrieveSeeBusinessPerDatabox($stories); @@ -1407,20 +1421,32 @@ class V1Controller extends Controller */ private function resolveSearchIncludes(Request $request) { + $includes = [ + 'results.stories.records' + ]; + if ($request->attributes->get('_extended', false)) { - return [ - 'results.stories.records.subdefs', - 'results.stories.records.metadata', - 'results.stories.records.caption', - 'results.stories.records.status', + if ($request->get('search_type') != SearchEngineOptions::RECORD_STORY) { + $includes = array_merge($includes, [ + 'results.stories.records.subdefs', + 'results.stories.records.metadata', + 'results.stories.records.caption', + 'results.stories.records.status' + ]); + } + else { + $includes = [ 'results.stories.caption' ]; + } + + $includes = array_merge($includes, [ 'results.records.subdefs', 'results.records.metadata', 'results.records.caption', - 'results.records.status', - ]; + 'results.records.status' + ]); } - return []; + return $includes; } /** @@ -1436,7 +1462,7 @@ class V1Controller extends Controller 'results.subdefs', 'results.metadata', 'results.caption', - 'results.status', + 'results.status' ]; } diff --git a/lib/Alchemy/Phrasea/Controller/Controller.php b/lib/Alchemy/Phrasea/Controller/Controller.php index 6b11fe6ab0..4f477ff8de 100644 --- a/lib/Alchemy/Phrasea/Controller/Controller.php +++ b/lib/Alchemy/Phrasea/Controller/Controller.php @@ -26,8 +26,7 @@ class Controller { $this->app = $app; } - - + /** * @return \appbox */ diff --git a/lib/Alchemy/Phrasea/Controller/LazyLocator.php b/lib/Alchemy/Phrasea/Controller/LazyLocator.php index 39dbb8db05..92a96f9cb7 100644 --- a/lib/Alchemy/Phrasea/Controller/LazyLocator.php +++ b/lib/Alchemy/Phrasea/Controller/LazyLocator.php @@ -9,24 +9,12 @@ */ namespace Alchemy\Phrasea\Controller; -class LazyLocator +/** + * Class LazyLocator + * @package Alchemy\Phrasea\Controller + * @deprecated Use Alchemy\Phrasea\Core\LazyLocator + */ +class LazyLocator extends \Alchemy\Phrasea\Core\LazyLocator { - /** @var \Pimple */ - private $pimple; - private $serviceId; - - /** - * @param \Pimple $pimple - * @param string $serviceId - */ - public function __construct(\Pimple $pimple, $serviceId) - { - $this->pimple = $pimple; - $this->serviceId = $serviceId; - } - - public function __invoke() - { - return $this->pimple->offsetGet($this->serviceId); - } + // Stub left for BC } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/DoDownloadController.php b/lib/Alchemy/Phrasea/Controller/Prod/DoDownloadController.php index 6ec9823ac6..66a14d57fc 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/DoDownloadController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/DoDownloadController.php @@ -42,6 +42,7 @@ class DoDownloadController extends Controller if (false === $list = @unserialize($token->getData())) { $this->app->abort(500, 'Invalid datas'); } + if (!is_array($list)) { $this->app->abort(500, 'Invalid datas'); } diff --git a/lib/Alchemy/Phrasea/Controller/Prod/EditController.php b/lib/Alchemy/Phrasea/Controller/Prod/EditController.php index bbf86e7213..4d2ce9a6fd 100644 --- a/lib/Alchemy/Phrasea/Controller/Prod/EditController.php +++ b/lib/Alchemy/Phrasea/Controller/Prod/EditController.php @@ -14,6 +14,8 @@ use Alchemy\Phrasea\Application\Helper\DispatcherAware; use Alchemy\Phrasea\Application\Helper\SubDefinitionSubstituerAware; use Alchemy\Phrasea\Controller\Controller; use Alchemy\Phrasea\Controller\RecordsRequest; +use Alchemy\Phrasea\Core\Event\Record\RecordEvents; +use Alchemy\Phrasea\Core\Event\Record\StoryCoverChangedEvent; use Alchemy\Phrasea\Core\Event\RecordEdit; use Alchemy\Phrasea\Core\PhraseaEvents; use Alchemy\Phrasea\Model\Entities\Preset; @@ -295,6 +297,7 @@ class EditController extends Controller $newsubdef_reg = new \record_adapter($this->app, $reg_record->getDataboxId(), $request->request->get('newrepresent')); + $subdefChanged = false; foreach ($newsubdef_reg->get_subdefs() as $name => $value) { if (!in_array($name, ['thumbnail', 'preview'])) { continue; @@ -304,14 +307,18 @@ class EditController extends Controller } $media = $this->app->getMediaFromUri($value->getRealPath()); - $this->getSubDefinitionSubstituer()->substitute($reg_record, $name, $media); - $this->getDispatcher()->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($reg_record)); + $this->getSubDefinitionSubstituer()->substituteSubdef($reg_record, $name, $media); $this->getDataboxLogger($reg_record->getDatabox())->log( $reg_record, \Session_Logger::EVENT_SUBSTITUTE, - $name == 'document' ? 'HD' : $name, + $name, '' ); + $subdefChanged = true; + } + if($subdefChanged) { + $this->dispatch(RecordEvents::STORY_COVER_CHANGED, new StoryCoverChangedEvent($reg_record, $newsubdef_reg)); + $this->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($reg_record)); } } catch (\Exception $e) { @@ -348,7 +355,7 @@ class EditController extends Controller if (isset($rec['metadatas']) && is_array($rec['metadatas'])) { $record->set_metadatas($rec['metadatas']); - $this->getDispatcher()->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($record)); + $this->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($record)); } $newstat = $record->getStatus(); diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php index 44440fa26a..a278a516d7 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusController.php @@ -1834,7 +1834,7 @@ class ThesaurusController extends Controller $this->renumerate($newte, $ct->getAttribute("id") . "." . $teid, $chgids); - $databox->saveThesaurus($domth); + $databox->saveCterms($domct); $this->dispatch( ThesaurusEvents::CONCEPT_TRASHED, @@ -1843,7 +1843,7 @@ class ThesaurusController extends Controller $thnode_parent->removeChild($thnode); - $databox->saveCterms($domct); + $databox->saveThesaurus($domth); $r = $refresh_list->appendChild($ret->createElement("refresh")); $r->setAttribute("id", $pid); diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php index cee17da338..2500a7dc23 100644 --- a/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php +++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/ThesaurusXmlHttpController.php @@ -1463,7 +1463,12 @@ class ThesaurusXmlHttpController extends Controller public function searchTermJson(Request $request) { - $lng = $request->get('lng'); + if (null === $lng = $request->get('lng')) { + $data = explode('_', $this->app['locale']); + if (count($data) > 0) { + $lng = $data[0]; + } + } $html = ''; $sbid = (int) $request->get('sbid'); @@ -1507,9 +1512,8 @@ class ThesaurusXmlHttpController extends Controller if ($t[1]) { $q2 .= ' and starts-with(@k, \'' . \thesaurus::xquery_escape($unicode->remove_indexer_chars($t[1])) . '\')'; } - if($lng !== null) { - $q2 .= ' and @lng=\'' . \thesaurus::xquery_escape($lng) . '\''; - } + + $q2 .= ' and @lng=\'' . \thesaurus::xquery_escape($lng) . '\''; $q .= ('//sy[' . $q2 . ']'); $nodes = $xpath->query($q); @@ -1661,4 +1665,4 @@ class ThesaurusXmlHttpController extends Controller { return $this->app['unicode']; } -} \ No newline at end of file +} diff --git a/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php b/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php index b58be0f9d6..915f1cd0d3 100644 --- a/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php +++ b/lib/Alchemy/Phrasea/ControllerProvider/Admin/Collection.php @@ -27,7 +27,7 @@ class Collection implements ControllerProviderInterface, ServiceProviderInterfac public function register(Application $app) { $app['controller.admin.collection'] = $app->share(function (PhraseaApplication $app) { - return (new CollectionController($app)) + return (new CollectionController($app, $app->getApplicationBox()->getCollectionService())) ->setUserQueryFactory(new LazyLocator($app, 'phraseanet.user-query')) ; }); diff --git a/lib/Alchemy/Phrasea/Core/Database/DatabaseMaintenanceService.php b/lib/Alchemy/Phrasea/Core/Database/DatabaseMaintenanceService.php index 998c5a10e2..1dd1430876 100644 --- a/lib/Alchemy/Phrasea/Core/Database/DatabaseMaintenanceService.php +++ b/lib/Alchemy/Phrasea/Core/Database/DatabaseMaintenanceService.php @@ -85,7 +85,7 @@ class DatabaseMaintenanceService $ref_engine = strtolower($foundTable['Engine']); if ($engine != $ref_engine && in_array($engine, ['innodb', 'myisam'])) { - $recommends = $this->alterTableEngine($tableName, $engine, $recommends); + $this->alterTableEngine($tableName, $engine, $recommends); } $ret = $this->upgradeTable($allTables[$tableName]); diff --git a/lib/Alchemy/Phrasea/Core/Event/Record/RecordEvents.php b/lib/Alchemy/Phrasea/Core/Event/Record/RecordEvents.php index 47db7da5be..c55245a7ff 100644 --- a/lib/Alchemy/Phrasea/Core/Event/Record/RecordEvents.php +++ b/lib/Alchemy/Phrasea/Core/Event/Record/RecordEvents.php @@ -30,4 +30,6 @@ final class RecordEvents const SUB_DEFINITION_CREATION_FAILED = 'record.sub_definition_creation_failed'; const MEDIA_SUBSTITUTED = 'record.media_substituted'; + + const STORY_COVER_CHANGED = 'record.story_cover_changed'; } diff --git a/lib/Alchemy/Phrasea/Core/Event/Record/StoryCoverChangedEvent.php b/lib/Alchemy/Phrasea/Core/Event/Record/StoryCoverChangedEvent.php new file mode 100644 index 0000000000..2f2c60bceb --- /dev/null +++ b/lib/Alchemy/Phrasea/Core/Event/Record/StoryCoverChangedEvent.php @@ -0,0 +1,45 @@ +story_record = $story_record; + $this->cover_record = $cover_record; + } + + /** + * @return record_adapter + */ + public function getStoryRecord() + { + return $this->story_record; + } + + /** + * @return record_adapter + */ + public function getCoverRecord() + { + return $this->cover_record; + } +} diff --git a/lib/Alchemy/Phrasea/Core/LazyLocator.php b/lib/Alchemy/Phrasea/Core/LazyLocator.php new file mode 100644 index 0000000000..ba274da753 --- /dev/null +++ b/lib/Alchemy/Phrasea/Core/LazyLocator.php @@ -0,0 +1,41 @@ +pimple = $pimple; + $this->serviceId = $serviceId; + } + + /** + * @return mixed + */ + public function __invoke() + { + return $this->pimple->offsetGet($this->serviceId); + } +} diff --git a/lib/Alchemy/Phrasea/Core/MetaProvider/HttpStackMetaProvider.php b/lib/Alchemy/Phrasea/Core/MetaProvider/HttpStackMetaProvider.php index b3a308fc18..8c2a42f4eb 100644 --- a/lib/Alchemy/Phrasea/Core/MetaProvider/HttpStackMetaProvider.php +++ b/lib/Alchemy/Phrasea/Core/MetaProvider/HttpStackMetaProvider.php @@ -91,6 +91,12 @@ class HttpStackMetaProvider implements ServiceProviderInterface unset($config['enabled']); $paths['/api/v\d+/'] = $config; + $paths['/download/'] = $config; + } + if (isset($app['phraseanet.configuration']['api_cors_paths'])) { + foreach ($app['phraseanet.configuration']['api_cors_paths'] as $path) { + $paths[$path] = $config; + } } } diff --git a/lib/Alchemy/Phrasea/Fractal/IncludeResolver.php b/lib/Alchemy/Phrasea/Fractal/IncludeResolver.php index df76ac97a3..c8c6a62adb 100644 --- a/lib/Alchemy/Phrasea/Fractal/IncludeResolver.php +++ b/lib/Alchemy/Phrasea/Fractal/IncludeResolver.php @@ -54,7 +54,6 @@ class IncludeResolver private function figureOutWhichIncludes(ResourceTransformerAccessibleScope $scope) { $transformer = $scope->getResourceTransformer(); - $includes = $transformer->getDefaultIncludes(); foreach ($transformer->getAvailableIncludes() as $include) { diff --git a/lib/Alchemy/Phrasea/Model/Repositories/TokenRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/TokenRepository.php index 57ebf952da..ad45425f7c 100644 --- a/lib/Alchemy/Phrasea/Model/Repositories/TokenRepository.php +++ b/lib/Alchemy/Phrasea/Model/Repositories/TokenRepository.php @@ -28,9 +28,10 @@ class TokenRepository extends EntityRepository WHERE t.type = :type AND t.user = :user AND t.data = :basket_id - AND (t.expiration > CURRENT_TIMESTAMP() OR t.expiration IS NULL)'; + AND (t.expiration > CURRENT_TIMESTAMP() OR t.expiration IS NULL) ORDER BY t.created DESC'; $query = $this->_em->createQuery($dql); + $query->setMaxResults(1); $query->setParameters([ ':type' => TokenManipulator::TYPE_VALIDATE, ':user' => $user, @@ -49,9 +50,10 @@ class TokenRepository extends EntityRepository { $dql = 'SELECT t FROM Phraseanet:Token t WHERE t.value = :value - AND (t.expiration IS NULL OR t.expiration >= CURRENT_TIMESTAMP())'; + AND (t.expiration IS NULL OR t.expiration >= CURRENT_TIMESTAMP()) ORDER BY t.created DESC'; $query = $this->_em->createQuery($dql); + $query->setMaxResults(1); $query->setParameters([':value' => $value]); return $query->getOneOrNullResult(); diff --git a/lib/Alchemy/Phrasea/Search/RecordTransformer.php b/lib/Alchemy/Phrasea/Search/RecordTransformer.php index 9fdb3a9847..9d995eedea 100644 --- a/lib/Alchemy/Phrasea/Search/RecordTransformer.php +++ b/lib/Alchemy/Phrasea/Search/RecordTransformer.php @@ -15,6 +15,7 @@ use League\Fractal\TransformerAbstract; class RecordTransformer extends TransformerAbstract { protected $availableIncludes = ['thumbnail', 'technical_informations', 'subdefs', 'metadata', 'status', 'caption']; + protected $defaultIncludes = ['thumbnail', 'technical_informations']; /** diff --git a/lib/Alchemy/Phrasea/Search/StoryTransformer.php b/lib/Alchemy/Phrasea/Search/StoryTransformer.php index df73f5580d..34a741e271 100644 --- a/lib/Alchemy/Phrasea/Search/StoryTransformer.php +++ b/lib/Alchemy/Phrasea/Search/StoryTransformer.php @@ -15,8 +15,15 @@ use League\Fractal\TransformerAbstract; class StoryTransformer extends TransformerAbstract { - protected $availableIncludes = ['thumbnail', 'metadatas', 'records']; - protected $defaultIncludes = ['thumbnail', 'metadatas', 'records']; + /** + * @var array + */ + protected $availableIncludes = ['thumbnail', 'metadatas', 'records', 'caption']; + + /** + * @var array + */ + protected $defaultIncludes = ['thumbnail', 'metadatas']; /** * @var SubdefTransformer @@ -51,6 +58,7 @@ class StoryTransformer extends TransformerAbstract 'collection_id' => $story->getCollectionId(), 'base_id' => $story->getBaseId(), 'uuid' => $story->getUuid(), + 'record_count' => count($storyView->getChildren()) ]; } @@ -61,7 +69,7 @@ class StoryTransformer extends TransformerAbstract public function includeMetadatas(StoryView $storyView) { - return $this->item($storyView->getCaption(), $this->getCaptionTransformer()); + return $this->item($storyView->getCaption(), $this->getCaptionDCFieldTransformer()); } public function includeRecords(StoryView $storyView) @@ -69,10 +77,29 @@ class StoryTransformer extends TransformerAbstract return $this->collection($storyView->getChildren(), $this->recordTransformer); } + public function includeCaption(StoryView $storyView) + { + return $this->collection($storyView->getCaption()->getFields(), $this->getCaptionFieldTransformer()); + } + /** * @return \Closure */ - private function getCaptionTransformer() + private function getCaptionFieldTransformer() + { + return function (\caption_field $captionField) { + return [ + 'meta_structure_id' => $captionField->get_meta_struct_id(), + 'name' => $captionField->get_name(), + 'value' => $captionField->get_serialized_values(';') + ]; + }; + } + + /** + * @return \Closure + */ + private function getCaptionDCFieldTransformer() { /** * @param \caption_field[] $fields diff --git a/lib/Alchemy/Phrasea/Search/StoryView.php b/lib/Alchemy/Phrasea/Search/StoryView.php index 30aebafce3..7ee976e183 100644 --- a/lib/Alchemy/Phrasea/Search/StoryView.php +++ b/lib/Alchemy/Phrasea/Search/StoryView.php @@ -31,7 +31,6 @@ class StoryView */ public function __construct(\record_adapter $story) { - $this->story = $story; } diff --git a/lib/Alchemy/Phrasea/Search/V1SearchCompositeResultTransformer.php b/lib/Alchemy/Phrasea/Search/V1SearchCompositeResultTransformer.php index f8b46894df..4023f769dc 100644 --- a/lib/Alchemy/Phrasea/Search/V1SearchCompositeResultTransformer.php +++ b/lib/Alchemy/Phrasea/Search/V1SearchCompositeResultTransformer.php @@ -14,13 +14,21 @@ use League\Fractal\TransformerAbstract; class V1SearchCompositeResultTransformer extends TransformerAbstract { + /** + * @var string[] + */ protected $availableIncludes = ['stories', 'records']; + + /** + * @var string[] + */ protected $defaultIncludes = ['stories', 'records']; /** * @var RecordTransformer */ private $recordTransformer; + /** * @var StoryTransformer */ diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php index eefd8bcd72..eae2a6b225 100644 --- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php +++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php @@ -24,6 +24,7 @@ class SearchEngineOptions { const RECORD_RECORD = 0; const RECORD_GROUPING = 1; + const RECORD_STORY = 2; const TYPE_IMAGE = 'image'; const TYPE_VIDEO = 'video'; const TYPE_AUDIO = 'audio'; @@ -296,6 +297,7 @@ class SearchEngineOptions $this->search_type = self::RECORD_RECORD; break; case self::RECORD_GROUPING: + case self::RECORD_STORY: $this->search_type = self::RECORD_GROUPING; break; } diff --git a/lib/classes/appbox.php b/lib/classes/appbox.php index 6309532b82..c45d21fda3 100644 --- a/lib/classes/appbox.php +++ b/lib/classes/appbox.php @@ -13,6 +13,7 @@ use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Collection\CollectionService; use Alchemy\Phrasea\Core\Configuration\AccessRestriction; use Alchemy\Phrasea\Core\Connection\ConnectionSettings; +use Alchemy\Phrasea\Core\LazyLocator; use Alchemy\Phrasea\Core\Version\AppboxVersionRepository; use Alchemy\Phrasea\Databox\DataboxConnectionProvider; use Alchemy\Phrasea\Databox\DataboxRepository; @@ -325,7 +326,8 @@ class appbox extends base $this->collectionService = new CollectionService( $this->app, $this->connection, - new DataboxConnectionProvider($this) + new DataboxConnectionProvider($this), + new LazyLocator($this->app, 'phraseanet.user-query') ); } diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php index 4f9199826f..a34f51b911 100644 --- a/lib/classes/record/adapter.php +++ b/lib/classes/record/adapter.php @@ -1310,6 +1310,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface while ($row = $stmt->fetch(\PDO::FETCH_ASSOC)) { @unlink(\p4string::addEndSlash($row['path']) . 'stamp_' . $row['file']); } + $stmt->closeCursor(); return $this; diff --git a/lib/classes/set/export.php b/lib/classes/set/export.php index 739c5ab5b7..e76db89ac9 100644 --- a/lib/classes/set/export.php +++ b/lib/classes/set/export.php @@ -399,16 +399,11 @@ SQL; throw new Exception('No subdefs given'); } - $includeBusinessFields = !!$includeBusinessFields; - + $includeBusinessFields = (bool) $includeBusinessFields; $files = []; - $n_files = 0; - $file_names = []; - $size = 0; - $unicode = new \unicode(); /** @var record_exportElement $download_element */ @@ -433,7 +428,7 @@ SQL; $files[$id]['original_name'] = $files[$id]['export_name'] = - $download_element->get_original_name(true); + $download_element->get_original_name(false); $files[$id]['original_name'] = trim($files[$id]['original_name']) != '' ? @@ -441,16 +436,20 @@ SQL; $infos = pathinfo($files[$id]['original_name']); - $extension = isset($infos['extension']) ? $infos['extension'] : ''; + $extension = isset($infos['extension']) ? $infos['extension'] : + substr($files[$id]['original_name'], 0 - strrpos($files[$id]['original_name'], '.')); if ($rename_title) { $title = strip_tags($download_element->get_title(null, null, true)); - $files[$id]['export_name'] = $unicode->remove_nonazAZ09($title, true, true, true); } else { $files[$id]["export_name"] = $infos['filename']; } + if (substr(strrev($files[$id]['export_name']), 0, strlen($extension)) != strrev($extension)) { + $files[$id]['export_name'] .= '.' . $extension; + } + $sizeMaxAjout = 0; $sizeMaxExt = 0; @@ -713,7 +712,7 @@ SQL; $name = $obj["folder"] . $record["export_name"] . $obj["ajout"] - . '.' . $obj["exportExt"]; + . (isset($obj["exportExt"]) && trim($obj["exportExt"]) != '' ? '.' . $obj["exportExt"] : ''); $archiveFiles[$app['unicode']->remove_diacritics($name)] = $path; if ($o == 'caption') { diff --git a/lib/conf.d/configuration.yml b/lib/conf.d/configuration.yml index 4c49e6ded6..ce07ab3d18 100644 --- a/lib/conf.d/configuration.yml +++ b/lib/conf.d/configuration.yml @@ -6,6 +6,7 @@ main: maintenance: false key: '' api_require_ssl: true + api_disabled: true database: host: 'sql-host' port: 3306 diff --git a/resources/ansible/roles/app/tasks/main.yml b/resources/ansible/roles/app/tasks/main.yml index ea161da69f..9c0d497bd6 100644 --- a/resources/ansible/roles/app/tasks/main.yml +++ b/resources/ansible/roles/app/tasks/main.yml @@ -5,7 +5,7 @@ become_user: vagrant shell: export NVM_DIR="$HOME/.nvm" &&. "$NVM_DIR/nvm.sh" && npm install -g bower recess -- name: Initialize application dependencies +- name: Install Composer dependencies shell: make install_composer become: yes become_user: vagrant @@ -13,7 +13,15 @@ args: chdir: /vagrant/ -- name: Initialize and build application assets +- name: Install assets dependencies + shell: export NVM_DIR="$HOME/.nvm" &&. "$NVM_DIR/nvm.sh" && make install_asset_dependencies + become: yes + become_user: vagrant + ignore_errors: yes + args: + chdir: /vagrant/ + +- name: Install assets shell: export NVM_DIR="$HOME/.nvm" &&. "$NVM_DIR/nvm.sh" && make install_assets become: yes become_user: vagrant @@ -21,9 +29,30 @@ args: chdir: /vagrant/ -- name: Initialize application configuration +- name: Run application setup become: yes become_user: vagrant shell: 'bin/setup system:install --email=admin@{{ hostname }}.vb --password=admin --db-host=127.0.0.1 --db-port=3306 --db-user={{ mariadb.user }} --db-password={{ mariadb.password }} --db-template=fr --appbox={{ mariadb.database }} --databox={{ mariadb.databox_db }} --server-name=www.{{ hostname }}.vb --data-path=/vagrant/datas -y' args: chdir: /vagrant/ + +- name: Enable debugger for host IP addresses + shell: bin/setup system:config add debugger.allowed-ips "{{ item}}" + with_items: '{{ host_addresses }}' + args: + chdir: /vagrant/ + +- name: Disable API SSL requirement + shell: bin/setup system:config set main.api_require_ssl false + args: + chdir: /vagrant/ + +- name: Enable API routes + shell: bin/setup system:config set main.api_disabled false + args: + chdir: /vagrant/ + +- name: Create ElasticSearch indexes + shell: bin/console s:i:c + args: + chdir: /vagrant/ diff --git a/resources/ansible/roles/elasticsearch/tasks/main.yml b/resources/ansible/roles/elasticsearch/tasks/main.yml index 9651ac6ce9..5608d8f9f9 100644 --- a/resources/ansible/roles/elasticsearch/tasks/main.yml +++ b/resources/ansible/roles/elasticsearch/tasks/main.yml @@ -17,19 +17,21 @@ - name: Install Dependencies apt: pkg=oracle-java8-installer state=latest -- name: Download +- name: Remove temporary debian package + shell: rm -f /tmp/elasticsearch-{{ elasticsearch.version }}.deb + when: not is_installed + +- name: Download debian package get_url: > url={{ elasticsearch_url }} dest=/tmp/elasticsearch-{{ elasticsearch.version }}.deb when: not is_installed -- name: Install +- name: Install debian package apt: deb=/tmp/elasticsearch-{{ elasticsearch.version }}.deb when: not is_installed - name: Install plugins - become: yes - become_user: elasticsearch shell: /usr/share/elasticsearch/bin/plugin install {{ item.name }}/{{ item.version }} when: not is_installed with_items: "{{ elasticsearch.plugins }}" diff --git a/resources/locales/messages.de.xlf b/resources/locales/messages.de.xlf index 04ab719fc1..b783fc0e69 100644 --- a/resources/locales/messages.de.xlf +++ b/resources/locales/messages.de.xlf @@ -1567,11 +1567,6 @@ meine E-Mail Adresse verändern web/account/reset-email.html.twig - - Changes for rotation will be applied only on the sub-definitions of "image" type. - Changes for rotation will be applied only on the sub-definitions of "image" type. - actions/Tools/index.html.twig - Channels Kanäle diff --git a/resources/locales/messages.en.xlf b/resources/locales/messages.en.xlf index 56afc1f1f4..507cc64d68 100644 --- a/resources/locales/messages.en.xlf +++ b/resources/locales/messages.en.xlf @@ -1567,11 +1567,6 @@ Change my e-mail address web/account/reset-email.html.twig - - Changes for rotation will be applied only on the sub-definitions of "image" type. - Rotations are applied only on subviews of "image" type documents. - actions/Tools/index.html.twig - Channels Channels diff --git a/resources/locales/messages.fr.xlf b/resources/locales/messages.fr.xlf index 88dfc7a1c9..d835e65068 100644 --- a/resources/locales/messages.fr.xlf +++ b/resources/locales/messages.fr.xlf @@ -1567,11 +1567,6 @@ Changer mon adresse e-mail web/account/reset-email.html.twig - - Changes for rotation will be applied only on the sub-definitions of "image" type. - Les rotations ne sont appliquées qu'aux sous-définitions des documents de type image. - actions/Tools/index.html.twig - Channels Canaux diff --git a/resources/locales/messages.nl.xlf b/resources/locales/messages.nl.xlf index fc576c3f63..7581519abf 100644 --- a/resources/locales/messages.nl.xlf +++ b/resources/locales/messages.nl.xlf @@ -1570,11 +1570,6 @@ Mijn email adres wijzigen web/account/reset-email.html.twig - - Changes for rotation will be applied only on the sub-definitions of "image" type. - Changes for rotation will be applied only on the sub-definitions of "image" type. - actions/Tools/index.html.twig - Channels Kanalen diff --git a/templates/web/common/technical_datas.html.twig b/templates/web/common/technical_datas.html.twig index 2eb459cb22..e010e7037b 100644 --- a/templates/web/common/technical_datas.html.twig +++ b/templates/web/common/technical_datas.html.twig @@ -25,6 +25,18 @@ {% if width is not none and height is not none %} {{ width ~ " x " ~ height }} {% endif %} + {% set document = record.get_subdef('document') %} + {% if document and document.get_width() and document.get_height() %} +
 
+
{% if record.get_type() == 'image' and document.get_width() and document.get_height() %} + {% set size_w = (document.get_width() * (254/100) / 300) %} + {% set size_h = (document.get_height() * (254/100) / 300) %} + {{ size_w|round(1) }} x {{ size_h|round(1) }} cm (300dpi) + {% set size_w = (document.get_width() * (254/100) / 72) %}
+ {% set size_h = (document.get_height() * (254/100) / 72) %} + {{ size_w|round(1) }} x {{ size_h|round(1) }} cm (72dpi) + {% endif %}
+ {% endif %} {% endblock %}
@@ -132,4 +144,4 @@ {% endif %} {% endblock %} {% endif %} - \ No newline at end of file + diff --git a/templates/web/prod/actions/Tools/index.html.twig b/templates/web/prod/actions/Tools/index.html.twig index 79cc94f7a2..da5ed58c42 100644 --- a/templates/web/prod/actions/Tools/index.html.twig +++ b/templates/web/prod/actions/Tools/index.html.twig @@ -210,9 +210,6 @@ {% endif %}
-
- {% trans %}Changes for rotation will be applied only on the sub-definitions of "image" type.{% endtrans %} -
 {{ "image rotation" | trans }}  diff --git a/templates/web/prod/index.html.twig b/templates/web/prod/index.html.twig index f9325001c3..12aacf6221 100644 --- a/templates/web/prod/index.html.twig +++ b/templates/web/prod/index.html.twig @@ -358,7 +358,7 @@
{% if search_status|length > 0 %}
- {{ 'Status des documents a rechercher' | trans }} + {{ 'Status des documents a rechercher' | trans }} {% for databox_id, databox in search_status %} {% if databox.status|length > 0 %} diff --git a/templates/web/thesaurus/thesaurus.html.twig b/templates/web/thesaurus/thesaurus.html.twig index 86e073d882..48b4492a0b 100644 --- a/templates/web/thesaurus/thesaurus.html.twig +++ b/templates/web/thesaurus/thesaurus.html.twig @@ -131,11 +131,7 @@ alert("{{ 'phraseanet::erreur: Votre session est fermee, veuillez vous re-authentifier' | trans }}"); self.location.replace(self.location.href); } - //if(manageSession(data)) - var t = 5000; // 120000; - if(data.apps && parseInt(data.apps)>1) - t = Math.round((Math.sqrt(parseInt(data.apps)-1) * 1.3 * 120000)); - window.setTimeout("pollNotifications();", t); + window.setTimeout("pollNotifications();", 10000); return; } @@ -460,13 +456,8 @@ // alert(url); ret = loadXMLDoc(url, null, true); - // alert(ret); - allhits = ret.getElementsByTagName("allhits").item(0).firstChild.nodeValue; - if(allhits==0) - msg = "{{ 'thesaurus:: Supprimer cette branche ? (les termes concernes remonteront en candidats a la prochaine indexation)' | trans }}"; - else - msg = "{{ 'thesaurus:: Des reponses sont retournees par cette branche. Supprimer quand meme ? (les termes concernes remonteront en candidats a la prochaine indexation)' | trans }}"; + msg = "{{ 'thesaurus:: Supprimer cette branche ? (les termes concernes remonteront en candidats a la prochaine indexation)' | trans }}"; if(confirm(msg)) { @@ -1027,6 +1018,7 @@ if(confirm("{{ 'thesaurus:: deplacer le terme dans la corbeille ?' | trans | e('js') }}"+"\n\n"+fullpath+"\n\n")) { + console.log(url); // xmlhttp/delts.x.php?bid=15&id=T1.629&debug=1 // alert(url+"?"+parms); ret = loadXMLDoc(url, parms, true); diff --git a/tests/bootstrap.sh b/tests/bootstrap.sh index 14330c30f8..d4bcfc5476 100755 --- a/tests/bootstrap.sh +++ b/tests/bootstrap.sh @@ -28,9 +28,11 @@ SET @@global.wait_timeout= 999999; DROP SCHEMA IF EXISTS ab_test;DROP SCHEMA IF EXISTS db_test; CREATE SCHEMA IF NOT EXISTS ab_test;CREATE SCHEMA IF NOT EXISTS db_test; ' + if ! ./bin/developer system:uninstall > /dev/null 2>&1 then - rm -f config/configuration.yml config/configuration-compiled.php + mv config/configuration.yml{,.backup} + rm -f config/configuration-compiled.php fi ./bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=en --db-password=toor --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y $VERBOSITY case "$INSTALL_MODE" in