diff --git a/.gitignore b/.gitignore
index 05fa534447..7e22a7b5a2 100644
--- a/.gitignore
+++ b/.gitignore
@@ -6,6 +6,9 @@
/www/assets
/tmp-assets
+# Exclude thumbnails folder
+/www/thumbnails
+
# Exclude node.js dependencies folder
/node_modules
@@ -56,6 +59,7 @@ behat.yml
# Exclude vagrant configuration file
/.vagrant
+/vagrant
# Exclude crossdomain.xml file it's generated
/www/crossdomain.xml
diff --git a/.travis.yml b/.travis.yml
index f39c671313..90a39dad13 100644
--- a/.travis.yml
+++ b/.travis.yml
@@ -8,26 +8,20 @@ services:
- mysql
- memcached
- redis
- - elasticsearch
before_script:
- - export JS_COMPILER=$TRAVIS_BUILD_DIR/closure/compiler.jar
- - sudo apt-get update -qq && sudo apt-get install -qq scons inkscape python-setuptools
- - sudo easy_install -U taschenmesser scour boto
- - wget http://dl.google.com/closure-compiler/compiler-latest.zip && unzip compiler-latest.zip -d closure
- node --version
- npm --version
- travis_retry npm install
- - echo '' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/xdebug.ini
+ - phpenv config-rm xdebug.ini
- sh -c 'if [ $(php -r "echo PHP_MINOR_VERSION;") -le 4 ]; then echo "extension = apc.so" >> ~/.phpenv/versions/$(phpenv version-name)/etc/php.ini; fi;'
+ - echo 'session.cache_limiter = ""' >> ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/travis.ini
- echo 'extension="redis.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/redis.ini
- echo 'extension="memcache.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcache.ini
- echo 'extension="memcached.so"' > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/memcached.ini
- echo "extension=zmq.so" > ~/.phpenv/versions/$(phpenv version-name)/etc/conf.d/zmq.ini
- yes | pecl install imagick
- - mysql -e 'create database update39_test;create database ab_test;create database db_test; create database ab_unitTests; create database db_unitTests;'
- - sudo mysql -e "GRANT ALL PRIVILEGES ON ab_unitTests.* TO 'phraseaUnitTests'@'localhost' IDENTIFIED BY 'iWvGxPE8' WITH GRANT OPTION"
- - sudo mysql -e "GRANT ALL PRIVILEGES ON db_unitTests.* TO 'phraseaUnitTests'@'localhost' IDENTIFIED BY 'iWvGxPE8' WITH GRANT OPTION"
+ - mysql -e 'create database update39_test;create database ab_test;create database db_test;'
- mysql -e 'SET @@global.sql_mode= "";'
- mysql -e 'SET @@global.max_allowed_packet= 33554432;'
- mysql -e 'SET @@global.wait_timeout= 999999;'
@@ -48,21 +42,17 @@ matrix:
- php: 5.6
script:
- - travis_retry composer install --dev --prefer-source -vvv
- - travis_retry grunt install-assets -vvv
+ - travis_retry composer install --optimize-autoloader --dev --prefer-source
+ - travis_retry grunt install-assets
- bin/developer assets:compile-less
- bin/developer system:uninstall
+ - bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=fr --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y;
- sh -c " if [ '$SETUP_MODE' = 'update' ]; then
- bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=fr --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y -v;
- bin/developer ini:reset --email=test@phraseanet.com --password=test --run-patches -v;
+ bin/developer ini:reset --email=test@phraseanet.com --password=test --run-patches --no-setup-dbs;
+ php resources/hudson/cleanupSubdefs.php;
fi"
- - sh -c " if [ '$SETUP_MODE' = 'install' ]; then
- bin/setup system:install --email=test@phraseanet.com --password=test --db-user=root --db-template=fr --db-password= --databox=db_test --appbox=ab_test --server-name=http://127.0.0.1 -y -v;
- bin/developer ini:setup-tests-dbs -v;
- fi"
- - php resources/hudson/cleanupSubdefs.php
- #sqlite db generation should occur once Phraseanet is up to date :
+ - bin/developer ini:setup-tests-dbs
- bin/developer phraseanet:regenerate-sqlite
+ - bin/developer phraseanet:generate-js-fixtures
- ./node_modules/.bin/grunt test
- #ls -d tests/Alchemy/Tests/Phrasea/*/ | parallel --gnu 'bin/phpunit {};'
- bin/phpunit
diff --git a/CHANGELOG.md b/CHANGELOG.md
index b0f566100c..9472e35817 100644
--- a/CHANGELOG.md
+++ b/CHANGELOG.md
@@ -1,5 +1,6 @@
# CHANGELOG
+
* 3.9.0 (xxxx-xx-xx)
- Convert Orders custom adapter to Doctrine entity.
@@ -9,6 +10,61 @@
- Convert Ftp Export custom adapter to Doctrine entity.
- Session management is now part of Phraseanet configuration.
+## 3.8.6 (2015-01-20)
+
+ - BugFix : Fixes the stories editing. When opening an editing form, the style applied to the notice doesn't match its selection
+ - BugFix : Fixes the sending of a return receipt (attributed in the headers of the email) at the export
+ - BugFix : Fixes the SMTP field in the Administration panel which is pre filled with a wrong information
+ - BugFix : Fixes a bad mapping of the registration fields on the homepage and the displayed fields in the registration requests in the Administration
+ - BugFix : In the detailed view, fixes the list of the stories titles which is truncated.
+ - BugFix : Fixes Oauth 2.0, the authorization of the client applications is not systematically requested when logging in.
+ - BugFix : When uploading documents, the first status is not taken into account
+ - BugFix : Fixes the cache invalidation of the status bits icons when changed in Admin section
+ - BugFix : Fixes the reordering of the media in a basket
+ - BugFix : Fixes the control of field "name" when creating a push or a feedback
+ - BugFix : Fixes Oauth 2.0 message when the connection fails
+ - BugFix : Fixes the suppression of diffusion lists on IE9
+ - BugFix : Fixes the anonymous download when a user is logged off
+ - BugFix : Fixes the setup of the default display mode of the collections (stamp/watermark) on a non authenticated mode
+ - BugFix : Fixes the printing of the thumbnails of documents for the videos or PDFs
+ - BugFix : Fixes the reordering of the basket when the documents come from n different collections
+ - BugFix : Fixes the application of the "status bits" when the status bit is defined by the task "RecordMover"
+ - BugFix : Fixes the detection of duplicates for PDF files
+ - BugFix : Fixes the rewriting of metadata of a document, when the name space is empty
+ - BugFix : Fixes the injection of the rights of a user for a connection via Oauth2
+ - BugFix : Fixes the invalidation of the cache when disassembling a databox
+ - BugFix : Fixes the sorting criteria by date and by field, according to users rights
+ - BugFix : Fixes the right to download for the guest access
+ - BugFix : Fixes the report generation for the number of downloads and connections
+ - BugFix : Fixes the memory use of the task for the the sub-definitions creation
+ - BugFix : Fixes the generation of sub-definitions when editing the sub-definitions task
+ - BugFix : Fixes the display of multivalued fields in the editing window
+ - BugFix : Fixes the adding of a term in the candidates which was is not detected as present in the candidates
+ - BugFix : Fixes the users' rights when using the API
+ - BugFix : When being redirected, fixes the add of parameters after login.
+ - BugFix : Fixes the thumbnails' size of EPS files.
+ - BugFix : The "Delete" action of a task ("Record Mover" type) is now taken into consideration.
+ - BugFix : The edition dates of a record sent back by the API are now fixed
+ - BuxFix : Writing of IPTC fields is fixed, when setting up a stamp on a media (image type).
+ - Enhancement : Possibility to adapt a task "creation of subdefinition", by database and type of document
+ - Enhancement : Reporting modifications of Flickr & Dailymotion APIs (Bridge feature).
+ - Enhancement : Adding the possibility to overload the name space reserved for the cache
+ - Enhancement : Adding the possibility to deactivate the use of the TaskManager by instance
+ - Enhancement : Adding an extended format for the API replies. Get more information about Phraseanet records in one API request.
+ - Enhancement : Adding a block for the help text of Production when no result is displayed to authorize the modification of this text via a plugin
+ - Enhancement : Adding the possibility to deactivate the notifications to the users for a new publication
+ - Enhancement : Adding the possibility to modify the rotation of pictures representing the videos and PDF files
+ - Enhancement : Adding the possibility to serve the thumbnails of the application in a static way for improved performances
+ - Enhancement : Adding the possibility to deactivate the lazy load for the thumbnails
+ - Enhancement : The tasks can now reconnect automatically to MySQL
+ - Enhancement : The sorting on the fields "Number" is now possible
+ - Enhancement : The sub-definition creation task now displays the remaining number of sub-definitions to create
+ - Enhancement : Adding the date of edition of the media
+ - Enhancement : Use of http cache for the display of documents
+ - Enhancement : Adding the possibility to deactivate the CSRF for the authentication form
+ - NewFeature : Adding a Vagrant VM (for developers and testers). The setup is quicker: development environments made easy.
+ - NewFeature : Adding a command for the file generation crossdomain.xml depending on the configuration.
+
## 3.8.5 (2014-07-08)
- BugFix : Fix Flickr connexion throught Bridge Application
diff --git a/Gruntfile.js b/Gruntfile.js
index 5379d38a1b..bf61376786 100644
--- a/Gruntfile.js
+++ b/Gruntfile.js
@@ -42,23 +42,22 @@ module.exports = function(grunt) {
dist: {
options: {
components: {
- "jquery.ui": ["npm", {"../../node_modules/.bin/grunt": "build"}],
- "jquery-mobile": ["npm", {"../../node_modules/.bin/grunt": "dist"}],
- "bootstrap": ["npm", {"make": "bootstrap"}],
- "autobahnjs": [{"make":"build"}]
+ "bootstrap": ["npm", {"make": "bootstrap"}]
}
}
}
},
copy: {
- "autobahnjs": {
+ "autobahn": {
"expand": true,
"src": [
- "<%= path.bower %>/autobahnjs/build/autobahn.js",
- "<%= path.bower %>/autobahnjs/LICENSE"
+ "<%= path.bower %>/autobahn/index.js",
],
- "dest": "<%= path.asset %>/autobahnjs/",
- "flatten": true
+ "dest": "<%= path.asset %>/autobahn/",
+ "flatten": true,
+ "rename": function(dest, src) {
+ return dest + "autobahn.js"
+ }
},
"backbone": {
"expand": true,
@@ -102,7 +101,7 @@ module.exports = function(grunt) {
},
"bootstrap-multiselect": {
"expand": true,
- "cwd": "<%= path.bower %>/bootstrap-multiselect",
+ "cwd": "<%= path.bower %>/bootstrap-multiselect/dist",
"src": [
"css/bootstrap-multiselect.css",
"js/bootstrap-multiselect.js"
@@ -115,12 +114,6 @@ module.exports = function(grunt) {
"dest": "<%= path.asset %>/chai/",
"flatten": true
},
- "deps-when": {
- "expand": true,
- "cwd": "<%= path.bower %>/autobahnjs",
- "src": "../when/when.js",
- "dest": "<%= path.bower %>/autobahnjs/when"
- },
"font-awesome": {
"expand": true,
"cwd": "<%= path.bower %>/font-awesome",
@@ -190,12 +183,13 @@ module.exports = function(grunt) {
},
"jquery-mobile": {
"expand": true,
- "cwd": "<%= path.bower %>/jquery-mobile/dist",
+ "cwd": "<%= path.bower %>/jquery-mobile-bower/",
"src": [
"images/*",
- "jquery.mobile.css",
- "jquery.mobile.js"
+ "css/jquery.mobile-1.3.2.css",
+ "js/jquery.mobile-1.3.2.js"
],
+ "flatten": true,
"dest": "<%= path.asset %>/jquery-mobile/"
},
"jquery.cookie": {
@@ -208,18 +202,17 @@ module.exports = function(grunt) {
},
"jquery-ui": {
"expand": true,
- "cwd": "<%= path.bower %>/jquery.ui",
+ "cwd": "<%= path.bower %>/jquery-ui",
"src": [
- "dist/i18n/*",
- "dist/images/*",
+ "ui/i18n/*",
+ "ui/*",
"themes/base/*",
"themes/base/images/*",
- "dist/jquery-ui.css",
- "dist/jquery-ui.js",
"MIT-LICENSE.txt"
],
"rename": function(dest, src) {
- return dest + src.replace("dist", "");
+ var dest = dest + src.replace("ui/", "/");
+ return dest.replace("themes/base/", "/")
},
"dest": "<%= path.asset %>/jquery.ui/"
},
@@ -319,12 +312,13 @@ module.exports = function(grunt) {
},
"tinymce": {
"expand": true,
- "cwd": "<%= path.bower %>/tinymce/js/tinymce",
+ "cwd": "<%= path.bower %>/tinymce/",
"src": [
"plugins/**",
"skins/**",
"themes/**",
- "tinymce.js",
+ "*.js",
+ "changelog.txt",
"license.txt"
],
"dest": "<%= path.asset %>/tinymce"
@@ -413,15 +407,8 @@ module.exports = function(grunt) {
grunt.loadNpmTasks("grunt-bower-postinst");
grunt.loadNpmTasks('grunt-mocha-phantomjs');
- // This task is here to copy bower module into an other bower module
- // Because bower removes .git folder you can not use git submodule update
- // So fetch them with bower and copy them to appropriate path
- grunt.registerTask("copy-deps", [
- "copy:deps-when"
- ]);
-
grunt.registerTask("copy-assets", [
- "copy:autobahnjs",
+ "copy:autobahn",
"copy:backbone",
"copy:blueimp",
"copy:bootstrap",
@@ -458,10 +445,9 @@ module.exports = function(grunt) {
grunt.registerTask("install-assets", [
"clean:assets",
"bower",
- "copy-deps",
"bower_postinst",
"copy-assets",
"clean:bower"
]);
grunt.registerTask('test', ["shell:generate_js_fixtures", "qunit", "mocha_phantomjs"]);
-};
+};
\ No newline at end of file
diff --git a/bin/console b/bin/console
index f7efcd9540..b953088087 100755
--- a/bin/console
+++ b/bin/console
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -11,6 +11,7 @@
namespace KonsoleKommander;
+use Alchemy\Phrasea\Command\BuildSubdefs;
use Alchemy\Phrasea\Command\Plugin\ListPlugin;
use Alchemy\Phrasea\Command\Setup\H264ConfigurationDumper;
use Alchemy\Phrasea\Command\Setup\H264MappingGenerator;
@@ -113,6 +114,7 @@ $cli->command(new CreateCollection('collection:create'));
$cli->command(new RecordAdd('records:add'));
$cli->command(new RescanTechnicalDatas('records:rescan-technical-datas'));
$cli->command(new BuildMissingSubdefs('records:build-missing-subdefs'));
+$cli->command(new BuildSubdefs('records:build-subdefs'));
$cli->command(new AddPlugin());
$cli->command(new ListPlugin());
diff --git a/bin/developer b/bin/developer
index cb81b0b35b..f9f7831b0b 100755
--- a/bin/developer
+++ b/bin/developer
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -69,8 +69,8 @@ $cli = new CLI("
if ($cli['configuration.store']->isSetup()) {
$helpers = [
- 'db' => new ConnectionHelper($cli['EM']->getConnection()),
- 'em' => new EntityManagerHelper($cli['EM'])
+ 'db' => new ConnectionHelper($cli['orm.em']->getConnection()),
+ 'em' => new EntityManagerHelper($cli['orm.em'])
];
$helperSet = $cli['console']->getHelperSet();
diff --git a/bin/setup b/bin/setup
index ea2a4ecc03..18cd6933d4 100755
--- a/bin/setup
+++ b/bin/setup
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/bower.json b/bower.json
index a10b7fcb01..2fd44faa1b 100644
--- a/bower.json
+++ b/bower.json
@@ -4,8 +4,8 @@
"dependencies": {
"bootstrap": "2.3.2",
"jquery": "~1.8.3",
- "jquery.ui": "~1.10.0",
- "jquery-mobile": "~1.3.0",
+ "jquery-ui": "~1.10.0",
+ "jquery-mobile-bower": "~1.3.0",
"underscore": "~1.4.4",
"font-awesome": "~3.0.2",
"modernizr": "~2.6.2",
@@ -25,11 +25,12 @@
"tinymce": "~4.0",
"jquery-galleria": "1.2.9",
"jquery.cookie": "~1.4",
- "autobahnjs": "~0.8.0",
+ "autobahn": "http://autobahn.s3.amazonaws.com/js/autobahn.min.js",
"when": "~2.7.0",
"web-socket-js": "~1.0.1",
"jquery.treeview": "1.4.1",
- "fancytree": "~2.7"
+ "fancytree": "~2.7",
+ "joyride": "https://github.com/zurb/joyride/archive/v2.0.0.zip"
},
"devDependencies": {
"mocha": "latest",
@@ -43,4 +44,4 @@
"resolutions": {
"jquery": "1.8.3"
}
-}
+}
\ No newline at end of file
diff --git a/composer.json b/composer.json
index 6aefcc37bc..040611b8f4 100644
--- a/composer.json
+++ b/composer.json
@@ -26,28 +26,29 @@
"require": {
"php" : ">=5.4",
"alchemy/oauth2php" : "1.0.0",
- "alchemy/phlickr" : "0.2.8",
+ "alchemy/phlickr" : "0.2.9",
"alchemy/task-manager" : "2.0.x-dev@dev",
"alchemy/zippy" : "0.2.x-dev@dev",
"cboden/ratchet" : "~0.3",
"dailymotion/sdk" : "~1.5",
"data-uri/data-uri" : "~0.1.0",
"doctrine/orm" : "~2.4.0",
+ "doctrine/dbal" : "~2.4.0",
"elasticsearch/elasticsearch" : "~1.0",
"facebook/php-sdk" : "~3.0",
"gedmo/doctrine-extensions" : "~2.3.0",
"alchemy/google-plus-api-client" : "~0.6.2",
"alchemy/geonames-api-consumer" : "~0.1.0",
- "goodby/csv" : "~1.0",
+ "goodby/csv" : "dev-master",
"guzzle/guzzle" : "~3.0",
- "imagine/imagine" : "dev-0.6.1-flatten-layer as 0.6.1",
+ "imagine/imagine" : "dev-alchemy-0.6.2 as 0.6.2",
"igorw/get-in" : "~1.0",
"ircmaxell/random-lib" : "~1.0",
- "jms/serializer" : "~0.10",
+ "jms/serializer" : "~0.10",
"jms/translation-bundle" : "~1.1",
"justinrainbow/json-schema" : "~1.3",
"mediavorus/mediavorus" : "~0.4.0",
- "media-alchemyst/media-alchemyst" : "~0.4.0",
+ "media-alchemyst/media-alchemyst" : "~0.4",
"monolog/monolog" : "~1.3",
"mrclay/minify" : "~2.1.6",
"neutron/process-manager" : "2.0.x-dev@dev",
@@ -64,7 +65,7 @@
"silex/silex" : "1.1.x-dev@dev",
"silex/web-profiler" : "~1.0.0@dev",
"sorien/silex-dbal-profiler" : "~1.0.0",
- "swiftmailer/swiftmailer" : "~4.3.0",
+ "swiftmailer/swiftmailer" : "~5.3.0",
"symfony/symfony" : "~2.4",
"alchemy-fr/tcpdf-clone" : "~6.0",
"themattharris/tmhoauth" : "~0.7",
@@ -73,8 +74,10 @@
"vierbergenlars/php-semver" : "~2.1",
"zend/gdata" : "~1.12.1",
"doctrine/migrations" : "1.0.x-dev@dev",
- "willdurand/negotiation" : "~1.3",
- "hoa/compiler": "2.14.09.23"
+ "willdurand/negotiation" : "~1.3",
+ "hoa/compiler": "2.14.09.23",
+ "dflydev/doctrine-orm-service-provider" : "~1.0",
+ "roave/security-advisories": "dev-master"
},
"require-dev": {
"phpunit/phpunit" : "~3.7",
diff --git a/composer.lock b/composer.lock
index 74f08b1144..2d5d10f8a8 100644
--- a/composer.lock
+++ b/composer.lock
@@ -4,16 +4,22 @@
"Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically"
],
- "hash": "73cfb65537610dfd0edc9cf6485c4ebb",
+ "hash": "f5e0457425e2c151f1a6b27e0bad160d",
"packages": [
{
"name": "alchemy-fr/tcpdf-clone",
"version": "6.0.039",
"source": {
"type": "git",
- "url": "https://github.com/alchemy-fr/tcpdf-clone",
+ "url": "https://github.com/alchemy-fr/tcpdf-clone.git",
"reference": "2ba0248a7187f1626df6c128750650416267f0e7"
},
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/alchemy-fr/tcpdf-clone/zipball/2ba0248a7187f1626df6c128750650416267f0e7",
+ "reference": "2ba0248a7187f1626df6c128750650416267f0e7",
+ "shasum": ""
+ },
"require": {
"php": ">=5.3.0"
},
@@ -60,6 +66,10 @@
"qrcode",
"tcpdf"
],
+ "support": {
+ "source": "https://github.com/alchemy-fr/tcpdf-clone/tree/6.0.039",
+ "issues": "https://github.com/alchemy-fr/tcpdf-clone/issues"
+ },
"time": "2013-10-13 16:11:17"
},
{
@@ -103,7 +113,7 @@
"homepage": "http://www.lickmychip.com/"
},
{
- "name": "Nicolas Le Goff",
+ "name": "nlegoff",
"email": "legoff.n@gmail.com"
},
{
@@ -272,16 +282,16 @@
},
{
"name": "alchemy/phlickr",
- "version": "0.2.8",
+ "version": "0.2.9",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/Phlickr.git",
- "reference": "26b7764fd45c15062cb1b21c9389aff919e8c2bd"
+ "reference": "f9af93e27e9235db43e61ce2f9588d8ce9859b68"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/alchemy-fr/Phlickr/zipball/26b7764fd45c15062cb1b21c9389aff919e8c2bd",
- "reference": "26b7764fd45c15062cb1b21c9389aff919e8c2bd",
+ "url": "https://api.github.com/repos/alchemy-fr/Phlickr/zipball/f9af93e27e9235db43e61ce2f9588d8ce9859b68",
+ "reference": "f9af93e27e9235db43e61ce2f9588d8ce9859b68",
"shasum": ""
},
"type": "library",
@@ -291,7 +301,7 @@
}
},
"notification-url": "https://packagist.org/downloads/",
- "time": "2014-07-07 14:01:51"
+ "time": "2014-12-15 14:27:57"
},
{
"name": "alchemy/task-manager",
@@ -469,16 +479,16 @@
},
{
"name": "dailymotion/sdk",
- "version": "1.6",
+ "version": "1.6.2",
"source": {
"type": "git",
"url": "https://github.com/dailymotion/dailymotion-sdk-php.git",
- "reference": "670ce8c536077a17ac31096d4c61372c35caa713"
+ "reference": "96b291b755e97906f54cafa60be4990ece624e83"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/dailymotion/dailymotion-sdk-php/zipball/670ce8c536077a17ac31096d4c61372c35caa713",
- "reference": "670ce8c536077a17ac31096d4c61372c35caa713",
+ "url": "https://api.github.com/repos/dailymotion/dailymotion-sdk-php/zipball/96b291b755e97906f54cafa60be4990ece624e83",
+ "reference": "96b291b755e97906f54cafa60be4990ece624e83",
"shasum": ""
},
"type": "library",
@@ -498,7 +508,7 @@
"dailymotion",
"sdk"
],
- "time": "2014-09-11 15:14:39"
+ "time": "2014-11-03 16:53:45"
},
{
"name": "data-uri/data-uri",
@@ -545,6 +555,68 @@
],
"time": "2014-08-22 15:01:57"
},
+ {
+ "name": "dflydev/doctrine-orm-service-provider",
+ "version": "v1.0.6",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/dflydev/dflydev-doctrine-orm-service-provider.git",
+ "reference": "a55b92ac5111b8cb2aca19623f10301bab373718"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/dflydev/dflydev-doctrine-orm-service-provider/zipball/a55b92ac5111b8cb2aca19623f10301bab373718",
+ "reference": "a55b92ac5111b8cb2aca19623f10301bab373718",
+ "shasum": ""
+ },
+ "require": {
+ "doctrine/orm": "~2.3",
+ "php": ">=5.3.3",
+ "pimple/pimple": "1.*@dev"
+ },
+ "require-dev": {
+ "cilex/cilex": "1.*@dev",
+ "cilex/console-service-provider": "@dev",
+ "silex/silex": "1.*@dev"
+ },
+ "suggest": {
+ "dflydev/psr0-resource-locator-service-provider": "1.0.*@dev"
+ },
+ "type": "library",
+ "autoload": {
+ "psr-0": {
+ "Dflydev\\Cilex\\Provider\\DoctrineOrm": "src",
+ "Dflydev\\Pimple\\Provider\\DoctrineOrm": "src",
+ "Dflydev\\Silex\\Provider\\DoctrineOrm": "src"
+ }
+ },
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Dragonfly Development Inc.",
+ "email": "info@dflydev.com",
+ "homepage": "http://dflydev.com"
+ },
+ {
+ "name": "Beau Simensen",
+ "email": "beau@dflydev.com",
+ "homepage": "http://beausimensen.com"
+ }
+ ],
+ "description": "Doctrine ORM Service Provider",
+ "homepage": "http://dflydev.com/projects/doctrine-orm-service-provider/",
+ "keywords": [
+ "cilex",
+ "doctrine",
+ "orm",
+ "pimple",
+ "silex"
+ ],
+ "time": "2014-07-24 19:35:45"
+ },
{
"name": "doctrine/annotations",
"version": "v1.2.1",
@@ -737,7 +809,7 @@
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
- "homepage": "http://jmsyst.com",
+ "homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
@@ -830,16 +902,16 @@
},
{
"name": "doctrine/dbal",
- "version": "v2.4.2",
+ "version": "v2.4.4",
"source": {
"type": "git",
"url": "https://github.com/doctrine/dbal.git",
- "reference": "fec965d330c958e175c39e61c3f6751955af32d0"
+ "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/dbal/zipball/fec965d330c958e175c39e61c3f6751955af32d0",
- "reference": "fec965d330c958e175c39e61c3f6751955af32d0",
+ "url": "https://api.github.com/repos/doctrine/dbal/zipball/a370e5b95e509a7809d11f3d280acfc9310d464b",
+ "reference": "a370e5b95e509a7809d11f3d280acfc9310d464b",
"shasum": ""
},
"require": {
@@ -851,7 +923,7 @@
"symfony/console": "~2.0"
},
"suggest": {
- "symfony/console": "Allows use of the command line interface"
+ "symfony/console": "For helpful console commands such as SQL execution and import of files."
},
"type": "library",
"autoload": {
@@ -864,17 +936,6 @@
"MIT"
],
"authors": [
- {
- "name": "Jonathan Wage",
- "email": "jonwage@gmail.com",
- "homepage": "http://www.jwage.com/",
- "role": "Creator"
- },
- {
- "name": "Guilherme Blanco",
- "email": "guilhermeblanco@gmail.com",
- "homepage": "http://www.instaclick.com"
- },
{
"name": "Roman Borschel",
"email": "roman@code-factory.org"
@@ -882,6 +943,14 @@
{
"name": "Benjamin Eberlei",
"email": "kontakt@beberlei.de"
+ },
+ {
+ "name": "Guilherme Blanco",
+ "email": "guilhermeblanco@gmail.com"
+ },
+ {
+ "name": "Jonathan Wage",
+ "email": "jonwage@gmail.com"
}
],
"description": "Database Abstraction Layer",
@@ -892,7 +961,7 @@
"persistence",
"queryobject"
],
- "time": "2014-01-01 16:43:57"
+ "time": "2015-01-12 21:57:01"
},
{
"name": "doctrine/inflector",
@@ -925,7 +994,8 @@
{
"name": "Jonathan Wage",
"email": "jonwage@gmail.com",
- "homepage": "http://www.jwage.com/"
+ "homepage": "http://www.jwage.com/",
+ "role": "Creator"
},
{
"name": "Guilherme Blanco",
@@ -943,7 +1013,7 @@
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
- "homepage": "http://jmsyst.com",
+ "homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
@@ -997,7 +1067,7 @@
{
"name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
- "homepage": "http://jmsyst.com",
+ "homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
@@ -1015,12 +1085,12 @@
"source": {
"type": "git",
"url": "https://github.com/doctrine/migrations.git",
- "reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8"
+ "reference": "f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/migrations/zipball/4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
- "reference": "4256449c5e2603a6b6ee5a78c7c4521d4d4430b8",
+ "url": "https://api.github.com/repos/doctrine/migrations/zipball/f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0",
+ "reference": "f4fe9d9cc21a711d89d91d29c4a4e7945289cdd0",
"shasum": ""
},
"require": {
@@ -1067,20 +1137,20 @@
"database",
"migrations"
],
- "time": "2014-07-09 07:58:02"
+ "time": "2014-10-30 14:49:25"
},
{
"name": "doctrine/orm",
- "version": "v2.4.6",
+ "version": "v2.4.7",
"source": {
"type": "git",
"url": "https://github.com/doctrine/doctrine2.git",
- "reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9"
+ "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9",
- "reference": "bebacf79d8d4dae9168f0f9bc6811e6c2cb6a4d9",
+ "url": "https://api.github.com/repos/doctrine/doctrine2/zipball/2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68",
+ "reference": "2bc4ff3cab2ae297bcd05f2e619d42e6a7ca9e68",
"shasum": ""
},
"require": {
@@ -1140,7 +1210,7 @@
"database",
"orm"
],
- "time": "2014-10-06 13:22:50"
+ "time": "2014-12-16 13:45:01"
},
{
"name": "elasticsearch/elasticsearch",
@@ -1204,13 +1274,13 @@
"version": "v1.0.0",
"source": {
"type": "git",
- "url": "https://github.com/igorw/evenement",
- "reference": "v1.0.0"
+ "url": "https://github.com/igorw/evenement.git",
+ "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d"
},
"dist": {
"type": "zip",
- "url": "https://github.com/igorw/evenement/zipball/v1.0.0",
- "reference": "v1.0.0",
+ "url": "https://api.github.com/repos/igorw/evenement/zipball/fa966683e7df3e5dd5929d984a44abfbd6bafe8d",
+ "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d",
"shasum": ""
},
"require": {
@@ -1237,7 +1307,7 @@
"keywords": [
"event-dispatcher"
],
- "time": "2012-05-30 08:01:08"
+ "time": "2012-05-30 15:01:08"
},
{
"name": "facebook/php-sdk",
@@ -1290,12 +1360,12 @@
"version": "v2.3.9",
"source": {
"type": "git",
- "url": "https://github.com/l3pp4rd/DoctrineExtensions.git",
+ "url": "https://github.com/Atlantic18/DoctrineExtensions.git",
"reference": "35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/l3pp4rd/DoctrineExtensions/zipball/35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54",
+ "url": "https://api.github.com/repos/Atlantic18/DoctrineExtensions/zipball/35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54",
"reference": "35adcaae1a3f50d0d5b73aa50ed8fd28ee35ce54",
"shasum": ""
},
@@ -1363,20 +1433,20 @@
"tree",
"uploadable"
],
- "time": "2013-08-18 07:18:44"
+ "time": "2014-01-12 16:34:06"
},
{
"name": "goodby/csv",
- "version": "1.1.0",
+ "version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/goodby/csv.git",
- "reference": "da672802985d196cae767da29b11618a676496b0"
+ "reference": "b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/goodby/csv/zipball/da672802985d196cae767da29b11618a676496b0",
- "reference": "da672802985d196cae767da29b11618a676496b0",
+ "url": "https://api.github.com/repos/goodby/csv/zipball/b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a",
+ "reference": "b289ca3e3f6ad3c76b7d8c3bef3effd0232ca13a",
"shasum": ""
},
"require": {
@@ -1420,7 +1490,7 @@
"export",
"import"
],
- "time": "2014-01-12 16:34:06"
+ "time": "2015-02-02 12:29:23"
},
{
"name": "guzzle/guzzle",
@@ -1988,16 +2058,16 @@
},
{
"name": "imagine/imagine",
- "version": "dev-0.6.1-flatten-layer",
+ "version": "dev-alchemy-0.6.2",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/Imagine.git",
- "reference": "e75d9495677b40e0868836e3510667178b2bd90a"
+ "reference": "6605d13e3b24f335fe80099c193546671158c041"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/alchemy-fr/Imagine/zipball/e75d9495677b40e0868836e3510667178b2bd90a",
- "reference": "e75d9495677b40e0868836e3510667178b2bd90a",
+ "url": "https://api.github.com/repos/alchemy-fr/Imagine/zipball/6605d13e3b24f335fe80099c193546671158c041",
+ "reference": "6605d13e3b24f335fe80099c193546671158c041",
"shasum": ""
},
"require": {
@@ -2041,9 +2111,9 @@
"image processing"
],
"support": {
- "source": "https://github.com/alchemy-fr/Imagine/tree/0.6.1-flatten-layer"
+ "source": "https://github.com/alchemy-fr/Imagine/tree/alchemy-0.6.2"
},
- "time": "2014-10-08 16:23:33"
+ "time": "2015-01-13 18:12:26"
},
{
"name": "ircmaxell/random-lib",
@@ -2350,9 +2420,9 @@
],
"authors": [
{
- "name": "Johannes M. Schmitt",
+ "name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
- "homepage": "http://jmsyst.com",
+ "homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
@@ -2438,16 +2508,16 @@
},
{
"name": "media-alchemyst/media-alchemyst",
- "version": "0.4.6",
+ "version": "0.4.8",
"source": {
"type": "git",
"url": "https://github.com/alchemy-fr/Media-Alchemyst.git",
- "reference": "0145a40c01b67268a29ee3863e1ce7be4ad60ac8"
+ "reference": "cf1fdacbaf0d54440fa7b61c750234d0befde0c8"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/0145a40c01b67268a29ee3863e1ce7be4ad60ac8",
- "reference": "0145a40c01b67268a29ee3863e1ce7be4ad60ac8",
+ "url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/cf1fdacbaf0d54440fa7b61c750234d0befde0c8",
+ "reference": "cf1fdacbaf0d54440fa7b61c750234d0befde0c8",
"shasum": ""
},
"require": {
@@ -2507,7 +2577,7 @@
"video",
"video processing"
],
- "time": "2014-09-10 09:44:33"
+ "time": "2015-02-03 16:25:38"
},
{
"name": "mediavorus/mediavorus",
@@ -2567,16 +2637,16 @@
},
{
"name": "monolog/monolog",
- "version": "1.11.0",
+ "version": "1.13.0",
"source": {
"type": "git",
"url": "https://github.com/Seldaek/monolog.git",
- "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa"
+ "reference": "c41c218e239b50446fd883acb1ecfd4b770caeae"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/Seldaek/monolog/zipball/ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
- "reference": "ec3961874c43840e96da3a8a1ed20d8c73d7e5aa",
+ "url": "https://api.github.com/repos/Seldaek/monolog/zipball/c41c218e239b50446fd883acb1ecfd4b770caeae",
+ "reference": "c41c218e239b50446fd883acb1ecfd4b770caeae",
"shasum": ""
},
"require": {
@@ -2590,9 +2660,10 @@
"aws/aws-sdk-php": "~2.4, >2.4.8",
"doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0",
- "phpunit/phpunit": "~3.7.0",
+ "phpunit/phpunit": "~4.0",
"raven/raven": "~0.5",
"ruflin/elastica": "0.90.*",
+ "swiftmailer/swiftmailer": "~5.3",
"videlalvaro/php-amqplib": "~2.4"
},
"suggest": {
@@ -2609,7 +2680,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.11.x-dev"
+ "dev-master": "1.13.x-dev"
}
},
"autoload": {
@@ -2635,7 +2706,7 @@
"logging",
"psr-3"
],
- "time": "2014-09-30 13:30:58"
+ "time": "2015-03-05 01:12:12"
},
{
"name": "mrclay/minify",
@@ -2667,7 +2738,7 @@
],
"authors": [
{
- "name": "Stephen Clay",
+ "name": "Steve Clay",
"email": "steve@mrclay.org",
"homepage": "http://www.mrclay.org/",
"role": "Developer"
@@ -2853,21 +2924,21 @@
"source": {
"type": "git",
"url": "https://github.com/romainneutron/Imagine-Silex-Service-Provider.git",
- "reference": "0.1.2"
+ "reference": "a8a7862ae90419f2b23746cd8436c2310e4eb084"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/romainneutron/Imagine-Silex-Service-Provider/zipball/0.1.2",
- "reference": "0.1.2",
+ "url": "https://api.github.com/repos/romainneutron/Imagine-Silex-Service-Provider/zipball/a8a7862ae90419f2b23746cd8436c2310e4eb084",
+ "reference": "a8a7862ae90419f2b23746cd8436c2310e4eb084",
"shasum": ""
},
"require": {
"imagine/imagine": "*",
"php": ">=5.3.3",
- "silex/silex": ">=1.0,<2.0"
+ "silex/silex": "~1.0"
},
"require-dev": {
- "symfony/browser-kit": ">=2.0,<3.0"
+ "symfony/browser-kit": "~2.0"
},
"type": "library",
"autoload": {
@@ -3381,7 +3452,7 @@
"metadata"
],
"support": {
- "source": "https://github.com/alchemy-fr/PHPExiftool/tree/0.4.1-mwg-metadata-copy"
+ "source": "https://github.com/alchemy-fr/PHPExiftool/tree/dev"
},
"time": "2014-10-08 16:09:02"
},
@@ -3419,9 +3490,9 @@
],
"authors": [
{
- "name": "Johannes M. Schmitt",
+ "name": "Johannes Schmitt",
"email": "schmittjoh@gmail.com",
- "homepage": "http://jmsyst.com",
+ "homepage": "https://github.com/schmittjoh",
"role": "Developer of wrapped JMSSerializerBundle"
}
],
@@ -3697,16 +3768,16 @@
},
{
"name": "rhumsaa/uuid",
- "version": "2.7.3",
+ "version": "2.8.0",
"source": {
"type": "git",
"url": "https://github.com/ramsey/uuid.git",
- "reference": "b976326ca5977d7333f34e3c828ae7c22a49a65a"
+ "reference": "cca98c652cac412c9c2f109c69e5532f313435fc"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/ramsey/uuid/zipball/b976326ca5977d7333f34e3c828ae7c22a49a65a",
- "reference": "b976326ca5977d7333f34e3c828ae7c22a49a65a",
+ "url": "https://api.github.com/repos/ramsey/uuid/zipball/cca98c652cac412c9c2f109c69e5532f313435fc",
+ "reference": "cca98c652cac412c9c2f109c69e5532f313435fc",
"shasum": ""
},
"require": {
@@ -3730,7 +3801,7 @@
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "2.7.x-dev"
+ "dev-master": "2.8.x-dev"
}
},
"autoload": {
@@ -3759,7 +3830,81 @@
"identifier",
"uuid"
],
- "time": "2014-08-27 22:39:41"
+ "time": "2014-11-09 18:42:56"
+ },
+ {
+ "name": "roave/security-advisories",
+ "version": "dev-master",
+ "source": {
+ "type": "git",
+ "url": "https://github.com/Roave/SecurityAdvisories.git",
+ "reference": "a1d7d327e9b8017b5a848ccb6a1433f25975f65b"
+ },
+ "dist": {
+ "type": "zip",
+ "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/a1d7d327e9b8017b5a848ccb6a1433f25975f65b",
+ "reference": "a1d7d327e9b8017b5a848ccb6a1433f25975f65b",
+ "shasum": ""
+ },
+ "conflict": {
+ "contao/core": ">=2.11.0,<2.11.16|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.7|>=2.11.0,<2.11.17|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.9|>=2.11.0,<3.0.0|>=3.0.0,<3.1.0|>=3.1.0,<3.2.0|>=3.2.0,<3.2.19|>=3.3.0,<3.4.0|>=3.4.0,<3.4.4",
+ "doctrine/dbal": ">=2.0.0,<2.0.8|>=2.1.0,<2.1.2",
+ "doctrine/doctrine-module": "<=0.7.1|<=0.7.1",
+ "doctrine/orm": ">=2.0.0,<2.0.3",
+ "dompdf/dompdf": ">=0.6.0,<0.6.1",
+ "friendsofsymfony/rest-bundle": ">=1.2.0,<1.2.2",
+ "friendsofsymfony/user-bundle": ">=1.2.0,<1.2.1|>=1.2.0,<1.2.4|>=1.2.0,<1.3.0|>=1.3.0,<1.3.5|>=1.2.0,<1.2.5|>=1.3.0,<1.3.3",
+ "illuminate/auth": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.26",
+ "illuminate/database": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.29",
+ "laravel/framework": ">=4.0.0,<4.0.99|>=4.1.0,<4.1.26|>=4.0.0,<4.0.99|>=4.1.0,<4.1.29",
+ "monolog/monolog": ">=1.8.0,<1.12.0",
+ "sabre/dav": ">=1.6.0,<1.6.9|>=1.7.0,<1.7.7|>=1.8.0,<1.8.5",
+ "socalnick/scn-social-auth": "<1.15.2",
+ "swiftmailer/swiftmailer": ">=4.0.0,<4.99.99|>=5.0.0,<5.2.1",
+ "symfony/dependency-injection": ">=2.0.0,<2.0.17",
+ "symfony/framework-bundle": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.18|>=2.4.0,<2.4.8|>=2.5.0,<2.5.2",
+ "symfony/http-foundation": ">=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
+ "symfony/http-kernel": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
+ "symfony/routing": ">=2.0.0,<2.0.17|>=2.0.0,<2.0.19",
+ "symfony/security": ">=2.0.0,<2.0.19|>=2.0.0,<2.0.25|>=2.1.0,<2.1.13|>=2.2.0,<2.2.9|>=2.3.0,<2.3.6",
+ "symfony/serializer": ">=2.0.0,<2.0.11",
+ "symfony/symfony": ">=2.0.0,<2.0.6|>=2.0.0,<2.0.11|>=2.0.0,<2.0.17|>=2.0.0,<2.0.19|>=2.1.0,<2.1.4|>=2.0.0,<2.0.19|>=2.0.0,<2.0.20|>=2.1.0,<2.1.5|>=2.0.0,<2.0.22|>=2.0.0,<2.0.22|>=2.1.0,<2.1.7|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3|>=2.0.0,<2.0.25|>=2.1.0,<2.1.13|>=2.2.0,<2.2.9|>=2.3.0,<2.3.6|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4|>=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
+ "symfony/translation": ">=2.0.0,<2.0.17",
+ "symfony/validator": ">=2.0.0,<2.0.17|>=2.0.0,<2.0.24|>=2.1.0,<2.1.12|>=2.2.0,<2.2.5|>=2.3.0,<2.3.3",
+ "symfony/web-profiler-bundle": ">=2.0.0,<2.1.0|>=2.1.0,<2.2.0|>=2.2.0,<2.3.0|>=2.3.0,<2.3.19|>=2.4.0,<2.4.9|>=2.5.0,<2.5.4",
+ "symfony/yaml": ">=2.0.0,<2.0.22|>=2.0.0,<2.0.22|>=2.1.0,<2.1.7",
+ "thelia/backoffice-default-template": ">=2.1.0,<2.1.2",
+ "thelia/thelia": ">=2.1.0,<2.1.2",
+ "twig/twig": ">=1.0.0,<1.12.3",
+ "willdurand/js-translation-bundle": "<2.1.1",
+ "yiisoft/yii": ">=1.1.14,<1.1.15",
+ "zendframework/zend-db": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.10|>=2.3.0,<2.3.5",
+ "zendframework/zend-form": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1",
+ "zendframework/zend-json": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6",
+ "zendframework/zend-navigation": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1",
+ "zendframework/zend-session": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.9|>=2.3.0,<2.3.4",
+ "zendframework/zend-view": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1",
+ "zendframework/zend-xmlrpc": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6",
+ "zendframework/zendframework": ">=2.0.0,<2.0.1|>=2.0.0,<2.0.5|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.0.0,<2.0.8|>=2.1.0,<2.1.4|>=2.2.0,<2.2.5|>=2.1.0,<2.1.6|>=2.2.0,<2.2.6|>=2.0.0,<2.2.7|>=2.3.0,<2.3.1|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.8|>=2.3.0,<2.3.3|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.9|>=2.3.0,<2.3.4|>=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.2.0,<2.2.10|>=2.3.0,<2.3.5",
+ "zendframework/zendframework1": ">=1.7.0,<1.7.5|>=1.7.0,<1.7.6|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.7.0,<1.7.9|>=1.8.0,<1.8.5|>=1.9.0,<1.9.7|>=1.9.0,<1.9.8|>=1.10.0,<1.10.3|>=1.0.0,<1.11.4|>=1.10.0,<1.10.9|>=1.11.0,<1.11.6|>=1.0.0,<1.11.13|>=1.0.0,<1.11.13|>=1.11.0,<1.11.15|>=1.12.0,<1.12.1|>=1.12.0,<1.12.4|>=1.12.0,<1.12.4|>=1.12.0,<1.12.7|>=1.12.0,<1.12.9|>=1.12.0,<1.12.9",
+ "zendframework/zendopenid": ">=2.0.0,<2.0.2",
+ "zf-commons/zfc-user": "<1.2.2",
+ "zfr/zfr-oauth2-server-module": "<0.1.2"
+ },
+ "type": "metapackage",
+ "notification-url": "https://packagist.org/downloads/",
+ "license": [
+ "MIT"
+ ],
+ "authors": [
+ {
+ "name": "Marco Pivetta",
+ "email": "ocramius@gmail.com",
+ "role": "maintainer"
+ }
+ ],
+ "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
+ "time": "2015-03-02 13:02:36"
},
{
"name": "silex/silex",
@@ -3978,7 +4123,7 @@
},
{
"name": "Phraseanet Team",
- "email": "support@alchemy.fr",
+ "email": "info@alchemy.fr",
"homepage": "http://www.phraseanet.com/"
}
],
@@ -3992,25 +4137,28 @@
},
{
"name": "swiftmailer/swiftmailer",
- "version": "v4.3.1",
+ "version": "v5.3.1",
"source": {
"type": "git",
"url": "https://github.com/swiftmailer/swiftmailer.git",
- "reference": "ae540bed1079c07aa12e9e62d9d8d4fc49bbdff2"
+ "reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/ae540bed1079c07aa12e9e62d9d8d4fc49bbdff2",
- "reference": "ae540bed1079c07aa12e9e62d9d8d4fc49bbdff2",
+ "url": "https://api.github.com/repos/swiftmailer/swiftmailer/zipball/c5f963e7f9d6f6438fda4f22d5cc2db296ec621a",
+ "reference": "c5f963e7f9d6f6438fda4f22d5cc2db296ec621a",
"shasum": ""
},
"require": {
- "php": ">=5.2.4"
+ "php": ">=5.3.3"
+ },
+ "require-dev": {
+ "mockery/mockery": "~0.9.1"
},
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "4.3-dev"
+ "dev-master": "5.3-dev"
}
},
"autoload": {
@@ -4020,15 +4168,15 @@
},
"notification-url": "https://packagist.org/downloads/",
"license": [
- "LGPL"
+ "MIT"
],
"authors": [
{
- "name": "Fabien Potencier",
- "email": "fabien@symfony.com"
+ "name": "Chris Corbyn"
},
{
- "name": "Chris Corbyn"
+ "name": "Fabien Potencier",
+ "email": "fabien@symfony.com"
}
],
"description": "Swiftmailer, free feature-rich PHP mailer",
@@ -4037,7 +4185,7 @@
"mail",
"mailer"
],
- "time": "2013-04-11 10:22:09"
+ "time": "2014-12-05 14:17:14"
},
{
"name": "symfony/icu",
@@ -4245,25 +4393,31 @@
},
{
"name": "twig/extensions",
- "version": "v1.1.0",
+ "version": "v1.2.0",
"source": {
"type": "git",
- "url": "https://github.com/fabpot/Twig-extensions.git",
- "reference": "c0ab818595338dd5569369bfce2552d02cec5d50"
+ "url": "https://github.com/twigphp/Twig-extensions.git",
+ "reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Twig-extensions/zipball/c0ab818595338dd5569369bfce2552d02cec5d50",
- "reference": "c0ab818595338dd5569369bfce2552d02cec5d50",
+ "url": "https://api.github.com/repos/twigphp/Twig-extensions/zipball/8cf4b9fe04077bd54fc73f4fde83347040c3b8cd",
+ "reference": "8cf4b9fe04077bd54fc73f4fde83347040c3b8cd",
"shasum": ""
},
"require": {
"twig/twig": "~1.12"
},
+ "require-dev": {
+ "symfony/translation": "~2.3"
+ },
+ "suggest": {
+ "symfony/translation": "Allow the time_diff output to be translated"
+ },
"type": "library",
"extra": {
"branch-alias": {
- "dev-master": "1.1.x-dev"
+ "dev-master": "1.2.x-dev"
}
},
"autoload": {
@@ -4278,30 +4432,28 @@
"authors": [
{
"name": "Fabien Potencier",
- "email": "fabien@symfony.com",
- "homepage": "http://fabien.potencier.org",
- "role": "Lead Developer"
+ "email": "fabien@symfony.com"
}
],
"description": "Common additional features for Twig that do not directly belong in core",
- "homepage": "https://github.com/fabpot/Twig-extensions",
+ "homepage": "http://twig.sensiolabs.org/doc/extensions/index.html",
"keywords": [
"i18n",
"text"
],
- "time": "2014-07-05 10:01:35"
+ "time": "2014-10-30 14:30:03"
},
{
"name": "twig/twig",
- "version": "v1.16.0",
+ "version": "v1.16.2",
"source": {
"type": "git",
- "url": "https://github.com/fabpot/Twig.git",
+ "url": "https://github.com/twigphp/Twig.git",
"reference": "8ce37115802e257a984a82d38254884085060024"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/fabpot/Twig/zipball/8ce37115802e257a984a82d38254884085060024",
+ "url": "https://api.github.com/repos/twigphp/Twig/zipball/8ce37115802e257a984a82d38254884085060024",
"reference": "8ce37115802e257a984a82d38254884085060024",
"shasum": ""
},
@@ -4346,7 +4498,7 @@
"keywords": [
"templating"
],
- "time": "2014-07-05 12:19:05"
+ "time": "2014-10-17 12:53:44"
},
{
"name": "vierbergenlars/php-semver",
@@ -5176,16 +5328,16 @@
},
{
"name": "instaclick/php-webdriver",
- "version": "1.4.0",
+ "version": "1.4.1",
"source": {
"type": "git",
"url": "https://github.com/instaclick/php-webdriver.git",
- "reference": "3cf130283b054b50119f887e11b9b5a648d785a9"
+ "reference": "a57b2bcd9467e217134a2248b261b8b3a90ccea0"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/3cf130283b054b50119f887e11b9b5a648d785a9",
- "reference": "3cf130283b054b50119f887e11b9b5a648d785a9",
+ "url": "https://api.github.com/repos/instaclick/php-webdriver/zipball/a57b2bcd9467e217134a2248b261b8b3a90ccea0",
+ "reference": "a57b2bcd9467e217134a2248b261b8b3a90ccea0",
"shasum": ""
},
"require": {
@@ -5219,7 +5371,7 @@
{
"name": "Anthon Pang",
"email": "apang@softwaredevelopment.ca",
- "role": "developer"
+ "role": "Fork Maintainer"
}
],
"description": "PHP WebDriver for Selenium 2",
@@ -5230,7 +5382,7 @@
"webdriver",
"webtest"
],
- "time": "2014-05-08 04:19:19"
+ "time": "2014-05-12 21:03:05"
},
{
"name": "phpunit/php-code-coverage",
@@ -5478,16 +5630,16 @@
},
{
"name": "phpunit/phpunit",
- "version": "3.7.37",
+ "version": "3.7.38",
"source": {
"type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git",
- "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc"
+ "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6"
},
"dist": {
"type": "zip",
- "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
- "reference": "ae6cefd7cc84586a5ef27e04bae11ee940ec63dc",
+ "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/38709dc22d519a3d1be46849868aa2ddf822bcf6",
+ "reference": "38709dc22d519a3d1be46849868aa2ddf822bcf6",
"shasum": ""
},
"require": {
@@ -5547,7 +5699,7 @@
"testing",
"xunit"
],
- "time": "2014-04-30 12:24:19"
+ "time": "2014-10-17 09:04:17"
},
{
"name": "phpunit/phpunit-mock-objects",
@@ -5601,9 +5753,9 @@
],
"aliases": [
{
- "alias": "0.6.1",
- "alias_normalized": "0.6.1.0",
- "version": "dev-0.6.1-flatten-layer",
+ "alias": "0.6.2",
+ "alias_normalized": "0.6.2.0",
+ "version": "dev-alchemy-0.6.2",
"package": "imagine/imagine"
},
{
@@ -5617,16 +5769,19 @@
"stability-flags": {
"alchemy/task-manager": 20,
"alchemy/zippy": 20,
+ "goodby/csv": 20,
"imagine/imagine": 20,
"neutron/process-manager": 20,
"phpexiftool/phpexiftool": 20,
"silex/silex": 20,
"silex/web-profiler": 20,
"doctrine/migrations": 20,
+ "roave/security-advisories": 20,
"behat/behat": 20,
"behat/gherkin": 20
},
"prefer-stable": false,
+ "prefer-lowest": false,
"platform": {
"php": ">=5.4"
},
diff --git a/config/configuration.sample.yml b/config/configuration.sample.yml
index 0b9d0a585e..093160879c 100644
--- a/config/configuration.sample.yml
+++ b/config/configuration.sample.yml
@@ -206,10 +206,6 @@ api_cors:
session:
idle: 0
lifetime: 604800 # 1 week
-static-file:
- enabled: false
- type: nginx
- symlink-directory: ''
crossdomain:
site-control: 'master-only'
allow-access-from:
diff --git a/flash/ImageDisplayx1/caurina/transitions/AuxFunctions.as b/flash/ImageDisplayx1/caurina/transitions/AuxFunctions.as
deleted file mode 100644
index 21704689f2..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/AuxFunctions.as
+++ /dev/null
@@ -1,92 +0,0 @@
-package caurina.transitions {
-
- /**
- * Generic, auxiliary functions
- *
- * @author Zeh Fernando
- * @version 1.0.0
- * @private
- */
-
- public class AuxFunctions {
-
- /**
- * Gets the R (xx0000) bits from a number
- *
- * @param p_num Number Color number (ie, 0xffff00)
- * @return Number The R value
- */
- public static function numberToR(p_num:Number):Number {
- // The initial & is meant to crop numbers bigger than 0xffffff
- return (p_num & 0xff0000) >> 16;
- }
-
- /**
- * Gets the G (00xx00) bits from a number
- *
- * @param p_num Number Color number (ie, 0xffff00)
- * @return Number The G value
- */
- public static function numberToG(p_num:Number):Number {
- return (p_num & 0xff00) >> 8;
- }
-
- /**
- * Gets the B (0000xx) bits from a number
- *
- * @param p_num Number Color number (ie, 0xffff00)
- * @return Number The B value
- */
- public static function numberToB(p_num:Number):Number {
- return (p_num & 0xff);
- }
-
- /**
- * Checks whether a string is on an array
- *
- * @param p_string String String to search for
- * @param p_array Array Array to be searched
- * @return Boolean Whether the array contains the string or not
- */
- public static function isInArray(p_string:String, p_array:Array):Boolean {
- var l:uint = p_array.length;
- for (var i:uint = 0; i < l; i++) {
- if (p_array[i] == p_string) return true;
- }
- return false;
- }
-
- /**
- * Returns the number of properties an object has
- *
- * @param p_object Object Target object with a number of properties
- * @return Number Number of total properties the object has
- */
- public static function getObjectLength(p_object:Object):uint {
- var totalProperties:uint = 0;
- for (var pName:String in p_object) totalProperties ++;
- return totalProperties;
- }
-
- /* Takes a variable number of objects as parameters and "adds" their properties, from left to right. If a latter object defines a property as null, it will be removed from the final object
- * @param args Object(s) A variable number of objects
- * @return Object An object with the sum of all paremeters added as properties.
- */
- public static function concatObjects(...args) : Object{
- var finalObject : Object = {};
- var currentObject : Object;
- for (var i : int = 0; i < args.length; i++){
- currentObject = args[i];
- for (var prop : String in currentObject){
- if (currentObject[prop] == null){
- // delete in case is null
- delete finalObject[prop];
- }else{
- finalObject[prop] = currentObject[prop];
- }
- }
- }
- return finalObject;
- }
- }
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/Equations.as b/flash/ImageDisplayx1/caurina/transitions/Equations.as
deleted file mode 100644
index d9893c4940..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/Equations.as
+++ /dev/null
@@ -1,714 +0,0 @@
-/**
- * Equations
- * Main equations for the Tweener class
- *
- * @author Zeh Fernando, Nate Chatellier
- * @version 1.0.2
- */
-
-/*
-Disclaimer for Robert Penner's Easing Equations license:
-
-TERMS OF USE - EASING EQUATIONS
-
-Open source under the BSD License.
-
-Copyright © 2001 Robert Penner
-All rights reserved.
-
-Redistribution and use in source and binary forms, with or without modification, are permitted provided that the following conditions are met:
-
- * Redistributions of source code must retain the above copyright notice, this list of conditions and the following disclaimer.
- * Redistributions in binary form must reproduce the above copyright notice, this list of conditions and the following disclaimer in the documentation and/or other materials provided with the distribution.
- * Neither the name of the author nor the names of contributors may be used to endorse or promote products derived from this software without specific prior written permission.
-
-THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
-*/
-
-package caurina.transitions {
-
- public class Equations {
-
- /**
- * There's no constructor.
- * @private
- */
- public function Equations () {
- trace ("Equations is a static class and should not be instantiated.")
- }
-
- /**
- * Registers all the equations to the Tweener class, so they can be found by the direct string parameters.
- * This method doesn't actually have to be used - equations can always be referenced by their full function
- * names. But "registering" them make them available as their shorthand string names.
- */
- public static function init():void {
- Tweener.registerTransition("easenone", easeNone);
- Tweener.registerTransition("linear", easeNone); // mx.transitions.easing.None.easeNone
-
- Tweener.registerTransition("easeinquad", easeInQuad); // mx.transitions.easing.Regular.easeIn
- Tweener.registerTransition("easeoutquad", easeOutQuad); // mx.transitions.easing.Regular.easeOut
- Tweener.registerTransition("easeinoutquad", easeInOutQuad); // mx.transitions.easing.Regular.easeInOut
- Tweener.registerTransition("easeoutinquad", easeOutInQuad);
-
- Tweener.registerTransition("easeincubic", easeInCubic);
- Tweener.registerTransition("easeoutcubic", easeOutCubic);
- Tweener.registerTransition("easeinoutcubic", easeInOutCubic);
- Tweener.registerTransition("easeoutincubic", easeOutInCubic);
-
- Tweener.registerTransition("easeinquart", easeInQuart);
- Tweener.registerTransition("easeoutquart", easeOutQuart);
- Tweener.registerTransition("easeinoutquart", easeInOutQuart);
- Tweener.registerTransition("easeoutinquart", easeOutInQuart);
-
- Tweener.registerTransition("easeinquint", easeInQuint);
- Tweener.registerTransition("easeoutquint", easeOutQuint);
- Tweener.registerTransition("easeinoutquint", easeInOutQuint);
- Tweener.registerTransition("easeoutinquint", easeOutInQuint);
-
- Tweener.registerTransition("easeinsine", easeInSine);
- Tweener.registerTransition("easeoutsine", easeOutSine);
- Tweener.registerTransition("easeinoutsine", easeInOutSine);
- Tweener.registerTransition("easeoutinsine", easeOutInSine);
-
- Tweener.registerTransition("easeincirc", easeInCirc);
- Tweener.registerTransition("easeoutcirc", easeOutCirc);
- Tweener.registerTransition("easeinoutcirc", easeInOutCirc);
- Tweener.registerTransition("easeoutincirc", easeOutInCirc);
-
- Tweener.registerTransition("easeinexpo", easeInExpo); // mx.transitions.easing.Strong.easeIn
- Tweener.registerTransition("easeoutexpo", easeOutExpo); // mx.transitions.easing.Strong.easeOut
- Tweener.registerTransition("easeinoutexpo", easeInOutExpo); // mx.transitions.easing.Strong.easeInOut
- Tweener.registerTransition("easeoutinexpo", easeOutInExpo);
-
- Tweener.registerTransition("easeinelastic", easeInElastic); // mx.transitions.easing.Elastic.easeIn
- Tweener.registerTransition("easeoutelastic", easeOutElastic); // mx.transitions.easing.Elastic.easeOut
- Tweener.registerTransition("easeinoutelastic", easeInOutElastic); // mx.transitions.easing.Elastic.easeInOut
- Tweener.registerTransition("easeoutinelastic", easeOutInElastic);
-
- Tweener.registerTransition("easeinback", easeInBack); // mx.transitions.easing.Back.easeIn
- Tweener.registerTransition("easeoutback", easeOutBack); // mx.transitions.easing.Back.easeOut
- Tweener.registerTransition("easeinoutback", easeInOutBack); // mx.transitions.easing.Back.easeInOut
- Tweener.registerTransition("easeoutinback", easeOutInBack);
-
- Tweener.registerTransition("easeinbounce", easeInBounce); // mx.transitions.easing.Bounce.easeIn
- Tweener.registerTransition("easeoutbounce", easeOutBounce); // mx.transitions.easing.Bounce.easeOut
- Tweener.registerTransition("easeinoutbounce", easeInOutBounce); // mx.transitions.easing.Bounce.easeInOut
- Tweener.registerTransition("easeoutinbounce", easeOutInBounce);
- }
-
- // ==================================================================================================================================
- // TWEENING EQUATIONS functions -----------------------------------------------------------------------------------------------------
- // (the original equations are Robert Penner's work as mentioned on the disclaimer)
-
- /**
- * Easing equation function for a simple linear tweening, with no easing.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeNone (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c*t/d + b;
- }
-
- /**
- * Easing equation function for a quadratic (t^2) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c*(t/=d)*t + b;
- }
-
- /**
- * Easing equation function for a quadratic (t^2) easing out: decelerating to zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return -c *(t/=d)*(t-2) + b;
- }
-
- /**
- * Easing equation function for a quadratic (t^2) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if ((t/=d/2) < 1) return c/2*t*t + b;
- return -c/2 * ((--t)*(t-2) - 1) + b;
- }
-
- /**
- * Easing equation function for a quadratic (t^2) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInQuad (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutQuad (t*2, b, c/2, d, p_params);
- return easeInQuad((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for a cubic (t^3) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c*(t/=d)*t*t + b;
- }
-
- /**
- * Easing equation function for a cubic (t^3) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c*((t=t/d-1)*t*t + 1) + b;
- }
-
- /**
- * Easing equation function for a cubic (t^3) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if ((t/=d/2) < 1) return c/2*t*t*t + b;
- return c/2*((t-=2)*t*t + 2) + b;
- }
-
- /**
- * Easing equation function for a cubic (t^3) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInCubic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutCubic (t*2, b, c/2, d, p_params);
- return easeInCubic((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for a quartic (t^4) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c*(t/=d)*t*t*t + b;
- }
-
- /**
- * Easing equation function for a quartic (t^4) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return -c * ((t=t/d-1)*t*t*t - 1) + b;
- }
-
- /**
- * Easing equation function for a quartic (t^4) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if ((t/=d/2) < 1) return c/2*t*t*t*t + b;
- return -c/2 * ((t-=2)*t*t*t - 2) + b;
- }
-
- /**
- * Easing equation function for a quartic (t^4) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInQuart (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutQuart (t*2, b, c/2, d, p_params);
- return easeInQuart((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for a quintic (t^5) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c*(t/=d)*t*t*t*t + b;
- }
-
- /**
- * Easing equation function for a quintic (t^5) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c*((t=t/d-1)*t*t*t*t + 1) + b;
- }
-
- /**
- * Easing equation function for a quintic (t^5) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if ((t/=d/2) < 1) return c/2*t*t*t*t*t + b;
- return c/2*((t-=2)*t*t*t*t + 2) + b;
- }
-
- /**
- * Easing equation function for a quintic (t^5) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInQuint (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutQuint (t*2, b, c/2, d, p_params);
- return easeInQuint((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for a sinusoidal (sin(t)) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return -c * Math.cos(t/d * (Math.PI/2)) + c + b;
- }
-
- /**
- * Easing equation function for a sinusoidal (sin(t)) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c * Math.sin(t/d * (Math.PI/2)) + b;
- }
-
- /**
- * Easing equation function for a sinusoidal (sin(t)) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return -c/2 * (Math.cos(Math.PI*t/d) - 1) + b;
- }
-
- /**
- * Easing equation function for a sinusoidal (sin(t)) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInSine (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutSine (t*2, b, c/2, d, p_params);
- return easeInSine((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for an exponential (2^t) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return (t==0) ? b : c * Math.pow(2, 10 * (t/d - 1)) + b - c * 0.001;
- }
-
- /**
- * Easing equation function for an exponential (2^t) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return (t==d) ? b+c : c * 1.001 * (-Math.pow(2, -10 * t/d) + 1) + b;
- }
-
- /**
- * Easing equation function for an exponential (2^t) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t==0) return b;
- if (t==d) return b+c;
- if ((t/=d/2) < 1) return c/2 * Math.pow(2, 10 * (t - 1)) + b - c * 0.0005;
- return c/2 * 1.0005 * (-Math.pow(2, -10 * --t) + 2) + b;
- }
-
- /**
- * Easing equation function for an exponential (2^t) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInExpo (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutExpo (t*2, b, c/2, d, p_params);
- return easeInExpo((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for a circular (sqrt(1-t^2)) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return -c * (Math.sqrt(1 - (t/=d)*t) - 1) + b;
- }
-
- /**
- * Easing equation function for a circular (sqrt(1-t^2)) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c * Math.sqrt(1 - (t=t/d-1)*t) + b;
- }
-
- /**
- * Easing equation function for a circular (sqrt(1-t^2)) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if ((t/=d/2) < 1) return -c/2 * (Math.sqrt(1 - t*t) - 1) + b;
- return c/2 * (Math.sqrt(1 - (t-=2)*t) + 1) + b;
- }
-
- /**
- * Easing equation function for a circular (sqrt(1-t^2)) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInCirc (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutCirc (t*2, b, c/2, d, p_params);
- return easeInCirc((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for an elastic (exponentially decaying sine wave) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param a Amplitude.
- * @param p Period.
- * @return The correct value.
- */
- public static function easeInElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t==0) return b;
- if ((t/=d)==1) return b+c;
- var p:Number = !Boolean(p_params) || isNaN(p_params.period) ? d*.3 : p_params.period;
- var s:Number;
- var a:Number = !Boolean(p_params) || isNaN(p_params.amplitude) ? 0 : p_params.amplitude;
- if (!Boolean(a) || a < Math.abs(c)) {
- a = c;
- s = p/4;
- } else {
- s = p/(2*Math.PI) * Math.asin (c/a);
- }
- return -(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- }
-
- /**
- * Easing equation function for an elastic (exponentially decaying sine wave) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param a Amplitude.
- * @param p Period.
- * @return The correct value.
- */
- public static function easeOutElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t==0) return b;
- if ((t/=d)==1) return b+c;
- var p:Number = !Boolean(p_params) || isNaN(p_params.period) ? d*.3 : p_params.period;
- var s:Number;
- var a:Number = !Boolean(p_params) || isNaN(p_params.amplitude) ? 0 : p_params.amplitude;
- if (!Boolean(a) || a < Math.abs(c)) {
- a = c;
- s = p/4;
- } else {
- s = p/(2*Math.PI) * Math.asin (c/a);
- }
- return (a*Math.pow(2,-10*t) * Math.sin( (t*d-s)*(2*Math.PI)/p ) + c + b);
- }
-
- /**
- * Easing equation function for an elastic (exponentially decaying sine wave) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param a Amplitude.
- * @param p Period.
- * @return The correct value.
- */
- public static function easeInOutElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t==0) return b;
- if ((t/=d/2)==2) return b+c;
- var p:Number = !Boolean(p_params) || isNaN(p_params.period) ? d*(.3*1.5) : p_params.period;
- var s:Number;
- var a:Number = !Boolean(p_params) || isNaN(p_params.amplitude) ? 0 : p_params.amplitude;
- if (!Boolean(a) || a < Math.abs(c)) {
- a = c;
- s = p/4;
- } else {
- s = p/(2*Math.PI) * Math.asin (c/a);
- }
- if (t < 1) return -.5*(a*Math.pow(2,10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )) + b;
- return a*Math.pow(2,-10*(t-=1)) * Math.sin( (t*d-s)*(2*Math.PI)/p )*.5 + c + b;
- }
-
- /**
- * Easing equation function for an elastic (exponentially decaying sine wave) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param a Amplitude.
- * @param p Period.
- * @return The correct value.
- */
- public static function easeOutInElastic (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutElastic (t*2, b, c/2, d, p_params);
- return easeInElastic((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
- * @return The correct value.
- */
- public static function easeInBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- var s:Number = !Boolean(p_params) || isNaN(p_params.overshoot) ? 1.70158 : p_params.overshoot;
- return c*(t/=d)*t*((s+1)*t - s) + b;
- }
-
- /**
- * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
- * @return The correct value.
- */
- public static function easeOutBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- var s:Number = !Boolean(p_params) || isNaN(p_params.overshoot) ? 1.70158 : p_params.overshoot;
- return c*((t=t/d-1)*t*((s+1)*t + s) + 1) + b;
- }
-
- /**
- * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
- * @return The correct value.
- */
- public static function easeInOutBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- var s:Number = !Boolean(p_params) || isNaN(p_params.overshoot) ? 1.70158 : p_params.overshoot;
- if ((t/=d/2) < 1) return c/2*(t*t*(((s*=(1.525))+1)*t - s)) + b;
- return c/2*((t-=2)*t*(((s*=(1.525))+1)*t + s) + 2) + b;
- }
-
- /**
- * Easing equation function for a back (overshooting cubic easing: (s+1)*t^3 - s*t^2) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @param s Overshoot ammount: higher s means greater overshoot (0 produces cubic easing with no overshoot, and the default value of 1.70158 produces an overshoot of 10 percent).
- * @return The correct value.
- */
- public static function easeOutInBack (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutBack (t*2, b, c/2, d, p_params);
- return easeInBack((t*2)-d, b+c/2, c/2, d, p_params);
- }
-
- /**
- * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in: accelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- return c - easeOutBounce (d-t, 0, c, d) + b;
- }
-
- /**
- * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out: decelerating from zero velocity.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if ((t/=d) < (1/2.75)) {
- return c*(7.5625*t*t) + b;
- } else if (t < (2/2.75)) {
- return c*(7.5625*(t-=(1.5/2.75))*t + .75) + b;
- } else if (t < (2.5/2.75)) {
- return c*(7.5625*(t-=(2.25/2.75))*t + .9375) + b;
- } else {
- return c*(7.5625*(t-=(2.625/2.75))*t + .984375) + b;
- }
- }
-
- /**
- * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing in/out: acceleration until halfway, then deceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeInOutBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeInBounce (t*2, 0, c, d) * .5 + b;
- else return easeOutBounce (t*2-d, 0, c, d) * .5 + c*.5 + b;
- }
-
- /**
- * Easing equation function for a bounce (exponentially decaying parabolic bounce) easing out/in: deceleration until halfway, then acceleration.
- *
- * @param t Current time (in frames or seconds).
- * @param b Starting value.
- * @param c Change needed in value.
- * @param d Expected easing duration (in frames or seconds).
- * @return The correct value.
- */
- public static function easeOutInBounce (t:Number, b:Number, c:Number, d:Number, p_params:Object = null):Number {
- if (t < d/2) return easeOutBounce (t*2, b, c/2, d, p_params);
- return easeInBounce((t*2)-d, b+c/2, c/2, d, p_params);
- }
- }
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/PropertyInfoObj.as b/flash/ImageDisplayx1/caurina/transitions/PropertyInfoObj.as
deleted file mode 100644
index 132aaa5c0e..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/PropertyInfoObj.as
+++ /dev/null
@@ -1,90 +0,0 @@
-package caurina.transitions {
-
- /**
- * PropertyInfoObj
- * An object containing the updating info for a given property (its starting value, and its final value)
- *
- * @author Zeh Fernando
- * @version 1.0.0
- * @private
- */
-
- public class PropertyInfoObj {
-
- public var valueStart :Number; // Starting value of the tweening (null if not started yet)
- public var valueComplete :Number; // Final desired value
- public var originalValueComplete :Object; // Final desired value as declared initially
- public var arrayIndex :Number; // Index (if this is an array item)
- public var extra :Object; // Additional parameters, used by some special properties
- public var isSpecialProperty :Boolean; // Whether or not this is a special property instead of a direct one
- public var hasModifier :Boolean; // Whether or not it has a modifier function
- public var modifierFunction :Function; // Modifier function, if any
- public var modifierParameters :Array; // Additional array of modifier parameters
-
- // ==================================================================================================================================
- // CONSTRUCTOR function -------------------------------------------------------------------------------------------------------------
-
- /**
- * Initializes the basic PropertyInfoObj.
- *
- * @param p_valueStart Number Starting value of the tweening (null if not started yet)
- * @param p_valueComplete Number Final (desired) property value
- */
- function PropertyInfoObj(p_valueStart:Number, p_valueComplete:Number, p_originalValueComplete:Object, p_arrayIndex:Number, p_extra:Object, p_isSpecialProperty:Boolean, p_modifierFunction:Function, p_modifierParameters:Array) {
- valueStart = p_valueStart;
- valueComplete = p_valueComplete;
- originalValueComplete = p_originalValueComplete;
- arrayIndex = p_arrayIndex;
- extra = p_extra;
- isSpecialProperty = p_isSpecialProperty;
- hasModifier = Boolean(p_modifierFunction);
- modifierFunction = p_modifierFunction;
- modifierParameters = p_modifierParameters;
- }
-
-
- // ==================================================================================================================================
- // OTHER functions ------------------------------------------------------------------------------------------------------------------
-
- /**
- * Clones this property info and returns the new PropertyInfoObj
- *
- * @param omitEvents Boolean Whether or not events such as onStart (and its parameters) should be omitted
- * @return TweenListObj A copy of this object
- */
- public function clone():PropertyInfoObj {
- var nProperty:PropertyInfoObj = new PropertyInfoObj(valueStart, valueComplete, originalValueComplete, arrayIndex, extra, isSpecialProperty, modifierFunction, modifierParameters);
- return nProperty;
- }
-
- /**
- * Returns this object described as a String.
- *
- * @return String The description of this object.
- */
- public function toString():String {
- var returnStr:String = "\n[PropertyInfoObj ";
- returnStr += "valueStart:" + String(valueStart);
- returnStr += ", ";
- returnStr += "valueComplete:" + String(valueComplete);
- returnStr += ", ";
- returnStr += "originalValueComplete:" + String(originalValueComplete);
- returnStr += ", ";
- returnStr += "arrayIndex:" + String(arrayIndex);
- returnStr += ", ";
- returnStr += "extra:" + String(extra);
- returnStr += ", ";
- returnStr += "isSpecialProperty:" + String(isSpecialProperty);
- returnStr += ", ";
- returnStr += "hasModifier:" + String(hasModifier);
- returnStr += ", ";
- returnStr += "modifierFunction:" + String(modifierFunction);
- returnStr += ", ";
- returnStr += "modifierParameters:" + String(modifierParameters);
- returnStr += "]\n";
- return returnStr;
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/SpecialProperty.as b/flash/ImageDisplayx1/caurina/transitions/SpecialProperty.as
deleted file mode 100644
index a261597483..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/SpecialProperty.as
+++ /dev/null
@@ -1,49 +0,0 @@
-package caurina.transitions {
-
- /**
- * SpecialProperty
- * A kind of a getter/setter for special properties
- *
- * @author Zeh Fernando
- * @version 1.0.0
- * @private
- */
-
- public class SpecialProperty {
-
- public var getValue:Function; // (p_obj:Object, p_parameters:Array, p_extra:Object): Number
- public var setValue:Function; // (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object): Void
- public var parameters:Array;
- public var preProcess:Function; // (p_obj:Object, p_parameters:Array, p_originalValueComplete:Object, p_extra:Object): Number
-
- /**
- * Builds a new special property object.
- *
- * @param p_getFunction Function Reference to the function used to get the special property value
- * @param p_setFunction Function Reference to the function used to set the special property value
- */
- public function SpecialProperty (p_getFunction:Function, p_setFunction:Function, p_parameters:Array = null, p_preProcessFunction:Function = null) {
- getValue = p_getFunction;
- setValue = p_setFunction;
- parameters = p_parameters;
- preProcess = p_preProcessFunction;
- }
-
- /**
- * Converts the instance to a string that can be used when trace()ing the object
- */
- public function toString():String {
- var value:String = "";
- value += "[SpecialProperty ";
- value += "getValue:"+String(getValue);
- value += ", ";
- value += "setValue:"+String(setValue);
- value += ", ";
- value += "parameters:"+String(parameters);
- value += ", ";
- value += "preProcess:"+String(preProcess);
- value += "]";
- return value;
- }
- }
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/SpecialPropertyModifier.as b/flash/ImageDisplayx1/caurina/transitions/SpecialPropertyModifier.as
deleted file mode 100644
index 049af18f65..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/SpecialPropertyModifier.as
+++ /dev/null
@@ -1,42 +0,0 @@
-package caurina.transitions {
-
- /**
- * SpecialPropertyModifier
- * A special property which actually acts on other properties
- *
- * @author Zeh Fernando
- * @version 1.0.0
- * @private
- */
-
- public class SpecialPropertyModifier {
-
- public var modifyValues:Function;
- public var getValue:Function;
-
- /**
- * Builds a new special property modifier object.
- *
- * @param p_modifyFunction Function Function that returns the modifider parameters.
- */
- public function SpecialPropertyModifier (p_modifyFunction:Function, p_getFunction:Function) {
- modifyValues = p_modifyFunction;
- getValue = p_getFunction;
- }
-
- /**
- * Converts the instance to a string that can be used when trace()ing the object
- */
- public function toString():String {
- var value:String = "";
- value += "[SpecialPropertyModifier ";
- value += "modifyValues:"+String(modifyValues);
- value += ", ";
- value += "getValue:"+String(getValue);
- value += "]";
- return value;
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/SpecialPropertySplitter.as b/flash/ImageDisplayx1/caurina/transitions/SpecialPropertySplitter.as
deleted file mode 100644
index eeef9033f7..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/SpecialPropertySplitter.as
+++ /dev/null
@@ -1,42 +0,0 @@
-package caurina.transitions {
-
- /**
- * SpecialPropertySplitter
- * A proxy setter for special properties
- *
- * @author Zeh Fernando
- * @version 1.0.0
- * @private
- */
-
- public class SpecialPropertySplitter {
-
- public var parameters:Array;
- public var splitValues:Function;
-
- /**
- * Builds a new group special property object.
- *
- * @param p_splitFunction Function Reference to the function used to split a value
- */
- public function SpecialPropertySplitter (p_splitFunction:Function, p_parameters:Array) {
- splitValues = p_splitFunction;
- parameters = p_parameters;
- }
-
- /**
- * Converts the instance to a string that can be used when trace()ing the object
- */
- public function toString():String {
- var value:String = "";
- value += "[SpecialPropertySplitter ";
- value += "splitValues:"+String(splitValues); // .toString();
- value += ", ";
- value += "parameters:"+String(parameters);
- value += "]";
- return value;
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/TweenListObj.as b/flash/ImageDisplayx1/caurina/transitions/TweenListObj.as
deleted file mode 100644
index 77fa1fef39..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/TweenListObj.as
+++ /dev/null
@@ -1,236 +0,0 @@
-package caurina.transitions {
- import caurina.transitions.AuxFunctions;
- /**
- * The tween list object. Stores all of the properties and information that pertain to individual tweens.
- *
- * @author Nate Chatellier, Zeh Fernando
- * @version 1.0.4
- * @private
- */
-
- public class TweenListObj {
-
- public var scope :Object; // Object affected by this tweening
- public var properties :Object; // List of properties that are tweened (PropertyInfoObj instances)
- // .valueStart :Number // Initial value of the property
- // .valueComplete :Number // The value the property should have when completed
- public var timeStart :Number; // Time when this tweening should start
- public var timeComplete :Number; // Time when this tweening should end
- public var useFrames :Boolean; // Whether or not to use frames instead of time
- public var transition :Function; // Equation to control the transition animation
- public var transitionParams :Object; // Additional parameters for the transition
- public var onStart :Function; // Function to be executed on the object when the tween starts (once)
- public var onUpdate :Function; // Function to be executed on the object when the tween updates (several times)
- public var onComplete :Function; // Function to be executed on the object when the tween completes (once)
- public var onOverwrite :Function; // Function to be executed on the object when the tween is overwritten
- public var onError :Function; // Function to be executed if an error is thrown when tweener exectues a callback (onComplete, onUpdate etc)
- public var onStartParams :Array; // Array of parameters to be passed for the event
- public var onUpdateParams :Array; // Array of parameters to be passed for the event
- public var onCompleteParams :Array; // Array of parameters to be passed for the event
- public var onOverwriteParams :Array; // Array of parameters to be passed for the event
- public var onStartScope :Object; // Scope in which the event function is ran
- public var onUpdateScope :Object; // Scope in which the event function is ran
- public var onCompleteScope :Object; // Scope in which the event function is ran
- public var onOverwriteScope :Object; // Scope in which the event function is ran
- public var onErrorScope :Object; // Scope in which the event function is ran
- public var rounded :Boolean; // Use rounded values when updating
- public var isPaused :Boolean; // Whether or not this tween is paused
- public var timePaused :Number; // Time when this tween was paused
- public var isCaller :Boolean; // Whether or not this tween is a "caller" tween
- public var count :Number; // Number of times this caller should be called
- public var timesCalled :Number; // How many times the caller has already been called ("caller" tweens only)
- public var waitFrames :Boolean; // Whether or not this caller should wait at least one frame for each call execution ("caller" tweens only)
- public var skipUpdates :Number; // How many updates should be skipped (default = 0; 1 = update-skip-update-skip...)
- public var updatesSkipped :Number; // How many updates have already been skipped
- public var hasStarted :Boolean; // Whether or not this tween has already started
-
- // ==================================================================================================================================
- // CONSTRUCTOR function -------------------------------------------------------------------------------------------------------------
-
- /**
- * Initializes the basic TweenListObj.
- *
- * @param p_scope Object Object affected by this tweening
- * @param p_timeStart Number Time when this tweening should start
- * @param p_timeComplete Number Time when this tweening should end
- * @param p_useFrames Boolean Whether or not to use frames instead of time
- * @param p_transition Function Equation to control the transition animation
- */
- function TweenListObj(p_scope:Object, p_timeStart:Number, p_timeComplete:Number, p_useFrames:Boolean, p_transition:Function, p_transitionParams:Object) {
- scope = p_scope;
- timeStart = p_timeStart;
- timeComplete = p_timeComplete;
- useFrames = p_useFrames;
- transition = p_transition;
- transitionParams = p_transitionParams;
-
- // Other default information
- properties = new Object();
- isPaused = false;
- timePaused = undefined;
- isCaller = false;
- updatesSkipped = 0;
- timesCalled = 0;
- skipUpdates = 0;
- hasStarted = false;
- }
-
-
- // ==================================================================================================================================
- // OTHER functions ------------------------------------------------------------------------------------------------------------------
-
- /**
- * Clones this tweening and returns the new TweenListObj
- *
- * @param omitEvents Boolean Whether or not events such as onStart (and its parameters) should be omitted
- * @return TweenListObj A copy of this object
- */
- public function clone(omitEvents:Boolean):TweenListObj {
- var nTween:TweenListObj = new TweenListObj(scope, timeStart, timeComplete, useFrames, transition, transitionParams);
- nTween.properties = new Array();
- for (var pName:String in properties) {
- nTween.properties[pName] = properties[pName].clone();
- }
- nTween.skipUpdates = skipUpdates;
- nTween.updatesSkipped = updatesSkipped;
- if (!omitEvents) {
- nTween.onStart = onStart;
- nTween.onUpdate = onUpdate;
- nTween.onComplete = onComplete;
- nTween.onOverwrite = onOverwrite;
- nTween.onError = onError;
- nTween.onStartParams = onStartParams;
- nTween.onUpdateParams = onUpdateParams;
- nTween.onCompleteParams = onCompleteParams;
- nTween.onOverwriteParams = onOverwriteParams;
- nTween.onStartScope = onStartScope;
- nTween.onUpdateScope = onUpdateScope;
- nTween.onCompleteScope = onCompleteScope;
- nTween.onOverwriteScope = onOverwriteScope;
- nTween.onErrorScope = onErrorScope;
- }
- nTween.rounded = rounded;
- nTween.isPaused = isPaused;
- nTween.timePaused = timePaused;
- nTween.isCaller = isCaller;
- nTween.count = count;
- nTween.timesCalled = timesCalled;
- nTween.waitFrames = waitFrames;
- nTween.hasStarted = hasStarted;
-
- return nTween;
- }
-
- /**
- * Returns this object described as a String.
- *
- * @return String The description of this object.
- */
- public function toString():String {
- var returnStr:String = "\n[TweenListObj ";
- returnStr += "scope:" + String(scope);
- returnStr += ", properties:";
- var isFirst:Boolean = true;
- for (var i:String in properties) {
- if (!isFirst) returnStr += ",";
- returnStr += "[name:"+properties[i].name;
- returnStr += ",valueStart:"+properties[i].valueStart;
- returnStr += ",valueComplete:"+properties[i].valueComplete;
- returnStr += "]";
- isFirst = false;
- }
- returnStr += ", timeStart:" + String(timeStart);
- returnStr += ", timeComplete:" + String(timeComplete);
- returnStr += ", useFrames:" + String(useFrames);
- returnStr += ", transition:" + String(transition);
- returnStr += ", transitionParams:" + String(transitionParams);
-
- if (skipUpdates) returnStr += ", skipUpdates:" + String(skipUpdates);
- if (updatesSkipped) returnStr += ", updatesSkipped:" + String(updatesSkipped);
-
- if (Boolean(onStart)) returnStr += ", onStart:" + String(onStart);
- if (Boolean(onUpdate)) returnStr += ", onUpdate:" + String(onUpdate);
- if (Boolean(onComplete)) returnStr += ", onComplete:" + String(onComplete);
- if (Boolean(onOverwrite)) returnStr += ", onOverwrite:" + String(onOverwrite);
- if (Boolean(onError)) returnStr += ", onError:" + String(onError);
-
- if (onStartParams) returnStr += ", onStartParams:" + String(onStartParams);
- if (onUpdateParams) returnStr += ", onUpdateParams:" + String(onUpdateParams);
- if (onCompleteParams) returnStr += ", onCompleteParams:" + String(onCompleteParams);
- if (onOverwriteParams) returnStr += ", onOverwriteParams:" + String(onOverwriteParams);
-
- if (onStartScope) returnStr += ", onStartScope:" + String(onStartScope);
- if (onUpdateScope) returnStr += ", onUpdateScope:" + String(onUpdateScope);
- if (onCompleteScope) returnStr += ", onCompleteScope:" + String(onCompleteScope);
- if (onOverwriteScope) returnStr += ", onOverwriteScope:" + String(onOverwriteScope);
- if (onErrorScope) returnStr += ", onErrorScope:" + String(onErrorScope);
-
- if (rounded) returnStr += ", rounded:" + String(rounded);
- if (isPaused) returnStr += ", isPaused:" + String(isPaused);
- if (timePaused) returnStr += ", timePaused:" + String(timePaused);
- if (isCaller) returnStr += ", isCaller:" + String(isCaller);
- if (count) returnStr += ", count:" + String(count);
- if (timesCalled) returnStr += ", timesCalled:" + String(timesCalled);
- if (waitFrames) returnStr += ", waitFrames:" + String(waitFrames);
- if (hasStarted) returnStr += ", hasStarted:" + String(hasStarted);
-
- returnStr += "]\n";
- return returnStr;
- }
-
- /**
- * Checks if p_obj "inherits" properties from other objects, as set by the "base" property. Will create a new object, leaving others intact.
- * o_bj.base can be an object or an array of objects. Properties are collected from the first to the last element of the "base" filed, with higher
- * indexes overwritting smaller ones. Does not modify any of the passed objects, but makes a shallow copy of all properties.
- *
- * @param p_obj Object Object that should be tweened: a movieclip, textfield, etc.. OR an array of objects
- * @return Object A new object with all properties from the p_obj and p_obj.base.
- */
-
- public static function makePropertiesChain(p_obj : Object) : Object{
- // Is this object inheriting properties from another object?
- var baseObject : Object = p_obj.base;
- if(baseObject){
- // object inherits. Are we inheriting from an object or an array
- var chainedObject : Object = {};
- var chain : Object;
- if (baseObject is Array){
- // Inheritance chain is the base array
- chain = [];
- // make a shallow copy
- for (var k : Number = 0 ; k< baseObject.length; k++) chain.push(baseObject[k]);
- }else{
- // Only one object to be added to the array
- chain = [baseObject];
- }
- // add the final object to the array, so it's properties are added last
- chain.push(p_obj);
- var currChainObj : Object;
- // Loops through each object adding it's property to the final object
- var len : Number = chain.length;
- for(var i : Number = 0; i < len ; i ++){
- if(chain[i]["base"]){
- // deal with recursion: watch the order! "parent" base must be concatenated first!
- currChainObj = AuxFunctions.concatObjects( makePropertiesChain(chain[i]["base"] ), chain[i]);
- }else{
- currChainObj = chain[i] ;
- }
- chainedObject = AuxFunctions.concatObjects(chainedObject, currChainObj );
- }
- if( chainedObject["base"]){
- delete chainedObject["base"];
- }
- return chainedObject;
- }else{
- // No inheritance, just return the object it self
- return p_obj;
- }
- }
-
-
- }
-
-
-
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/Tweener.as b/flash/ImageDisplayx1/caurina/transitions/Tweener.as
deleted file mode 100644
index 7afa244a51..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/Tweener.as
+++ /dev/null
@@ -1,1105 +0,0 @@
-/**
- * Tweener
- * Transition controller for movieclips, sounds, textfields and other objects
- *
- * @author Zeh Fernando, Nate Chatellier, Arthur Debert
- * @version 1.31.71
- */
-
-/*
-Licensed under the MIT License
-
-Copyright (c) 2006-2007 Zeh Fernando and Nate Chatellier
-
-Permission is hereby granted, free of charge, to any person obtaining a copy of
-this software and associated documentation files (the "Software"), to deal in
-the Software without restriction, including without limitation the rights to
-use, copy, modify, merge, publish, distribute, sublicense, and/or sell copies of
-the Software, and to permit persons to whom the Software is furnished to do so,
-subject to the following conditions:
-
-The above copyright notice and this permission notice shall be included in all
-copies or substantial portions of the Software.
-
-THE SOFTWARE IS PROVIDED "AS IS", WITHOUT WARRANTY OF ANY KIND, EXPRESS OR
-IMPLIED, INCLUDING BUT NOT LIMITED TO THE WARRANTIES OF MERCHANTABILITY, FITNESS
-FOR A PARTICULAR PURPOSE AND NONINFRINGEMENT. IN NO EVENT SHALL THE AUTHORS OR
-COPYRIGHT HOLDERS BE LIABLE FOR ANY CLAIM, DAMAGES OR OTHER LIABILITY, WHETHER
-IN AN ACTION OF CONTRACT, TORT OR OTHERWISE, ARISING FROM, OUT OF OR IN
-CONNECTION WITH THE SOFTWARE OR THE USE OR OTHER DEALINGS IN THE SOFTWARE.
-
-http://code.google.com/p/tweener/
-http://code.google.com/p/tweener/wiki/License
-*/
-
-package caurina.transitions {
-
- import flash.display.*;
- import flash.events.Event;
- import flash.utils.getTimer;
-
- public class Tweener {
-
- private static var __tweener_controller__:MovieClip; // Used to ensure the stage copy is always accessible (garbage collection)
-
- private static var _engineExists:Boolean = false; // Whether or not the engine is currently running
- private static var _inited:Boolean = false; // Whether or not the class has been initiated
- private static var _currentTime:Number; // The current time. This is generic for all tweenings for a "time grid" based update
- private static var _currentTimeFrame:Number; // The current frame. Used on frame-based tweenings
-
- private static var _tweenList:Array; // List of active tweens
-
- private static var _timeScale:Number = 1; // Time scale (default = 1)
-
- private static var _transitionList:Object; // List of "pre-fetched" transition functions
- private static var _specialPropertyList:Object; // List of special properties
- private static var _specialPropertyModifierList:Object; // List of special property modifiers
- private static var _specialPropertySplitterList:Object; // List of special property splitters
-
-
- /**
- * There's no constructor.
- * @private
- */
- public function Tweener () {
- trace ("Tweener is a static class and should not be instantiated.");
- }
-
- // ==================================================================================================================================
- // TWEENING CONTROL functions -------------------------------------------------------------------------------------------------------
-
- /**
- * Adds a new tweening.
- *
- * @param (first-n param) Object Object that should be tweened: a movieclip, textfield, etc.. OR an array of objects
- * @param (last param) Object Object containing the specified parameters in any order, as well as the properties that should be tweened and their values
- * @param .time Number Time in seconds or frames for the tweening to take (defaults 2)
- * @param .delay Number Delay time (defaults 0)
- * @param .useFrames Boolean Whether to use frames instead of seconds for time control (defaults false)
- * @param .transition String/Function Type of transition equation... (defaults to "easeoutexpo")
- * @param .onStart Function * Direct property, See the TweenListObj class
- * @param .onUpdate Function * Direct property, See the TweenListObj class
- * @param .onComplete Function * Direct property, See the TweenListObj class
- * @param .onOverwrite Function * Direct property, See the TweenListObj class
- * @param .onStartParams Array * Direct property, See the TweenListObj class
- * @param .onUpdateParams Array * Direct property, See the TweenListObj class
- * @param .onCompleteParams Array * Direct property, See the TweenListObj class
- * @param .onOverwriteParams Array * Direct property, See the TweenListObj class
- * @param .rounded Boolean * Direct property, See the TweenListObj class
- * @param .skipUpdates Number * Direct property, See the TweenListObj class
- * @return Boolean TRUE if the tween was successfully added, FALSE if otherwise
- */
- public static function addTween (p_scopes:Object = null, p_parameters:Object = null):Boolean {
- if (!Boolean(p_scopes)) return false;
-
- var i:Number, j:Number, istr:String;
-
- var rScopes:Array; // List of objects to tween
- if (p_scopes is Array) {
- // The first argument is an array
- rScopes = p_scopes.concat();
- } else {
- // The first argument(s) is(are) object(s)
- rScopes = [p_scopes];
- }
-
- // make properties chain ("inheritance")
- var p_obj:Object = TweenListObj.makePropertiesChain(p_parameters);
-
- // Creates the main engine if it isn't active
- if (!_inited) init();
- if (!_engineExists || !Boolean(__tweener_controller__)) startEngine(); // Quick fix for Flash not resetting the vars on double ctrl+enter...
-
- // Creates a "safer", more strict tweening object
- var rTime:Number = (isNaN(p_obj.time) ? 0 : p_obj.time); // Real time
- var rDelay:Number = (isNaN(p_obj.delay) ? 0 : p_obj.delay); // Real delay
-
- // Creates the property list; everything that isn't a hardcoded variable
- var rProperties:Array = new Array(); // Object containing a list of PropertyInfoObj instances
- var restrictedWords:Object = {time:true, delay:true, useFrames:true, skipUpdates:true, transition:true, transitionParams:true, onStart:true, onUpdate:true, onComplete:true, onOverwrite:true, onError:true, rounded:true, onStartParams:true, onUpdateParams:true, onCompleteParams:true, onOverwriteParams:true, onStartScope:true, onUpdateScope:true, onCompleteScope:true, onOverwriteScope:true, onErrorScope:true};
- var modifiedProperties:Object = new Object();
- for (istr in p_obj) {
- if (!restrictedWords[istr]) {
- // It's an additional pair, so adds
- if (_specialPropertySplitterList[istr]) {
- // Special property splitter
- var splitProperties:Array = _specialPropertySplitterList[istr].splitValues(p_obj[istr], _specialPropertySplitterList[istr].parameters);
- for (i = 0; i < splitProperties.length; i++) {
- if (_specialPropertySplitterList[splitProperties[i].name]) {
- var splitProperties2:Array = _specialPropertySplitterList[splitProperties[i].name].splitValues(splitProperties[i].value, _specialPropertySplitterList[splitProperties[i].name].parameters);
- for (j = 0; j < splitProperties2.length; j++) {
- rProperties[splitProperties2[j].name] = {valueStart:undefined, valueComplete:splitProperties2[j].value, arrayIndex:splitProperties2[j].arrayIndex, isSpecialProperty:false};
- }
- } else {
- rProperties[splitProperties[i].name] = {valueStart:undefined, valueComplete:splitProperties[i].value, arrayIndex:splitProperties[i].arrayIndex, isSpecialProperty:false};
- }
- }
- } else if (_specialPropertyModifierList[istr] != undefined) {
- // Special property modifier
- var tempModifiedProperties:Array = _specialPropertyModifierList[istr].modifyValues(p_obj[istr]);
- for (i = 0; i < tempModifiedProperties.length; i++) {
- modifiedProperties[tempModifiedProperties[i].name] = {modifierParameters:tempModifiedProperties[i].parameters, modifierFunction:_specialPropertyModifierList[istr].getValue};
- }
- } else {
- // Regular property or special property, just add the property normally
- rProperties[istr] = {valueStart:undefined, valueComplete:p_obj[istr]};
- }
- }
- }
-
- // Verifies whether the properties exist or not, for warning messages
- for (istr in rProperties) {
- if (_specialPropertyList[istr] != undefined) {
- rProperties[istr].isSpecialProperty = true;
- } else {
- if (rScopes[0][istr] == undefined) {
- printError("The property '" + istr + "' doesn't seem to be a normal object property of " + String(rScopes[0]) + " or a registered special property.");
- }
- }
- }
-
- // Adds the modifiers to the list of properties
- for (istr in modifiedProperties) {
- if (rProperties[istr] != undefined) {
- rProperties[istr].modifierParameters = modifiedProperties[istr].modifierParameters;
- rProperties[istr].modifierFunction = modifiedProperties[istr].modifierFunction;
- }
-
- }
-
- var rTransition:Function; // Real transition
-
- if (typeof p_obj.transition == "string") {
- // String parameter, transition names
- var trans:String = p_obj.transition.toLowerCase();
- rTransition = _transitionList[trans];
- } else {
- // Proper transition function
- rTransition = p_obj.transition;
- }
- if (!Boolean(rTransition)) rTransition = _transitionList["easeoutexpo"];
-
- var nProperties:Object;
- var nTween:TweenListObj;
- var myT:Number;
-
- for (i = 0; i < rScopes.length; i++) {
- // Makes a copy of the properties
- nProperties = new Object();
- for (istr in rProperties) {
- nProperties[istr] = new PropertyInfoObj(rProperties[istr].valueStart, rProperties[istr].valueComplete, rProperties[istr].valueComplete, rProperties[istr].arrayIndex, {}, rProperties[istr].isSpecialProperty, rProperties[istr].modifierFunction, rProperties[istr].modifierParameters);
- }
-
- if (p_obj.useFrames == true) {
- nTween = new TweenListObj(
- /* scope */ rScopes[i],
- /* timeStart */ _currentTimeFrame + (rDelay / _timeScale),
- /* timeComplete */ _currentTimeFrame + ((rDelay + rTime) / _timeScale),
- /* useFrames */ true,
- /* transition */ rTransition,
- p_obj.transitionParams
- );
- } else {
- nTween = new TweenListObj(
- /* scope */ rScopes[i],
- /* timeStart */ _currentTime + ((rDelay * 1000) / _timeScale),
- /* timeComplete */ _currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale),
- /* useFrames */ false,
- /* transition */ rTransition,
- p_obj.transitionParams
- );
- }
-
- nTween.properties = nProperties;
- nTween.onStart = p_obj.onStart;
- nTween.onUpdate = p_obj.onUpdate;
- nTween.onComplete = p_obj.onComplete;
- nTween.onOverwrite = p_obj.onOverwrite;
- nTween.onError = p_obj.onError;
- nTween.onStartParams = p_obj.onStartParams;
- nTween.onUpdateParams = p_obj.onUpdateParams;
- nTween.onCompleteParams = p_obj.onCompleteParams;
- nTween.onOverwriteParams = p_obj.onOverwriteParams;
- nTween.onStartScope = p_obj.onStartScope;
- nTween.onUpdateScope = p_obj.onUpdateScope;
- nTween.onCompleteScope = p_obj.onCompleteScope;
- nTween.onOverwriteScope = p_obj.onOverwriteScope;
- nTween.onErrorScope = p_obj.onErrorScope;
- nTween.rounded = p_obj.rounded;
- nTween.skipUpdates = p_obj.skipUpdates;
-
- // Remove other tweenings that occur at the same time
- removeTweensByTime(nTween.scope, nTween.properties, nTween.timeStart, nTween.timeComplete);
-
- // And finally adds it to the list
- _tweenList.push(nTween);
-
- // Immediate update and removal if it's an immediate tween -- if not deleted, it executes at the end of this frame execution
- if (rTime == 0 && rDelay == 0) {
- myT = _tweenList.length-1;
- updateTweenByIndex(myT);
- removeTweenByIndex(myT);
- }
- }
-
- return true;
- }
-
- // A "caller" is like this: [ | | | ||] got it? :)
- // this function is crap - should be fixed later/extend on addTween()
-
- /**
- * Adds a new caller tweening.
- *
- * @param (first-n param) Object that should be tweened: a movieclip, textfield, etc.. OR an array of objects
- * @param (last param) Object containing the specified parameters in any order, as well as the properties that should be tweened and their values
- * @param .time Number Time in seconds or frames for the tweening to take (defaults 2)
- * @param .delay Number Delay time (defaults 0)
- * @param .count Number Number of times this caller should be called
- * @param .transition String/Function Type of transition equation... (defaults to "easeoutexpo")
- * @param .onStart Function Event called when tween starts
- * @param .onUpdate Function Event called when tween updates
- * @param .onComplete Function Event called when tween ends
- * @param .waitFrames Boolean Whether to wait (or not) one frame for each call
- * @return true
if the tween was successfully added, false
if otherwise.
- */
- public static function addCaller (p_scopes:Object = null, p_parameters:Object = null):Boolean {
- if (!Boolean(p_scopes)) return false;
-
- var i:Number;
-
- var rScopes:Array; // List of objects to tween
- if (p_scopes is Array) {
- // The first argument is an array
- rScopes = p_scopes.concat();
- } else {
- // The first argument(s) is(are) object(s)
- rScopes = [p_scopes];
- }
-
- var p_obj:Object = p_parameters;
-
- // Creates the main engine if it isn't active
- if (!_inited) init();
- if (!_engineExists || !Boolean(__tweener_controller__)) startEngine(); // Quick fix for Flash not resetting the vars on double ctrl+enter...
-
- // Creates a "safer", more strict tweening object
- var rTime:Number = (isNaN(p_obj.time) ? 0 : p_obj.time); // Real time
- var rDelay:Number = (isNaN(p_obj.delay) ? 0 : p_obj.delay); // Real delay
-
- var rTransition:Function; // Real transition
- if (typeof p_obj.transition == "string") {
- // String parameter, transition names
- var trans:String = p_obj.transition.toLowerCase();
- rTransition = _transitionList[trans];
- } else {
- // Proper transition function
- rTransition = p_obj.transition;
- }
- if (!Boolean(rTransition)) rTransition = _transitionList["easeoutexpo"];
-
- var nTween:TweenListObj;
- var myT:Number;
- for (i = 0; i < rScopes.length; i++) {
-
- if (p_obj.useFrames == true) {
- nTween = new TweenListObj(
- /* scope */ rScopes[i],
- /* timeStart */ _currentTimeFrame + (rDelay / _timeScale),
- /* timeComplete */ _currentTimeFrame + ((rDelay + rTime) / _timeScale),
- /* useFrames */ true,
- /* transition */ rTransition,
- p_obj.transitionParams
- );
- } else {
- nTween = new TweenListObj(
- /* scope */ rScopes[i],
- /* timeStart */ _currentTime + ((rDelay * 1000) / _timeScale),
- /* timeComplete */ _currentTime + (((rDelay * 1000) + (rTime * 1000)) / _timeScale),
- /* useFrames */ false,
- /* transition */ rTransition,
- p_obj.transitionParams
- );
- }
-
- nTween.properties = null;
- nTween.onStart = p_obj.onStart;
- nTween.onUpdate = p_obj.onUpdate;
- nTween.onComplete = p_obj.onComplete;
- nTween.onOverwrite = p_obj.onOverwrite;
- nTween.onStartParams = p_obj.onStartParams;
- nTween.onUpdateParams = p_obj.onUpdateParams;
- nTween.onCompleteParams = p_obj.onCompleteParams;
- nTween.onOverwriteParams = p_obj.onOverwriteParams;
- nTween.onStartScope = p_obj.onStartScope;
- nTween.onUpdateScope = p_obj.onUpdateScope;
- nTween.onCompleteScope = p_obj.onCompleteScope;
- nTween.onOverwriteScope = p_obj.onOverwriteScope;
- nTween.onErrorScope = p_obj.onErrorScope;
- nTween.isCaller = true;
- nTween.count = p_obj.count;
- nTween.waitFrames = p_obj.waitFrames;
-
- // And finally adds it to the list
- _tweenList.push(nTween);
-
- // Immediate update and removal if it's an immediate tween -- if not deleted, it executes at the end of this frame execution
- if (rTime == 0 && rDelay == 0) {
- myT = _tweenList.length-1;
- updateTweenByIndex(myT);
- removeTweenByIndex(myT);
- }
- }
-
- return true;
- }
-
- /**
- * Remove an specified tweening of a specified object the tweening list, if it conflicts with the given time.
- *
- * @param p_scope Object List of objects affected
- * @param p_properties Object List of properties affected (PropertyInfoObj instances)
- * @param p_timeStart Number Time when the new tween starts
- * @param p_timeComplete Number Time when the new tween ends
- * @return Boolean Whether or not it actually deleted something
- */
- public static function removeTweensByTime (p_scope:Object, p_properties:Object, p_timeStart:Number, p_timeComplete:Number):Boolean {
- var removed:Boolean = false;
- var removedLocally:Boolean;
-
- var i:uint;
- var tl:uint = _tweenList.length;
- var pName:String;
-
- for (i = 0; i < tl; i++) {
- if (Boolean(_tweenList[i]) && p_scope == _tweenList[i].scope) {
- // Same object...
- if (p_timeComplete > _tweenList[i].timeStart && p_timeStart < _tweenList[i].timeComplete) {
- // New time should override the old one...
- removedLocally = false;
- for (pName in _tweenList[i].properties) {
- if (Boolean(p_properties[pName])) {
- // Same object, same property
- // Finally, remove this old tweening and use the new one
- if (Boolean(_tweenList[i].onOverwrite)) {
- var eventScope:Object = Boolean(_tweenList[i].onOverwriteScope) ? _tweenList[i].onOverwriteScope : _tweenList[i].scope;
- try {
- _tweenList[i].onOverwrite.apply(eventScope, _tweenList[i].onOverwriteParams);
- } catch(e:Error) {
- handleError(_tweenList[i], e, "onOverwrite");
- }
- }
- _tweenList[i].properties[pName] = undefined;
- delete _tweenList[i].properties[pName];
- removedLocally = true;
- removed = true;
- }
- }
- if (removedLocally) {
- // Verify if this can be deleted
- if (AuxFunctions.getObjectLength(_tweenList[i].properties) == 0) removeTweenByIndex(i);
- }
- }
- }
- }
-
- return removed;
- }
-
- /**
- * Remove tweenings from a given object from the tweening list.
- *
- * @param p_tween Object Object that must have its tweens removed
- * @param (2nd-last params) Object Property(ies) that must be removed
- * @return Boolean Whether or not it successfully removed this tweening
- */
- public static function removeTweens (p_scope:Object, ...args):Boolean {
- // Create the property list
- var properties:Array = new Array();
- var i:uint;
- for (i = 0; i < args.length; i++) {
- if (typeof(args[i]) == "string" && !AuxFunctions.isInArray(args[i], properties)) properties.push(args[i]);
- }
- // Call the affect function on the specified properties
- return affectTweens(removeTweenByIndex, p_scope, properties);
- }
-
-
- /**
- * Remove all tweenings from the engine.
- *
- * @return true
if it successfully removed any tweening, false
if otherwise.
- */
- public static function removeAllTweens ():Boolean {
- if (!Boolean(_tweenList)) return false;
- var removed:Boolean = false;
- var i:uint;
- for (i = 0; i<_tweenList.length; i++) {
- removeTweenByIndex(i);
- removed = true;
- }
- return removed;
- }
-
- /**
- * Pause tweenings for a given object.
- *
- * @param p_scope Object that must have its tweens paused
- * @param (2nd-last params) Property(ies) that must be paused
- * @return true
if it successfully paused any tweening, false
if otherwise.
- */
- public static function pauseTweens (p_scope:Object, ...args):Boolean {
- // Create the property list
- var properties:Array = new Array();
- var i:uint;
- for (i = 0; i < args.length; i++) {
- if (typeof(args[i]) == "string" && !AuxFunctions.isInArray(args[i], properties)) properties.push(args[i]);
- }
- // Call the affect function on the specified properties
- return affectTweens(pauseTweenByIndex, p_scope, properties);
- }
-
- /**
- * Pause all tweenings on the engine.
- *
- * @return true
if it successfully paused any tweening, false
if otherwise.
- * @see #resumeAllTweens()
- */
- public static function pauseAllTweens ():Boolean {
- if (!Boolean(_tweenList)) return false;
- var paused:Boolean = false;
- var i:uint;
- for (i = 0; i < _tweenList.length; i++) {
- pauseTweenByIndex(i);
- paused = true;
- }
- return paused;
- }
-
- /**
- * Resume tweenings from a given object.
- *
- * @param p_scope Object Object that must have its tweens resumed
- * @param (2nd-last params) Object Property(ies) that must be resumed
- * @return Boolean Whether or not it successfully resumed something
- */
- public static function resumeTweens (p_scope:Object, ...args):Boolean {
- // Create the property list
- var properties:Array = new Array();
- var i:uint;
- for (i = 0; i < args.length; i++) {
- if (typeof(args[i]) == "string" && !AuxFunctions.isInArray(args[i], properties)) properties.push(args[i]);
- }
- // Call the affect function on the specified properties
- return affectTweens(resumeTweenByIndex, p_scope, properties);
- }
-
- /**
- * Resume all tweenings on the engine.
- *
- * @return true
if it successfully resumed any tweening, false
if otherwise.
- * @see #pauseAllTweens()
- */
- public static function resumeAllTweens ():Boolean {
- if (!Boolean(_tweenList)) return false;
- var resumed:Boolean = false;
- var i:uint;
- for (i = 0; i < _tweenList.length; i++) {
- resumeTweenByIndex(i);
- resumed = true;
- }
- return resumed;
- }
-
- /**
- * Do some generic action on specific tweenings (pause, resume, remove, more?)
- *
- * @param p_function Function Function to run on the tweenings that match
- * @param p_scope Object Object that must have its tweens affected by the function
- * @param p_properties Array Array of strings that must be affected
- * @return Boolean Whether or not it successfully affected something
- */
- private static function affectTweens (p_affectFunction:Function, p_scope:Object, p_properties:Array):Boolean {
- var affected:Boolean = false;
- var i:uint;
-
- if (!Boolean(_tweenList)) return false;
-
- for (i = 0; i < _tweenList.length; i++) {
- if (_tweenList[i] && _tweenList[i].scope == p_scope) {
- if (p_properties.length == 0) {
- // Can affect everything
- p_affectFunction(i);
- affected = true;
- } else {
- // Must check whether this tween must have specific properties affected
- var affectedProperties:Array = new Array();
- var j:uint;
- for (j = 0; j < p_properties.length; j++) {
- if (Boolean(_tweenList[i].properties[p_properties[j]])) {
- affectedProperties.push(p_properties[j]);
- }
- }
- if (affectedProperties.length > 0) {
- // This tween has some properties that need to be affected
- var objectProperties:uint = AuxFunctions.getObjectLength(_tweenList[i].properties);
- if (objectProperties == affectedProperties.length) {
- // The list of properties is the same as all properties, so affect it all
- p_affectFunction(i);
- affected = true;
- } else {
- // The properties are mixed, so split the tween and affect only certain specific properties
- var slicedTweenIndex:uint = splitTweens(i, affectedProperties);
- p_affectFunction(slicedTweenIndex);
- affected = true;
- }
- }
- }
- }
- }
- return affected;
- }
-
- /**
- * Splits a tweening in two
- *
- * @param p_tween Number Object that must have its tweens split
- * @param p_properties Array Array of strings containing the list of properties that must be separated
- * @return Number The index number of the new tween
- */
- public static function splitTweens (p_tween:Number, p_properties:Array):uint {
- // First, duplicates
- var originalTween:TweenListObj = _tweenList[p_tween];
- var newTween:TweenListObj = originalTween.clone(false);
-
- // Now, removes tweenings where needed
- var i:uint;
- var pName:String;
-
- // Removes the specified properties from the old one
- for (i = 0; i < p_properties.length; i++) {
- pName = p_properties[i];
- if (Boolean(originalTween.properties[pName])) {
- originalTween.properties[pName] = undefined;
- delete originalTween.properties[pName];
- }
- }
-
- // Removes the unspecified properties from the new one
- var found:Boolean;
- for (pName in newTween.properties) {
- found = false;
- for (i = 0; i < p_properties.length; i++) {
- if (p_properties[i] == pName) {
- found = true;
- break;
- }
- }
- if (!found) {
- newTween.properties[pName] = undefined;
- delete newTween.properties[pName];
- }
- }
-
- // If there are empty property lists, a cleanup is done on the next updateTweens() cycle
- _tweenList.push(newTween);
- return (_tweenList.length - 1);
-
- }
-
- // ==================================================================================================================================
- // ENGINE functions -----------------------------------------------------------------------------------------------------------------
-
- /**
- * Updates all existing tweenings.
- *
- * @return Boolean FALSE if no update was made because there's no tweening (even delayed ones)
- */
- private static function updateTweens ():Boolean {
- if (_tweenList.length == 0) return false;
- var i:int;
- for (i = 0; i < _tweenList.length; i++) {
- // Looping throught each Tweening and updating the values accordingly
- if (_tweenList[i] == undefined || !_tweenList[i].isPaused) {
- if (!updateTweenByIndex(i)) removeTweenByIndex(i);
- if (_tweenList[i] == null) {
- removeTweenByIndex(i, true);
- i--;
- }
- }
- }
-
- return true;
- }
-
- /**
- * Remove a specific tweening from the tweening list.
- *
- * @param p_tween Number Index of the tween to be removed on the tweenings list
- * @return Boolean Whether or not it successfully removed this tweening
- */
- public static function removeTweenByIndex (i:Number, p_finalRemoval:Boolean = false):Boolean {
- _tweenList[i] = null;
- if (p_finalRemoval) _tweenList.splice(i, 1);
- return true;
- }
-
- /**
- * Pauses a specific tween.
- *
- * @param p_tween Number Index of the tween to be paused
- * @return Boolean Whether or not it successfully paused this tweening
- */
- public static function pauseTweenByIndex (p_tween:Number):Boolean {
- var tTweening:TweenListObj = _tweenList[p_tween]; // Shortcut to this tweening
- if (tTweening == null || tTweening.isPaused) return false;
- tTweening.timePaused = getCurrentTweeningTime(tTweening);
- tTweening.isPaused = true;
-
- return true;
- }
-
- /**
- * Resumes a specific tween.
- *
- * @param p_tween Number Index of the tween to be resumed
- * @return Boolean Whether or not it successfully resumed this tweening
- */
- public static function resumeTweenByIndex (p_tween:Number):Boolean {
- var tTweening:TweenListObj = _tweenList[p_tween]; // Shortcut to this tweening
- if (tTweening == null || !tTweening.isPaused) return false;
- var cTime:Number = getCurrentTweeningTime(tTweening);
- tTweening.timeStart += cTime - tTweening.timePaused;
- tTweening.timeComplete += cTime - tTweening.timePaused;
- tTweening.timePaused = undefined;
- tTweening.isPaused = false;
-
- return true;
- }
-
- /**
- * Updates a specific tween.
- *
- * @param i Number Index (from the tween list) of the tween that should be updated
- * @return Boolean FALSE if it's already finished and should be deleted, TRUE if otherwise
- */
- private static function updateTweenByIndex (i:Number):Boolean {
-
- var tTweening:TweenListObj = _tweenList[i]; // Shortcut to this tweening
-
- if (tTweening == null || !Boolean(tTweening.scope)) return false;
-
- var isOver:Boolean = false; // Whether or not it's over the update time
- var mustUpdate:Boolean; // Whether or not it should be updated (skipped if false)
-
- var nv:Number; // New value for each property
-
- var t:Number; // current time (frames, seconds)
- var b:Number; // beginning value
- var c:Number; // change in value
- var d:Number; // duration (frames, seconds)
-
- var pName:String; // Property name, used in loops
- var eventScope:Object; // Event scope, used to call functions
-
- // Shortcut stuff for speed
- var tScope:Object; // Current scope
- var cTime:Number = getCurrentTweeningTime(tTweening);
- var tProperty:Object; // Property being checked
-
- if (cTime >= tTweening.timeStart) {
- // Can already start
-
- tScope = tTweening.scope;
-
- if (tTweening.isCaller) {
- // It's a 'caller' tween
- do {
- t = ((tTweening.timeComplete - tTweening.timeStart)/tTweening.count) * (tTweening.timesCalled+1);
- b = tTweening.timeStart;
- c = tTweening.timeComplete - tTweening.timeStart;
- d = tTweening.timeComplete - tTweening.timeStart;
- nv = tTweening.transition(t, b, c, d);
-
- if (cTime >= nv) {
- if (Boolean(tTweening.onUpdate)) {
- eventScope = Boolean(tTweening.onUpdateScope) ? tTweening.onUpdateScope : tScope;
- try {
- tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
- } catch(e:Error) {
- handleError(tTweening, e, "onUpdate");
- }
- }
-
- tTweening.timesCalled++;
- if (tTweening.timesCalled >= tTweening.count) {
- isOver = true;
- break;
- }
- if (tTweening.waitFrames) break;
- }
-
- } while (cTime >= nv);
- } else {
- // It's a normal transition tween
-
- mustUpdate = tTweening.skipUpdates < 1 || !tTweening.skipUpdates || tTweening.updatesSkipped >= tTweening.skipUpdates;
-
- if (cTime >= tTweening.timeComplete) {
- isOver = true;
- mustUpdate = true;
- }
-
- if (!tTweening.hasStarted) {
- // First update, read all default values (for proper filter tweening)
- if (Boolean(tTweening.onStart)) {
- eventScope = Boolean(tTweening.onStartScope) ? tTweening.onStartScope : tScope;
- try {
- tTweening.onStart.apply(eventScope, tTweening.onStartParams);
- } catch(e:Error) {
- handleError(tTweening, e, "onStart");
- }
- }
- var pv:Number;
- for (pName in tTweening.properties) {
- if (tTweening.properties[pName].isSpecialProperty) {
- // It's a special property, tunnel via the special property function
- if (Boolean(_specialPropertyList[pName].preProcess)) {
- tTweening.properties[pName].valueComplete = _specialPropertyList[pName].preProcess(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].originalValueComplete, tTweening.properties[pName].extra);
- }
- pv = _specialPropertyList[pName].getValue(tScope, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
- } else {
- // Directly read property
- pv = tScope[pName];
- }
- tTweening.properties[pName].valueStart = isNaN(pv) ? tTweening.properties[pName].valueComplete : pv;
- }
- mustUpdate = true;
- tTweening.hasStarted = true;
- }
-
- if (mustUpdate) {
- for (pName in tTweening.properties) {
- tProperty = tTweening.properties[pName];
-
- if (isOver) {
- // Tweening time has finished, just set it to the final value
- nv = tProperty.valueComplete;
- } else {
- if (tProperty.hasModifier) {
- // Modified
- t = cTime - tTweening.timeStart;
- d = tTweening.timeComplete - tTweening.timeStart;
- nv = tTweening.transition(t, 0, 1, d, tTweening.transitionParams);
- nv = tProperty.modifierFunction(tProperty.valueStart, tProperty.valueComplete, nv, tProperty.modifierParameters);
- } else {
- // Normal update
- t = cTime - tTweening.timeStart;
- b = tProperty.valueStart;
- c = tProperty.valueComplete - tProperty.valueStart;
- d = tTweening.timeComplete - tTweening.timeStart;
- nv = tTweening.transition(t, b, c, d, tTweening.transitionParams);
- }
- }
-
- if (tTweening.rounded) nv = Math.round(nv);
- if (tProperty.isSpecialProperty) {
- // It's a special property, tunnel via the special property method
- _specialPropertyList[pName].setValue(tScope, nv, _specialPropertyList[pName].parameters, tTweening.properties[pName].extra);
- } else {
- // Directly set property
- tScope[pName] = nv;
- }
- }
-
- tTweening.updatesSkipped = 0;
-
- if (Boolean(tTweening.onUpdate)) {
- eventScope = Boolean(tTweening.onUpdateScope) ? tTweening.onUpdateScope : tScope;
- try {
- tTweening.onUpdate.apply(eventScope, tTweening.onUpdateParams);
- } catch(e:Error) {
- handleError(tTweening, e, "onUpdate");
- }
- }
- } else {
- tTweening.updatesSkipped++;
- }
- }
-
- if (isOver && Boolean(tTweening.onComplete)) {
- eventScope = Boolean(tTweening.onCompleteScope) ? tTweening.onCompleteScope : tScope;
- try {
- tTweening.onComplete.apply(eventScope, tTweening.onCompleteParams);
- } catch(e:Error) {
- handleError(tTweening, e, "onComplete");
- }
- }
-
- return (!isOver);
- }
-
- // On delay, hasn't started, so returns true
- return (true);
-
- }
-
- /**
- * Initiates the Tweener--should only be ran once.
- */
- public static function init(...rest):void {
- _inited = true;
-
- // Registers all default equations
- _transitionList = new Object();
- Equations.init();
-
- // Registers all default special properties
- _specialPropertyList = new Object();
- _specialPropertyModifierList = new Object();
- _specialPropertySplitterList = new Object();
- }
-
- /**
- * Adds a new function to the available transition list "shortcuts".
- *
- * @param p_name String Shorthand transition name
- * @param p_function Function The proper equation function
- */
- public static function registerTransition(p_name:String, p_function:Function): void {
- if (!_inited) init();
- _transitionList[p_name] = p_function;
- }
-
- /**
- * Adds a new special property to the available special property list.
- *
- * @param p_name Name of the "special" property.
- * @param p_getFunction Function that gets the value.
- * @param p_setFunction Function that sets the value.
- */
- public static function registerSpecialProperty(p_name:String, p_getFunction:Function, p_setFunction:Function, p_parameters:Array = null, p_preProcessFunction:Function = null): void {
- if (!_inited) init();
- var sp:SpecialProperty = new SpecialProperty(p_getFunction, p_setFunction, p_parameters, p_preProcessFunction);
- _specialPropertyList[p_name] = sp;
- }
-
- /**
- * Adds a new special property modifier to the available modifier list.
- *
- * @param p_name Name of the "special" property modifier.
- * @param p_modifyFunction Function that modifies the value.
- * @param p_getFunction Function that gets the value.
- */
- public static function registerSpecialPropertyModifier(p_name:String, p_modifyFunction:Function, p_getFunction:Function): void {
- if (!_inited) init();
- var spm:SpecialPropertyModifier = new SpecialPropertyModifier(p_modifyFunction, p_getFunction);
- _specialPropertyModifierList[p_name] = spm;
- }
-
- /**
- * Adds a new special property splitter to the available splitter list.
- *
- * @param p_name Name of the "special" property splitter.
- * @param p_splitFunction Function that splits the value.
- */
- public static function registerSpecialPropertySplitter(p_name:String, p_splitFunction:Function, p_parameters:Array = null): void {
- if (!_inited) init();
- var sps:SpecialPropertySplitter = new SpecialPropertySplitter(p_splitFunction, p_parameters);
- _specialPropertySplitterList[p_name] = sps;
- }
-
- /**
- * Starts the Tweener class engine. It is supposed to be running every time a tween exists.
- */
- private static function startEngine():void {
- _engineExists = true;
- _tweenList = new Array();
-
- __tweener_controller__ = new MovieClip();
- __tweener_controller__.addEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
-
- _currentTimeFrame = 0;
- updateTime();
- }
-
- /**
- * Stops the Tweener class engine.
- */
- private static function stopEngine():void {
- _engineExists = false;
- _tweenList = null;
- _currentTime = 0;
- _currentTimeFrame = 0;
- __tweener_controller__.removeEventListener(Event.ENTER_FRAME, Tweener.onEnterFrame);
- __tweener_controller__ = null;
- }
-
- /**
- * Updates the time to enforce time grid-based updates.
- */
- public static function updateTime():void {
- _currentTime = getTimer();
- }
-
- /**
- * Updates the current frame count
- */
- public static function updateFrame():void {
- _currentTimeFrame++;
- }
-
- /**
- * Ran once every frame. It's the main engine; updates all existing tweenings.
- */
- public static function onEnterFrame(e:Event):void {
- updateTime();
- updateFrame();
- var hasUpdated:Boolean = false;
- hasUpdated = updateTweens();
- if (!hasUpdated) stopEngine(); // There's no tweening to update or wait, so it's better to stop the engine
- }
-
- /**
- * Sets the new time scale.
- *
- * @param p_time Number New time scale (0.5 = slow, 1 = normal, 2 = 2x fast forward, etc)
- */
- public static function setTimeScale(p_time:Number):void {
- var i:Number;
- var cTime:Number;
-
- if (isNaN(p_time)) p_time = 1;
- if (p_time < 0.00001) p_time = 0.00001;
- if (p_time != _timeScale) {
- if (_tweenList != null) {
- // Multiplies all existing tween times accordingly
- for (i = 0; i<_tweenList.length; i++) {
- cTime = getCurrentTweeningTime(_tweenList[i]);
- _tweenList[i].timeStart = cTime - ((cTime - _tweenList[i].timeStart) * _timeScale / p_time);
- _tweenList[i].timeComplete = cTime - ((cTime - _tweenList[i].timeComplete) * _timeScale / p_time);
- if (_tweenList[i].timePaused != undefined) _tweenList[i].timePaused = cTime - ((cTime - _tweenList[i].timePaused) * _timeScale / p_time);
- }
- }
- // Sets the new timescale value (for new tweenings)
- _timeScale = p_time;
- }
- }
-
-
- // ==================================================================================================================================
- // AUXILIARY functions --------------------------------------------------------------------------------------------------------------
-
- /**
- * Finds whether or not an object has any tweening.
- *
- * @param p_scope Target object.
- * @return true
if there's a tweening occuring on this object (paused, delayed, or active), false
if otherwise.
- */
- public static function isTweening (p_scope:Object):Boolean {
- if (!Boolean(_tweenList)) return false;
- var i:uint;
-
- for (i = 0; i<_tweenList.length; i++) {
- if (Boolean(_tweenList[i]) && _tweenList[i].scope == p_scope) {
- return true;
- }
- }
- return false;
- }
-
- /**
- * Returns an array containing a list of the properties being tweened for this object.
- *
- * @param p_scope Target object.
- * @return Total number of properties being tweened (including delayed or paused tweens).
- */
- public static function getTweens (p_scope:Object):Array {
- if (!Boolean(_tweenList)) return [];
- var i:uint;
- var pName:String;
- var tList:Array = new Array();
-
- for (i = 0; i<_tweenList.length; i++) {
- if (Boolean(_tweenList[i]) && _tweenList[i].scope == p_scope) {
- for (pName in _tweenList[i].properties) tList.push(pName);
- }
- }
- return tList;
- }
-
- /**
- * Returns the number of properties being tweened for a given object.
- *
- * @param p_scope Target object.
- * @return Total number of properties being tweened (including delayed or paused tweens).
- */
- public static function getTweenCount (p_scope:Object):Number {
- if (!Boolean(_tweenList)) return 0;
- var i:uint;
- var c:Number = 0;
-
- for (i = 0; i<_tweenList.length; i++) {
- if (Boolean(_tweenList[i]) && _tweenList[i].scope == p_scope) {
- c += AuxFunctions.getObjectLength(_tweenList[i].properties);
- }
- }
- return c;
- }
-
-
- /* Handles errors when Tweener executes any callbacks (onStart, onUpdate, etc)
- * If the TweenListObj specifies an onError
callback it well get called, passing the Error
object and the current scope as parameters. If no onError
callback is specified, it will trace a stackTrace.
- */
- private static function handleError(pTweening : TweenListObj, pError : Error, pCallBackName : String) : void{
- // do we have an error handler?
- if (Boolean(pTweening.onError) && (pTweening.onError is Function)){
- // yup, there's a handler. Wrap this in a try catch in case the onError throws an error itself.
- var eventScope:Object = Boolean(pTweening.onErrorScope) ? pTweening.onErrorScope : pTweening.scope;
- try {
- pTweening.onError.apply(eventScope, [pTweening.scope, pError]);
- } catch (metaError : Error){
- printError(String(pTweening.scope) + " raised an error while executing the 'onError' handler. Original error:\n " + pError.getStackTrace() + "\nonError error: " + metaError.getStackTrace());
- }
- } else {
- // no handler, simply trace the stack trace:
- if (!Boolean(pTweening.onError)){
- printError(String(pTweening.scope) + " raised an error while executing the '" + pCallBackName + "'handler. \n" + pError.getStackTrace() );
- }
- }
- }
-
- /**
- * Get the current tweening time (no matter if it uses frames or time as basis), given a specific tweening
- *
- * @param p_tweening TweenListObj Tween information
- */
- public static function getCurrentTweeningTime(p_tweening:Object):Number {
- return p_tweening.useFrames ? _currentTimeFrame : _currentTime;
- }
-
- /**
- * Return the current tweener version
- *
- * @return String The number of the current Tweener version
- */
- public static function getVersion():String {
- return "AS3 1.31.71";
- }
-
-
- // ==================================================================================================================================
- // DEBUG functions ------------------------------------------------------------------------------------------------------------------
-
- /**
- * Output an error message
- *
- * @param p_message String The error message to output
- */
- public static function printError(p_message:String): void {
- //
- trace("## [Tweener] Error: "+p_message);
- }
-
- }
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/properties/ColorShortcuts.as b/flash/ImageDisplayx1/caurina/transitions/properties/ColorShortcuts.as
deleted file mode 100644
index a5493aa0d5..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/properties/ColorShortcuts.as
+++ /dev/null
@@ -1,479 +0,0 @@
-package caurina.transitions.properties {
-
- /**
- * properties.ColorShortcuts
- * List of default special color properties (normal and splitter properties) for the Tweener class
- * The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
- *
- * @author Zeh Fernando, Nate Chatellier, Arthur Debert
- * @version 1.0.0
- */
-
- import flash.geom.ColorTransform;
- import flash.filters.ColorMatrixFilter;
-
- import caurina.transitions.Tweener;
- import caurina.transitions.AuxFunctions;
-
- public class ColorShortcuts {
-
- // Sources:
- // http://www.graficaobscura.com/matrix/index.html
- // And mario Klingemann's ColorMatrix class as mentioned on the credits:
- // http://www.quasimondo.com/archives/000565.php
-
- // Defines luminance using sRGB luminance
- private static var LUMINANCE_R:Number = 0.212671;
- private static var LUMINANCE_G:Number = 0.715160;
- private static var LUMINANCE_B:Number = 0.072169;
-
- /**
- * There's no constructor.
- */
- public function ColorShortcuts () {
- trace ("This is an static class and should not be instantiated.")
- }
-
- /**
- * Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
- */
- public static function init(): void {
-
- // Normal properties
- Tweener.registerSpecialProperty("_color_ra", _oldColor_property_get, _oldColor_property_set, ["redMultiplier"]);
- Tweener.registerSpecialProperty("_color_rb", _color_property_get, _color_property_set, ["redOffset"]);
- Tweener.registerSpecialProperty("_color_ga", _oldColor_property_get, _oldColor_property_set, ["greenMultiplier"]);
- Tweener.registerSpecialProperty("_color_gb", _color_property_get, _color_property_set, ["greenOffset"]);
- Tweener.registerSpecialProperty("_color_ba", _oldColor_property_get, _oldColor_property_set, ["blueMultiplier"]);
- Tweener.registerSpecialProperty("_color_bb", _color_property_get, _color_property_set, ["blueOffset"]);
- Tweener.registerSpecialProperty("_color_aa", _oldColor_property_get, _oldColor_property_set, ["alphaMultiplier"]);
- Tweener.registerSpecialProperty("_color_ab", _color_property_get, _color_property_set, ["alphaOffset"]);
-
- Tweener.registerSpecialProperty("_color_redMultiplier", _color_property_get, _color_property_set, ["redMultiplier"]);
- Tweener.registerSpecialProperty("_color_redOffset", _color_property_get, _color_property_set, ["redOffset"]);
- Tweener.registerSpecialProperty("_color_greenMultiplier", _color_property_get, _color_property_set, ["greenMultiplier"]);
- Tweener.registerSpecialProperty("_color_greenOffset", _color_property_get, _color_property_set, ["greenOffset"]);
- Tweener.registerSpecialProperty("_color_blueMultiplier", _color_property_get, _color_property_set, ["blueMultiplier"]);
- Tweener.registerSpecialProperty("_color_blueOffset", _color_property_get, _color_property_set, ["blueOffset"]);
- Tweener.registerSpecialProperty("_color_alphaMultiplier", _color_property_get, _color_property_set, ["alphaMultiplier"]);
- Tweener.registerSpecialProperty("_color_alphaOffset", _color_property_get, _color_property_set, ["alphaOffset"]);
-
- // Normal splitter properties
- Tweener.registerSpecialPropertySplitter("_color", _color_splitter);
- Tweener.registerSpecialPropertySplitter("_colorTransform", _colorTransform_splitter);
-
- // Color changes that depend on the ColorMatrixFilter
- Tweener.registerSpecialProperty("_brightness", _brightness_get, _brightness_set, [false]);
- Tweener.registerSpecialProperty("_tintBrightness", _brightness_get, _brightness_set, [true]);
- Tweener.registerSpecialProperty("_contrast", _contrast_get, _contrast_set);
- Tweener.registerSpecialProperty("_hue", _hue_get, _hue_set);
- Tweener.registerSpecialProperty("_saturation", _saturation_get, _saturation_set, [false]);
- Tweener.registerSpecialProperty("_dumbSaturation", _saturation_get, _saturation_set, [true]);
-
- }
-
-
- // ==================================================================================================================================
- // PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _color
-
- /**
- * Splits the _color parameter into specific color variables
- *
- * @param p_value Number The original _color value
- * @return Array An array containing the .name and .value of all new properties
- */
- public static function _color_splitter (p_value:*, p_parameters:Array):Array {
- var nArray:Array = new Array();
- if (p_value == null) {
- // No parameter passed, so just resets the color
- nArray.push({name:"_color_redMultiplier", value:1});
- nArray.push({name:"_color_redOffset", value:0});
- nArray.push({name:"_color_greenMultiplier", value:1});
- nArray.push({name:"_color_greenOffset", value:0});
- nArray.push({name:"_color_blueMultiplier", value:1});
- nArray.push({name:"_color_blueOffset", value:0});
- } else {
- // A color tinting is passed, so converts it to the object values
- nArray.push({name:"_color_redMultiplier", value:0});
- nArray.push({name:"_color_redOffset", value:AuxFunctions.numberToR(p_value)});
- nArray.push({name:"_color_greenMultiplier", value:0});
- nArray.push({name:"_color_greenOffset", value:AuxFunctions.numberToG(p_value)});
- nArray.push({name:"_color_blueMultiplier", value:0});
- nArray.push({name:"_color_blueOffset", value:AuxFunctions.numberToB(p_value)});
- }
- return nArray;
- }
-
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _colorTransform
-
- /**
- * Splits the _colorTransform parameter into specific color variables
- *
- * @param p_value Number The original _colorTransform value
- * @return Array An array containing the .name and .value of all new properties
- */
- public static function _colorTransform_splitter (p_value:Object, p_parameters:Array):Array {
- var nArray:Array = new Array();
- if (p_value == null) {
- // No parameter passed, so just resets the color
- nArray.push({name:"_color_redMultiplier", value:1});
- nArray.push({name:"_color_redOffset", value:0});
- nArray.push({name:"_color_greenMultiplier", value:1});
- nArray.push({name:"_color_greenOffset", value:0});
- nArray.push({name:"_color_blueMultiplier", value:1});
- nArray.push({name:"_color_blueOffset", value:0});
- } else {
- // A color tinting is passed, so converts it to the object values
- if (p_value.ra != undefined) nArray.push({name:"_color_ra", value:p_value.ra});
- if (p_value.rb != undefined) nArray.push({name:"_color_rb", value:p_value.rb});
- if (p_value.ga != undefined) nArray.push({name:"_color_ba", value:p_value.ba});
- if (p_value.gb != undefined) nArray.push({name:"_color_bb", value:p_value.bb});
- if (p_value.ba != undefined) nArray.push({name:"_color_ga", value:p_value.ga});
- if (p_value.bb != undefined) nArray.push({name:"_color_gb", value:p_value.gb});
- if (p_value.aa != undefined) nArray.push({name:"_color_aa", value:p_value.aa});
- if (p_value.ab != undefined) nArray.push({name:"_color_ab", value:p_value.ab});
- if (p_value.redMultiplier != undefined) nArray.push({name:"_color_redMultiplier", value:p_value.redMultiplier});
- if (p_value.redOffset != undefined) nArray.push({name:"_color_redOffset", value:p_value.redOffset});
- if (p_value.blueMultiplier != undefined) nArray.push({name:"_color_blueMultiplier", value:p_value.blueMultiplier});
- if (p_value.blueOffset != undefined) nArray.push({name:"_color_blueOffset", value:p_value.blueOffset});
- if (p_value.greenMultiplier != undefined) nArray.push({name:"_color_greenMultiplier", value:p_value.greenMultiplier});
- if (p_value.greenOffset != undefined) nArray.push({name:"_color_greenOffset", value:p_value.greenOffset});
- if (p_value.alphaMultiplier != undefined) nArray.push({name:"_color_alphaMultiplier", value:p_value.alphaMultiplier});
- if (p_value.alphaOffset != undefined) nArray.push({name:"_color_alphaOffset", value:p_value.alphaOffset});
- }
- return nArray;
- }
-
-
- // ==================================================================================================================================
- // NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _color_*
-
- /**
- * _color_*
- * Generic function for the ra/rb/etc components of the deprecated colorTransform object
- */
- public static function _oldColor_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- return p_obj.transform.colorTransform[p_parameters[0]] * 100;
- }
- public static function _oldColor_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- var tf:ColorTransform = p_obj.transform.colorTransform;
- tf[p_parameters[0]] = p_value / 100;
- p_obj.transform.colorTransform = tf;
- }
-
- /**
- * _color_*
- * Generic function for the redMultiplier/redOffset/etc components of the new colorTransform
- */
- public static function _color_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- return p_obj.transform.colorTransform[p_parameters[0]];
- }
- public static function _color_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- var cfm:ColorTransform = p_obj.transform.colorTransform;
- cfm[p_parameters[0]] = p_value;
- p_obj.transform.colorTransform = cfm;
- }
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // Special coloring
-
- /**
- * _brightness
- * Brightness of an object: -1 -> [0] -> +1
- */
- public static function _brightness_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
-
- var isTint:Boolean = p_parameters[0];
-
- /*
- // Using ColorMatrix:
-
- var mtx:Array = getObjectMatrix(p_obj);
-
- var mc:Number = 1 - ((mtx[0] + mtx[6] + mtx[12]) / 3); // Brightness as determined by the main channels
- var co:Number = (mtx[4] + mtx[9] + mtx[14]) / 3; // Brightness as determined by the offset channels
- */
-
- var cfm:ColorTransform = p_obj.transform.colorTransform;
- var mc:Number = 1 - ((cfm.redMultiplier + cfm.greenMultiplier + cfm.blueMultiplier) / 3); // Brightness as determined by the main channels
- var co:Number = (cfm.redOffset + cfm.greenOffset + cfm.blueOffset) / 3;
-
- if (isTint) {
- // Tint style
- //return (mc+(co/255))/2;
- return co > 0 ? co / 255 : -mc;
- } else {
- // Native, Flash "Adjust Color" and Photoshop style
- return co / 100;
- }
- }
- public static function _brightness_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- //var mtx:Array = getObjectMatrix(p_obj);
-
- var isTint:Boolean = p_parameters[0];
-
- var mc:Number; // Main channel
- var co:Number; // Channel offset
-
- if (isTint) {
- // Tint style
- mc = 1 - Math.abs(p_value);
- co = p_value > 0 ? Math.round(p_value*255) : 0;
- } else {
- // Native, Flash "Adjust Color" and Photoshop style
- mc = 1;
- co = Math.round(p_value*100);
- }
-
- /*
- // Using ColorMatrix:
- var mtx:Array = [
- mc, cc, cc, cc, co,
- cc, mc, cc, cc, co,
- cc, cc, mc, cc, co,
- 0, 0, 0, 1, 0
- ];
- setObjectMatrix(p_obj, mtx);
- */
- var cfm:ColorTransform = new ColorTransform(mc, mc, mc, 1, co, co, co, 0);
- p_obj.transform.colorTransform = cfm;
- }
-
- /**
- * _saturation
- * Saturation of an object: 0 -> [1] -> 2
- */
- public static function _saturation_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
-
- var mtx:Array = getObjectMatrix(p_obj);
-
- var isDumb:Boolean = p_parameters[0];
- var rl:Number = isDumb ? 1/3 : LUMINANCE_R;
- var gl:Number = isDumb ? 1/3 : LUMINANCE_G;
- var bl:Number = isDumb ? 1/3 : LUMINANCE_B;
-
- var mc:Number = ((mtx[0]-rl)/(1-rl) + (mtx[6]-gl)/(1-gl) + (mtx[12]-bl)/(1-bl)) / 3; // Color saturation as determined by the main channels
- var cc:Number = 1 - ((mtx[1]/gl + mtx[2]/bl + mtx[5]/rl + mtx[7]/bl + mtx[10]/rl + mtx[11]/gl) / 6); // Color saturation as determined by the other channels
- return (mc + cc) / 2;
- }
- public static function _saturation_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
-
- var isDumb:Boolean = p_parameters[0];
- var rl:Number = isDumb ? 1/3 : LUMINANCE_R;
- var gl:Number = isDumb ? 1/3 : LUMINANCE_G;
- var bl:Number = isDumb ? 1/3 : LUMINANCE_B;
-
- var sf:Number = p_value;
- var nf:Number = 1-sf;
- var nr:Number = rl * nf;
- var ng:Number = gl * nf;
- var nb:Number = bl * nf;
-
- var mtx:Array = [
- nr+sf, ng, nb, 0, 0,
- nr, ng+sf, nb, 0, 0,
- nr, ng, nb+sf, 0, 0,
- 0, 0, 0, 1, 0
- ];
- setObjectMatrix(p_obj, mtx);
- }
-
- /**
- * _contrast
- * Contrast of an object: -1 -> [0] -> +1
- */
- public static function _contrast_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
-
- /*
- // Using ColorMatrix:
- var mtx:Array = getObjectMatrix(p_obj);
-
- var mc:Number = ((mtx[0] + mtx[6] + mtx[12]) / 3) - 1; // Contrast as determined by the main channels
- var co:Number = (mtx[4] + mtx[9] + mtx[14]) / 3 / -128; // Contrast as determined by the offset channel
- */
- var cfm:ColorTransform = p_obj.transform.colorTransform;
- var mc:Number; // Contrast as determined by the main channels
- var co:Number; // Contrast as determined by the offset channel
- mc = ((cfm.redMultiplier + cfm.greenMultiplier + cfm.blueMultiplier) / 3) - 1;
- co = (cfm.redOffset + cfm.greenOffset + cfm.blueOffset) / 3 / -128;
- /*
- if (cfm.ra < 100) {
- // Low contrast
- mc = ((cfm.ra + cfm.ga + cfm.ba) / 300) - 1;
- co = (cfm.rb + cfm.gb + cfm.bb) / 3 / -128;
- } else {
- // High contrast
- mc = (((cfm.ra + cfm.ga + cfm.ba) / 300) - 1) / 37;
- co = (cfm.rb + cfm.gb + cfm.bb) / 3 / -3840;
- }
- */
-
- return (mc+co)/2;
- }
- public static function _contrast_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
-
- var mc:Number; // Main channel
- var co:Number; // Channel offset
- mc = p_value + 1;
- co = Math.round(p_value*-128);
-
- /*
- if (p_value < 0) {
- // Low contrast
- mc = p_value + 1;
- co = Math.round(p_value*-128);
- } else {
- // High contrast
- mc = (p_value * 37) + 1;
- co = Math.round(p_value*-3840);
- }
- */
-
- // Flash: * 8, * -512
-
- /*
- // Using ColorMatrix:
- var mtx:Array = [
- mc, 0, 0, 0, co,
- 0, mc, 0, 0, co,
- 0, 0, mc, 0, co,
- 0, 0, 0, 1, 0
- ];
- setObjectMatrix(p_obj, mtx);
- */
- var cfm:ColorTransform = new ColorTransform(mc, mc, mc, 1, co, co, co, 0);
- p_obj.transform.colorTransform = cfm;
- }
-
- /**
- * _hue
- * Hue of an object: -180 -> [0] -> 180
- */
- public static function _hue_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
-
- var mtx:Array = getObjectMatrix(p_obj);
-
- // Find the current Hue based on a given matrix.
- // This is a kind of a brute force method by sucessive division until a close enough angle is found.
- // Reverse-engineering the hue equation would be is a better choice, but it's hard to find material
- // on the correct calculation employed by Flash.
- // This code has to run only once (before the tween starts), so it's good enough.
-
- var hues:Array = [];
- var i:Number;
-
- hues[0] = {angle:-179.9, matrix:getHueMatrix(-179.9)};
- hues[1] = {angle:180, matrix:getHueMatrix(180)};
-
- for (i = 0; i < hues.length; i++) {
- hues[i].distance = getHueDistance(mtx, hues[i].matrix);
- }
-
- var maxTries:Number = 15; // Number o maximum divisions until the hue is found
- var angleToSplit:Number;
-
- for (i = 0; i < maxTries; i++) {
- // Find the nearest angle
- if (hues[0].distance < hues[1].distance) {
- // First is closer
- angleToSplit = 1;
- } else {
- // Second is closer
- angleToSplit = 0;
- }
- hues[angleToSplit].angle = (hues[0].angle + hues[1].angle)/2;
- hues[angleToSplit].matrix = getHueMatrix(hues[angleToSplit].angle)
- hues[angleToSplit].distance = getHueDistance(mtx, hues[angleToSplit].matrix);
- }
-
- return hues[angleToSplit].angle;
- }
-
- public static function _hue_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- setObjectMatrix(p_obj, getHueMatrix(p_value));
- }
-
- public static function getHueDistance (mtx1:Array, mtx2:Array): Number {
- return (Math.abs(mtx1[0] - mtx2[0]) + Math.abs(mtx1[1] - mtx2[1]) + Math.abs(mtx1[2] - mtx2[2]));
- }
-
- public static function getHueMatrix (hue:Number): Array {
- var ha:Number = hue * Math.PI/180; // Hue angle, to radians
-
- var rl:Number = LUMINANCE_R;
- var gl:Number = LUMINANCE_G;
- var bl:Number = LUMINANCE_B;
-
- var c:Number = Math.cos(ha);
- var s:Number = Math.sin(ha);
-
- var mtx:Array = [
- (rl + (c * (1 - rl))) + (s * (-rl)),
- (gl + (c * (-gl))) + (s * (-gl)),
- (bl + (c * (-bl))) + (s * (1 - bl)),
- 0, 0,
-
- (rl + (c * (-rl))) + (s * 0.143),
- (gl + (c * (1 - gl))) + (s * 0.14),
- (bl + (c * (-bl))) + (s * -0.283),
- 0, 0,
-
- (rl + (c * (-rl))) + (s * (-(1 - rl))),
- (gl + (c * (-gl))) + (s * gl),
- (bl + (c * (1 - bl))) + (s * bl),
- 0, 0,
-
- 0, 0, 0, 1, 0
- ];
-
- return mtx;
- }
-
-
- // ==================================================================================================================================
- // AUXILIARY functions --------------------------------------------------------------------------------------------------------------
-
- private static function getObjectMatrix(p_obj:Object): Array {
- // Get the current color matrix of an object
- for (var i:Number = 0; i < p_obj.filters.length; i++) {
- if (p_obj.filters[i] is ColorMatrixFilter) {
- return p_obj.filters[i].matrix.concat();
- }
- }
- return [
- 1, 0, 0, 0, 0,
- 0, 1, 0, 0, 0,
- 0, 0, 1, 0, 0,
- 0, 0, 0, 1, 0
- ];
- }
-
- private static function setObjectMatrix(p_obj:Object, p_matrix:Array): void {
- // Set the current color matrix of an object
- var objFilters:Array = p_obj.filters.concat();
- var found:Boolean = false;
- for (var i:Number = 0; i < objFilters.length; i++) {
- if (objFilters[i] is ColorMatrixFilter) {
- objFilters[i].matrix = p_matrix.concat();
- found = true;
- }
- }
- if (!found) {
- // Has to create a new color matrix filter
- var cmtx:ColorMatrixFilter = new ColorMatrixFilter(p_matrix);
- objFilters[objFilters.length] = cmtx;
- }
- p_obj.filters = objFilters;
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/properties/CurveModifiers.as b/flash/ImageDisplayx1/caurina/transitions/properties/CurveModifiers.as
deleted file mode 100644
index b004c1fcc0..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/properties/CurveModifiers.as
+++ /dev/null
@@ -1,109 +0,0 @@
-package caurina.transitions.properties {
-
- /**
- * properties.CurveModifiers
- * List of default special properties modifiers for the Tweener class
- * The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
- *
- * @author Zeh Fernando, Nate Chatellier, Arthur Debert
- * @version 1.0.0
- */
-
- import caurina.transitions.Tweener;
-
- public class CurveModifiers {
-
- /**
- * There's no constructor.
- */
- public function CurveModifiers () {
- trace ("This is an static class and should not be instantiated.")
- }
-
- /**
- * Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
- */
- public static function init(): void {
-
- // Bezier modifiers
- Tweener.registerSpecialPropertyModifier("_bezier", _bezier_modifier, _bezier_get);
- }
-
-
- // ==================================================================================================================================
- // SPECIAL PROPERTY MODIFIER functions ----------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _bezier
-
- /**
- * Given the parameter object passed to this special property, return an array listing the properties that should be modified, and their parameters
- *
- * @param p_obj Object Parameter passed to this property
- * @return Array Array listing name and parameter of each property
- */
- public static function _bezier_modifier (p_obj:*):Array {
- var mList:Array = []; // List of properties to be modified
- var pList:Array; // List of parameters passed, normalized as an array
- if (p_obj is Array) {
- // Complex
- pList = p_obj;
- } else {
- pList = [p_obj];
- }
-
- var i:uint;
- var istr:String;
- var mListObj:Object = {}; // Object describing each property name and parameter
-
- for (i = 0; i < pList.length; i++) {
- for (istr in pList[i]) {
- if (mListObj[istr] == undefined) mListObj[istr] = [];
- mListObj[istr].push(pList[i][istr]);
- }
- }
- for (istr in mListObj) {
- mList.push({name:istr, parameters:mListObj[istr]});
- }
- return mList;
- }
-
- /**
- * Given tweening specifications (beging, end, t), applies the property parameter to it, returning new t
- *
- * @param b Number Beginning value of the property
- * @param e Number Ending (desired) value of the property
- * @param t Number Current t of this tweening (0-1), after applying the easing equation
- * @param p Array Array of parameters passed to this specific property
- * @return Number New t, with the p parameters applied to it
- */
- public static function _bezier_get (b:Number, e:Number, t:Number, p:Array):Number {
- // This is based on Robert Penner's code
- if (p.length == 1) {
- // Simple curve with just one bezier control point
- return b + t*(2*(1-t)*(p[0]-b) + t*(e - b));
- } else {
- // Array of bezier control points, must find the point between each pair of bezier points
- var ip:uint = Math.floor(t * p.length); // Position on the bezier list
- var it:Number = (t - (ip * (1 / p.length))) * p.length; // t inside this ip
- var p1:Number, p2:Number;
- if (ip == 0) {
- // First part: belongs to the first control point, find second midpoint
- p1 = b;
- p2 = (p[0]+p[1])/2;
- } else if (ip == p.length - 1) {
- // Last part: belongs to the last control point, find first midpoint
- p1 = (p[ip-1]+p[ip])/2;
- p2 = e;
- } else {
- // Any middle part: find both midpoints
- p1 = (p[ip-1]+p[ip])/2;
- p2 = (p[ip]+p[ip+1])/2;
- }
- return p1+it*(2*(1-it)*(p[ip]-p1) + it*(p2 - p1));
- }
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/properties/DisplayShortcuts.as b/flash/ImageDisplayx1/caurina/transitions/properties/DisplayShortcuts.as
deleted file mode 100644
index fff4568ab2..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/properties/DisplayShortcuts.as
+++ /dev/null
@@ -1,161 +0,0 @@
-package caurina.transitions.properties {
-
- /**
- * properties.DisplayShortcuts.as
- * List of default special MovieClip properties (normal and splitter properties) for the Tweener class
- * The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
- *
- * @author Zeh Fernando, Nate Chatellier, Arthur Debert
- * @version 1.0.0
- */
-
- import flash.geom.Point;
- import flash.geom.Rectangle;
-
- import caurina.transitions.Tweener;
-
- public class DisplayShortcuts {
-
- /**
- * There's no constructor.
- */
- public function DisplayShortcuts () {
- trace ("This is an static class and should not be instantiated.")
- }
-
- /**
- * Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
- */
- public static function init(): void {
-
- // Normal properties
- Tweener.registerSpecialProperty("_frame", _frame_get, _frame_set);
- Tweener.registerSpecialProperty("_autoAlpha", _autoAlpha_get, _autoAlpha_set);
-
- // Scale splitter properties
- Tweener.registerSpecialPropertySplitter("_scale", _scale_splitter);
-
- // scrollRect splitter properties
- Tweener.registerSpecialPropertySplitter("_scrollRect", _scrollRect_splitter);
-
- // scrollrect normal properties
- Tweener.registerSpecialProperty("_scrollRect_x", _scrollRect_property_get, _scrollRect_property_set, ["x"]);
- Tweener.registerSpecialProperty("_scrollRect_y", _scrollRect_property_get, _scrollRect_property_set, ["y"]);
- Tweener.registerSpecialProperty("_scrollRect_left", _scrollRect_property_get, _scrollRect_property_set, ["left"]);
- Tweener.registerSpecialProperty("_scrollRect_right", _scrollRect_property_get, _scrollRect_property_set, ["right"]);
- Tweener.registerSpecialProperty("_scrollRect_top", _scrollRect_property_get, _scrollRect_property_set, ["top"]);
- Tweener.registerSpecialProperty("_scrollRect_bottom", _scrollRect_property_get, _scrollRect_property_set, ["bottom"]);
- Tweener.registerSpecialProperty("_scrollRect_width", _scrollRect_property_get, _scrollRect_property_set, ["width"]);
- Tweener.registerSpecialProperty("_scrollRect_height", _scrollRect_property_get, _scrollRect_property_set, ["height"]);
-
- }
-
-
- // ==================================================================================================================================
- // PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // scale
- public static function _scale_splitter(p_value:Number, p_parameters:Array) : Array{
- var nArray:Array = new Array();
- nArray.push({name:"scaleX", value: p_value});
- nArray.push({name:"scaleY", value: p_value});
- return nArray;
- }
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _scrollRect
-
- /**
- * Splits the _scrollRect parameter into specific scrollRect variables
- *
- * @param p_value Rectangle The original _scrollRect rectangle
- * @return Array An array containing the .name and .value of all new properties
- */
- public static function _scrollRect_splitter (p_value:Rectangle, p_parameters:Array, p_extra:Object = null):Array {
- var nArray:Array = new Array();
- if (p_value == null) {
- // No parameter passed, so try any rectangle :/
- nArray.push({name:"_scrollRect_x", value:0});
- nArray.push({name:"_scrollRect_y", value:0});
- nArray.push({name:"_scrollRect_width", value:100});
- nArray.push({name:"_scrollRect_height", value:100});
- } else {
- // A rectangle is passed, so just return the properties
- nArray.push({name:"_scrollRect_x", value:p_value.x});
- nArray.push({name:"_scrollRect_y", value:p_value.y});
- nArray.push({name:"_scrollRect_width", value:p_value.width});
- nArray.push({name:"_scrollRect_height", value:p_value.height});
- }
- return nArray;
- }
-
-
- // ==================================================================================================================================
- // NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _frame
-
- /**
- * Returns the current frame number from the movieclip timeline
- *
- * @param p_obj Object MovieClip object
- * @return Number The current frame
- */
- public static function _frame_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- return p_obj.currentFrame;
- }
-
- /**
- * Sets the timeline frame
- *
- * @param p_obj Object MovieClip object
- * @param p_value Number New frame number
- */
- public static function _frame_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- p_obj.gotoAndStop(Math.round(p_value));
- }
-
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _autoAlpha
-
- /**
- * Returns the current alpha
- *
- * @param p_obj Object MovieClip or Textfield object
- * @return Number The current alpha
- */
- public static function _autoAlpha_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- return p_obj.alpha;
- }
-
- /**
- * Sets the current autoAlpha
- *
- * @param p_obj Object MovieClip or Textfield object
- * @param p_value Number New alpha
- */
- public static function _autoAlpha_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- p_obj.alpha = p_value;
- p_obj.visible = p_value > 0;
- }
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _scrollRect_*
-
- /**
- * _scrollRect_*
- * Generic function for the properties of the scrollRect object
- */
- public static function _scrollRect_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- return p_obj.scrollRect[p_parameters[0]];
- }
- public static function _scrollRect_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- var rect:Rectangle = p_obj.scrollRect;
- rect[p_parameters[0]] = Math.round(p_value);
- p_obj.scrollRect = rect;
- }
- }
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/properties/FilterShortcuts.as b/flash/ImageDisplayx1/caurina/transitions/properties/FilterShortcuts.as
deleted file mode 100644
index e63b7e18cf..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/properties/FilterShortcuts.as
+++ /dev/null
@@ -1,495 +0,0 @@
-package caurina.transitions.properties {
-
- /**
- * properties.FilterShortcuts
- * Special properties for the Tweener class to handle MovieClip filters
- * The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
- *
- * @author Zeh Fernando, Nate Chatellier, Arthur Debert
- * @version 1.0.0
- */
-
- import flash.display.BitmapData;
- import flash.filters.BevelFilter;
- import flash.filters.BitmapFilter;
- import flash.filters.BlurFilter;
- import flash.filters.ColorMatrixFilter;
- import flash.filters.ConvolutionFilter;
- import flash.filters.DisplacementMapFilter;
- import flash.filters.DropShadowFilter;
- import flash.filters.GlowFilter;
- import flash.filters.GradientBevelFilter;
- import flash.filters.GradientGlowFilter;
- import flash.geom.Point;
-
- import caurina.transitions.Tweener;
- import caurina.transitions.AuxFunctions;
-
- public class FilterShortcuts {
-
- /**
- * There's no constructor.
- */
- public function FilterShortcuts () {
- trace ("This is an static class and should not be instantiated.")
- }
-
- /**
- * Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
- */
- public static function init(): void {
-
- // Filter tweening splitter properties
- Tweener.registerSpecialPropertySplitter("_filter", _filter_splitter);
-
- // Shortcuts - BevelFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/BevelFilter.html
- Tweener.registerSpecialProperty("_Bevel_angle", _filter_property_get, _filter_property_set, [BevelFilter, "angle"]);
- Tweener.registerSpecialProperty("_Bevel_blurX", _filter_property_get, _filter_property_set, [BevelFilter, "blurX"]);
- Tweener.registerSpecialProperty("_Bevel_blurY", _filter_property_get, _filter_property_set, [BevelFilter, "blurY"]);
- Tweener.registerSpecialProperty("_Bevel_distance", _filter_property_get, _filter_property_set, [BevelFilter, "distance"]);
- Tweener.registerSpecialProperty("_Bevel_highlightAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "highlightAlpha"]);
- Tweener.registerSpecialPropertySplitter("_Bevel_highlightColor", _generic_color_splitter, ["_Bevel_highlightColor_r", "_Bevel_highlightColor_g", "_Bevel_highlightColor_b"]);
- Tweener.registerSpecialProperty("_Bevel_highlightColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "r"]);
- Tweener.registerSpecialProperty("_Bevel_highlightColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "g"]);
- Tweener.registerSpecialProperty("_Bevel_highlightColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "highlightColor", "color", "b"]);
- Tweener.registerSpecialProperty("_Bevel_knockout", _filter_property_get, _filter_property_set, [BevelFilter, "knockout"]);
- Tweener.registerSpecialProperty("_Bevel_quality", _filter_property_get, _filter_property_set, [BevelFilter, "quality"]);
- Tweener.registerSpecialProperty("_Bevel_shadowAlpha", _filter_property_get, _filter_property_set, [BevelFilter, "shadowAlpha"]);
- Tweener.registerSpecialPropertySplitter("_Bevel_shadowColor", _generic_color_splitter, ["_Bevel_shadowColor_r", "_Bevel_shadowColor_g", "_Bevel_shadowColor_b"]);
- Tweener.registerSpecialProperty("_Bevel_shadowColor_r", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "r"]);
- Tweener.registerSpecialProperty("_Bevel_shadowColor_g", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "g"]);
- Tweener.registerSpecialProperty("_Bevel_shadowColor_b", _filter_property_get, _filter_property_set, [BevelFilter, "shadowColor", "color", "b"]);
- Tweener.registerSpecialProperty("_Bevel_strength", _filter_property_get, _filter_property_set, [BevelFilter, "strength"]);
- Tweener.registerSpecialProperty("_Bevel_type", _filter_property_get, _filter_property_set, [BevelFilter, "type"]);
-
- // Shortcuts - BlurFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/BlurFilter.html
- Tweener.registerSpecialProperty("_Blur_blurX", _filter_property_get, _filter_property_set, [BlurFilter, "blurX"]);
- Tweener.registerSpecialProperty("_Blur_blurY", _filter_property_get, _filter_property_set, [BlurFilter, "blurY"]);
- Tweener.registerSpecialProperty("_Blur_quality", _filter_property_get, _filter_property_set, [BlurFilter, "quality"]);
-
- // Shortcuts - ColorMatrixFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/ColorMatrixFilter.html
- Tweener.registerSpecialPropertySplitter("_ColorMatrix_matrix", _generic_matrix_splitter, [[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0],
- ["_ColorMatrix_matrix_rr", "_ColorMatrix_matrix_rg", "_ColorMatrix_matrix_rb", "_ColorMatrix_matrix_ra", "_ColorMatrix_matrix_ro",
- "_ColorMatrix_matrix_gr", "_ColorMatrix_matrix_gg", "_ColorMatrix_matrix_gb", "_ColorMatrix_matrix_ga", "_ColorMatrix_matrix_go",
- "_ColorMatrix_matrix_br", "_ColorMatrix_matrix_bg", "_ColorMatrix_matrix_bb", "_ColorMatrix_matrix_ba", "_ColorMatrix_matrix_bo",
- "_ColorMatrix_matrix_ar", "_ColorMatrix_matrix_ag", "_ColorMatrix_matrix_ab", "_ColorMatrix_matrix_aa", "_ColorMatrix_matrix_ao"]]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_rr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 0]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_rg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 1]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_rb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 2]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ra", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 3]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ro", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 4]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_gr", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 5]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_gg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 6]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_gb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 7]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ga", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 8]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_go", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 9]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_br", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 10]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_bg", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 11]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_bb", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 12]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ba", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 13]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_bo", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 14]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ar", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 15]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ag", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 16]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ab", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 17]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_aa", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 18]);
- Tweener.registerSpecialProperty("_ColorMatrix_matrix_ao", _filter_property_get, _filter_property_set, [ColorMatrixFilter, "matrix", "matrix", 19]);
-
- // Shortcuts - ConvolutionFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/ConvolutionFilter.html
- Tweener.registerSpecialProperty("_Convolution_alpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "alpha"]);
- Tweener.registerSpecialProperty("_Convolution_bias", _filter_property_get, _filter_property_set, [ConvolutionFilter, "bias"]);
- Tweener.registerSpecialProperty("_Convolution_clamp", _filter_property_get, _filter_property_set, [ConvolutionFilter, "clamp"]);
- Tweener.registerSpecialPropertySplitter("_Convolution_color", _generic_color_splitter, ["_Convolution_color_r", "_Convolution_color_g", "_Convolution_color_b"]);
- Tweener.registerSpecialProperty("_Convolution_color_r", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "r"]);
- Tweener.registerSpecialProperty("_Convolution_color_g", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "g"]);
- Tweener.registerSpecialProperty("_Convolution_color_b", _filter_property_get, _filter_property_set, [ConvolutionFilter, "color", "color", "b"]);
- Tweener.registerSpecialProperty("_Convolution_divisor", _filter_property_get, _filter_property_set, [ConvolutionFilter, "divisor"]);
- //Tweener.registerSpecialPropertySplitter("_Convolution_matrix", _generic_array_splitter, ["_Convolution_matrix_array"]);
- //Tweener.registerSpecialProperty("_Convolution_matrix_array", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrix", "array"]);
- Tweener.registerSpecialProperty("_Convolution_matrixX", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixX"]);
- Tweener.registerSpecialProperty("_Convolution_matrixY", _filter_property_get, _filter_property_set, [ConvolutionFilter, "matrixY"]);
- Tweener.registerSpecialProperty("_Convolution_preserveAlpha", _filter_property_get, _filter_property_set, [ConvolutionFilter, "preserveAlpha"]);
-
- // Shortcuts - DisplacementMapFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/DisplacementMapFilter.html
- Tweener.registerSpecialProperty("_DisplacementMap_alpha", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "alpha"]);
- Tweener.registerSpecialPropertySplitter("_DisplacementMap_color", _generic_color_splitter, ["_DisplacementMap_color_r", "_DisplacementMap_color_r", "_DisplacementMap_color_r"]);
- Tweener.registerSpecialProperty("_DisplacementMap_color_r", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "r"]);
- Tweener.registerSpecialProperty("_DisplacementMap_color_g", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "g"]);
- Tweener.registerSpecialProperty("_DisplacementMap_color_b", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "color", "color", "b"]);
- Tweener.registerSpecialProperty("_DisplacementMap_componentX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentX"]);
- Tweener.registerSpecialProperty("_DisplacementMap_componentY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "componentY"]);
- Tweener.registerSpecialProperty("_DisplacementMap_mapBitmap", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapBitmap"]);
- Tweener.registerSpecialProperty("_DisplacementMap_mapPoint", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mapPoint"]);
- Tweener.registerSpecialProperty("_DisplacementMap_mode", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "mode"]);
- Tweener.registerSpecialProperty("_DisplacementMap_scaleX", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleX"]);
- Tweener.registerSpecialProperty("_DisplacementMap_scaleY", _filter_property_get, _filter_property_set, [DisplacementMapFilter, "scaleY"]);
-
- // Shortcuts - DropShadowFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/DropShadowFilter.html
- Tweener.registerSpecialProperty("_DropShadow_alpha", _filter_property_get, _filter_property_set, [DropShadowFilter, "alpha"]);
- Tweener.registerSpecialProperty("_DropShadow_angle", _filter_property_get, _filter_property_set, [DropShadowFilter, "angle"]);
- Tweener.registerSpecialProperty("_DropShadow_blurX", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurX"]);
- Tweener.registerSpecialProperty("_DropShadow_blurY", _filter_property_get, _filter_property_set, [DropShadowFilter, "blurY"]);
- Tweener.registerSpecialPropertySplitter("_DropShadow_color", _generic_color_splitter, ["_DropShadow_color_r", "_DropShadow_color_g", "_DropShadow_color_b"]);
- Tweener.registerSpecialProperty("_DropShadow_color_r", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "r"]);
- Tweener.registerSpecialProperty("_DropShadow_color_g", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "g"]);
- Tweener.registerSpecialProperty("_DropShadow_color_b", _filter_property_get, _filter_property_set, [DropShadowFilter, "color", "color", "b"]);
- Tweener.registerSpecialProperty("_DropShadow_distance", _filter_property_get, _filter_property_set, [DropShadowFilter, "distance"]);
- Tweener.registerSpecialProperty("_DropShadow_hideObject", _filter_property_get, _filter_property_set, [DropShadowFilter, "hideObject"]);
- Tweener.registerSpecialProperty("_DropShadow_inner", _filter_property_get, _filter_property_set, [DropShadowFilter, "inner"]);
- Tweener.registerSpecialProperty("_DropShadow_knockout", _filter_property_get, _filter_property_set, [DropShadowFilter, "knockout"]);
- Tweener.registerSpecialProperty("_DropShadow_quality", _filter_property_get, _filter_property_set, [DropShadowFilter, "quality"]);
- Tweener.registerSpecialProperty("_DropShadow_strength", _filter_property_get, _filter_property_set, [DropShadowFilter, "strength"]);
-
- // Shortcuts - GlowFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/GlowFilter.html
- Tweener.registerSpecialProperty("_Glow_alpha", _filter_property_get, _filter_property_set, [GlowFilter, "alpha"]);
- Tweener.registerSpecialProperty("_Glow_blurX", _filter_property_get, _filter_property_set, [GlowFilter, "blurX"]);
- Tweener.registerSpecialProperty("_Glow_blurY", _filter_property_get, _filter_property_set, [GlowFilter, "blurY"]);
- Tweener.registerSpecialPropertySplitter("_Glow_color", _generic_color_splitter, ["_Glow_color_r", "_Glow_color_g", "_Glow_color_b"]);
- Tweener.registerSpecialProperty("_Glow_color_r", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "r"]);
- Tweener.registerSpecialProperty("_Glow_color_g", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "g"]);
- Tweener.registerSpecialProperty("_Glow_color_b", _filter_property_get, _filter_property_set, [GlowFilter, "color", "color", "b"]);
- Tweener.registerSpecialProperty("_Glow_inner", _filter_property_get, _filter_property_set, [GlowFilter, "inner"]);
- Tweener.registerSpecialProperty("_Glow_knockout", _filter_property_get, _filter_property_set, [GlowFilter, "knockout"]);
- Tweener.registerSpecialProperty("_Glow_quality", _filter_property_get, _filter_property_set, [GlowFilter, "quality"]);
- Tweener.registerSpecialProperty("_Glow_strength", _filter_property_get, _filter_property_set, [GlowFilter, "strength"]);
-
- // Shortcuts - GradientBevelFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/GradientBevelFilter.html
- // .alphas (array)
- Tweener.registerSpecialProperty("_GradientBevel_angle", _filter_property_get, _filter_property_set, [GradientBevelFilter, "angle"]);
- Tweener.registerSpecialProperty("_GradientBevel_blurX", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurX"]);
- Tweener.registerSpecialProperty("_GradientBevel_blurY", _filter_property_get, _filter_property_set, [GradientBevelFilter, "blurY"]);
- // .colors (array)
- Tweener.registerSpecialProperty("_GradientBevel_distance", _filter_property_get, _filter_property_set, [GradientBevelFilter, "distance"]);
- Tweener.registerSpecialProperty("_GradientBevel_quality", _filter_property_get, _filter_property_set, [GradientBevelFilter, "quality"]);
- // .ratios(array)
- Tweener.registerSpecialProperty("_GradientBevel_strength", _filter_property_get, _filter_property_set, [GradientBevelFilter, "strength"]);
- Tweener.registerSpecialProperty("_GradientBevel_type", _filter_property_get, _filter_property_set, [GradientBevelFilter, "type"]);
-
- // Shortcuts - GradientGlowFilter
- // http://livedocs.adobe.com/flex/2/langref/flash/filters/GradientGlowFilter.html
- // .alphas (array)
- Tweener.registerSpecialProperty("_GradientGlow_angle", _filter_property_get, _filter_property_set, [GradientGlowFilter, "angle"]);
- Tweener.registerSpecialProperty("_GradientGlow_blurX", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurX"]);
- Tweener.registerSpecialProperty("_GradientGlow_blurY", _filter_property_get, _filter_property_set, [GradientGlowFilter, "blurY"]);
- // .colors (array)
- Tweener.registerSpecialProperty("_GradientGlow_distance", _filter_property_get, _filter_property_set, [GradientGlowFilter, "distance"]);
- Tweener.registerSpecialProperty("_GradientGlow_knockout", _filter_property_get, _filter_property_set, [GradientGlowFilter, "knockout"]);
- Tweener.registerSpecialProperty("_GradientGlow_quality", _filter_property_get, _filter_property_set, [GradientGlowFilter, "quality"]);
- // .ratios (array)
- Tweener.registerSpecialProperty("_GradientGlow_strength", _filter_property_get, _filter_property_set, [GradientGlowFilter, "strength"]);
- Tweener.registerSpecialProperty("_GradientGlow_type", _filter_property_get, _filter_property_set, [GradientGlowFilter, "type"]);
-
- }
-
-
- // ==================================================================================================================================
- // PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // generic splitters
-
- /**
- * A generic color splitter - from 0xrrggbb to r, g, b with the name of the parameters passed
- *
- * @param p_value Number The original _color value
- * @return Array An array containing the .name and .value of all new properties
- */
- public static function _generic_color_splitter (p_value:Number, p_parameters:Array):Array {
- var nArray:Array = new Array();
- nArray.push({name:p_parameters[0], value:AuxFunctions.numberToR(p_value)});
- nArray.push({name:p_parameters[1], value:AuxFunctions.numberToG(p_value)});
- nArray.push({name:p_parameters[2], value:AuxFunctions.numberToB(p_value)});
- return nArray;
- }
-
- /**
- * A generic matrix splitter - from [] to items with the name of the parameters passed
- *
- * @param p_value Array The original
- * @return Array An array containing the .name and .value of all new properties
- */
- public static function _generic_matrix_splitter (p_value:Array, p_parameters:Array):Array {
- if (p_value == null) p_value = p_parameters[0].concat();
- var nArray:Array = new Array();
- for (var i:Number = 0; i < p_value.length; i++) {
- nArray.push({name:p_parameters[1][i], value:p_value[i]});
- }
- return nArray;
- }
-
- /**
- * A generic array splitter - from [] to items with the index passed back
- *
- * @param p_value Array The original array value
- * @return Array An array containing the .name and .value of all new properties
- */
- /*
- public static function _generic_array_splitter (p_value:Array, p_parameters:Array):Array {
- if (p_value == null) p_value = p_parameters[0].concat();
- var nArray:Array = new Array();
- for (var i:Number = 0; i < p_value.length; i++) {
- nArray.push({name:p_parameters[1][i], value:p_value[i], arrayIndex:i});
- }
- return nArray;
- }
- */
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // filters
-
- /**
- * Splits the _filter, _blur, etc parameter into specific filter variables
- *
- * @param p_value BitmapFilter A BitmapFilter instance
- * @return Array An array containing the .name and .value of all new properties
- */
- public static function _filter_splitter (p_value:BitmapFilter, p_parameters:Array, p_extra:Object = null):Array {
- var nArray:Array = new Array();
- if (p_value is BevelFilter) {
- nArray.push({name:"_Bevel_angle", value:BevelFilter(p_value).angle});
- nArray.push({name:"_Bevel_blurX", value:BevelFilter(p_value).blurX});
- nArray.push({name:"_Bevel_blurY", value:BevelFilter(p_value).blurY});
- nArray.push({name:"_Bevel_distance", value:BevelFilter(p_value).distance});
- nArray.push({name:"_Bevel_highlightAlpha", value:BevelFilter(p_value).highlightAlpha});
- nArray.push({name:"_Bevel_highlightColor", value:BevelFilter(p_value).highlightColor});
- nArray.push({name:"_Bevel_knockout", value:BevelFilter(p_value).knockout});
- nArray.push({name:"_Bevel_quality", value:BevelFilter(p_value).quality});
- nArray.push({name:"_Bevel_shadowAlpha", value:BevelFilter(p_value).shadowAlpha});
- nArray.push({name:"_Bevel_shadowColor", value:BevelFilter(p_value).shadowColor});
- nArray.push({name:"_Bevel_strength", value:BevelFilter(p_value).strength});
- nArray.push({name:"_Bevel_type", value:BevelFilter(p_value).type});
- } else if (p_value is BlurFilter) {
- nArray.push({name:"_Blur_blurX", value:BlurFilter(p_value).blurX});
- nArray.push({name:"_Blur_blurY", value:BlurFilter(p_value).blurY});
- nArray.push({name:"_Blur_quality", value:BlurFilter(p_value).quality});
- } else if (p_value is ColorMatrixFilter) {
- nArray.push({name:"_ColorMatrix_matrix", value:ColorMatrixFilter(p_value).matrix});
- } else if (p_value is ConvolutionFilter) {
- nArray.push({name:"_Convolution_alpha", value:ConvolutionFilter(p_value).alpha});
- nArray.push({name:"_Convolution_bias", value:ConvolutionFilter(p_value).bias});
- nArray.push({name:"_Convolution_clamp", value:ConvolutionFilter(p_value).clamp});
- nArray.push({name:"_Convolution_color", value:ConvolutionFilter(p_value).color});
- // .matrix
- nArray.push({name:"_Convolution_divisor", value:ConvolutionFilter(p_value).divisor});
- nArray.push({name:"_Convolution_matrixX", value:ConvolutionFilter(p_value).matrixX});
- nArray.push({name:"_Convolution_matrixY", value:ConvolutionFilter(p_value).matrixY});
- nArray.push({name:"_Convolution_preserveAlpha", value:ConvolutionFilter(p_value).preserveAlpha});
- } else if (p_value is DisplacementMapFilter) {
- nArray.push({name:"_DisplacementMap_alpha", value:DisplacementMapFilter(p_value).alpha});
- nArray.push({name:"_DisplacementMap_color", value:DisplacementMapFilter(p_value).color});
- nArray.push({name:"_DisplacementMap_componentX", value:DisplacementMapFilter(p_value).componentX});
- nArray.push({name:"_DisplacementMap_componentY", value:DisplacementMapFilter(p_value).componentY});
- nArray.push({name:"_DisplacementMap_mapBitmap", value:DisplacementMapFilter(p_value).mapBitmap});
- nArray.push({name:"_DisplacementMap_mapPoint", value:DisplacementMapFilter(p_value).mapPoint});
- nArray.push({name:"_DisplacementMap_mode", value:DisplacementMapFilter(p_value).mode});
- nArray.push({name:"_DisplacementMap_scaleX", value:DisplacementMapFilter(p_value).scaleX});
- nArray.push({name:"_DisplacementMap_scaleY", value:DisplacementMapFilter(p_value).scaleY});
- } else if (p_value is DropShadowFilter) {
- nArray.push({name:"_DropShadow_alpha", value:DropShadowFilter(p_value).alpha});
- nArray.push({name:"_DropShadow_angle", value:DropShadowFilter(p_value).angle});
- nArray.push({name:"_DropShadow_blurX", value:DropShadowFilter(p_value).blurX});
- nArray.push({name:"_DropShadow_blurY", value:DropShadowFilter(p_value).blurY});
- nArray.push({name:"_DropShadow_color", value:DropShadowFilter(p_value).color});
- nArray.push({name:"_DropShadow_distance", value:DropShadowFilter(p_value).distance});
- nArray.push({name:"_DropShadow_hideObject", value:DropShadowFilter(p_value).hideObject});
- nArray.push({name:"_DropShadow_inner", value:DropShadowFilter(p_value).inner});
- nArray.push({name:"_DropShadow_knockout", value:DropShadowFilter(p_value).knockout});
- nArray.push({name:"_DropShadow_quality", value:DropShadowFilter(p_value).quality});
- nArray.push({name:"_DropShadow_strength", value:DropShadowFilter(p_value).strength});
- } else if (p_value is GlowFilter) {
- nArray.push({name:"_Glow_alpha", value:GlowFilter(p_value).alpha});
- nArray.push({name:"_Glow_blurX", value:GlowFilter(p_value).blurX});
- nArray.push({name:"_Glow_blurY", value:GlowFilter(p_value).blurY});
- nArray.push({name:"_Glow_color", value:GlowFilter(p_value).color});
- nArray.push({name:"_Glow_inner", value:GlowFilter(p_value).inner});
- nArray.push({name:"_Glow_knockout", value:GlowFilter(p_value).knockout});
- nArray.push({name:"_Glow_quality", value:GlowFilter(p_value).quality});
- nArray.push({name:"_Glow_strength", value:GlowFilter(p_value).strength});
- } else if (p_value is GradientBevelFilter) {
- // .alphas (array)
- nArray.push({name:"_GradientBevel_angle", value:GradientBevelFilter(p_value).strength});
- nArray.push({name:"_GradientBevel_blurX", value:GradientBevelFilter(p_value).blurX});
- nArray.push({name:"_GradientBevel_blurY", value:GradientBevelFilter(p_value).blurY});
- // .colors (array)
- nArray.push({name:"_GradientBevel_distance", value:GradientBevelFilter(p_value).distance});
- nArray.push({name:"_GradientBevel_quality", value:GradientBevelFilter(p_value).quality});
- // .ratios(array)
- nArray.push({name:"_GradientBevel_strength", value:GradientBevelFilter(p_value).strength});
- nArray.push({name:"_GradientBevel_type", value:GradientBevelFilter(p_value).type});
- } else if (p_value is GradientGlowFilter) {
- // .alphas (array)
- nArray.push({name:"_GradientGlow_angle", value:GradientGlowFilter(p_value).strength});
- nArray.push({name:"_GradientGlow_blurX", value:GradientGlowFilter(p_value).blurX});
- nArray.push({name:"_GradientGlow_blurY", value:GradientGlowFilter(p_value).blurY});
- // .colors (array)
- nArray.push({name:"_GradientGlow_distance", value:GradientGlowFilter(p_value).distance});
- nArray.push({name:"_GradientGlow_knockout", value:GradientGlowFilter(p_value).knockout});
- nArray.push({name:"_GradientGlow_quality", value:GradientGlowFilter(p_value).quality});
- // .ratios(array)
- nArray.push({name:"_GradientGlow_strength", value:GradientGlowFilter(p_value).strength});
- nArray.push({name:"_GradientGlow_type", value:GradientGlowFilter(p_value).type});
- } else {
- // ?
- trace ("Tweener FilterShortcuts Error :: Unknown filter class used");
- }
- return nArray;
- }
-
-
- // ==================================================================================================================================
- // NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // filters
-
- /**
- * (filters)
- * Generic function for the properties of filter objects
- */
- public static function _filter_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- var f:Array = p_obj.filters;
- var i:Number;
- var filterClass:Object = p_parameters[0];
- var propertyName:String = p_parameters[1];
- var splitType:String = p_parameters[2];
- for (i = 0; i < f.length; i++) {
- if (f[i] is Class(filterClass)) {
- if (splitType == "color") {
- // Composite, color channel
- var colorComponent:String = p_parameters[3];
- if (colorComponent == "r") return AuxFunctions.numberToR(f[i][propertyName]);
- if (colorComponent == "g") return AuxFunctions.numberToG(f[i][propertyName]);
- if (colorComponent == "b") return AuxFunctions.numberToB(f[i][propertyName]);
- } else if (splitType == "matrix") {
- // Composite, some kind of matrix
- return f[i][propertyName][p_parameters[3]];
- } else {
- // Standard property
- return (f[i][propertyName]);
- }
- }
- }
-
- // No value found for this property - no filter instance found using this class!
- // Must return default desired values
- var defaultValues:Object;
- switch (filterClass) {
- case BevelFilter:
- defaultValues = {angle:NaN, blurX:0, blurY:0, distance:0, highlightAlpha:1, highlightColor:NaN, knockout:null, quality:NaN, shadowAlpha:1, shadowColor:NaN, strength:2, type:null};
- break;
- case BlurFilter:
- defaultValues = {blurX:0, blurY:0, quality:NaN};
- break;
- case ColorMatrixFilter:
- defaultValues = {matrix:[1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]};
- break;
- case ConvolutionFilter:
- defaultValues = {alpha:0, bias:0, clamp:null, color:NaN, divisor:1, matrix:[1], matrixX:1, matrixY:1, preserveAlpha:null};
- break;
- case DisplacementMapFilter:
- defaultValues = {alpha:0, color:NaN, componentX:null, componentY:null, mapBitmap:null, mapPoint:null, mode:null, scaleX:0, scaleY:0};
- break;
- case DropShadowFilter:
- defaultValues = {distance:0, angle:NaN, color:NaN, alpha:1, blurX:0, blurY:0, strength:1, quality:NaN, inner:null, knockout:null, hideObject:null};
- break;
- case GlowFilter:
- defaultValues = {alpha:1, blurX:0, blurY:0, color:NaN, inner:null, knockout:null, quality:NaN, strength:2};
- break;
- case GradientBevelFilter:
- defaultValues = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null};
- break;
- case GradientGlowFilter:
- defaultValues = {alphas:null, angle:NaN, blurX:0, blurY:0, colors:null, distance:0, knockout:null, quality:NaN, ratios:NaN, strength:1, type:null};
- break;
- }
- // When returning NaN, the Tweener engine sets the starting value as being the same as the final value (if not found)
- // When returning null, the Tweener engine doesn't tween it at all, just setting it to the final value
- // This is DIFFERENT from the default filter applied as default on _filter_property_set because some values shouldn't be tweened
- if (splitType == "color") {
- // Composite, color channel; always defaults to target value
- return NaN;
- } else if (splitType == "matrix") {
- // Composite, matrix; always defaults to target value
- return defaultValues[propertyName][p_parameters[3]];
- } else {
- // Standard property
- return defaultValues[propertyName];
- }
- }
-
- public static function _filter_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- var f:Array = p_obj.filters;
- var i:Number;
- var filterClass:Object = p_parameters[0];
- var propertyName:String = p_parameters[1];
- var splitType:String = p_parameters[2];
- for (i = 0; i < f.length; i++) {
- if (f[i] is Class(filterClass)) {
- if (splitType == "color") {
- // Composite, color channel
- var colorComponent:String = p_parameters[3];
- if (colorComponent == "r") f[i][propertyName] = (f[i][propertyName] & 0xffff) | (p_value << 16);
- if (colorComponent == "g") f[i][propertyName] = (f[i][propertyName] & 0xff00ff) | (p_value << 8);
- if (colorComponent == "b") f[i][propertyName] = (f[i][propertyName] & 0xffff00) | p_value;
- } else if (splitType == "matrix") {
- var mtx:Array = f[i][propertyName];
- mtx[p_parameters[3]] = p_value;
- f[i][propertyName] = mtx;
- } else {
- // Standard property
- f[i][propertyName] = p_value;
- }
- p_obj.filters = f;
- return;
- }
- }
-
- // The correct filter class wasn't found, so create a new one that is the equivalent of the object without the filter
- if (f == null) f = new Array();
- var fi:BitmapFilter;
- switch (filterClass) {
- case BevelFilter:
- fi = new BevelFilter(0, 45, 0xffffff, 1, 0x000000, 1, 0, 0);
- break;
- case BlurFilter:
- fi = new BlurFilter(0, 0);
- break;
- case ColorMatrixFilter:
- fi = new ColorMatrixFilter([1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0, 0, 0, 0, 0, 1, 0]);
- break;
- case ConvolutionFilter:
- fi = new ConvolutionFilter(1, 1, [1], 1, 0, true, true, 0x000000, 0);
- break;
- case DisplacementMapFilter:
- // Doesn't make much sense to create a new empty DisplacementMapFilter if there's nothing to tween
- fi = new DisplacementMapFilter(new BitmapData(10, 10), new Point(0, 0), 0, 1, 0, 0);
- break;
- case DropShadowFilter:
- fi = new DropShadowFilter(0, 45, 0x000000, 1, 0, 0);
- break;
- case GlowFilter:
- fi = new GlowFilter(0xff0000, 1, 0, 0);
- break;
- case GradientBevelFilter:
- fi = new GradientBevelFilter(0, 45, [0xffffff, 0x000000], [1, 1], [32, 223], 0, 0);
- break;
- case GradientGlowFilter:
- fi = new GradientGlowFilter(0, 45, [0xffffff, 0x000000], [1, 1], [32, 223], 0, 0);
- break;
- }
- //fi[propertyName] = p_value;
- f.push(fi);
- p_obj.filters = f;
- _filter_property_set(p_obj, p_value, p_parameters);
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/properties/SoundShortcuts.as b/flash/ImageDisplayx1/caurina/transitions/properties/SoundShortcuts.as
deleted file mode 100644
index 6e8b8a70a8..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/properties/SoundShortcuts.as
+++ /dev/null
@@ -1,93 +0,0 @@
-package caurina.transitions.properties {
-
- /**
- * properties.SoundShortcuts
- * List of default special properties for Sounds
- * The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
- *
- * @author Zeh Fernando, Nate Chatellier, Arthur Debert
- * @version 1.0.0
- */
-
- import flash.media.SoundTransform;
-
- import caurina.transitions.Tweener;
-
- public class SoundShortcuts {
-
- /**
- * There's no constructor.
- */
- public function SoundShortcuts () {
- trace ("This is an static class and should not be instantiated.")
- }
-
- /**
- * Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
- */
- public static function init():void {
-
- // Normal properties
- Tweener.registerSpecialProperty("_sound_volume", _sound_volume_get, _sound_volume_set);
- Tweener.registerSpecialProperty("_sound_pan", _sound_pan_get, _sound_pan_set);
-
- }
-
-
- // ==================================================================================================================================
- // NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _sound_volume
-
- /**
- * Returns the current sound volume
- *
- * @param p_obj Object SoundChannel object
- * @return Number The current volume
- */
- public static function _sound_volume_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- return p_obj.soundTransform.volume;
- }
-
- /**
- * Sets the sound volume
- *
- * @param p_obj Object SoundChannel object
- * @param p_value Number New volume
- */
- public static function _sound_volume_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null):void {
- var sndTransform:SoundTransform = p_obj.soundTransform;
- sndTransform.volume = p_value;
- p_obj.soundTransform = sndTransform;
- }
-
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _sound_pan
-
- /**
- * Returns the current sound pan
- *
- * @param p_obj Object SoundChannel object
- * @return Number The current pan
- */
- public static function _sound_pan_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- return p_obj.soundTransform.pan;
- }
-
- /**
- * Sets the sound volume
- *
- * @param p_obj Object SoundChannel object
- * @param p_value Number New pan
- */
- public static function _sound_pan_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null):void {
- var sndTransform:SoundTransform = p_obj.soundTransform;
- sndTransform.pan = p_value;
- p_obj.soundTransform = sndTransform;
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/caurina/transitions/properties/TextShortcuts.as b/flash/ImageDisplayx1/caurina/transitions/properties/TextShortcuts.as
deleted file mode 100644
index 6d8f3f88a3..0000000000
--- a/flash/ImageDisplayx1/caurina/transitions/properties/TextShortcuts.as
+++ /dev/null
@@ -1,157 +0,0 @@
-package caurina.transitions.properties {
-
- /**
- * properties.TextShortcuts
- * Special properties for the Tweener class to handle MovieClip filters
- * The function names are strange/inverted because it makes for easier debugging (alphabetic order). They're only for internal use (on this class) anyways.
- *
- * @author Zeh Fernando, Nate Chatellier, Arthur Debert
- * @version 1.0.0
- */
-
- import caurina.transitions.Tweener;
- import caurina.transitions.AuxFunctions;
-
- import flash.text.TextFormat;
-
- public class TextShortcuts {
-
- /**
- * There's no constructor.
- */
- public function TextShortcuts () {
- trace ("This is an static class and should not be instantiated.")
- }
-
- /**
- * Registers all the special properties to the Tweener class, so the Tweener knows what to do with them.
- */
- public static function init(): void {
- // Normal properties
- Tweener.registerSpecialProperty("_text", _text_get, _text_set, null, _text_preProcess);
- // Tweener.registerSpecialPropertyModifier("_text", _text_modifier, _text_get);
-
- // TextFormat-based properties
- Tweener.registerSpecialPropertySplitter("_text_color", _generic_color_splitter, ["_text_color_r", "_text_color_g", "_text_color_b"]);
- Tweener.registerSpecialProperty("_text_color_r", _textFormat_property_get, _textFormat_property_set, ["color", true, "r"]);
- Tweener.registerSpecialProperty("_text_color_g", _textFormat_property_get, _textFormat_property_set, ["color", true, "g"]);
- Tweener.registerSpecialProperty("_text_color_b", _textFormat_property_get, _textFormat_property_set, ["color", true, "b"]);
- Tweener.registerSpecialProperty("_text_indent", _textFormat_property_get, _textFormat_property_set, ["indent"]);
- Tweener.registerSpecialProperty("_text_leading", _textFormat_property_get, _textFormat_property_set, ["leading"]);
- Tweener.registerSpecialProperty("_text_leftMargin", _textFormat_property_get, _textFormat_property_set, ["leftMargin"]);
- Tweener.registerSpecialProperty("_text_letterSpacing", _textFormat_property_get, _textFormat_property_set, ["letterSpacing"]);
- Tweener.registerSpecialProperty("_text_rightMargin", _textFormat_property_get, _textFormat_property_set, ["rightMargin"]);
- Tweener.registerSpecialProperty("_text_size", _textFormat_property_get, _textFormat_property_set, ["size"]);
-
- }
-
-
- // ==================================================================================================================================
- // NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // _text
-
- /**
- * Returns the current frame number from the movieclip timeline
- *
- * @param p_obj Object MovieClip object
- * @return Number The current frame
- */
- public static function _text_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- //return p_obj._currentFrame;
- return -p_obj.text.length;
- }
-
- /**
- * Sets the timeline frame
- *
- * @param p_obj Object MovieClip object
- * @param p_value Number New frame number
- */
- public static function _text_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- //p_obj.gotoAndStop(Math.round(p_value));
- //p_obj.text =
- if (p_value < 0) {
- // Old text
- p_obj.text = p_extra.oldText.substr(0, -Math.round(p_value));
- } else {
- // New text
- p_obj.text = p_extra.newText.substr(0, Math.round(p_value));
- }
- }
-
- public static function _text_preProcess (p_obj:Object, p_parameters:Array, p_originalValueComplete:Object, p_extra:Object): Number {
- p_extra.oldText = p_obj.text;
- p_extra.newText = p_originalValueComplete;
- return p_extra.newText.length;
- }
-
- // ==================================================================================================================================
- // PROPERTY GROUPING/SPLITTING functions --------------------------------------------------------------------------------------------
-
- // ----------------------------------------------------------------------------------------------------------------------------------
- // generic splitters
-
- /**
- * A generic color splitter - from 0xrrggbb to r, g, b with the name of the parameters passed
- *
- * @param p_value Number The original _color value
- * @return Array An array containing the .name and .value of all new properties
- */
- public static function _generic_color_splitter (p_value:Number, p_parameters:Array):Array {
- var nArray:Array = new Array();
- nArray.push({name:p_parameters[0], value:AuxFunctions.numberToR(p_value)});
- nArray.push({name:p_parameters[1], value:AuxFunctions.numberToG(p_value)});
- nArray.push({name:p_parameters[2], value:AuxFunctions.numberToB(p_value)});
- return nArray;
- }
-
-
- // ==================================================================================================================================
- // NORMAL SPECIAL PROPERTY functions ------------------------------------------------------------------------------------------------
-
- /**
- * Generic function for the textformat properties
- */
- public static function _textFormat_property_get (p_obj:Object, p_parameters:Array, p_extra:Object = null):Number {
- var fmt:TextFormat = p_obj.getTextFormat();
- var propertyName:String = p_parameters[0];
- var isColor:Boolean = p_parameters[1];
- if (!isColor) {
- // Standard property
- return (fmt[propertyName]);
- } else {
- // Composite, color channel
- var colorComponent:String = p_parameters[2];
- if (colorComponent == "r") return AuxFunctions.numberToR(fmt[propertyName]);
- if (colorComponent == "g") return AuxFunctions.numberToG(fmt[propertyName]);
- if (colorComponent == "b") return AuxFunctions.numberToB(fmt[propertyName]);
- }
-
- return NaN;
- }
-
- public static function _textFormat_property_set (p_obj:Object, p_value:Number, p_parameters:Array, p_extra:Object = null): void {
- var fmt:TextFormat = p_obj.getTextFormat();
- var propertyName:String = p_parameters[0];
- var isColor:Boolean = p_parameters[1];
- if (!isColor) {
- // Standard property
- fmt[propertyName] = p_value;
- } else {
- // Composite, color channel
- var colorComponent:String = p_parameters[2];
- if (colorComponent == "r") fmt[propertyName] = (fmt[propertyName] & 0xffff) | (p_value << 16);
- if (colorComponent == "g") fmt[propertyName] = (fmt[propertyName] & 0xff00ff) | (p_value << 8);
- if (colorComponent == "b") fmt[propertyName] = (fmt[propertyName] & 0xffff00) | p_value;
- }
-
- p_obj.defaultTextFormat = fmt;
- p_obj.setTextFormat(fmt);
-
- }
-
- }
-
-}
diff --git a/flash/ImageDisplayx1/homelink.fla b/flash/ImageDisplayx1/homelink.fla
deleted file mode 100644
index 1ff11afc97..0000000000
Binary files a/flash/ImageDisplayx1/homelink.fla and /dev/null differ
diff --git a/flash/ImageScroll/.actionScriptProperties b/flash/ImageScroll/.actionScriptProperties
deleted file mode 100644
index 97343923cf..0000000000
--- a/flash/ImageScroll/.actionScriptProperties
+++ /dev/null
@@ -1,20 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/flash/ImageScroll/.flexProperties b/flash/ImageScroll/.flexProperties
deleted file mode 100644
index f207211255..0000000000
--- a/flash/ImageScroll/.flexProperties
+++ /dev/null
@@ -1,2 +0,0 @@
-
-
diff --git a/flash/ImageScroll/.project b/flash/ImageScroll/.project
deleted file mode 100644
index b8b46881c9..0000000000
--- a/flash/ImageScroll/.project
+++ /dev/null
@@ -1,18 +0,0 @@
-
-
- ImageScroll
-
-
-
-
-
- com.adobe.flexbuilder.project.flexbuilder
-
-
-
-
-
- com.adobe.flexbuilder.project.flexnature
- com.adobe.flexbuilder.project.actionscriptnature
-
-
diff --git a/flash/ImageScroll/bin-debug/AC_OETags.js b/flash/ImageScroll/bin-debug/AC_OETags.js
deleted file mode 100644
index ba5d24aac3..0000000000
--- a/flash/ImageScroll/bin-debug/AC_OETags.js
+++ /dev/null
@@ -1,292 +0,0 @@
-// Flash Player Version Detection - Rev 1.6
-// Detect Client Browser type
-// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
-var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
-var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
-var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
-
-function ControlVersion()
-{
- var version;
- var axo;
- var e;
-
- // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
-
- try {
- // version will be set for 7.X or greater players
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
- version = axo.GetVariable("$version");
- } catch (e) {
- }
-
- if (!version)
- {
- try {
- // version will be set for 6.X players only
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
-
- // installed player is some revision of 6.0
- // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
- // so we have to be careful.
-
- // default to the first public version
- version = "WIN 6,0,21,0";
-
- // throws if AllowScripAccess does not exist (introduced in 6.0r47)
- axo.AllowScriptAccess = "always";
-
- // safe to call for 6.0r47 or greater
- version = axo.GetVariable("$version");
-
- } catch (e) {
- }
- }
-
- if (!version)
- {
- try {
- // version will be set for 4.X or 5.X player
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
- version = axo.GetVariable("$version");
- } catch (e) {
- }
- }
-
- if (!version)
- {
- try {
- // version will be set for 3.X player
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
- version = "WIN 3,0,18,0";
- } catch (e) {
- }
- }
-
- if (!version)
- {
- try {
- // version will be set for 2.X player
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
- version = "WIN 2,0,0,11";
- } catch (e) {
- version = -1;
- }
- }
-
- return version;
-}
-
-// JavaScript helper required to detect Flash Player PlugIn version information
-function GetSwfVer(){
- // NS/Opera version >= 3 check for Flash plugin in plugin array
- var flashVer = -1;
-
- if (navigator.plugins != null && navigator.plugins.length > 0) {
- if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
- var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
- var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
- var descArray = flashDescription.split(" ");
- var tempArrayMajor = descArray[2].split(".");
- var versionMajor = tempArrayMajor[0];
- var versionMinor = tempArrayMajor[1];
- var versionRevision = descArray[3];
- if (versionRevision == "") {
- versionRevision = descArray[4];
- }
- if (versionRevision[0] == "d") {
- versionRevision = versionRevision.substring(1);
- } else if (versionRevision[0] == "r") {
- versionRevision = versionRevision.substring(1);
- if (versionRevision.indexOf("d") > 0) {
- versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
- }
- } else if (versionRevision[0] == "b") {
- versionRevision = versionRevision.substring(1);
- }
- var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
- }
- }
- // MSN/WebTV 2.6 supports Flash 4
- else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
- // WebTV 2.5 supports Flash 3
- else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
- // older WebTV supports Flash 2
- else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
- else if ( isIE && isWin && !isOpera ) {
- flashVer = ControlVersion();
- }
- return flashVer;
-}
-
-// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
-function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
-{
- versionStr = GetSwfVer();
- if (versionStr == -1 ) {
- return false;
- } else if (versionStr != 0) {
- if(isIE && isWin && !isOpera) {
- // Given "WIN 2,0,0,11"
- tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
- tempString = tempArray[1]; // "2,0,0,11"
- versionArray = tempString.split(","); // ['2', '0', '0', '11']
- } else {
- versionArray = versionStr.split(".");
- }
- var versionMajor = versionArray[0];
- var versionMinor = versionArray[1];
- var versionRevision = versionArray[2];
-
- // is the major.revision >= requested major.revision AND the minor version >= requested minor
- if (versionMajor > parseFloat(reqMajorVer)) {
- return true;
- } else if (versionMajor == parseFloat(reqMajorVer)) {
- if (versionMinor > parseFloat(reqMinorVer))
- return true;
- else if (versionMinor == parseFloat(reqMinorVer)) {
- if (versionRevision >= parseFloat(reqRevision))
- return true;
- }
- }
- return false;
- }
-}
-
-function AC_AddExtension(src, ext)
-{
- var qIndex = src.indexOf('?');
- if ( qIndex != -1)
- {
- // Add the extention (if needed) before the query params
- var path = src.substring(0, qIndex);
- if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
- return src;
- else
- return src.replace(/\?/, ext+'?');
- }
- else
- {
- // Add the extension (if needed) to the end of the URL
- if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
- return src; // Already have extension
- else
- return src + ext;
- }
-}
-
-function AC_Generateobj(objAttrs, params, embedAttrs)
-{
- var str = '';
- if (isIE && isWin && !isOpera)
- {
- str += '';
- for (var i in params)
- str += ' ';
- str += ' ';
- } else {
- str += ' ';
- }
-
- document.write(str);
-}
-
-function AC_FL_RunContent(){
- var ret =
- AC_GetArgs
- ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
- , "application/x-shockwave-flash"
- );
- AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
-}
-
-function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
- var ret = new Object();
- ret.embedAttrs = new Object();
- ret.params = new Object();
- ret.objAttrs = new Object();
- for (var i=0; i < args.length; i=i+2){
- var currArg = args[i].toLowerCase();
-
- switch (currArg){
- case "classid":
- break;
- case "pluginspage":
- ret.embedAttrs[args[i]] = args[i+1];
- break;
- case "src":
- case "movie":
- args[i+1] = AC_AddExtension(args[i+1], ext);
- ret.embedAttrs["src"] = args[i+1];
- ret.params[srcParamName] = args[i+1];
- break;
- case "onafterupdate":
- case "onbeforeupdate":
- case "onblur":
- case "oncellchange":
- case "onclick":
- case "ondblClick":
- case "ondrag":
- case "ondragend":
- case "ondragenter":
- case "ondragleave":
- case "ondragover":
- case "ondrop":
- case "onfinish":
- case "onfocus":
- case "onhelp":
- case "onmousedown":
- case "onmouseup":
- case "onmouseover":
- case "onmousemove":
- case "onmouseout":
- case "onkeypress":
- case "onkeydown":
- case "onkeyup":
- case "onload":
- case "onlosecapture":
- case "onpropertychange":
- case "onreadystatechange":
- case "onrowsdelete":
- case "onrowenter":
- case "onrowexit":
- case "onrowsinserted":
- case "onstart":
- case "onscroll":
- case "onbeforeeditfocus":
- case "onactivate":
- case "onbeforedeactivate":
- case "ondeactivate":
- case "type":
- case "codebase":
- ret.objAttrs[args[i]] = args[i+1];
- break;
- case "id":
- case "width":
- case "height":
- case "align":
- case "vspace":
- case "hspace":
- case "class":
- case "title":
- case "accesskey":
- case "name":
- case "tabindex":
- ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
- break;
- default:
- ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
- }
- }
- ret.objAttrs["classid"] = classid;
- if (mimeType) ret.embedAttrs["type"] = mimeType;
- return ret;
-}
-
-
diff --git a/flash/ImageScroll/bin-debug/ImageScroll.html b/flash/ImageScroll/bin-debug/ImageScroll.html
deleted file mode 100644
index d002a9f4f6..0000000000
--- a/flash/ImageScroll/bin-debug/ImageScroll.html
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- To view this page ensure that Adobe Flash Player version
- 10.0.0 or greater is installed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Either scripts and active content are not permitted to run or Adobe Flash Player version
- 10.0.0 or greater is not installed.
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/flash/ImageScroll/bin-debug/ImageScroll.swf b/flash/ImageScroll/bin-debug/ImageScroll.swf
deleted file mode 100644
index d4d22e8c45..0000000000
Binary files a/flash/ImageScroll/bin-debug/ImageScroll.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-debug/framework_4.0.0.14159.swf b/flash/ImageScroll/bin-debug/framework_4.0.0.14159.swf
deleted file mode 100644
index c2a7bb13f8..0000000000
Binary files a/flash/ImageScroll/bin-debug/framework_4.0.0.14159.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-debug/history/history.css b/flash/ImageScroll/bin-debug/history/history.css
deleted file mode 100644
index dbc47c61b9..0000000000
--- a/flash/ImageScroll/bin-debug/history/history.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
-
-#ie_historyFrame { width: 0px; height: 0px; display:none }
-#firefox_anchorDiv { width: 0px; height: 0px; display:none }
-#safari_formDiv { width: 0px; height: 0px; display:none }
-#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/flash/ImageScroll/bin-debug/history/history.js b/flash/ImageScroll/bin-debug/history/history.js
deleted file mode 100644
index b56be2f338..0000000000
--- a/flash/ImageScroll/bin-debug/history/history.js
+++ /dev/null
@@ -1,710 +0,0 @@
-BrowserHistoryUtils = {
- addEvent: function(elm, evType, fn, useCapture) {
- useCapture = useCapture || false;
- if (elm.addEventListener) {
- elm.addEventListener(evType, fn, useCapture);
- return true;
- }
- else if (elm.attachEvent) {
- var r = elm.attachEvent('on' + evType, fn);
- return r;
- }
- else {
- elm['on' + evType] = fn;
- }
- }
-}
-
-BrowserHistory = (function() {
- // type of browser
- var browser = {
- ie: false,
- ie8: false,
- firefox: false,
- safari: false,
- opera: false,
- version: -1
- };
-
- // if setDefaultURL has been called, our first clue
- // that the SWF is ready and listening
- //var swfReady = false;
-
- // the URL we'll send to the SWF once it is ready
- //var pendingURL = '';
-
- // Default app state URL to use when no fragment ID present
- var defaultHash = '';
-
- // Last-known app state URL
- var currentHref = document.location.href;
-
- // Initial URL (used only by IE)
- var initialHref = document.location.href;
-
- // Initial URL (used only by IE)
- var initialHash = document.location.hash;
-
- // History frame source URL prefix (used only by IE)
- var historyFrameSourcePrefix = 'history/historyFrame.html?';
-
- // History maintenance (used only by Safari)
- var currentHistoryLength = -1;
-
- var historyHash = [];
-
- var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
-
- var backStack = [];
- var forwardStack = [];
-
- var currentObjectId = null;
-
- //UserAgent detection
- var useragent = navigator.userAgent.toLowerCase();
-
- if (useragent.indexOf("opera") != -1) {
- browser.opera = true;
- } else if (useragent.indexOf("msie") != -1) {
- browser.ie = true;
- browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
- if (browser.version == 8)
- {
- browser.ie = false;
- browser.ie8 = true;
- }
- } else if (useragent.indexOf("safari") != -1) {
- browser.safari = true;
- browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
- } else if (useragent.indexOf("gecko") != -1) {
- browser.firefox = true;
- }
-
- if (browser.ie == true && browser.version == 7) {
- window["_ie_firstload"] = false;
- }
-
- function hashChangeHandler()
- {
- currentHref = document.location.href;
- var flexAppUrl = getHash();
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- }
-
- // Accessor functions for obtaining specific elements of the page.
- function getHistoryFrame()
- {
- return document.getElementById('ie_historyFrame');
- }
-
- function getAnchorElement()
- {
- return document.getElementById('firefox_anchorDiv');
- }
-
- function getFormElement()
- {
- return document.getElementById('safari_formDiv');
- }
-
- function getRememberElement()
- {
- return document.getElementById("safari_remember_field");
- }
-
- // Get the Flash player object for performing ExternalInterface callbacks.
- // Updated for changes to SWFObject2.
- function getPlayer(id) {
- var i;
-
- if (id && document.getElementById(id)) {
- var r = document.getElementById(id);
- if (typeof r.SetVariable != "undefined") {
- return r;
- }
- else {
- var o = r.getElementsByTagName("object");
- var e = r.getElementsByTagName("embed");
- for (i = 0; i < o.length; i++) {
- if (typeof o[i].browserURLChange != "undefined")
- return o[i];
- }
- for (i = 0; i < e.length; i++) {
- if (typeof e[i].browserURLChange != "undefined")
- return e[i];
- }
- }
- }
- else {
- var o = document.getElementsByTagName("object");
- var e = document.getElementsByTagName("embed");
- for (i = 0; i < e.length; i++) {
- if (typeof e[i].browserURLChange != "undefined")
- {
- return e[i];
- }
- }
- for (i = 0; i < o.length; i++) {
- if (typeof o[i].browserURLChange != "undefined")
- {
- return o[i];
- }
- }
- }
- return undefined;
- }
-
- function getPlayers() {
- var i;
- var players = [];
- if (players.length == 0) {
- var tmp = document.getElementsByTagName('object');
- for (i = 0; i < tmp.length; i++)
- {
- if (typeof tmp[i].browserURLChange != "undefined")
- players.push(tmp[i]);
- }
- }
- if (players.length == 0 || players[0].object == null) {
- var tmp = document.getElementsByTagName('embed');
- for (i = 0; i < tmp.length; i++)
- {
- if (typeof tmp[i].browserURLChange != "undefined")
- players.push(tmp[i]);
- }
- }
- return players;
- }
-
- function getIframeHash() {
- var doc = getHistoryFrame().contentWindow.document;
- var hash = String(doc.location.search);
- if (hash.length == 1 && hash.charAt(0) == "?") {
- hash = "";
- }
- else if (hash.length >= 2 && hash.charAt(0) == "?") {
- hash = hash.substring(1);
- }
- return hash;
- }
-
- /* Get the current location hash excluding the '#' symbol. */
- function getHash() {
- // It would be nice if we could use document.location.hash here,
- // but it's faulty sometimes.
- var idx = document.location.href.indexOf('#');
- return (idx >= 0) ? document.location.href.substr(idx+1) : '';
- }
-
- /* Get the current location hash excluding the '#' symbol. */
- function setHash(hash) {
- // It would be nice if we could use document.location.hash here,
- // but it's faulty sometimes.
- if (hash == '') hash = '#'
- document.location.hash = hash;
- }
-
- function createState(baseUrl, newUrl, flexAppUrl) {
- return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
- }
-
- /* Add a history entry to the browser.
- * baseUrl: the portion of the location prior to the '#'
- * newUrl: the entire new URL, including '#' and following fragment
- * flexAppUrl: the portion of the location following the '#' only
- */
- function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
-
- //delete all the history entries
- forwardStack = [];
-
- if (browser.ie) {
- //Check to see if we are being asked to do a navigate for the first
- //history entry, and if so ignore, because it's coming from the creation
- //of the history iframe
- if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
- currentHref = initialHref;
- return;
- }
- if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
- newUrl = baseUrl + '#' + defaultHash;
- flexAppUrl = defaultHash;
- } else {
- // for IE, tell the history frame to go somewhere without a '#'
- // in order to get this entry into the browser history.
- getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
- }
- setHash(flexAppUrl);
- } else {
-
- //ADR
- if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
- initialState = createState(baseUrl, newUrl, flexAppUrl);
- } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
- backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
- }
-
- if (browser.safari) {
- // for Safari, submit a form whose action points to the desired URL
- if (browser.version <= 419.3) {
- var file = window.location.pathname.toString();
- file = file.substring(file.lastIndexOf("/")+1);
- getFormElement().innerHTML = '';
- //get the current elements and add them to the form
- var qs = window.location.search.substring(1);
- var qs_arr = qs.split("&");
- for (var i = 0; i < qs_arr.length; i++) {
- var tmp = qs_arr[i].split("=");
- var elem = document.createElement("input");
- elem.type = "hidden";
- elem.name = tmp[0];
- elem.value = tmp[1];
- document.forms.historyForm.appendChild(elem);
- }
- document.forms.historyForm.submit();
- } else {
- top.location.hash = flexAppUrl;
- }
- // We also have to maintain the history by hand for Safari
- historyHash[history.length] = flexAppUrl;
- _storeStates();
- } else {
- // Otherwise, write an anchor into the page and tell the browser to go there
- addAnchor(flexAppUrl);
- setHash(flexAppUrl);
-
- // For IE8 we must restore full focus/activation to our invoking player instance.
- if (browser.ie8)
- getPlayer().focus();
- }
- }
- backStack.push(createState(baseUrl, newUrl, flexAppUrl));
- }
-
- function _storeStates() {
- if (browser.safari) {
- getRememberElement().value = historyHash.join(",");
- }
- }
-
- function handleBackButton() {
- //The "current" page is always at the top of the history stack.
- var current = backStack.pop();
- if (!current) { return; }
- var last = backStack[backStack.length - 1];
- if (!last && backStack.length == 0){
- last = initialState;
- }
- forwardStack.push(current);
- }
-
- function handleForwardButton() {
- //summary: private method. Do not call this directly.
-
- var last = forwardStack.pop();
- if (!last) { return; }
- backStack.push(last);
- }
-
- function handleArbitraryUrl() {
- //delete all the history entries
- forwardStack = [];
- }
-
- /* Called periodically to poll to see if we need to detect navigation that has occurred */
- function checkForUrlChange() {
-
- if (browser.ie) {
- if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
- //This occurs when the user has navigated to a specific URL
- //within the app, and didn't use browser back/forward
- //IE seems to have a bug where it stops updating the URL it
- //shows the end-user at this point, but programatically it
- //appears to be correct. Do a full app reload to get around
- //this issue.
- if (browser.version < 7) {
- currentHref = document.location.href;
- document.location.reload();
- } else {
- if (getHash() != getIframeHash()) {
- // this.iframe.src = this.blankURL + hash;
- var sourceToSet = historyFrameSourcePrefix + getHash();
- getHistoryFrame().src = sourceToSet;
- currentHref = document.location.href;
- }
- }
- }
- }
-
- if (browser.safari) {
- // For Safari, we have to check to see if history.length changed.
- if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
- //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
- var flexAppUrl = getHash();
- if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
- {
- // If it did change and we're running Safari 3.x or earlier,
- // then we have to look the old state up in our hand-maintained
- // array since document.location.hash won't have changed,
- // then call back into BrowserManager.
- currentHistoryLength = history.length;
- flexAppUrl = historyHash[currentHistoryLength];
- }
-
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- _storeStates();
- }
- }
- if (browser.firefox) {
- if (currentHref != document.location.href) {
- var bsl = backStack.length;
-
- var urlActions = {
- back: false,
- forward: false,
- set: false
- }
-
- if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
- urlActions.back = true;
- // FIXME: could this ever be a forward button?
- // we can't clear it because we still need to check for forwards. Ugg.
- // clearInterval(this.locationTimer);
- handleBackButton();
- }
-
- // first check to see if we could have gone forward. We always halt on
- // a no-hash item.
- if (forwardStack.length > 0) {
- if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
- urlActions.forward = true;
- handleForwardButton();
- }
- }
-
- // ok, that didn't work, try someplace back in the history stack
- if ((bsl >= 2) && (backStack[bsl - 2])) {
- if (backStack[bsl - 2].flexAppUrl == getHash()) {
- urlActions.back = true;
- handleBackButton();
- }
- }
-
- if (!urlActions.back && !urlActions.forward) {
- var foundInStacks = {
- back: -1,
- forward: -1
- }
-
- for (var i = 0; i < backStack.length; i++) {
- if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
- arbitraryUrl = true;
- foundInStacks.back = i;
- }
- }
- for (var i = 0; i < forwardStack.length; i++) {
- if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
- arbitraryUrl = true;
- foundInStacks.forward = i;
- }
- }
- handleArbitraryUrl();
- }
-
- // Firefox changed; do a callback into BrowserManager to tell it.
- currentHref = document.location.href;
- var flexAppUrl = getHash();
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- }
- }
- //setTimeout(checkForUrlChange, 50);
- }
-
- /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
- function addAnchor(flexAppUrl)
- {
- if (document.getElementsByName(flexAppUrl).length == 0) {
- getAnchorElement().innerHTML += "" + flexAppUrl + " ";
- }
- }
-
- var _initialize = function () {
- if (browser.ie)
- {
- var scripts = document.getElementsByTagName('script');
- for (var i = 0, s; s = scripts[i]; i++) {
- if (s.src.indexOf("history.js") > -1) {
- var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
- }
- }
- historyFrameSourcePrefix = iframe_location + "?";
- var src = historyFrameSourcePrefix;
-
- var iframe = document.createElement("iframe");
- iframe.id = 'ie_historyFrame';
- iframe.name = 'ie_historyFrame';
- iframe.src = 'javascript:false;';
-
- try {
- document.body.appendChild(iframe);
- } catch(e) {
- setTimeout(function() {
- document.body.appendChild(iframe);
- }, 0);
- }
- }
-
- if (browser.safari)
- {
- var rememberDiv = document.createElement("div");
- rememberDiv.id = 'safari_rememberDiv';
- document.body.appendChild(rememberDiv);
- rememberDiv.innerHTML = ' ';
-
- var formDiv = document.createElement("div");
- formDiv.id = 'safari_formDiv';
- document.body.appendChild(formDiv);
-
- var reloader_content = document.createElement('div');
- reloader_content.id = 'safarireloader';
- var scripts = document.getElementsByTagName('script');
- for (var i = 0, s; s = scripts[i]; i++) {
- if (s.src.indexOf("history.js") > -1) {
- html = (new String(s.src)).replace(".js", ".html");
- }
- }
- reloader_content.innerHTML = '';
- document.body.appendChild(reloader_content);
- reloader_content.style.position = 'absolute';
- reloader_content.style.left = reloader_content.style.top = '-9999px';
- iframe = reloader_content.getElementsByTagName('iframe')[0];
-
- if (document.getElementById("safari_remember_field").value != "" ) {
- historyHash = document.getElementById("safari_remember_field").value.split(",");
- }
-
- }
-
- if (browser.firefox || browser.ie8)
- {
- var anchorDiv = document.createElement("div");
- anchorDiv.id = 'firefox_anchorDiv';
- document.body.appendChild(anchorDiv);
- }
-
- if (browser.ie8)
- document.body.onhashchange = hashChangeHandler;
- //setTimeout(checkForUrlChange, 50);
- }
-
- return {
- historyHash: historyHash,
- backStack: function() { return backStack; },
- forwardStack: function() { return forwardStack },
- getPlayer: getPlayer,
- initialize: function(src) {
- _initialize(src);
- },
- setURL: function(url) {
- document.location.href = url;
- },
- getURL: function() {
- return document.location.href;
- },
- getTitle: function() {
- return document.title;
- },
- setTitle: function(title) {
- try {
- backStack[backStack.length - 1].title = title;
- } catch(e) { }
- //if on safari, set the title to be the empty string.
- if (browser.safari) {
- if (title == "") {
- try {
- var tmp = window.location.href.toString();
- title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
- } catch(e) {
- title = "";
- }
- }
- }
- document.title = title;
- },
- setDefaultURL: function(def)
- {
- defaultHash = def;
- def = getHash();
- //trailing ? is important else an extra frame gets added to the history
- //when navigating back to the first page. Alternatively could check
- //in history frame navigation to compare # and ?.
- if (browser.ie)
- {
- window['_ie_firstload'] = true;
- var sourceToSet = historyFrameSourcePrefix + def;
- var func = function() {
- getHistoryFrame().src = sourceToSet;
- window.location.replace("#" + def);
- setInterval(checkForUrlChange, 50);
- }
- try {
- func();
- } catch(e) {
- window.setTimeout(function() { func(); }, 0);
- }
- }
-
- if (browser.safari)
- {
- currentHistoryLength = history.length;
- if (historyHash.length == 0) {
- historyHash[currentHistoryLength] = def;
- var newloc = "#" + def;
- window.location.replace(newloc);
- } else {
- //alert(historyHash[historyHash.length-1]);
- }
- //setHash(def);
- setInterval(checkForUrlChange, 50);
- }
-
-
- if (browser.firefox || browser.opera)
- {
- var reg = new RegExp("#" + def + "$");
- if (window.location.toString().match(reg)) {
- } else {
- var newloc ="#" + def;
- window.location.replace(newloc);
- }
- setInterval(checkForUrlChange, 50);
- //setHash(def);
- }
-
- },
-
- /* Set the current browser URL; called from inside BrowserManager to propagate
- * the application state out to the container.
- */
- setBrowserURL: function(flexAppUrl, objectId) {
- if (browser.ie && typeof objectId != "undefined") {
- currentObjectId = objectId;
- }
- //fromIframe = fromIframe || false;
- //fromFlex = fromFlex || false;
- //alert("setBrowserURL: " + flexAppUrl);
- //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
-
- var pos = document.location.href.indexOf('#');
- var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
- var newUrl = baseUrl + '#' + flexAppUrl;
-
- if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
- currentHref = newUrl;
- addHistoryEntry(baseUrl, newUrl, flexAppUrl);
- currentHistoryLength = history.length;
- }
- },
-
- browserURLChange: function(flexAppUrl) {
- var objectId = null;
- if (browser.ie && currentObjectId != null) {
- objectId = currentObjectId;
- }
- pendingURL = '';
-
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- try {
- pl[i].browserURLChange(flexAppUrl);
- } catch(e) { }
- }
- } else {
- try {
- getPlayer(objectId).browserURLChange(flexAppUrl);
- } catch(e) { }
- }
-
- currentObjectId = null;
- },
- getUserAgent: function() {
- return navigator.userAgent;
- },
- getPlatform: function() {
- return navigator.platform;
- }
-
- }
-
-})();
-
-// Initialization
-
-// Automated unit testing and other diagnostics
-
-function setURL(url)
-{
- document.location.href = url;
-}
-
-function backButton()
-{
- history.back();
-}
-
-function forwardButton()
-{
- history.forward();
-}
-
-function goForwardOrBackInHistory(step)
-{
- history.go(step);
-}
-
-//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
-(function(i) {
- var u =navigator.userAgent;var e=/*@cc_on!@*/false;
- var st = setTimeout;
- if(/webkit/i.test(u)){
- st(function(){
- var dr=document.readyState;
- if(dr=="loaded"||dr=="complete"){i()}
- else{st(arguments.callee,10);}},10);
- } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
- document.addEventListener("DOMContentLoaded",i,false);
- } else if(e){
- (function(){
- var t=document.createElement('doc:rdy');
- try{t.doScroll('left');
- i();t=null;
- }catch(e){st(arguments.callee,0);}})();
- } else{
- window.onload=i;
- }
-})( function() {BrowserHistory.initialize();} );
diff --git a/flash/ImageScroll/bin-debug/history/historyFrame.html b/flash/ImageScroll/bin-debug/history/historyFrame.html
deleted file mode 100644
index 07e3806f0e..0000000000
--- a/flash/ImageScroll/bin-debug/history/historyFrame.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
- Hidden frame for Browser History support.
-
-
diff --git a/flash/ImageScroll/bin-debug/osmf_flex.4.0.0.13495.swf b/flash/ImageScroll/bin-debug/osmf_flex.4.0.0.13495.swf
deleted file mode 100644
index af1cef7a3c..0000000000
Binary files a/flash/ImageScroll/bin-debug/osmf_flex.4.0.0.13495.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-debug/playerProductInstall.swf b/flash/ImageScroll/bin-debug/playerProductInstall.swf
deleted file mode 100644
index bdc3437856..0000000000
Binary files a/flash/ImageScroll/bin-debug/playerProductInstall.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-debug/rpc_4.0.0.14159.swf b/flash/ImageScroll/bin-debug/rpc_4.0.0.14159.swf
deleted file mode 100644
index 28af28b216..0000000000
Binary files a/flash/ImageScroll/bin-debug/rpc_4.0.0.14159.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-debug/spark_4.0.0.14159.swf b/flash/ImageScroll/bin-debug/spark_4.0.0.14159.swf
deleted file mode 100644
index 8f497c2323..0000000000
Binary files a/flash/ImageScroll/bin-debug/spark_4.0.0.14159.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-debug/sparkskins_4.0.0.14159.swf b/flash/ImageScroll/bin-debug/sparkskins_4.0.0.14159.swf
deleted file mode 100644
index 81e2da2a59..0000000000
Binary files a/flash/ImageScroll/bin-debug/sparkskins_4.0.0.14159.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-debug/swfobject.js b/flash/ImageScroll/bin-debug/swfobject.js
deleted file mode 100644
index bf35c07c8f..0000000000
--- a/flash/ImageScroll/bin-debug/swfobject.js
+++ /dev/null
@@ -1,777 +0,0 @@
-/*! SWFObject v2.2
- is released under the MIT License
-*/
-
-var swfobject = function() {
-
- var UNDEF = "undefined",
- OBJECT = "object",
- SHOCKWAVE_FLASH = "Shockwave Flash",
- SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
- FLASH_MIME_TYPE = "application/x-shockwave-flash",
- EXPRESS_INSTALL_ID = "SWFObjectExprInst",
- ON_READY_STATE_CHANGE = "onreadystatechange",
-
- win = window,
- doc = document,
- nav = navigator,
-
- plugin = false,
- domLoadFnArr = [main],
- regObjArr = [],
- objIdArr = [],
- listenersArr = [],
- storedAltContent,
- storedAltContentId,
- storedCallbackFn,
- storedCallbackObj,
- isDomLoaded = false,
- isExpressInstallActive = false,
- dynamicStylesheet,
- dynamicStylesheetMedia,
- autoHideShow = true,
-
- /* Centralized function for browser feature detection
- - User agent string detection is only used when no good alternative is possible
- - Is executed directly for optimal performance
- */
- ua = function() {
- var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
- u = nav.userAgent.toLowerCase(),
- p = nav.platform.toLowerCase(),
- windows = p ? /win/.test(p) : /win/.test(u),
- mac = p ? /mac/.test(p) : /mac/.test(u),
- webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
- ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
- playerVersion = [0,0,0],
- d = null;
- if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
- d = nav.plugins[SHOCKWAVE_FLASH].description;
- if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
- plugin = true;
- ie = false; // cascaded feature detection for Internet Explorer
- d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
- playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
- playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
- playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
- }
- }
- else if (typeof win.ActiveXObject != UNDEF) {
- try {
- var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
- if (a) { // a will return null when ActiveX is disabled
- d = a.GetVariable("$version");
- if (d) {
- ie = true; // cascaded feature detection for Internet Explorer
- d = d.split(" ")[1].split(",");
- playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
- }
- }
- }
- catch(e) {}
- }
- return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
- }(),
-
- /* Cross-browser onDomLoad
- - Will fire an event as soon as the DOM of a web page is loaded
- - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
- - Regular onload serves as fallback
- */
- onDomLoad = function() {
- if (!ua.w3) { return; }
- if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
- callDomLoadFunctions();
- }
- if (!isDomLoaded) {
- if (typeof doc.addEventListener != UNDEF) {
- doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
- }
- if (ua.ie && ua.win) {
- doc.attachEvent(ON_READY_STATE_CHANGE, function() {
- if (doc.readyState == "complete") {
- doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
- callDomLoadFunctions();
- }
- });
- if (win == top) { // if not inside an iframe
- (function(){
- if (isDomLoaded) { return; }
- try {
- doc.documentElement.doScroll("left");
- }
- catch(e) {
- setTimeout(arguments.callee, 0);
- return;
- }
- callDomLoadFunctions();
- })();
- }
- }
- if (ua.wk) {
- (function(){
- if (isDomLoaded) { return; }
- if (!/loaded|complete/.test(doc.readyState)) {
- setTimeout(arguments.callee, 0);
- return;
- }
- callDomLoadFunctions();
- })();
- }
- addLoadEvent(callDomLoadFunctions);
- }
- }();
-
- function callDomLoadFunctions() {
- if (isDomLoaded) { return; }
- try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
- var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
- t.parentNode.removeChild(t);
- }
- catch (e) { return; }
- isDomLoaded = true;
- var dl = domLoadFnArr.length;
- for (var i = 0; i < dl; i++) {
- domLoadFnArr[i]();
- }
- }
-
- function addDomLoadEvent(fn) {
- if (isDomLoaded) {
- fn();
- }
- else {
- domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
- }
- }
-
- /* Cross-browser onload
- - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- - Will fire an event as soon as a web page including all of its assets are loaded
- */
- function addLoadEvent(fn) {
- if (typeof win.addEventListener != UNDEF) {
- win.addEventListener("load", fn, false);
- }
- else if (typeof doc.addEventListener != UNDEF) {
- doc.addEventListener("load", fn, false);
- }
- else if (typeof win.attachEvent != UNDEF) {
- addListener(win, "onload", fn);
- }
- else if (typeof win.onload == "function") {
- var fnOld = win.onload;
- win.onload = function() {
- fnOld();
- fn();
- };
- }
- else {
- win.onload = fn;
- }
- }
-
- /* Main function
- - Will preferably execute onDomLoad, otherwise onload (as a fallback)
- */
- function main() {
- if (plugin) {
- testPlayerVersion();
- }
- else {
- matchVersions();
- }
- }
-
- /* Detect the Flash Player version for non-Internet Explorer browsers
- - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
- a. Both release and build numbers can be detected
- b. Avoid wrong descriptions by corrupt installers provided by Adobe
- c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
- - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
- */
- function testPlayerVersion() {
- var b = doc.getElementsByTagName("body")[0];
- var o = createElement(OBJECT);
- o.setAttribute("type", FLASH_MIME_TYPE);
- var t = b.appendChild(o);
- if (t) {
- var counter = 0;
- (function(){
- if (typeof t.GetVariable != UNDEF) {
- var d = t.GetVariable("$version");
- if (d) {
- d = d.split(" ")[1].split(",");
- ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
- }
- }
- else if (counter < 10) {
- counter++;
- setTimeout(arguments.callee, 10);
- return;
- }
- b.removeChild(o);
- t = null;
- matchVersions();
- })();
- }
- else {
- matchVersions();
- }
- }
-
- /* Perform Flash Player and SWF version matching; static publishing only
- */
- function matchVersions() {
- var rl = regObjArr.length;
- if (rl > 0) {
- for (var i = 0; i < rl; i++) { // for each registered object element
- var id = regObjArr[i].id;
- var cb = regObjArr[i].callbackFn;
- var cbObj = {success:false, id:id};
- if (ua.pv[0] > 0) {
- var obj = getElementById(id);
- if (obj) {
- if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
- setVisibility(id, true);
- if (cb) {
- cbObj.success = true;
- cbObj.ref = getObjectById(id);
- cb(cbObj);
- }
- }
- else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
- var att = {};
- att.data = regObjArr[i].expressInstall;
- att.width = obj.getAttribute("width") || "0";
- att.height = obj.getAttribute("height") || "0";
- if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
- if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
- // parse HTML object param element's name-value pairs
- var par = {};
- var p = obj.getElementsByTagName("param");
- var pl = p.length;
- for (var j = 0; j < pl; j++) {
- if (p[j].getAttribute("name").toLowerCase() != "movie") {
- par[p[j].getAttribute("name")] = p[j].getAttribute("value");
- }
- }
- showExpressInstall(att, par, id, cb);
- }
- else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
- displayAltContent(obj);
- if (cb) { cb(cbObj); }
- }
- }
- }
- else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
- setVisibility(id, true);
- if (cb) {
- var o = getObjectById(id); // test whether there is an HTML object element or not
- if (o && typeof o.SetVariable != UNDEF) {
- cbObj.success = true;
- cbObj.ref = o;
- }
- cb(cbObj);
- }
- }
- }
- }
- }
-
- function getObjectById(objectIdStr) {
- var r = null;
- var o = getElementById(objectIdStr);
- if (o && o.nodeName == "OBJECT") {
- if (typeof o.SetVariable != UNDEF) {
- r = o;
- }
- else {
- var n = o.getElementsByTagName(OBJECT)[0];
- if (n) {
- r = n;
- }
- }
- }
- return r;
- }
-
- /* Requirements for Adobe Express Install
- - only one instance can be active at a time
- - fp 6.0.65 or higher
- - Win/Mac OS only
- - no Webkit engines older than version 312
- */
- function canExpressInstall() {
- return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
- }
-
- /* Show the Adobe Express Install dialog
- - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
- */
- function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
- isExpressInstallActive = true;
- storedCallbackFn = callbackFn || null;
- storedCallbackObj = {success:false, id:replaceElemIdStr};
- var obj = getElementById(replaceElemIdStr);
- if (obj) {
- if (obj.nodeName == "OBJECT") { // static publishing
- storedAltContent = abstractAltContent(obj);
- storedAltContentId = null;
- }
- else { // dynamic publishing
- storedAltContent = obj;
- storedAltContentId = replaceElemIdStr;
- }
- att.id = EXPRESS_INSTALL_ID;
- if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
- if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
- doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
- var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
- fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
- if (typeof par.flashvars != UNDEF) {
- par.flashvars += "&" + fv;
- }
- else {
- par.flashvars = fv;
- }
- // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
- // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
- if (ua.ie && ua.win && obj.readyState != 4) {
- var newObj = createElement("div");
- replaceElemIdStr += "SWFObjectNew";
- newObj.setAttribute("id", replaceElemIdStr);
- obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- obj.parentNode.removeChild(obj);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- createSWF(att, par, replaceElemIdStr);
- }
- }
-
- /* Functions to abstract and display alternative content
- */
- function displayAltContent(obj) {
- if (ua.ie && ua.win && obj.readyState != 4) {
- // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
- // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
- var el = createElement("div");
- obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
- el.parentNode.replaceChild(abstractAltContent(obj), el);
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- obj.parentNode.removeChild(obj);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- else {
- obj.parentNode.replaceChild(abstractAltContent(obj), obj);
- }
- }
-
- function abstractAltContent(obj) {
- var ac = createElement("div");
- if (ua.win && ua.ie) {
- ac.innerHTML = obj.innerHTML;
- }
- else {
- var nestedObj = obj.getElementsByTagName(OBJECT)[0];
- if (nestedObj) {
- var c = nestedObj.childNodes;
- if (c) {
- var cl = c.length;
- for (var i = 0; i < cl; i++) {
- if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
- ac.appendChild(c[i].cloneNode(true));
- }
- }
- }
- }
- }
- return ac;
- }
-
- /* Cross-browser dynamic SWF creation
- */
- function createSWF(attObj, parObj, id) {
- var r, el = getElementById(id);
- if (ua.wk && ua.wk < 312) { return r; }
- if (el) {
- if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
- attObj.id = id;
- }
- if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
- var att = "";
- for (var i in attObj) {
- if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
- if (i.toLowerCase() == "data") {
- parObj.movie = attObj[i];
- }
- else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
- att += ' class="' + attObj[i] + '"';
- }
- else if (i.toLowerCase() != "classid") {
- att += ' ' + i + '="' + attObj[i] + '"';
- }
- }
- }
- var par = "";
- for (var j in parObj) {
- if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
- par += ' ';
- }
- }
- el.outerHTML = '' + par + ' ';
- objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
- r = getElementById(attObj.id);
- }
- else { // well-behaving browsers
- var o = createElement(OBJECT);
- o.setAttribute("type", FLASH_MIME_TYPE);
- for (var m in attObj) {
- if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
- if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
- o.setAttribute("class", attObj[m]);
- }
- else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
- o.setAttribute(m, attObj[m]);
- }
- }
- }
- for (var n in parObj) {
- if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
- createObjParam(o, n, parObj[n]);
- }
- }
- el.parentNode.replaceChild(o, el);
- r = o;
- }
- }
- return r;
- }
-
- function createObjParam(el, pName, pValue) {
- var p = createElement("param");
- p.setAttribute("name", pName);
- p.setAttribute("value", pValue);
- el.appendChild(p);
- }
-
- /* Cross-browser SWF removal
- - Especially needed to safely and completely remove a SWF in Internet Explorer
- */
- function removeSWF(id) {
- var obj = getElementById(id);
- if (obj && obj.nodeName == "OBJECT") {
- if (ua.ie && ua.win) {
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- removeObjectInIE(id);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- else {
- obj.parentNode.removeChild(obj);
- }
- }
- }
-
- function removeObjectInIE(id) {
- var obj = getElementById(id);
- if (obj) {
- for (var i in obj) {
- if (typeof obj[i] == "function") {
- obj[i] = null;
- }
- }
- obj.parentNode.removeChild(obj);
- }
- }
-
- /* Functions to optimize JavaScript compression
- */
- function getElementById(id) {
- var el = null;
- try {
- el = doc.getElementById(id);
- }
- catch (e) {}
- return el;
- }
-
- function createElement(el) {
- return doc.createElement(el);
- }
-
- /* Updated attachEvent function for Internet Explorer
- - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
- */
- function addListener(target, eventType, fn) {
- target.attachEvent(eventType, fn);
- listenersArr[listenersArr.length] = [target, eventType, fn];
- }
-
- /* Flash Player and SWF content version matching
- */
- function hasPlayerVersion(rv) {
- var pv = ua.pv, v = rv.split(".");
- v[0] = parseInt(v[0], 10);
- v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
- v[2] = parseInt(v[2], 10) || 0;
- return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
- }
-
- /* Cross-browser dynamic CSS creation
- - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
- */
- function createCSS(sel, decl, media, newStyle) {
- if (ua.ie && ua.mac) { return; }
- var h = doc.getElementsByTagName("head")[0];
- if (!h) { return; } // to also support badly authored HTML pages that lack a head element
- var m = (media && typeof media == "string") ? media : "screen";
- if (newStyle) {
- dynamicStylesheet = null;
- dynamicStylesheetMedia = null;
- }
- if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
- // create dynamic stylesheet + get a global reference to it
- var s = createElement("style");
- s.setAttribute("type", "text/css");
- s.setAttribute("media", m);
- dynamicStylesheet = h.appendChild(s);
- if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
- dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
- }
- dynamicStylesheetMedia = m;
- }
- // add style rule
- if (ua.ie && ua.win) {
- if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
- dynamicStylesheet.addRule(sel, decl);
- }
- }
- else {
- if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
- dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
- }
- }
- }
-
- function setVisibility(id, isVisible) {
- if (!autoHideShow) { return; }
- var v = isVisible ? "visible" : "hidden";
- if (isDomLoaded && getElementById(id)) {
- getElementById(id).style.visibility = v;
- }
- else {
- createCSS("#" + id, "visibility:" + v);
- }
- }
-
- /* Filter to avoid XSS attacks
- */
- function urlEncodeIfNecessary(s) {
- var regex = /[\\\"<>\.;]/;
- var hasBadChars = regex.exec(s) != null;
- return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
- }
-
- /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
- */
- var cleanup = function() {
- if (ua.ie && ua.win) {
- window.attachEvent("onunload", function() {
- // remove listeners to avoid memory leaks
- var ll = listenersArr.length;
- for (var i = 0; i < ll; i++) {
- listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
- }
- // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
- var il = objIdArr.length;
- for (var j = 0; j < il; j++) {
- removeSWF(objIdArr[j]);
- }
- // cleanup library's main closures to avoid memory leaks
- for (var k in ua) {
- ua[k] = null;
- }
- ua = null;
- for (var l in swfobject) {
- swfobject[l] = null;
- }
- swfobject = null;
- });
- }
- }();
-
- return {
- /* Public API
- - Reference: http://code.google.com/p/swfobject/wiki/documentation
- */
- registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
- if (ua.w3 && objectIdStr && swfVersionStr) {
- var regObj = {};
- regObj.id = objectIdStr;
- regObj.swfVersion = swfVersionStr;
- regObj.expressInstall = xiSwfUrlStr;
- regObj.callbackFn = callbackFn;
- regObjArr[regObjArr.length] = regObj;
- setVisibility(objectIdStr, false);
- }
- else if (callbackFn) {
- callbackFn({success:false, id:objectIdStr});
- }
- },
-
- getObjectById: function(objectIdStr) {
- if (ua.w3) {
- return getObjectById(objectIdStr);
- }
- },
-
- embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
- var callbackObj = {success:false, id:replaceElemIdStr};
- if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
- setVisibility(replaceElemIdStr, false);
- addDomLoadEvent(function() {
- widthStr += ""; // auto-convert to string
- heightStr += "";
- var att = {};
- if (attObj && typeof attObj === OBJECT) {
- for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
- att[i] = attObj[i];
- }
- }
- att.data = swfUrlStr;
- att.width = widthStr;
- att.height = heightStr;
- var par = {};
- if (parObj && typeof parObj === OBJECT) {
- for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
- par[j] = parObj[j];
- }
- }
- if (flashvarsObj && typeof flashvarsObj === OBJECT) {
- for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
- if (typeof par.flashvars != UNDEF) {
- par.flashvars += "&" + k + "=" + flashvarsObj[k];
- }
- else {
- par.flashvars = k + "=" + flashvarsObj[k];
- }
- }
- }
- if (hasPlayerVersion(swfVersionStr)) { // create SWF
- var obj = createSWF(att, par, replaceElemIdStr);
- if (att.id == replaceElemIdStr) {
- setVisibility(replaceElemIdStr, true);
- }
- callbackObj.success = true;
- callbackObj.ref = obj;
- }
- else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
- att.data = xiSwfUrlStr;
- showExpressInstall(att, par, replaceElemIdStr, callbackFn);
- return;
- }
- else { // show alternative content
- setVisibility(replaceElemIdStr, true);
- }
- if (callbackFn) { callbackFn(callbackObj); }
- });
- }
- else if (callbackFn) { callbackFn(callbackObj); }
- },
-
- switchOffAutoHideShow: function() {
- autoHideShow = false;
- },
-
- ua: ua,
-
- getFlashPlayerVersion: function() {
- return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
- },
-
- hasFlashPlayerVersion: hasPlayerVersion,
-
- createSWF: function(attObj, parObj, replaceElemIdStr) {
- if (ua.w3) {
- return createSWF(attObj, parObj, replaceElemIdStr);
- }
- else {
- return undefined;
- }
- },
-
- showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
- if (ua.w3 && canExpressInstall()) {
- showExpressInstall(att, par, replaceElemIdStr, callbackFn);
- }
- },
-
- removeSWF: function(objElemIdStr) {
- if (ua.w3) {
- removeSWF(objElemIdStr);
- }
- },
-
- createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
- if (ua.w3) {
- createCSS(selStr, declStr, mediaStr, newStyleBoolean);
- }
- },
-
- addDomLoadEvent: addDomLoadEvent,
-
- addLoadEvent: addLoadEvent,
-
- getQueryParamValue: function(param) {
- var q = doc.location.search || doc.location.hash;
- if (q) {
- if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
- if (param == null) {
- return urlEncodeIfNecessary(q);
- }
- var pairs = q.split("&");
- for (var i = 0; i < pairs.length; i++) {
- if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
- return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
- }
- }
- }
- return "";
- },
-
- // For internal usage only
- expressInstallCallback: function() {
- if (isExpressInstallActive) {
- var obj = getElementById(EXPRESS_INSTALL_ID);
- if (obj && storedAltContent) {
- obj.parentNode.replaceChild(storedAltContent, obj);
- if (storedAltContentId) {
- setVisibility(storedAltContentId, true);
- if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
- }
- if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
- }
- isExpressInstallActive = false;
- }
- }
- };
-}();
diff --git a/flash/ImageScroll/bin-debug/test.php b/flash/ImageScroll/bin-debug/test.php
deleted file mode 100644
index 186ae70706..0000000000
--- a/flash/ImageScroll/bin-debug/test.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-hello
-
-'
-
- >
-
-
-
-
diff --git a/flash/ImageScroll/bin-debug/textLayout_1.0.0.595.swf b/flash/ImageScroll/bin-debug/textLayout_1.0.0.595.swf
deleted file mode 100644
index 70c12ac31c..0000000000
Binary files a/flash/ImageScroll/bin-debug/textLayout_1.0.0.595.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/AC_OETags.js b/flash/ImageScroll/bin-release/AC_OETags.js
deleted file mode 100644
index ba5d24aac3..0000000000
--- a/flash/ImageScroll/bin-release/AC_OETags.js
+++ /dev/null
@@ -1,292 +0,0 @@
-// Flash Player Version Detection - Rev 1.6
-// Detect Client Browser type
-// Copyright(c) 2005-2006 Adobe Macromedia Software, LLC. All rights reserved.
-var isIE = (navigator.appVersion.indexOf("MSIE") != -1) ? true : false;
-var isWin = (navigator.appVersion.toLowerCase().indexOf("win") != -1) ? true : false;
-var isOpera = (navigator.userAgent.indexOf("Opera") != -1) ? true : false;
-
-function ControlVersion()
-{
- var version;
- var axo;
- var e;
-
- // NOTE : new ActiveXObject(strFoo) throws an exception if strFoo isn't in the registry
-
- try {
- // version will be set for 7.X or greater players
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.7");
- version = axo.GetVariable("$version");
- } catch (e) {
- }
-
- if (!version)
- {
- try {
- // version will be set for 6.X players only
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.6");
-
- // installed player is some revision of 6.0
- // GetVariable("$version") crashes for versions 6.0.22 through 6.0.29,
- // so we have to be careful.
-
- // default to the first public version
- version = "WIN 6,0,21,0";
-
- // throws if AllowScripAccess does not exist (introduced in 6.0r47)
- axo.AllowScriptAccess = "always";
-
- // safe to call for 6.0r47 or greater
- version = axo.GetVariable("$version");
-
- } catch (e) {
- }
- }
-
- if (!version)
- {
- try {
- // version will be set for 4.X or 5.X player
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
- version = axo.GetVariable("$version");
- } catch (e) {
- }
- }
-
- if (!version)
- {
- try {
- // version will be set for 3.X player
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash.3");
- version = "WIN 3,0,18,0";
- } catch (e) {
- }
- }
-
- if (!version)
- {
- try {
- // version will be set for 2.X player
- axo = new ActiveXObject("ShockwaveFlash.ShockwaveFlash");
- version = "WIN 2,0,0,11";
- } catch (e) {
- version = -1;
- }
- }
-
- return version;
-}
-
-// JavaScript helper required to detect Flash Player PlugIn version information
-function GetSwfVer(){
- // NS/Opera version >= 3 check for Flash plugin in plugin array
- var flashVer = -1;
-
- if (navigator.plugins != null && navigator.plugins.length > 0) {
- if (navigator.plugins["Shockwave Flash 2.0"] || navigator.plugins["Shockwave Flash"]) {
- var swVer2 = navigator.plugins["Shockwave Flash 2.0"] ? " 2.0" : "";
- var flashDescription = navigator.plugins["Shockwave Flash" + swVer2].description;
- var descArray = flashDescription.split(" ");
- var tempArrayMajor = descArray[2].split(".");
- var versionMajor = tempArrayMajor[0];
- var versionMinor = tempArrayMajor[1];
- var versionRevision = descArray[3];
- if (versionRevision == "") {
- versionRevision = descArray[4];
- }
- if (versionRevision[0] == "d") {
- versionRevision = versionRevision.substring(1);
- } else if (versionRevision[0] == "r") {
- versionRevision = versionRevision.substring(1);
- if (versionRevision.indexOf("d") > 0) {
- versionRevision = versionRevision.substring(0, versionRevision.indexOf("d"));
- }
- } else if (versionRevision[0] == "b") {
- versionRevision = versionRevision.substring(1);
- }
- var flashVer = versionMajor + "." + versionMinor + "." + versionRevision;
- }
- }
- // MSN/WebTV 2.6 supports Flash 4
- else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.6") != -1) flashVer = 4;
- // WebTV 2.5 supports Flash 3
- else if (navigator.userAgent.toLowerCase().indexOf("webtv/2.5") != -1) flashVer = 3;
- // older WebTV supports Flash 2
- else if (navigator.userAgent.toLowerCase().indexOf("webtv") != -1) flashVer = 2;
- else if ( isIE && isWin && !isOpera ) {
- flashVer = ControlVersion();
- }
- return flashVer;
-}
-
-// When called with reqMajorVer, reqMinorVer, reqRevision returns true if that version or greater is available
-function DetectFlashVer(reqMajorVer, reqMinorVer, reqRevision)
-{
- versionStr = GetSwfVer();
- if (versionStr == -1 ) {
- return false;
- } else if (versionStr != 0) {
- if(isIE && isWin && !isOpera) {
- // Given "WIN 2,0,0,11"
- tempArray = versionStr.split(" "); // ["WIN", "2,0,0,11"]
- tempString = tempArray[1]; // "2,0,0,11"
- versionArray = tempString.split(","); // ['2', '0', '0', '11']
- } else {
- versionArray = versionStr.split(".");
- }
- var versionMajor = versionArray[0];
- var versionMinor = versionArray[1];
- var versionRevision = versionArray[2];
-
- // is the major.revision >= requested major.revision AND the minor version >= requested minor
- if (versionMajor > parseFloat(reqMajorVer)) {
- return true;
- } else if (versionMajor == parseFloat(reqMajorVer)) {
- if (versionMinor > parseFloat(reqMinorVer))
- return true;
- else if (versionMinor == parseFloat(reqMinorVer)) {
- if (versionRevision >= parseFloat(reqRevision))
- return true;
- }
- }
- return false;
- }
-}
-
-function AC_AddExtension(src, ext)
-{
- var qIndex = src.indexOf('?');
- if ( qIndex != -1)
- {
- // Add the extention (if needed) before the query params
- var path = src.substring(0, qIndex);
- if (path.length >= ext.length && path.lastIndexOf(ext) == (path.length - ext.length))
- return src;
- else
- return src.replace(/\?/, ext+'?');
- }
- else
- {
- // Add the extension (if needed) to the end of the URL
- if (src.length >= ext.length && src.lastIndexOf(ext) == (src.length - ext.length))
- return src; // Already have extension
- else
- return src + ext;
- }
-}
-
-function AC_Generateobj(objAttrs, params, embedAttrs)
-{
- var str = '';
- if (isIE && isWin && !isOpera)
- {
- str += '';
- for (var i in params)
- str += ' ';
- str += ' ';
- } else {
- str += ' ';
- }
-
- document.write(str);
-}
-
-function AC_FL_RunContent(){
- var ret =
- AC_GetArgs
- ( arguments, ".swf", "movie", "clsid:d27cdb6e-ae6d-11cf-96b8-444553540000"
- , "application/x-shockwave-flash"
- );
- AC_Generateobj(ret.objAttrs, ret.params, ret.embedAttrs);
-}
-
-function AC_GetArgs(args, ext, srcParamName, classid, mimeType){
- var ret = new Object();
- ret.embedAttrs = new Object();
- ret.params = new Object();
- ret.objAttrs = new Object();
- for (var i=0; i < args.length; i=i+2){
- var currArg = args[i].toLowerCase();
-
- switch (currArg){
- case "classid":
- break;
- case "pluginspage":
- ret.embedAttrs[args[i]] = args[i+1];
- break;
- case "src":
- case "movie":
- args[i+1] = AC_AddExtension(args[i+1], ext);
- ret.embedAttrs["src"] = args[i+1];
- ret.params[srcParamName] = args[i+1];
- break;
- case "onafterupdate":
- case "onbeforeupdate":
- case "onblur":
- case "oncellchange":
- case "onclick":
- case "ondblClick":
- case "ondrag":
- case "ondragend":
- case "ondragenter":
- case "ondragleave":
- case "ondragover":
- case "ondrop":
- case "onfinish":
- case "onfocus":
- case "onhelp":
- case "onmousedown":
- case "onmouseup":
- case "onmouseover":
- case "onmousemove":
- case "onmouseout":
- case "onkeypress":
- case "onkeydown":
- case "onkeyup":
- case "onload":
- case "onlosecapture":
- case "onpropertychange":
- case "onreadystatechange":
- case "onrowsdelete":
- case "onrowenter":
- case "onrowexit":
- case "onrowsinserted":
- case "onstart":
- case "onscroll":
- case "onbeforeeditfocus":
- case "onactivate":
- case "onbeforedeactivate":
- case "ondeactivate":
- case "type":
- case "codebase":
- ret.objAttrs[args[i]] = args[i+1];
- break;
- case "id":
- case "width":
- case "height":
- case "align":
- case "vspace":
- case "hspace":
- case "class":
- case "title":
- case "accesskey":
- case "name":
- case "tabindex":
- ret.embedAttrs[args[i]] = ret.objAttrs[args[i]] = args[i+1];
- break;
- default:
- ret.embedAttrs[args[i]] = ret.params[args[i]] = args[i+1];
- }
- }
- ret.objAttrs["classid"] = classid;
- if (mimeType) ret.embedAttrs["type"] = mimeType;
- return ret;
-}
-
-
diff --git a/flash/ImageScroll/bin-release/ImageScroll.html b/flash/ImageScroll/bin-release/ImageScroll.html
deleted file mode 100644
index d002a9f4f6..0000000000
--- a/flash/ImageScroll/bin-release/ImageScroll.html
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- To view this page ensure that Adobe Flash Player version
- 10.0.0 or greater is installed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Either scripts and active content are not permitted to run or Adobe Flash Player version
- 10.0.0 or greater is not installed.
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/flash/ImageScroll/bin-release/ImageScroll.swf b/flash/ImageScroll/bin-release/ImageScroll.swf
deleted file mode 100644
index 92be76b48f..0000000000
Binary files a/flash/ImageScroll/bin-release/ImageScroll.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/assets/main.css b/flash/ImageScroll/bin-release/assets/main.css
deleted file mode 100644
index e69de29bb2..0000000000
diff --git a/flash/ImageScroll/bin-release/framework_4.0.0.14159.swz b/flash/ImageScroll/bin-release/framework_4.0.0.14159.swz
deleted file mode 100644
index 4381f2d4e4..0000000000
Binary files a/flash/ImageScroll/bin-release/framework_4.0.0.14159.swz and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/history/history.css b/flash/ImageScroll/bin-release/history/history.css
deleted file mode 100644
index dbc47c61b9..0000000000
--- a/flash/ImageScroll/bin-release/history/history.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
-
-#ie_historyFrame { width: 0px; height: 0px; display:none }
-#firefox_anchorDiv { width: 0px; height: 0px; display:none }
-#safari_formDiv { width: 0px; height: 0px; display:none }
-#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/flash/ImageScroll/bin-release/history/history.js b/flash/ImageScroll/bin-release/history/history.js
deleted file mode 100644
index b56be2f338..0000000000
--- a/flash/ImageScroll/bin-release/history/history.js
+++ /dev/null
@@ -1,710 +0,0 @@
-BrowserHistoryUtils = {
- addEvent: function(elm, evType, fn, useCapture) {
- useCapture = useCapture || false;
- if (elm.addEventListener) {
- elm.addEventListener(evType, fn, useCapture);
- return true;
- }
- else if (elm.attachEvent) {
- var r = elm.attachEvent('on' + evType, fn);
- return r;
- }
- else {
- elm['on' + evType] = fn;
- }
- }
-}
-
-BrowserHistory = (function() {
- // type of browser
- var browser = {
- ie: false,
- ie8: false,
- firefox: false,
- safari: false,
- opera: false,
- version: -1
- };
-
- // if setDefaultURL has been called, our first clue
- // that the SWF is ready and listening
- //var swfReady = false;
-
- // the URL we'll send to the SWF once it is ready
- //var pendingURL = '';
-
- // Default app state URL to use when no fragment ID present
- var defaultHash = '';
-
- // Last-known app state URL
- var currentHref = document.location.href;
-
- // Initial URL (used only by IE)
- var initialHref = document.location.href;
-
- // Initial URL (used only by IE)
- var initialHash = document.location.hash;
-
- // History frame source URL prefix (used only by IE)
- var historyFrameSourcePrefix = 'history/historyFrame.html?';
-
- // History maintenance (used only by Safari)
- var currentHistoryLength = -1;
-
- var historyHash = [];
-
- var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
-
- var backStack = [];
- var forwardStack = [];
-
- var currentObjectId = null;
-
- //UserAgent detection
- var useragent = navigator.userAgent.toLowerCase();
-
- if (useragent.indexOf("opera") != -1) {
- browser.opera = true;
- } else if (useragent.indexOf("msie") != -1) {
- browser.ie = true;
- browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
- if (browser.version == 8)
- {
- browser.ie = false;
- browser.ie8 = true;
- }
- } else if (useragent.indexOf("safari") != -1) {
- browser.safari = true;
- browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
- } else if (useragent.indexOf("gecko") != -1) {
- browser.firefox = true;
- }
-
- if (browser.ie == true && browser.version == 7) {
- window["_ie_firstload"] = false;
- }
-
- function hashChangeHandler()
- {
- currentHref = document.location.href;
- var flexAppUrl = getHash();
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- }
-
- // Accessor functions for obtaining specific elements of the page.
- function getHistoryFrame()
- {
- return document.getElementById('ie_historyFrame');
- }
-
- function getAnchorElement()
- {
- return document.getElementById('firefox_anchorDiv');
- }
-
- function getFormElement()
- {
- return document.getElementById('safari_formDiv');
- }
-
- function getRememberElement()
- {
- return document.getElementById("safari_remember_field");
- }
-
- // Get the Flash player object for performing ExternalInterface callbacks.
- // Updated for changes to SWFObject2.
- function getPlayer(id) {
- var i;
-
- if (id && document.getElementById(id)) {
- var r = document.getElementById(id);
- if (typeof r.SetVariable != "undefined") {
- return r;
- }
- else {
- var o = r.getElementsByTagName("object");
- var e = r.getElementsByTagName("embed");
- for (i = 0; i < o.length; i++) {
- if (typeof o[i].browserURLChange != "undefined")
- return o[i];
- }
- for (i = 0; i < e.length; i++) {
- if (typeof e[i].browserURLChange != "undefined")
- return e[i];
- }
- }
- }
- else {
- var o = document.getElementsByTagName("object");
- var e = document.getElementsByTagName("embed");
- for (i = 0; i < e.length; i++) {
- if (typeof e[i].browserURLChange != "undefined")
- {
- return e[i];
- }
- }
- for (i = 0; i < o.length; i++) {
- if (typeof o[i].browserURLChange != "undefined")
- {
- return o[i];
- }
- }
- }
- return undefined;
- }
-
- function getPlayers() {
- var i;
- var players = [];
- if (players.length == 0) {
- var tmp = document.getElementsByTagName('object');
- for (i = 0; i < tmp.length; i++)
- {
- if (typeof tmp[i].browserURLChange != "undefined")
- players.push(tmp[i]);
- }
- }
- if (players.length == 0 || players[0].object == null) {
- var tmp = document.getElementsByTagName('embed');
- for (i = 0; i < tmp.length; i++)
- {
- if (typeof tmp[i].browserURLChange != "undefined")
- players.push(tmp[i]);
- }
- }
- return players;
- }
-
- function getIframeHash() {
- var doc = getHistoryFrame().contentWindow.document;
- var hash = String(doc.location.search);
- if (hash.length == 1 && hash.charAt(0) == "?") {
- hash = "";
- }
- else if (hash.length >= 2 && hash.charAt(0) == "?") {
- hash = hash.substring(1);
- }
- return hash;
- }
-
- /* Get the current location hash excluding the '#' symbol. */
- function getHash() {
- // It would be nice if we could use document.location.hash here,
- // but it's faulty sometimes.
- var idx = document.location.href.indexOf('#');
- return (idx >= 0) ? document.location.href.substr(idx+1) : '';
- }
-
- /* Get the current location hash excluding the '#' symbol. */
- function setHash(hash) {
- // It would be nice if we could use document.location.hash here,
- // but it's faulty sometimes.
- if (hash == '') hash = '#'
- document.location.hash = hash;
- }
-
- function createState(baseUrl, newUrl, flexAppUrl) {
- return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
- }
-
- /* Add a history entry to the browser.
- * baseUrl: the portion of the location prior to the '#'
- * newUrl: the entire new URL, including '#' and following fragment
- * flexAppUrl: the portion of the location following the '#' only
- */
- function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
-
- //delete all the history entries
- forwardStack = [];
-
- if (browser.ie) {
- //Check to see if we are being asked to do a navigate for the first
- //history entry, and if so ignore, because it's coming from the creation
- //of the history iframe
- if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
- currentHref = initialHref;
- return;
- }
- if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
- newUrl = baseUrl + '#' + defaultHash;
- flexAppUrl = defaultHash;
- } else {
- // for IE, tell the history frame to go somewhere without a '#'
- // in order to get this entry into the browser history.
- getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
- }
- setHash(flexAppUrl);
- } else {
-
- //ADR
- if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
- initialState = createState(baseUrl, newUrl, flexAppUrl);
- } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
- backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
- }
-
- if (browser.safari) {
- // for Safari, submit a form whose action points to the desired URL
- if (browser.version <= 419.3) {
- var file = window.location.pathname.toString();
- file = file.substring(file.lastIndexOf("/")+1);
- getFormElement().innerHTML = '';
- //get the current elements and add them to the form
- var qs = window.location.search.substring(1);
- var qs_arr = qs.split("&");
- for (var i = 0; i < qs_arr.length; i++) {
- var tmp = qs_arr[i].split("=");
- var elem = document.createElement("input");
- elem.type = "hidden";
- elem.name = tmp[0];
- elem.value = tmp[1];
- document.forms.historyForm.appendChild(elem);
- }
- document.forms.historyForm.submit();
- } else {
- top.location.hash = flexAppUrl;
- }
- // We also have to maintain the history by hand for Safari
- historyHash[history.length] = flexAppUrl;
- _storeStates();
- } else {
- // Otherwise, write an anchor into the page and tell the browser to go there
- addAnchor(flexAppUrl);
- setHash(flexAppUrl);
-
- // For IE8 we must restore full focus/activation to our invoking player instance.
- if (browser.ie8)
- getPlayer().focus();
- }
- }
- backStack.push(createState(baseUrl, newUrl, flexAppUrl));
- }
-
- function _storeStates() {
- if (browser.safari) {
- getRememberElement().value = historyHash.join(",");
- }
- }
-
- function handleBackButton() {
- //The "current" page is always at the top of the history stack.
- var current = backStack.pop();
- if (!current) { return; }
- var last = backStack[backStack.length - 1];
- if (!last && backStack.length == 0){
- last = initialState;
- }
- forwardStack.push(current);
- }
-
- function handleForwardButton() {
- //summary: private method. Do not call this directly.
-
- var last = forwardStack.pop();
- if (!last) { return; }
- backStack.push(last);
- }
-
- function handleArbitraryUrl() {
- //delete all the history entries
- forwardStack = [];
- }
-
- /* Called periodically to poll to see if we need to detect navigation that has occurred */
- function checkForUrlChange() {
-
- if (browser.ie) {
- if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
- //This occurs when the user has navigated to a specific URL
- //within the app, and didn't use browser back/forward
- //IE seems to have a bug where it stops updating the URL it
- //shows the end-user at this point, but programatically it
- //appears to be correct. Do a full app reload to get around
- //this issue.
- if (browser.version < 7) {
- currentHref = document.location.href;
- document.location.reload();
- } else {
- if (getHash() != getIframeHash()) {
- // this.iframe.src = this.blankURL + hash;
- var sourceToSet = historyFrameSourcePrefix + getHash();
- getHistoryFrame().src = sourceToSet;
- currentHref = document.location.href;
- }
- }
- }
- }
-
- if (browser.safari) {
- // For Safari, we have to check to see if history.length changed.
- if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
- //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
- var flexAppUrl = getHash();
- if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
- {
- // If it did change and we're running Safari 3.x or earlier,
- // then we have to look the old state up in our hand-maintained
- // array since document.location.hash won't have changed,
- // then call back into BrowserManager.
- currentHistoryLength = history.length;
- flexAppUrl = historyHash[currentHistoryLength];
- }
-
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- _storeStates();
- }
- }
- if (browser.firefox) {
- if (currentHref != document.location.href) {
- var bsl = backStack.length;
-
- var urlActions = {
- back: false,
- forward: false,
- set: false
- }
-
- if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
- urlActions.back = true;
- // FIXME: could this ever be a forward button?
- // we can't clear it because we still need to check for forwards. Ugg.
- // clearInterval(this.locationTimer);
- handleBackButton();
- }
-
- // first check to see if we could have gone forward. We always halt on
- // a no-hash item.
- if (forwardStack.length > 0) {
- if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
- urlActions.forward = true;
- handleForwardButton();
- }
- }
-
- // ok, that didn't work, try someplace back in the history stack
- if ((bsl >= 2) && (backStack[bsl - 2])) {
- if (backStack[bsl - 2].flexAppUrl == getHash()) {
- urlActions.back = true;
- handleBackButton();
- }
- }
-
- if (!urlActions.back && !urlActions.forward) {
- var foundInStacks = {
- back: -1,
- forward: -1
- }
-
- for (var i = 0; i < backStack.length; i++) {
- if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
- arbitraryUrl = true;
- foundInStacks.back = i;
- }
- }
- for (var i = 0; i < forwardStack.length; i++) {
- if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
- arbitraryUrl = true;
- foundInStacks.forward = i;
- }
- }
- handleArbitraryUrl();
- }
-
- // Firefox changed; do a callback into BrowserManager to tell it.
- currentHref = document.location.href;
- var flexAppUrl = getHash();
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- }
- }
- //setTimeout(checkForUrlChange, 50);
- }
-
- /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
- function addAnchor(flexAppUrl)
- {
- if (document.getElementsByName(flexAppUrl).length == 0) {
- getAnchorElement().innerHTML += "" + flexAppUrl + " ";
- }
- }
-
- var _initialize = function () {
- if (browser.ie)
- {
- var scripts = document.getElementsByTagName('script');
- for (var i = 0, s; s = scripts[i]; i++) {
- if (s.src.indexOf("history.js") > -1) {
- var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
- }
- }
- historyFrameSourcePrefix = iframe_location + "?";
- var src = historyFrameSourcePrefix;
-
- var iframe = document.createElement("iframe");
- iframe.id = 'ie_historyFrame';
- iframe.name = 'ie_historyFrame';
- iframe.src = 'javascript:false;';
-
- try {
- document.body.appendChild(iframe);
- } catch(e) {
- setTimeout(function() {
- document.body.appendChild(iframe);
- }, 0);
- }
- }
-
- if (browser.safari)
- {
- var rememberDiv = document.createElement("div");
- rememberDiv.id = 'safari_rememberDiv';
- document.body.appendChild(rememberDiv);
- rememberDiv.innerHTML = ' ';
-
- var formDiv = document.createElement("div");
- formDiv.id = 'safari_formDiv';
- document.body.appendChild(formDiv);
-
- var reloader_content = document.createElement('div');
- reloader_content.id = 'safarireloader';
- var scripts = document.getElementsByTagName('script');
- for (var i = 0, s; s = scripts[i]; i++) {
- if (s.src.indexOf("history.js") > -1) {
- html = (new String(s.src)).replace(".js", ".html");
- }
- }
- reloader_content.innerHTML = '';
- document.body.appendChild(reloader_content);
- reloader_content.style.position = 'absolute';
- reloader_content.style.left = reloader_content.style.top = '-9999px';
- iframe = reloader_content.getElementsByTagName('iframe')[0];
-
- if (document.getElementById("safari_remember_field").value != "" ) {
- historyHash = document.getElementById("safari_remember_field").value.split(",");
- }
-
- }
-
- if (browser.firefox || browser.ie8)
- {
- var anchorDiv = document.createElement("div");
- anchorDiv.id = 'firefox_anchorDiv';
- document.body.appendChild(anchorDiv);
- }
-
- if (browser.ie8)
- document.body.onhashchange = hashChangeHandler;
- //setTimeout(checkForUrlChange, 50);
- }
-
- return {
- historyHash: historyHash,
- backStack: function() { return backStack; },
- forwardStack: function() { return forwardStack },
- getPlayer: getPlayer,
- initialize: function(src) {
- _initialize(src);
- },
- setURL: function(url) {
- document.location.href = url;
- },
- getURL: function() {
- return document.location.href;
- },
- getTitle: function() {
- return document.title;
- },
- setTitle: function(title) {
- try {
- backStack[backStack.length - 1].title = title;
- } catch(e) { }
- //if on safari, set the title to be the empty string.
- if (browser.safari) {
- if (title == "") {
- try {
- var tmp = window.location.href.toString();
- title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
- } catch(e) {
- title = "";
- }
- }
- }
- document.title = title;
- },
- setDefaultURL: function(def)
- {
- defaultHash = def;
- def = getHash();
- //trailing ? is important else an extra frame gets added to the history
- //when navigating back to the first page. Alternatively could check
- //in history frame navigation to compare # and ?.
- if (browser.ie)
- {
- window['_ie_firstload'] = true;
- var sourceToSet = historyFrameSourcePrefix + def;
- var func = function() {
- getHistoryFrame().src = sourceToSet;
- window.location.replace("#" + def);
- setInterval(checkForUrlChange, 50);
- }
- try {
- func();
- } catch(e) {
- window.setTimeout(function() { func(); }, 0);
- }
- }
-
- if (browser.safari)
- {
- currentHistoryLength = history.length;
- if (historyHash.length == 0) {
- historyHash[currentHistoryLength] = def;
- var newloc = "#" + def;
- window.location.replace(newloc);
- } else {
- //alert(historyHash[historyHash.length-1]);
- }
- //setHash(def);
- setInterval(checkForUrlChange, 50);
- }
-
-
- if (browser.firefox || browser.opera)
- {
- var reg = new RegExp("#" + def + "$");
- if (window.location.toString().match(reg)) {
- } else {
- var newloc ="#" + def;
- window.location.replace(newloc);
- }
- setInterval(checkForUrlChange, 50);
- //setHash(def);
- }
-
- },
-
- /* Set the current browser URL; called from inside BrowserManager to propagate
- * the application state out to the container.
- */
- setBrowserURL: function(flexAppUrl, objectId) {
- if (browser.ie && typeof objectId != "undefined") {
- currentObjectId = objectId;
- }
- //fromIframe = fromIframe || false;
- //fromFlex = fromFlex || false;
- //alert("setBrowserURL: " + flexAppUrl);
- //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
-
- var pos = document.location.href.indexOf('#');
- var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
- var newUrl = baseUrl + '#' + flexAppUrl;
-
- if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
- currentHref = newUrl;
- addHistoryEntry(baseUrl, newUrl, flexAppUrl);
- currentHistoryLength = history.length;
- }
- },
-
- browserURLChange: function(flexAppUrl) {
- var objectId = null;
- if (browser.ie && currentObjectId != null) {
- objectId = currentObjectId;
- }
- pendingURL = '';
-
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- try {
- pl[i].browserURLChange(flexAppUrl);
- } catch(e) { }
- }
- } else {
- try {
- getPlayer(objectId).browserURLChange(flexAppUrl);
- } catch(e) { }
- }
-
- currentObjectId = null;
- },
- getUserAgent: function() {
- return navigator.userAgent;
- },
- getPlatform: function() {
- return navigator.platform;
- }
-
- }
-
-})();
-
-// Initialization
-
-// Automated unit testing and other diagnostics
-
-function setURL(url)
-{
- document.location.href = url;
-}
-
-function backButton()
-{
- history.back();
-}
-
-function forwardButton()
-{
- history.forward();
-}
-
-function goForwardOrBackInHistory(step)
-{
- history.go(step);
-}
-
-//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
-(function(i) {
- var u =navigator.userAgent;var e=/*@cc_on!@*/false;
- var st = setTimeout;
- if(/webkit/i.test(u)){
- st(function(){
- var dr=document.readyState;
- if(dr=="loaded"||dr=="complete"){i()}
- else{st(arguments.callee,10);}},10);
- } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
- document.addEventListener("DOMContentLoaded",i,false);
- } else if(e){
- (function(){
- var t=document.createElement('doc:rdy');
- try{t.doScroll('left');
- i();t=null;
- }catch(e){st(arguments.callee,0);}})();
- } else{
- window.onload=i;
- }
-})( function() {BrowserHistory.initialize();} );
diff --git a/flash/ImageScroll/bin-release/history/historyFrame.html b/flash/ImageScroll/bin-release/history/historyFrame.html
deleted file mode 100644
index 07e3806f0e..0000000000
--- a/flash/ImageScroll/bin-release/history/historyFrame.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
- Hidden frame for Browser History support.
-
-
diff --git a/flash/ImageScroll/bin-release/osmf_flex.4.0.0.13495.swz b/flash/ImageScroll/bin-release/osmf_flex.4.0.0.13495.swz
deleted file mode 100644
index 8b580fc33c..0000000000
Binary files a/flash/ImageScroll/bin-release/osmf_flex.4.0.0.13495.swz and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/playerProductInstall.swf b/flash/ImageScroll/bin-release/playerProductInstall.swf
deleted file mode 100644
index bdc3437856..0000000000
Binary files a/flash/ImageScroll/bin-release/playerProductInstall.swf and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/rpc_4.0.0.14159.swz b/flash/ImageScroll/bin-release/rpc_4.0.0.14159.swz
deleted file mode 100644
index 5a87f133b7..0000000000
Binary files a/flash/ImageScroll/bin-release/rpc_4.0.0.14159.swz and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/spark_4.0.0.14159.swz b/flash/ImageScroll/bin-release/spark_4.0.0.14159.swz
deleted file mode 100644
index f5220d7f9c..0000000000
Binary files a/flash/ImageScroll/bin-release/spark_4.0.0.14159.swz and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/sparkskins_4.0.0.14159.swz b/flash/ImageScroll/bin-release/sparkskins_4.0.0.14159.swz
deleted file mode 100644
index 36c905d641..0000000000
Binary files a/flash/ImageScroll/bin-release/sparkskins_4.0.0.14159.swz and /dev/null differ
diff --git a/flash/ImageScroll/bin-release/swfobject.js b/flash/ImageScroll/bin-release/swfobject.js
deleted file mode 100644
index bf35c07c8f..0000000000
--- a/flash/ImageScroll/bin-release/swfobject.js
+++ /dev/null
@@ -1,777 +0,0 @@
-/*! SWFObject v2.2
- is released under the MIT License
-*/
-
-var swfobject = function() {
-
- var UNDEF = "undefined",
- OBJECT = "object",
- SHOCKWAVE_FLASH = "Shockwave Flash",
- SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
- FLASH_MIME_TYPE = "application/x-shockwave-flash",
- EXPRESS_INSTALL_ID = "SWFObjectExprInst",
- ON_READY_STATE_CHANGE = "onreadystatechange",
-
- win = window,
- doc = document,
- nav = navigator,
-
- plugin = false,
- domLoadFnArr = [main],
- regObjArr = [],
- objIdArr = [],
- listenersArr = [],
- storedAltContent,
- storedAltContentId,
- storedCallbackFn,
- storedCallbackObj,
- isDomLoaded = false,
- isExpressInstallActive = false,
- dynamicStylesheet,
- dynamicStylesheetMedia,
- autoHideShow = true,
-
- /* Centralized function for browser feature detection
- - User agent string detection is only used when no good alternative is possible
- - Is executed directly for optimal performance
- */
- ua = function() {
- var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
- u = nav.userAgent.toLowerCase(),
- p = nav.platform.toLowerCase(),
- windows = p ? /win/.test(p) : /win/.test(u),
- mac = p ? /mac/.test(p) : /mac/.test(u),
- webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
- ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
- playerVersion = [0,0,0],
- d = null;
- if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
- d = nav.plugins[SHOCKWAVE_FLASH].description;
- if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
- plugin = true;
- ie = false; // cascaded feature detection for Internet Explorer
- d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
- playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
- playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
- playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
- }
- }
- else if (typeof win.ActiveXObject != UNDEF) {
- try {
- var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
- if (a) { // a will return null when ActiveX is disabled
- d = a.GetVariable("$version");
- if (d) {
- ie = true; // cascaded feature detection for Internet Explorer
- d = d.split(" ")[1].split(",");
- playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
- }
- }
- }
- catch(e) {}
- }
- return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
- }(),
-
- /* Cross-browser onDomLoad
- - Will fire an event as soon as the DOM of a web page is loaded
- - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
- - Regular onload serves as fallback
- */
- onDomLoad = function() {
- if (!ua.w3) { return; }
- if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
- callDomLoadFunctions();
- }
- if (!isDomLoaded) {
- if (typeof doc.addEventListener != UNDEF) {
- doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
- }
- if (ua.ie && ua.win) {
- doc.attachEvent(ON_READY_STATE_CHANGE, function() {
- if (doc.readyState == "complete") {
- doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
- callDomLoadFunctions();
- }
- });
- if (win == top) { // if not inside an iframe
- (function(){
- if (isDomLoaded) { return; }
- try {
- doc.documentElement.doScroll("left");
- }
- catch(e) {
- setTimeout(arguments.callee, 0);
- return;
- }
- callDomLoadFunctions();
- })();
- }
- }
- if (ua.wk) {
- (function(){
- if (isDomLoaded) { return; }
- if (!/loaded|complete/.test(doc.readyState)) {
- setTimeout(arguments.callee, 0);
- return;
- }
- callDomLoadFunctions();
- })();
- }
- addLoadEvent(callDomLoadFunctions);
- }
- }();
-
- function callDomLoadFunctions() {
- if (isDomLoaded) { return; }
- try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
- var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
- t.parentNode.removeChild(t);
- }
- catch (e) { return; }
- isDomLoaded = true;
- var dl = domLoadFnArr.length;
- for (var i = 0; i < dl; i++) {
- domLoadFnArr[i]();
- }
- }
-
- function addDomLoadEvent(fn) {
- if (isDomLoaded) {
- fn();
- }
- else {
- domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
- }
- }
-
- /* Cross-browser onload
- - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- - Will fire an event as soon as a web page including all of its assets are loaded
- */
- function addLoadEvent(fn) {
- if (typeof win.addEventListener != UNDEF) {
- win.addEventListener("load", fn, false);
- }
- else if (typeof doc.addEventListener != UNDEF) {
- doc.addEventListener("load", fn, false);
- }
- else if (typeof win.attachEvent != UNDEF) {
- addListener(win, "onload", fn);
- }
- else if (typeof win.onload == "function") {
- var fnOld = win.onload;
- win.onload = function() {
- fnOld();
- fn();
- };
- }
- else {
- win.onload = fn;
- }
- }
-
- /* Main function
- - Will preferably execute onDomLoad, otherwise onload (as a fallback)
- */
- function main() {
- if (plugin) {
- testPlayerVersion();
- }
- else {
- matchVersions();
- }
- }
-
- /* Detect the Flash Player version for non-Internet Explorer browsers
- - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
- a. Both release and build numbers can be detected
- b. Avoid wrong descriptions by corrupt installers provided by Adobe
- c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
- - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
- */
- function testPlayerVersion() {
- var b = doc.getElementsByTagName("body")[0];
- var o = createElement(OBJECT);
- o.setAttribute("type", FLASH_MIME_TYPE);
- var t = b.appendChild(o);
- if (t) {
- var counter = 0;
- (function(){
- if (typeof t.GetVariable != UNDEF) {
- var d = t.GetVariable("$version");
- if (d) {
- d = d.split(" ")[1].split(",");
- ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
- }
- }
- else if (counter < 10) {
- counter++;
- setTimeout(arguments.callee, 10);
- return;
- }
- b.removeChild(o);
- t = null;
- matchVersions();
- })();
- }
- else {
- matchVersions();
- }
- }
-
- /* Perform Flash Player and SWF version matching; static publishing only
- */
- function matchVersions() {
- var rl = regObjArr.length;
- if (rl > 0) {
- for (var i = 0; i < rl; i++) { // for each registered object element
- var id = regObjArr[i].id;
- var cb = regObjArr[i].callbackFn;
- var cbObj = {success:false, id:id};
- if (ua.pv[0] > 0) {
- var obj = getElementById(id);
- if (obj) {
- if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
- setVisibility(id, true);
- if (cb) {
- cbObj.success = true;
- cbObj.ref = getObjectById(id);
- cb(cbObj);
- }
- }
- else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
- var att = {};
- att.data = regObjArr[i].expressInstall;
- att.width = obj.getAttribute("width") || "0";
- att.height = obj.getAttribute("height") || "0";
- if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
- if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
- // parse HTML object param element's name-value pairs
- var par = {};
- var p = obj.getElementsByTagName("param");
- var pl = p.length;
- for (var j = 0; j < pl; j++) {
- if (p[j].getAttribute("name").toLowerCase() != "movie") {
- par[p[j].getAttribute("name")] = p[j].getAttribute("value");
- }
- }
- showExpressInstall(att, par, id, cb);
- }
- else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
- displayAltContent(obj);
- if (cb) { cb(cbObj); }
- }
- }
- }
- else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
- setVisibility(id, true);
- if (cb) {
- var o = getObjectById(id); // test whether there is an HTML object element or not
- if (o && typeof o.SetVariable != UNDEF) {
- cbObj.success = true;
- cbObj.ref = o;
- }
- cb(cbObj);
- }
- }
- }
- }
- }
-
- function getObjectById(objectIdStr) {
- var r = null;
- var o = getElementById(objectIdStr);
- if (o && o.nodeName == "OBJECT") {
- if (typeof o.SetVariable != UNDEF) {
- r = o;
- }
- else {
- var n = o.getElementsByTagName(OBJECT)[0];
- if (n) {
- r = n;
- }
- }
- }
- return r;
- }
-
- /* Requirements for Adobe Express Install
- - only one instance can be active at a time
- - fp 6.0.65 or higher
- - Win/Mac OS only
- - no Webkit engines older than version 312
- */
- function canExpressInstall() {
- return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
- }
-
- /* Show the Adobe Express Install dialog
- - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
- */
- function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
- isExpressInstallActive = true;
- storedCallbackFn = callbackFn || null;
- storedCallbackObj = {success:false, id:replaceElemIdStr};
- var obj = getElementById(replaceElemIdStr);
- if (obj) {
- if (obj.nodeName == "OBJECT") { // static publishing
- storedAltContent = abstractAltContent(obj);
- storedAltContentId = null;
- }
- else { // dynamic publishing
- storedAltContent = obj;
- storedAltContentId = replaceElemIdStr;
- }
- att.id = EXPRESS_INSTALL_ID;
- if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
- if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
- doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
- var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
- fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
- if (typeof par.flashvars != UNDEF) {
- par.flashvars += "&" + fv;
- }
- else {
- par.flashvars = fv;
- }
- // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
- // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
- if (ua.ie && ua.win && obj.readyState != 4) {
- var newObj = createElement("div");
- replaceElemIdStr += "SWFObjectNew";
- newObj.setAttribute("id", replaceElemIdStr);
- obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- obj.parentNode.removeChild(obj);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- createSWF(att, par, replaceElemIdStr);
- }
- }
-
- /* Functions to abstract and display alternative content
- */
- function displayAltContent(obj) {
- if (ua.ie && ua.win && obj.readyState != 4) {
- // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
- // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
- var el = createElement("div");
- obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
- el.parentNode.replaceChild(abstractAltContent(obj), el);
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- obj.parentNode.removeChild(obj);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- else {
- obj.parentNode.replaceChild(abstractAltContent(obj), obj);
- }
- }
-
- function abstractAltContent(obj) {
- var ac = createElement("div");
- if (ua.win && ua.ie) {
- ac.innerHTML = obj.innerHTML;
- }
- else {
- var nestedObj = obj.getElementsByTagName(OBJECT)[0];
- if (nestedObj) {
- var c = nestedObj.childNodes;
- if (c) {
- var cl = c.length;
- for (var i = 0; i < cl; i++) {
- if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
- ac.appendChild(c[i].cloneNode(true));
- }
- }
- }
- }
- }
- return ac;
- }
-
- /* Cross-browser dynamic SWF creation
- */
- function createSWF(attObj, parObj, id) {
- var r, el = getElementById(id);
- if (ua.wk && ua.wk < 312) { return r; }
- if (el) {
- if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
- attObj.id = id;
- }
- if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
- var att = "";
- for (var i in attObj) {
- if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
- if (i.toLowerCase() == "data") {
- parObj.movie = attObj[i];
- }
- else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
- att += ' class="' + attObj[i] + '"';
- }
- else if (i.toLowerCase() != "classid") {
- att += ' ' + i + '="' + attObj[i] + '"';
- }
- }
- }
- var par = "";
- for (var j in parObj) {
- if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
- par += ' ';
- }
- }
- el.outerHTML = '' + par + ' ';
- objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
- r = getElementById(attObj.id);
- }
- else { // well-behaving browsers
- var o = createElement(OBJECT);
- o.setAttribute("type", FLASH_MIME_TYPE);
- for (var m in attObj) {
- if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
- if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
- o.setAttribute("class", attObj[m]);
- }
- else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
- o.setAttribute(m, attObj[m]);
- }
- }
- }
- for (var n in parObj) {
- if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
- createObjParam(o, n, parObj[n]);
- }
- }
- el.parentNode.replaceChild(o, el);
- r = o;
- }
- }
- return r;
- }
-
- function createObjParam(el, pName, pValue) {
- var p = createElement("param");
- p.setAttribute("name", pName);
- p.setAttribute("value", pValue);
- el.appendChild(p);
- }
-
- /* Cross-browser SWF removal
- - Especially needed to safely and completely remove a SWF in Internet Explorer
- */
- function removeSWF(id) {
- var obj = getElementById(id);
- if (obj && obj.nodeName == "OBJECT") {
- if (ua.ie && ua.win) {
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- removeObjectInIE(id);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- else {
- obj.parentNode.removeChild(obj);
- }
- }
- }
-
- function removeObjectInIE(id) {
- var obj = getElementById(id);
- if (obj) {
- for (var i in obj) {
- if (typeof obj[i] == "function") {
- obj[i] = null;
- }
- }
- obj.parentNode.removeChild(obj);
- }
- }
-
- /* Functions to optimize JavaScript compression
- */
- function getElementById(id) {
- var el = null;
- try {
- el = doc.getElementById(id);
- }
- catch (e) {}
- return el;
- }
-
- function createElement(el) {
- return doc.createElement(el);
- }
-
- /* Updated attachEvent function for Internet Explorer
- - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
- */
- function addListener(target, eventType, fn) {
- target.attachEvent(eventType, fn);
- listenersArr[listenersArr.length] = [target, eventType, fn];
- }
-
- /* Flash Player and SWF content version matching
- */
- function hasPlayerVersion(rv) {
- var pv = ua.pv, v = rv.split(".");
- v[0] = parseInt(v[0], 10);
- v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
- v[2] = parseInt(v[2], 10) || 0;
- return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
- }
-
- /* Cross-browser dynamic CSS creation
- - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
- */
- function createCSS(sel, decl, media, newStyle) {
- if (ua.ie && ua.mac) { return; }
- var h = doc.getElementsByTagName("head")[0];
- if (!h) { return; } // to also support badly authored HTML pages that lack a head element
- var m = (media && typeof media == "string") ? media : "screen";
- if (newStyle) {
- dynamicStylesheet = null;
- dynamicStylesheetMedia = null;
- }
- if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
- // create dynamic stylesheet + get a global reference to it
- var s = createElement("style");
- s.setAttribute("type", "text/css");
- s.setAttribute("media", m);
- dynamicStylesheet = h.appendChild(s);
- if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
- dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
- }
- dynamicStylesheetMedia = m;
- }
- // add style rule
- if (ua.ie && ua.win) {
- if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
- dynamicStylesheet.addRule(sel, decl);
- }
- }
- else {
- if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
- dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
- }
- }
- }
-
- function setVisibility(id, isVisible) {
- if (!autoHideShow) { return; }
- var v = isVisible ? "visible" : "hidden";
- if (isDomLoaded && getElementById(id)) {
- getElementById(id).style.visibility = v;
- }
- else {
- createCSS("#" + id, "visibility:" + v);
- }
- }
-
- /* Filter to avoid XSS attacks
- */
- function urlEncodeIfNecessary(s) {
- var regex = /[\\\"<>\.;]/;
- var hasBadChars = regex.exec(s) != null;
- return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
- }
-
- /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
- */
- var cleanup = function() {
- if (ua.ie && ua.win) {
- window.attachEvent("onunload", function() {
- // remove listeners to avoid memory leaks
- var ll = listenersArr.length;
- for (var i = 0; i < ll; i++) {
- listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
- }
- // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
- var il = objIdArr.length;
- for (var j = 0; j < il; j++) {
- removeSWF(objIdArr[j]);
- }
- // cleanup library's main closures to avoid memory leaks
- for (var k in ua) {
- ua[k] = null;
- }
- ua = null;
- for (var l in swfobject) {
- swfobject[l] = null;
- }
- swfobject = null;
- });
- }
- }();
-
- return {
- /* Public API
- - Reference: http://code.google.com/p/swfobject/wiki/documentation
- */
- registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
- if (ua.w3 && objectIdStr && swfVersionStr) {
- var regObj = {};
- regObj.id = objectIdStr;
- regObj.swfVersion = swfVersionStr;
- regObj.expressInstall = xiSwfUrlStr;
- regObj.callbackFn = callbackFn;
- regObjArr[regObjArr.length] = regObj;
- setVisibility(objectIdStr, false);
- }
- else if (callbackFn) {
- callbackFn({success:false, id:objectIdStr});
- }
- },
-
- getObjectById: function(objectIdStr) {
- if (ua.w3) {
- return getObjectById(objectIdStr);
- }
- },
-
- embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
- var callbackObj = {success:false, id:replaceElemIdStr};
- if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
- setVisibility(replaceElemIdStr, false);
- addDomLoadEvent(function() {
- widthStr += ""; // auto-convert to string
- heightStr += "";
- var att = {};
- if (attObj && typeof attObj === OBJECT) {
- for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
- att[i] = attObj[i];
- }
- }
- att.data = swfUrlStr;
- att.width = widthStr;
- att.height = heightStr;
- var par = {};
- if (parObj && typeof parObj === OBJECT) {
- for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
- par[j] = parObj[j];
- }
- }
- if (flashvarsObj && typeof flashvarsObj === OBJECT) {
- for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
- if (typeof par.flashvars != UNDEF) {
- par.flashvars += "&" + k + "=" + flashvarsObj[k];
- }
- else {
- par.flashvars = k + "=" + flashvarsObj[k];
- }
- }
- }
- if (hasPlayerVersion(swfVersionStr)) { // create SWF
- var obj = createSWF(att, par, replaceElemIdStr);
- if (att.id == replaceElemIdStr) {
- setVisibility(replaceElemIdStr, true);
- }
- callbackObj.success = true;
- callbackObj.ref = obj;
- }
- else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
- att.data = xiSwfUrlStr;
- showExpressInstall(att, par, replaceElemIdStr, callbackFn);
- return;
- }
- else { // show alternative content
- setVisibility(replaceElemIdStr, true);
- }
- if (callbackFn) { callbackFn(callbackObj); }
- });
- }
- else if (callbackFn) { callbackFn(callbackObj); }
- },
-
- switchOffAutoHideShow: function() {
- autoHideShow = false;
- },
-
- ua: ua,
-
- getFlashPlayerVersion: function() {
- return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
- },
-
- hasFlashPlayerVersion: hasPlayerVersion,
-
- createSWF: function(attObj, parObj, replaceElemIdStr) {
- if (ua.w3) {
- return createSWF(attObj, parObj, replaceElemIdStr);
- }
- else {
- return undefined;
- }
- },
-
- showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
- if (ua.w3 && canExpressInstall()) {
- showExpressInstall(att, par, replaceElemIdStr, callbackFn);
- }
- },
-
- removeSWF: function(objElemIdStr) {
- if (ua.w3) {
- removeSWF(objElemIdStr);
- }
- },
-
- createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
- if (ua.w3) {
- createCSS(selStr, declStr, mediaStr, newStyleBoolean);
- }
- },
-
- addDomLoadEvent: addDomLoadEvent,
-
- addLoadEvent: addLoadEvent,
-
- getQueryParamValue: function(param) {
- var q = doc.location.search || doc.location.hash;
- if (q) {
- if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
- if (param == null) {
- return urlEncodeIfNecessary(q);
- }
- var pairs = q.split("&");
- for (var i = 0; i < pairs.length; i++) {
- if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
- return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
- }
- }
- }
- return "";
- },
-
- // For internal usage only
- expressInstallCallback: function() {
- if (isExpressInstallActive) {
- var obj = getElementById(EXPRESS_INSTALL_ID);
- if (obj && storedAltContent) {
- obj.parentNode.replaceChild(storedAltContent, obj);
- if (storedAltContentId) {
- setVisibility(storedAltContentId, true);
- if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
- }
- if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
- }
- isExpressInstallActive = false;
- }
- }
- };
-}();
diff --git a/flash/ImageScroll/bin-release/test.php b/flash/ImageScroll/bin-release/test.php
deleted file mode 100644
index 186ae70706..0000000000
--- a/flash/ImageScroll/bin-release/test.php
+++ /dev/null
@@ -1,42 +0,0 @@
-
-
-
-
-hello
-
-'
-
- >
-
-
-
-
diff --git a/flash/ImageScroll/bin-release/textLayout_1.0.0.595.swz b/flash/ImageScroll/bin-release/textLayout_1.0.0.595.swz
deleted file mode 100644
index 18e69504dd..0000000000
Binary files a/flash/ImageScroll/bin-release/textLayout_1.0.0.595.swz and /dev/null differ
diff --git a/flash/ImageScroll/html-template/history/history.css b/flash/ImageScroll/html-template/history/history.css
deleted file mode 100644
index dbc47c61b9..0000000000
--- a/flash/ImageScroll/html-template/history/history.css
+++ /dev/null
@@ -1,6 +0,0 @@
-/* This CSS stylesheet defines styles used by required elements in a flex application page that supports browser history */
-
-#ie_historyFrame { width: 0px; height: 0px; display:none }
-#firefox_anchorDiv { width: 0px; height: 0px; display:none }
-#safari_formDiv { width: 0px; height: 0px; display:none }
-#safari_rememberDiv { width: 0px; height: 0px; display:none }
diff --git a/flash/ImageScroll/html-template/history/history.js b/flash/ImageScroll/html-template/history/history.js
deleted file mode 100644
index b56be2f338..0000000000
--- a/flash/ImageScroll/html-template/history/history.js
+++ /dev/null
@@ -1,710 +0,0 @@
-BrowserHistoryUtils = {
- addEvent: function(elm, evType, fn, useCapture) {
- useCapture = useCapture || false;
- if (elm.addEventListener) {
- elm.addEventListener(evType, fn, useCapture);
- return true;
- }
- else if (elm.attachEvent) {
- var r = elm.attachEvent('on' + evType, fn);
- return r;
- }
- else {
- elm['on' + evType] = fn;
- }
- }
-}
-
-BrowserHistory = (function() {
- // type of browser
- var browser = {
- ie: false,
- ie8: false,
- firefox: false,
- safari: false,
- opera: false,
- version: -1
- };
-
- // if setDefaultURL has been called, our first clue
- // that the SWF is ready and listening
- //var swfReady = false;
-
- // the URL we'll send to the SWF once it is ready
- //var pendingURL = '';
-
- // Default app state URL to use when no fragment ID present
- var defaultHash = '';
-
- // Last-known app state URL
- var currentHref = document.location.href;
-
- // Initial URL (used only by IE)
- var initialHref = document.location.href;
-
- // Initial URL (used only by IE)
- var initialHash = document.location.hash;
-
- // History frame source URL prefix (used only by IE)
- var historyFrameSourcePrefix = 'history/historyFrame.html?';
-
- // History maintenance (used only by Safari)
- var currentHistoryLength = -1;
-
- var historyHash = [];
-
- var initialState = createState(initialHref, initialHref + '#' + initialHash, initialHash);
-
- var backStack = [];
- var forwardStack = [];
-
- var currentObjectId = null;
-
- //UserAgent detection
- var useragent = navigator.userAgent.toLowerCase();
-
- if (useragent.indexOf("opera") != -1) {
- browser.opera = true;
- } else if (useragent.indexOf("msie") != -1) {
- browser.ie = true;
- browser.version = parseFloat(useragent.substring(useragent.indexOf('msie') + 4));
- if (browser.version == 8)
- {
- browser.ie = false;
- browser.ie8 = true;
- }
- } else if (useragent.indexOf("safari") != -1) {
- browser.safari = true;
- browser.version = parseFloat(useragent.substring(useragent.indexOf('safari') + 7));
- } else if (useragent.indexOf("gecko") != -1) {
- browser.firefox = true;
- }
-
- if (browser.ie == true && browser.version == 7) {
- window["_ie_firstload"] = false;
- }
-
- function hashChangeHandler()
- {
- currentHref = document.location.href;
- var flexAppUrl = getHash();
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- }
-
- // Accessor functions for obtaining specific elements of the page.
- function getHistoryFrame()
- {
- return document.getElementById('ie_historyFrame');
- }
-
- function getAnchorElement()
- {
- return document.getElementById('firefox_anchorDiv');
- }
-
- function getFormElement()
- {
- return document.getElementById('safari_formDiv');
- }
-
- function getRememberElement()
- {
- return document.getElementById("safari_remember_field");
- }
-
- // Get the Flash player object for performing ExternalInterface callbacks.
- // Updated for changes to SWFObject2.
- function getPlayer(id) {
- var i;
-
- if (id && document.getElementById(id)) {
- var r = document.getElementById(id);
- if (typeof r.SetVariable != "undefined") {
- return r;
- }
- else {
- var o = r.getElementsByTagName("object");
- var e = r.getElementsByTagName("embed");
- for (i = 0; i < o.length; i++) {
- if (typeof o[i].browserURLChange != "undefined")
- return o[i];
- }
- for (i = 0; i < e.length; i++) {
- if (typeof e[i].browserURLChange != "undefined")
- return e[i];
- }
- }
- }
- else {
- var o = document.getElementsByTagName("object");
- var e = document.getElementsByTagName("embed");
- for (i = 0; i < e.length; i++) {
- if (typeof e[i].browserURLChange != "undefined")
- {
- return e[i];
- }
- }
- for (i = 0; i < o.length; i++) {
- if (typeof o[i].browserURLChange != "undefined")
- {
- return o[i];
- }
- }
- }
- return undefined;
- }
-
- function getPlayers() {
- var i;
- var players = [];
- if (players.length == 0) {
- var tmp = document.getElementsByTagName('object');
- for (i = 0; i < tmp.length; i++)
- {
- if (typeof tmp[i].browserURLChange != "undefined")
- players.push(tmp[i]);
- }
- }
- if (players.length == 0 || players[0].object == null) {
- var tmp = document.getElementsByTagName('embed');
- for (i = 0; i < tmp.length; i++)
- {
- if (typeof tmp[i].browserURLChange != "undefined")
- players.push(tmp[i]);
- }
- }
- return players;
- }
-
- function getIframeHash() {
- var doc = getHistoryFrame().contentWindow.document;
- var hash = String(doc.location.search);
- if (hash.length == 1 && hash.charAt(0) == "?") {
- hash = "";
- }
- else if (hash.length >= 2 && hash.charAt(0) == "?") {
- hash = hash.substring(1);
- }
- return hash;
- }
-
- /* Get the current location hash excluding the '#' symbol. */
- function getHash() {
- // It would be nice if we could use document.location.hash here,
- // but it's faulty sometimes.
- var idx = document.location.href.indexOf('#');
- return (idx >= 0) ? document.location.href.substr(idx+1) : '';
- }
-
- /* Get the current location hash excluding the '#' symbol. */
- function setHash(hash) {
- // It would be nice if we could use document.location.hash here,
- // but it's faulty sometimes.
- if (hash == '') hash = '#'
- document.location.hash = hash;
- }
-
- function createState(baseUrl, newUrl, flexAppUrl) {
- return { 'baseUrl': baseUrl, 'newUrl': newUrl, 'flexAppUrl': flexAppUrl, 'title': null };
- }
-
- /* Add a history entry to the browser.
- * baseUrl: the portion of the location prior to the '#'
- * newUrl: the entire new URL, including '#' and following fragment
- * flexAppUrl: the portion of the location following the '#' only
- */
- function addHistoryEntry(baseUrl, newUrl, flexAppUrl) {
-
- //delete all the history entries
- forwardStack = [];
-
- if (browser.ie) {
- //Check to see if we are being asked to do a navigate for the first
- //history entry, and if so ignore, because it's coming from the creation
- //of the history iframe
- if (flexAppUrl == defaultHash && document.location.href == initialHref && window['_ie_firstload']) {
- currentHref = initialHref;
- return;
- }
- if ((!flexAppUrl || flexAppUrl == defaultHash) && window['_ie_firstload']) {
- newUrl = baseUrl + '#' + defaultHash;
- flexAppUrl = defaultHash;
- } else {
- // for IE, tell the history frame to go somewhere without a '#'
- // in order to get this entry into the browser history.
- getHistoryFrame().src = historyFrameSourcePrefix + flexAppUrl;
- }
- setHash(flexAppUrl);
- } else {
-
- //ADR
- if (backStack.length == 0 && initialState.flexAppUrl == flexAppUrl) {
- initialState = createState(baseUrl, newUrl, flexAppUrl);
- } else if(backStack.length > 0 && backStack[backStack.length - 1].flexAppUrl == flexAppUrl) {
- backStack[backStack.length - 1] = createState(baseUrl, newUrl, flexAppUrl);
- }
-
- if (browser.safari) {
- // for Safari, submit a form whose action points to the desired URL
- if (browser.version <= 419.3) {
- var file = window.location.pathname.toString();
- file = file.substring(file.lastIndexOf("/")+1);
- getFormElement().innerHTML = '';
- //get the current elements and add them to the form
- var qs = window.location.search.substring(1);
- var qs_arr = qs.split("&");
- for (var i = 0; i < qs_arr.length; i++) {
- var tmp = qs_arr[i].split("=");
- var elem = document.createElement("input");
- elem.type = "hidden";
- elem.name = tmp[0];
- elem.value = tmp[1];
- document.forms.historyForm.appendChild(elem);
- }
- document.forms.historyForm.submit();
- } else {
- top.location.hash = flexAppUrl;
- }
- // We also have to maintain the history by hand for Safari
- historyHash[history.length] = flexAppUrl;
- _storeStates();
- } else {
- // Otherwise, write an anchor into the page and tell the browser to go there
- addAnchor(flexAppUrl);
- setHash(flexAppUrl);
-
- // For IE8 we must restore full focus/activation to our invoking player instance.
- if (browser.ie8)
- getPlayer().focus();
- }
- }
- backStack.push(createState(baseUrl, newUrl, flexAppUrl));
- }
-
- function _storeStates() {
- if (browser.safari) {
- getRememberElement().value = historyHash.join(",");
- }
- }
-
- function handleBackButton() {
- //The "current" page is always at the top of the history stack.
- var current = backStack.pop();
- if (!current) { return; }
- var last = backStack[backStack.length - 1];
- if (!last && backStack.length == 0){
- last = initialState;
- }
- forwardStack.push(current);
- }
-
- function handleForwardButton() {
- //summary: private method. Do not call this directly.
-
- var last = forwardStack.pop();
- if (!last) { return; }
- backStack.push(last);
- }
-
- function handleArbitraryUrl() {
- //delete all the history entries
- forwardStack = [];
- }
-
- /* Called periodically to poll to see if we need to detect navigation that has occurred */
- function checkForUrlChange() {
-
- if (browser.ie) {
- if (currentHref != document.location.href && currentHref + '#' != document.location.href) {
- //This occurs when the user has navigated to a specific URL
- //within the app, and didn't use browser back/forward
- //IE seems to have a bug where it stops updating the URL it
- //shows the end-user at this point, but programatically it
- //appears to be correct. Do a full app reload to get around
- //this issue.
- if (browser.version < 7) {
- currentHref = document.location.href;
- document.location.reload();
- } else {
- if (getHash() != getIframeHash()) {
- // this.iframe.src = this.blankURL + hash;
- var sourceToSet = historyFrameSourcePrefix + getHash();
- getHistoryFrame().src = sourceToSet;
- currentHref = document.location.href;
- }
- }
- }
- }
-
- if (browser.safari) {
- // For Safari, we have to check to see if history.length changed.
- if (currentHistoryLength >= 0 && history.length != currentHistoryLength) {
- //alert("did change: " + history.length + ", " + historyHash.length + "|" + historyHash[history.length] + "|>" + historyHash.join("|"));
- var flexAppUrl = getHash();
- if (browser.version < 528.16 /* Anything earlier than Safari 4.0 */)
- {
- // If it did change and we're running Safari 3.x or earlier,
- // then we have to look the old state up in our hand-maintained
- // array since document.location.hash won't have changed,
- // then call back into BrowserManager.
- currentHistoryLength = history.length;
- flexAppUrl = historyHash[currentHistoryLength];
- }
-
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- _storeStates();
- }
- }
- if (browser.firefox) {
- if (currentHref != document.location.href) {
- var bsl = backStack.length;
-
- var urlActions = {
- back: false,
- forward: false,
- set: false
- }
-
- if ((window.location.hash == initialHash || window.location.href == initialHref) && (bsl == 1)) {
- urlActions.back = true;
- // FIXME: could this ever be a forward button?
- // we can't clear it because we still need to check for forwards. Ugg.
- // clearInterval(this.locationTimer);
- handleBackButton();
- }
-
- // first check to see if we could have gone forward. We always halt on
- // a no-hash item.
- if (forwardStack.length > 0) {
- if (forwardStack[forwardStack.length-1].flexAppUrl == getHash()) {
- urlActions.forward = true;
- handleForwardButton();
- }
- }
-
- // ok, that didn't work, try someplace back in the history stack
- if ((bsl >= 2) && (backStack[bsl - 2])) {
- if (backStack[bsl - 2].flexAppUrl == getHash()) {
- urlActions.back = true;
- handleBackButton();
- }
- }
-
- if (!urlActions.back && !urlActions.forward) {
- var foundInStacks = {
- back: -1,
- forward: -1
- }
-
- for (var i = 0; i < backStack.length; i++) {
- if (backStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
- arbitraryUrl = true;
- foundInStacks.back = i;
- }
- }
- for (var i = 0; i < forwardStack.length; i++) {
- if (forwardStack[i].flexAppUrl == getHash() && i != (bsl - 2)) {
- arbitraryUrl = true;
- foundInStacks.forward = i;
- }
- }
- handleArbitraryUrl();
- }
-
- // Firefox changed; do a callback into BrowserManager to tell it.
- currentHref = document.location.href;
- var flexAppUrl = getHash();
- //ADR: to fix multiple
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- pl[i].browserURLChange(flexAppUrl);
- }
- } else {
- getPlayer().browserURLChange(flexAppUrl);
- }
- }
- }
- //setTimeout(checkForUrlChange, 50);
- }
-
- /* Write an anchor into the page to legitimize it as a URL for Firefox et al. */
- function addAnchor(flexAppUrl)
- {
- if (document.getElementsByName(flexAppUrl).length == 0) {
- getAnchorElement().innerHTML += "" + flexAppUrl + " ";
- }
- }
-
- var _initialize = function () {
- if (browser.ie)
- {
- var scripts = document.getElementsByTagName('script');
- for (var i = 0, s; s = scripts[i]; i++) {
- if (s.src.indexOf("history.js") > -1) {
- var iframe_location = (new String(s.src)).replace("history.js", "historyFrame.html");
- }
- }
- historyFrameSourcePrefix = iframe_location + "?";
- var src = historyFrameSourcePrefix;
-
- var iframe = document.createElement("iframe");
- iframe.id = 'ie_historyFrame';
- iframe.name = 'ie_historyFrame';
- iframe.src = 'javascript:false;';
-
- try {
- document.body.appendChild(iframe);
- } catch(e) {
- setTimeout(function() {
- document.body.appendChild(iframe);
- }, 0);
- }
- }
-
- if (browser.safari)
- {
- var rememberDiv = document.createElement("div");
- rememberDiv.id = 'safari_rememberDiv';
- document.body.appendChild(rememberDiv);
- rememberDiv.innerHTML = ' ';
-
- var formDiv = document.createElement("div");
- formDiv.id = 'safari_formDiv';
- document.body.appendChild(formDiv);
-
- var reloader_content = document.createElement('div');
- reloader_content.id = 'safarireloader';
- var scripts = document.getElementsByTagName('script');
- for (var i = 0, s; s = scripts[i]; i++) {
- if (s.src.indexOf("history.js") > -1) {
- html = (new String(s.src)).replace(".js", ".html");
- }
- }
- reloader_content.innerHTML = '';
- document.body.appendChild(reloader_content);
- reloader_content.style.position = 'absolute';
- reloader_content.style.left = reloader_content.style.top = '-9999px';
- iframe = reloader_content.getElementsByTagName('iframe')[0];
-
- if (document.getElementById("safari_remember_field").value != "" ) {
- historyHash = document.getElementById("safari_remember_field").value.split(",");
- }
-
- }
-
- if (browser.firefox || browser.ie8)
- {
- var anchorDiv = document.createElement("div");
- anchorDiv.id = 'firefox_anchorDiv';
- document.body.appendChild(anchorDiv);
- }
-
- if (browser.ie8)
- document.body.onhashchange = hashChangeHandler;
- //setTimeout(checkForUrlChange, 50);
- }
-
- return {
- historyHash: historyHash,
- backStack: function() { return backStack; },
- forwardStack: function() { return forwardStack },
- getPlayer: getPlayer,
- initialize: function(src) {
- _initialize(src);
- },
- setURL: function(url) {
- document.location.href = url;
- },
- getURL: function() {
- return document.location.href;
- },
- getTitle: function() {
- return document.title;
- },
- setTitle: function(title) {
- try {
- backStack[backStack.length - 1].title = title;
- } catch(e) { }
- //if on safari, set the title to be the empty string.
- if (browser.safari) {
- if (title == "") {
- try {
- var tmp = window.location.href.toString();
- title = tmp.substring((tmp.lastIndexOf("/")+1), tmp.lastIndexOf("#"));
- } catch(e) {
- title = "";
- }
- }
- }
- document.title = title;
- },
- setDefaultURL: function(def)
- {
- defaultHash = def;
- def = getHash();
- //trailing ? is important else an extra frame gets added to the history
- //when navigating back to the first page. Alternatively could check
- //in history frame navigation to compare # and ?.
- if (browser.ie)
- {
- window['_ie_firstload'] = true;
- var sourceToSet = historyFrameSourcePrefix + def;
- var func = function() {
- getHistoryFrame().src = sourceToSet;
- window.location.replace("#" + def);
- setInterval(checkForUrlChange, 50);
- }
- try {
- func();
- } catch(e) {
- window.setTimeout(function() { func(); }, 0);
- }
- }
-
- if (browser.safari)
- {
- currentHistoryLength = history.length;
- if (historyHash.length == 0) {
- historyHash[currentHistoryLength] = def;
- var newloc = "#" + def;
- window.location.replace(newloc);
- } else {
- //alert(historyHash[historyHash.length-1]);
- }
- //setHash(def);
- setInterval(checkForUrlChange, 50);
- }
-
-
- if (browser.firefox || browser.opera)
- {
- var reg = new RegExp("#" + def + "$");
- if (window.location.toString().match(reg)) {
- } else {
- var newloc ="#" + def;
- window.location.replace(newloc);
- }
- setInterval(checkForUrlChange, 50);
- //setHash(def);
- }
-
- },
-
- /* Set the current browser URL; called from inside BrowserManager to propagate
- * the application state out to the container.
- */
- setBrowserURL: function(flexAppUrl, objectId) {
- if (browser.ie && typeof objectId != "undefined") {
- currentObjectId = objectId;
- }
- //fromIframe = fromIframe || false;
- //fromFlex = fromFlex || false;
- //alert("setBrowserURL: " + flexAppUrl);
- //flexAppUrl = (flexAppUrl == "") ? defaultHash : flexAppUrl ;
-
- var pos = document.location.href.indexOf('#');
- var baseUrl = pos != -1 ? document.location.href.substr(0, pos) : document.location.href;
- var newUrl = baseUrl + '#' + flexAppUrl;
-
- if (document.location.href != newUrl && document.location.href + '#' != newUrl) {
- currentHref = newUrl;
- addHistoryEntry(baseUrl, newUrl, flexAppUrl);
- currentHistoryLength = history.length;
- }
- },
-
- browserURLChange: function(flexAppUrl) {
- var objectId = null;
- if (browser.ie && currentObjectId != null) {
- objectId = currentObjectId;
- }
- pendingURL = '';
-
- if (typeof BrowserHistory_multiple != "undefined" && BrowserHistory_multiple == true) {
- var pl = getPlayers();
- for (var i = 0; i < pl.length; i++) {
- try {
- pl[i].browserURLChange(flexAppUrl);
- } catch(e) { }
- }
- } else {
- try {
- getPlayer(objectId).browserURLChange(flexAppUrl);
- } catch(e) { }
- }
-
- currentObjectId = null;
- },
- getUserAgent: function() {
- return navigator.userAgent;
- },
- getPlatform: function() {
- return navigator.platform;
- }
-
- }
-
-})();
-
-// Initialization
-
-// Automated unit testing and other diagnostics
-
-function setURL(url)
-{
- document.location.href = url;
-}
-
-function backButton()
-{
- history.back();
-}
-
-function forwardButton()
-{
- history.forward();
-}
-
-function goForwardOrBackInHistory(step)
-{
- history.go(step);
-}
-
-//BrowserHistoryUtils.addEvent(window, "load", function() { BrowserHistory.initialize(); });
-(function(i) {
- var u =navigator.userAgent;var e=/*@cc_on!@*/false;
- var st = setTimeout;
- if(/webkit/i.test(u)){
- st(function(){
- var dr=document.readyState;
- if(dr=="loaded"||dr=="complete"){i()}
- else{st(arguments.callee,10);}},10);
- } else if((/mozilla/i.test(u)&&!/(compati)/.test(u)) || (/opera/i.test(u))){
- document.addEventListener("DOMContentLoaded",i,false);
- } else if(e){
- (function(){
- var t=document.createElement('doc:rdy');
- try{t.doScroll('left');
- i();t=null;
- }catch(e){st(arguments.callee,0);}})();
- } else{
- window.onload=i;
- }
-})( function() {BrowserHistory.initialize();} );
diff --git a/flash/ImageScroll/html-template/history/historyFrame.html b/flash/ImageScroll/html-template/history/historyFrame.html
deleted file mode 100644
index 07e3806f0e..0000000000
--- a/flash/ImageScroll/html-template/history/historyFrame.html
+++ /dev/null
@@ -1,29 +0,0 @@
-
-
-
-
-
-
-
- Hidden frame for Browser History support.
-
-
diff --git a/flash/ImageScroll/html-template/index.template.html b/flash/ImageScroll/html-template/index.template.html
deleted file mode 100644
index 47b00d1204..0000000000
--- a/flash/ImageScroll/html-template/index.template.html
+++ /dev/null
@@ -1,105 +0,0 @@
-
-
-
-
-
- ${title}
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- To view this page ensure that Adobe Flash Player version
- ${version_major}.${version_minor}.${version_revision} or greater is installed.
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
- Either scripts and active content are not permitted to run or Adobe Flash Player version
- ${version_major}.${version_minor}.${version_revision} or greater is not installed.
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/flash/ImageScroll/html-template/playerProductInstall.swf b/flash/ImageScroll/html-template/playerProductInstall.swf
deleted file mode 100644
index bdc3437856..0000000000
Binary files a/flash/ImageScroll/html-template/playerProductInstall.swf and /dev/null differ
diff --git a/flash/ImageScroll/html-template/swfobject.js b/flash/ImageScroll/html-template/swfobject.js
deleted file mode 100644
index bf35c07c8f..0000000000
--- a/flash/ImageScroll/html-template/swfobject.js
+++ /dev/null
@@ -1,777 +0,0 @@
-/*! SWFObject v2.2
- is released under the MIT License
-*/
-
-var swfobject = function() {
-
- var UNDEF = "undefined",
- OBJECT = "object",
- SHOCKWAVE_FLASH = "Shockwave Flash",
- SHOCKWAVE_FLASH_AX = "ShockwaveFlash.ShockwaveFlash",
- FLASH_MIME_TYPE = "application/x-shockwave-flash",
- EXPRESS_INSTALL_ID = "SWFObjectExprInst",
- ON_READY_STATE_CHANGE = "onreadystatechange",
-
- win = window,
- doc = document,
- nav = navigator,
-
- plugin = false,
- domLoadFnArr = [main],
- regObjArr = [],
- objIdArr = [],
- listenersArr = [],
- storedAltContent,
- storedAltContentId,
- storedCallbackFn,
- storedCallbackObj,
- isDomLoaded = false,
- isExpressInstallActive = false,
- dynamicStylesheet,
- dynamicStylesheetMedia,
- autoHideShow = true,
-
- /* Centralized function for browser feature detection
- - User agent string detection is only used when no good alternative is possible
- - Is executed directly for optimal performance
- */
- ua = function() {
- var w3cdom = typeof doc.getElementById != UNDEF && typeof doc.getElementsByTagName != UNDEF && typeof doc.createElement != UNDEF,
- u = nav.userAgent.toLowerCase(),
- p = nav.platform.toLowerCase(),
- windows = p ? /win/.test(p) : /win/.test(u),
- mac = p ? /mac/.test(p) : /mac/.test(u),
- webkit = /webkit/.test(u) ? parseFloat(u.replace(/^.*webkit\/(\d+(\.\d+)?).*$/, "$1")) : false, // returns either the webkit version or false if not webkit
- ie = !+"\v1", // feature detection based on Andrea Giammarchi's solution: http://webreflection.blogspot.com/2009/01/32-bytes-to-know-if-your-browser-is-ie.html
- playerVersion = [0,0,0],
- d = null;
- if (typeof nav.plugins != UNDEF && typeof nav.plugins[SHOCKWAVE_FLASH] == OBJECT) {
- d = nav.plugins[SHOCKWAVE_FLASH].description;
- if (d && !(typeof nav.mimeTypes != UNDEF && nav.mimeTypes[FLASH_MIME_TYPE] && !nav.mimeTypes[FLASH_MIME_TYPE].enabledPlugin)) { // navigator.mimeTypes["application/x-shockwave-flash"].enabledPlugin indicates whether plug-ins are enabled or disabled in Safari 3+
- plugin = true;
- ie = false; // cascaded feature detection for Internet Explorer
- d = d.replace(/^.*\s+(\S+\s+\S+$)/, "$1");
- playerVersion[0] = parseInt(d.replace(/^(.*)\..*$/, "$1"), 10);
- playerVersion[1] = parseInt(d.replace(/^.*\.(.*)\s.*$/, "$1"), 10);
- playerVersion[2] = /[a-zA-Z]/.test(d) ? parseInt(d.replace(/^.*[a-zA-Z]+(.*)$/, "$1"), 10) : 0;
- }
- }
- else if (typeof win.ActiveXObject != UNDEF) {
- try {
- var a = new ActiveXObject(SHOCKWAVE_FLASH_AX);
- if (a) { // a will return null when ActiveX is disabled
- d = a.GetVariable("$version");
- if (d) {
- ie = true; // cascaded feature detection for Internet Explorer
- d = d.split(" ")[1].split(",");
- playerVersion = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
- }
- }
- }
- catch(e) {}
- }
- return { w3:w3cdom, pv:playerVersion, wk:webkit, ie:ie, win:windows, mac:mac };
- }(),
-
- /* Cross-browser onDomLoad
- - Will fire an event as soon as the DOM of a web page is loaded
- - Internet Explorer workaround based on Diego Perini's solution: http://javascript.nwbox.com/IEContentLoaded/
- - Regular onload serves as fallback
- */
- onDomLoad = function() {
- if (!ua.w3) { return; }
- if ((typeof doc.readyState != UNDEF && doc.readyState == "complete") || (typeof doc.readyState == UNDEF && (doc.getElementsByTagName("body")[0] || doc.body))) { // function is fired after onload, e.g. when script is inserted dynamically
- callDomLoadFunctions();
- }
- if (!isDomLoaded) {
- if (typeof doc.addEventListener != UNDEF) {
- doc.addEventListener("DOMContentLoaded", callDomLoadFunctions, false);
- }
- if (ua.ie && ua.win) {
- doc.attachEvent(ON_READY_STATE_CHANGE, function() {
- if (doc.readyState == "complete") {
- doc.detachEvent(ON_READY_STATE_CHANGE, arguments.callee);
- callDomLoadFunctions();
- }
- });
- if (win == top) { // if not inside an iframe
- (function(){
- if (isDomLoaded) { return; }
- try {
- doc.documentElement.doScroll("left");
- }
- catch(e) {
- setTimeout(arguments.callee, 0);
- return;
- }
- callDomLoadFunctions();
- })();
- }
- }
- if (ua.wk) {
- (function(){
- if (isDomLoaded) { return; }
- if (!/loaded|complete/.test(doc.readyState)) {
- setTimeout(arguments.callee, 0);
- return;
- }
- callDomLoadFunctions();
- })();
- }
- addLoadEvent(callDomLoadFunctions);
- }
- }();
-
- function callDomLoadFunctions() {
- if (isDomLoaded) { return; }
- try { // test if we can really add/remove elements to/from the DOM; we don't want to fire it too early
- var t = doc.getElementsByTagName("body")[0].appendChild(createElement("span"));
- t.parentNode.removeChild(t);
- }
- catch (e) { return; }
- isDomLoaded = true;
- var dl = domLoadFnArr.length;
- for (var i = 0; i < dl; i++) {
- domLoadFnArr[i]();
- }
- }
-
- function addDomLoadEvent(fn) {
- if (isDomLoaded) {
- fn();
- }
- else {
- domLoadFnArr[domLoadFnArr.length] = fn; // Array.push() is only available in IE5.5+
- }
- }
-
- /* Cross-browser onload
- - Based on James Edwards' solution: http://brothercake.com/site/resources/scripts/onload/
- - Will fire an event as soon as a web page including all of its assets are loaded
- */
- function addLoadEvent(fn) {
- if (typeof win.addEventListener != UNDEF) {
- win.addEventListener("load", fn, false);
- }
- else if (typeof doc.addEventListener != UNDEF) {
- doc.addEventListener("load", fn, false);
- }
- else if (typeof win.attachEvent != UNDEF) {
- addListener(win, "onload", fn);
- }
- else if (typeof win.onload == "function") {
- var fnOld = win.onload;
- win.onload = function() {
- fnOld();
- fn();
- };
- }
- else {
- win.onload = fn;
- }
- }
-
- /* Main function
- - Will preferably execute onDomLoad, otherwise onload (as a fallback)
- */
- function main() {
- if (plugin) {
- testPlayerVersion();
- }
- else {
- matchVersions();
- }
- }
-
- /* Detect the Flash Player version for non-Internet Explorer browsers
- - Detecting the plug-in version via the object element is more precise than using the plugins collection item's description:
- a. Both release and build numbers can be detected
- b. Avoid wrong descriptions by corrupt installers provided by Adobe
- c. Avoid wrong descriptions by multiple Flash Player entries in the plugin Array, caused by incorrect browser imports
- - Disadvantage of this method is that it depends on the availability of the DOM, while the plugins collection is immediately available
- */
- function testPlayerVersion() {
- var b = doc.getElementsByTagName("body")[0];
- var o = createElement(OBJECT);
- o.setAttribute("type", FLASH_MIME_TYPE);
- var t = b.appendChild(o);
- if (t) {
- var counter = 0;
- (function(){
- if (typeof t.GetVariable != UNDEF) {
- var d = t.GetVariable("$version");
- if (d) {
- d = d.split(" ")[1].split(",");
- ua.pv = [parseInt(d[0], 10), parseInt(d[1], 10), parseInt(d[2], 10)];
- }
- }
- else if (counter < 10) {
- counter++;
- setTimeout(arguments.callee, 10);
- return;
- }
- b.removeChild(o);
- t = null;
- matchVersions();
- })();
- }
- else {
- matchVersions();
- }
- }
-
- /* Perform Flash Player and SWF version matching; static publishing only
- */
- function matchVersions() {
- var rl = regObjArr.length;
- if (rl > 0) {
- for (var i = 0; i < rl; i++) { // for each registered object element
- var id = regObjArr[i].id;
- var cb = regObjArr[i].callbackFn;
- var cbObj = {success:false, id:id};
- if (ua.pv[0] > 0) {
- var obj = getElementById(id);
- if (obj) {
- if (hasPlayerVersion(regObjArr[i].swfVersion) && !(ua.wk && ua.wk < 312)) { // Flash Player version >= published SWF version: Houston, we have a match!
- setVisibility(id, true);
- if (cb) {
- cbObj.success = true;
- cbObj.ref = getObjectById(id);
- cb(cbObj);
- }
- }
- else if (regObjArr[i].expressInstall && canExpressInstall()) { // show the Adobe Express Install dialog if set by the web page author and if supported
- var att = {};
- att.data = regObjArr[i].expressInstall;
- att.width = obj.getAttribute("width") || "0";
- att.height = obj.getAttribute("height") || "0";
- if (obj.getAttribute("class")) { att.styleclass = obj.getAttribute("class"); }
- if (obj.getAttribute("align")) { att.align = obj.getAttribute("align"); }
- // parse HTML object param element's name-value pairs
- var par = {};
- var p = obj.getElementsByTagName("param");
- var pl = p.length;
- for (var j = 0; j < pl; j++) {
- if (p[j].getAttribute("name").toLowerCase() != "movie") {
- par[p[j].getAttribute("name")] = p[j].getAttribute("value");
- }
- }
- showExpressInstall(att, par, id, cb);
- }
- else { // Flash Player and SWF version mismatch or an older Webkit engine that ignores the HTML object element's nested param elements: display alternative content instead of SWF
- displayAltContent(obj);
- if (cb) { cb(cbObj); }
- }
- }
- }
- else { // if no Flash Player is installed or the fp version cannot be detected we let the HTML object element do its job (either show a SWF or alternative content)
- setVisibility(id, true);
- if (cb) {
- var o = getObjectById(id); // test whether there is an HTML object element or not
- if (o && typeof o.SetVariable != UNDEF) {
- cbObj.success = true;
- cbObj.ref = o;
- }
- cb(cbObj);
- }
- }
- }
- }
- }
-
- function getObjectById(objectIdStr) {
- var r = null;
- var o = getElementById(objectIdStr);
- if (o && o.nodeName == "OBJECT") {
- if (typeof o.SetVariable != UNDEF) {
- r = o;
- }
- else {
- var n = o.getElementsByTagName(OBJECT)[0];
- if (n) {
- r = n;
- }
- }
- }
- return r;
- }
-
- /* Requirements for Adobe Express Install
- - only one instance can be active at a time
- - fp 6.0.65 or higher
- - Win/Mac OS only
- - no Webkit engines older than version 312
- */
- function canExpressInstall() {
- return !isExpressInstallActive && hasPlayerVersion("6.0.65") && (ua.win || ua.mac) && !(ua.wk && ua.wk < 312);
- }
-
- /* Show the Adobe Express Install dialog
- - Reference: http://www.adobe.com/cfusion/knowledgebase/index.cfm?id=6a253b75
- */
- function showExpressInstall(att, par, replaceElemIdStr, callbackFn) {
- isExpressInstallActive = true;
- storedCallbackFn = callbackFn || null;
- storedCallbackObj = {success:false, id:replaceElemIdStr};
- var obj = getElementById(replaceElemIdStr);
- if (obj) {
- if (obj.nodeName == "OBJECT") { // static publishing
- storedAltContent = abstractAltContent(obj);
- storedAltContentId = null;
- }
- else { // dynamic publishing
- storedAltContent = obj;
- storedAltContentId = replaceElemIdStr;
- }
- att.id = EXPRESS_INSTALL_ID;
- if (typeof att.width == UNDEF || (!/%$/.test(att.width) && parseInt(att.width, 10) < 310)) { att.width = "310"; }
- if (typeof att.height == UNDEF || (!/%$/.test(att.height) && parseInt(att.height, 10) < 137)) { att.height = "137"; }
- doc.title = doc.title.slice(0, 47) + " - Flash Player Installation";
- var pt = ua.ie && ua.win ? "ActiveX" : "PlugIn",
- fv = "MMredirectURL=" + encodeURI(window.location).toString().replace(/&/g,"%26") + "&MMplayerType=" + pt + "&MMdoctitle=" + doc.title;
- if (typeof par.flashvars != UNDEF) {
- par.flashvars += "&" + fv;
- }
- else {
- par.flashvars = fv;
- }
- // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
- // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
- if (ua.ie && ua.win && obj.readyState != 4) {
- var newObj = createElement("div");
- replaceElemIdStr += "SWFObjectNew";
- newObj.setAttribute("id", replaceElemIdStr);
- obj.parentNode.insertBefore(newObj, obj); // insert placeholder div that will be replaced by the object element that loads expressinstall.swf
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- obj.parentNode.removeChild(obj);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- createSWF(att, par, replaceElemIdStr);
- }
- }
-
- /* Functions to abstract and display alternative content
- */
- function displayAltContent(obj) {
- if (ua.ie && ua.win && obj.readyState != 4) {
- // IE only: when a SWF is loading (AND: not available in cache) wait for the readyState of the object element to become 4 before removing it,
- // because you cannot properly cancel a loading SWF file without breaking browser load references, also obj.onreadystatechange doesn't work
- var el = createElement("div");
- obj.parentNode.insertBefore(el, obj); // insert placeholder div that will be replaced by the alternative content
- el.parentNode.replaceChild(abstractAltContent(obj), el);
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- obj.parentNode.removeChild(obj);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- else {
- obj.parentNode.replaceChild(abstractAltContent(obj), obj);
- }
- }
-
- function abstractAltContent(obj) {
- var ac = createElement("div");
- if (ua.win && ua.ie) {
- ac.innerHTML = obj.innerHTML;
- }
- else {
- var nestedObj = obj.getElementsByTagName(OBJECT)[0];
- if (nestedObj) {
- var c = nestedObj.childNodes;
- if (c) {
- var cl = c.length;
- for (var i = 0; i < cl; i++) {
- if (!(c[i].nodeType == 1 && c[i].nodeName == "PARAM") && !(c[i].nodeType == 8)) {
- ac.appendChild(c[i].cloneNode(true));
- }
- }
- }
- }
- }
- return ac;
- }
-
- /* Cross-browser dynamic SWF creation
- */
- function createSWF(attObj, parObj, id) {
- var r, el = getElementById(id);
- if (ua.wk && ua.wk < 312) { return r; }
- if (el) {
- if (typeof attObj.id == UNDEF) { // if no 'id' is defined for the object element, it will inherit the 'id' from the alternative content
- attObj.id = id;
- }
- if (ua.ie && ua.win) { // Internet Explorer + the HTML object element + W3C DOM methods do not combine: fall back to outerHTML
- var att = "";
- for (var i in attObj) {
- if (attObj[i] != Object.prototype[i]) { // filter out prototype additions from other potential libraries
- if (i.toLowerCase() == "data") {
- parObj.movie = attObj[i];
- }
- else if (i.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
- att += ' class="' + attObj[i] + '"';
- }
- else if (i.toLowerCase() != "classid") {
- att += ' ' + i + '="' + attObj[i] + '"';
- }
- }
- }
- var par = "";
- for (var j in parObj) {
- if (parObj[j] != Object.prototype[j]) { // filter out prototype additions from other potential libraries
- par += ' ';
- }
- }
- el.outerHTML = '' + par + ' ';
- objIdArr[objIdArr.length] = attObj.id; // stored to fix object 'leaks' on unload (dynamic publishing only)
- r = getElementById(attObj.id);
- }
- else { // well-behaving browsers
- var o = createElement(OBJECT);
- o.setAttribute("type", FLASH_MIME_TYPE);
- for (var m in attObj) {
- if (attObj[m] != Object.prototype[m]) { // filter out prototype additions from other potential libraries
- if (m.toLowerCase() == "styleclass") { // 'class' is an ECMA4 reserved keyword
- o.setAttribute("class", attObj[m]);
- }
- else if (m.toLowerCase() != "classid") { // filter out IE specific attribute
- o.setAttribute(m, attObj[m]);
- }
- }
- }
- for (var n in parObj) {
- if (parObj[n] != Object.prototype[n] && n.toLowerCase() != "movie") { // filter out prototype additions from other potential libraries and IE specific param element
- createObjParam(o, n, parObj[n]);
- }
- }
- el.parentNode.replaceChild(o, el);
- r = o;
- }
- }
- return r;
- }
-
- function createObjParam(el, pName, pValue) {
- var p = createElement("param");
- p.setAttribute("name", pName);
- p.setAttribute("value", pValue);
- el.appendChild(p);
- }
-
- /* Cross-browser SWF removal
- - Especially needed to safely and completely remove a SWF in Internet Explorer
- */
- function removeSWF(id) {
- var obj = getElementById(id);
- if (obj && obj.nodeName == "OBJECT") {
- if (ua.ie && ua.win) {
- obj.style.display = "none";
- (function(){
- if (obj.readyState == 4) {
- removeObjectInIE(id);
- }
- else {
- setTimeout(arguments.callee, 10);
- }
- })();
- }
- else {
- obj.parentNode.removeChild(obj);
- }
- }
- }
-
- function removeObjectInIE(id) {
- var obj = getElementById(id);
- if (obj) {
- for (var i in obj) {
- if (typeof obj[i] == "function") {
- obj[i] = null;
- }
- }
- obj.parentNode.removeChild(obj);
- }
- }
-
- /* Functions to optimize JavaScript compression
- */
- function getElementById(id) {
- var el = null;
- try {
- el = doc.getElementById(id);
- }
- catch (e) {}
- return el;
- }
-
- function createElement(el) {
- return doc.createElement(el);
- }
-
- /* Updated attachEvent function for Internet Explorer
- - Stores attachEvent information in an Array, so on unload the detachEvent functions can be called to avoid memory leaks
- */
- function addListener(target, eventType, fn) {
- target.attachEvent(eventType, fn);
- listenersArr[listenersArr.length] = [target, eventType, fn];
- }
-
- /* Flash Player and SWF content version matching
- */
- function hasPlayerVersion(rv) {
- var pv = ua.pv, v = rv.split(".");
- v[0] = parseInt(v[0], 10);
- v[1] = parseInt(v[1], 10) || 0; // supports short notation, e.g. "9" instead of "9.0.0"
- v[2] = parseInt(v[2], 10) || 0;
- return (pv[0] > v[0] || (pv[0] == v[0] && pv[1] > v[1]) || (pv[0] == v[0] && pv[1] == v[1] && pv[2] >= v[2])) ? true : false;
- }
-
- /* Cross-browser dynamic CSS creation
- - Based on Bobby van der Sluis' solution: http://www.bobbyvandersluis.com/articles/dynamicCSS.php
- */
- function createCSS(sel, decl, media, newStyle) {
- if (ua.ie && ua.mac) { return; }
- var h = doc.getElementsByTagName("head")[0];
- if (!h) { return; } // to also support badly authored HTML pages that lack a head element
- var m = (media && typeof media == "string") ? media : "screen";
- if (newStyle) {
- dynamicStylesheet = null;
- dynamicStylesheetMedia = null;
- }
- if (!dynamicStylesheet || dynamicStylesheetMedia != m) {
- // create dynamic stylesheet + get a global reference to it
- var s = createElement("style");
- s.setAttribute("type", "text/css");
- s.setAttribute("media", m);
- dynamicStylesheet = h.appendChild(s);
- if (ua.ie && ua.win && typeof doc.styleSheets != UNDEF && doc.styleSheets.length > 0) {
- dynamicStylesheet = doc.styleSheets[doc.styleSheets.length - 1];
- }
- dynamicStylesheetMedia = m;
- }
- // add style rule
- if (ua.ie && ua.win) {
- if (dynamicStylesheet && typeof dynamicStylesheet.addRule == OBJECT) {
- dynamicStylesheet.addRule(sel, decl);
- }
- }
- else {
- if (dynamicStylesheet && typeof doc.createTextNode != UNDEF) {
- dynamicStylesheet.appendChild(doc.createTextNode(sel + " {" + decl + "}"));
- }
- }
- }
-
- function setVisibility(id, isVisible) {
- if (!autoHideShow) { return; }
- var v = isVisible ? "visible" : "hidden";
- if (isDomLoaded && getElementById(id)) {
- getElementById(id).style.visibility = v;
- }
- else {
- createCSS("#" + id, "visibility:" + v);
- }
- }
-
- /* Filter to avoid XSS attacks
- */
- function urlEncodeIfNecessary(s) {
- var regex = /[\\\"<>\.;]/;
- var hasBadChars = regex.exec(s) != null;
- return hasBadChars && typeof encodeURIComponent != UNDEF ? encodeURIComponent(s) : s;
- }
-
- /* Release memory to avoid memory leaks caused by closures, fix hanging audio/video threads and force open sockets/NetConnections to disconnect (Internet Explorer only)
- */
- var cleanup = function() {
- if (ua.ie && ua.win) {
- window.attachEvent("onunload", function() {
- // remove listeners to avoid memory leaks
- var ll = listenersArr.length;
- for (var i = 0; i < ll; i++) {
- listenersArr[i][0].detachEvent(listenersArr[i][1], listenersArr[i][2]);
- }
- // cleanup dynamically embedded objects to fix audio/video threads and force open sockets and NetConnections to disconnect
- var il = objIdArr.length;
- for (var j = 0; j < il; j++) {
- removeSWF(objIdArr[j]);
- }
- // cleanup library's main closures to avoid memory leaks
- for (var k in ua) {
- ua[k] = null;
- }
- ua = null;
- for (var l in swfobject) {
- swfobject[l] = null;
- }
- swfobject = null;
- });
- }
- }();
-
- return {
- /* Public API
- - Reference: http://code.google.com/p/swfobject/wiki/documentation
- */
- registerObject: function(objectIdStr, swfVersionStr, xiSwfUrlStr, callbackFn) {
- if (ua.w3 && objectIdStr && swfVersionStr) {
- var regObj = {};
- regObj.id = objectIdStr;
- regObj.swfVersion = swfVersionStr;
- regObj.expressInstall = xiSwfUrlStr;
- regObj.callbackFn = callbackFn;
- regObjArr[regObjArr.length] = regObj;
- setVisibility(objectIdStr, false);
- }
- else if (callbackFn) {
- callbackFn({success:false, id:objectIdStr});
- }
- },
-
- getObjectById: function(objectIdStr) {
- if (ua.w3) {
- return getObjectById(objectIdStr);
- }
- },
-
- embedSWF: function(swfUrlStr, replaceElemIdStr, widthStr, heightStr, swfVersionStr, xiSwfUrlStr, flashvarsObj, parObj, attObj, callbackFn) {
- var callbackObj = {success:false, id:replaceElemIdStr};
- if (ua.w3 && !(ua.wk && ua.wk < 312) && swfUrlStr && replaceElemIdStr && widthStr && heightStr && swfVersionStr) {
- setVisibility(replaceElemIdStr, false);
- addDomLoadEvent(function() {
- widthStr += ""; // auto-convert to string
- heightStr += "";
- var att = {};
- if (attObj && typeof attObj === OBJECT) {
- for (var i in attObj) { // copy object to avoid the use of references, because web authors often reuse attObj for multiple SWFs
- att[i] = attObj[i];
- }
- }
- att.data = swfUrlStr;
- att.width = widthStr;
- att.height = heightStr;
- var par = {};
- if (parObj && typeof parObj === OBJECT) {
- for (var j in parObj) { // copy object to avoid the use of references, because web authors often reuse parObj for multiple SWFs
- par[j] = parObj[j];
- }
- }
- if (flashvarsObj && typeof flashvarsObj === OBJECT) {
- for (var k in flashvarsObj) { // copy object to avoid the use of references, because web authors often reuse flashvarsObj for multiple SWFs
- if (typeof par.flashvars != UNDEF) {
- par.flashvars += "&" + k + "=" + flashvarsObj[k];
- }
- else {
- par.flashvars = k + "=" + flashvarsObj[k];
- }
- }
- }
- if (hasPlayerVersion(swfVersionStr)) { // create SWF
- var obj = createSWF(att, par, replaceElemIdStr);
- if (att.id == replaceElemIdStr) {
- setVisibility(replaceElemIdStr, true);
- }
- callbackObj.success = true;
- callbackObj.ref = obj;
- }
- else if (xiSwfUrlStr && canExpressInstall()) { // show Adobe Express Install
- att.data = xiSwfUrlStr;
- showExpressInstall(att, par, replaceElemIdStr, callbackFn);
- return;
- }
- else { // show alternative content
- setVisibility(replaceElemIdStr, true);
- }
- if (callbackFn) { callbackFn(callbackObj); }
- });
- }
- else if (callbackFn) { callbackFn(callbackObj); }
- },
-
- switchOffAutoHideShow: function() {
- autoHideShow = false;
- },
-
- ua: ua,
-
- getFlashPlayerVersion: function() {
- return { major:ua.pv[0], minor:ua.pv[1], release:ua.pv[2] };
- },
-
- hasFlashPlayerVersion: hasPlayerVersion,
-
- createSWF: function(attObj, parObj, replaceElemIdStr) {
- if (ua.w3) {
- return createSWF(attObj, parObj, replaceElemIdStr);
- }
- else {
- return undefined;
- }
- },
-
- showExpressInstall: function(att, par, replaceElemIdStr, callbackFn) {
- if (ua.w3 && canExpressInstall()) {
- showExpressInstall(att, par, replaceElemIdStr, callbackFn);
- }
- },
-
- removeSWF: function(objElemIdStr) {
- if (ua.w3) {
- removeSWF(objElemIdStr);
- }
- },
-
- createCSS: function(selStr, declStr, mediaStr, newStyleBoolean) {
- if (ua.w3) {
- createCSS(selStr, declStr, mediaStr, newStyleBoolean);
- }
- },
-
- addDomLoadEvent: addDomLoadEvent,
-
- addLoadEvent: addLoadEvent,
-
- getQueryParamValue: function(param) {
- var q = doc.location.search || doc.location.hash;
- if (q) {
- if (/\?/.test(q)) { q = q.split("?")[1]; } // strip question mark
- if (param == null) {
- return urlEncodeIfNecessary(q);
- }
- var pairs = q.split("&");
- for (var i = 0; i < pairs.length; i++) {
- if (pairs[i].substring(0, pairs[i].indexOf("=")) == param) {
- return urlEncodeIfNecessary(pairs[i].substring((pairs[i].indexOf("=") + 1)));
- }
- }
- }
- return "";
- },
-
- // For internal usage only
- expressInstallCallback: function() {
- if (isExpressInstallActive) {
- var obj = getElementById(EXPRESS_INSTALL_ID);
- if (obj && storedAltContent) {
- obj.parentNode.replaceChild(storedAltContent, obj);
- if (storedAltContentId) {
- setVisibility(storedAltContentId, true);
- if (ua.ie && ua.win) { storedAltContent.style.display = "block"; }
- }
- if (storedCallbackFn) { storedCallbackFn(storedCallbackObj); }
- }
- isExpressInstallActive = false;
- }
- }
- };
-}();
diff --git a/flash/ImageScroll/src/DisplayItem.as b/flash/ImageScroll/src/DisplayItem.as
deleted file mode 100644
index 959f70282e..0000000000
--- a/flash/ImageScroll/src/DisplayItem.as
+++ /dev/null
@@ -1 +0,0 @@
-package {
import flash.display.Sprite;
import flash.events.Event;
public class DisplayItem extends Sprite {
protected static const FADE_RATE :Number = 0.05;
protected static const ALPHA_ON :Number = 1;
protected static const ALPHA_OFF :Number = 0.8;
public function DisplayItem(){
}
protected function fadeIn(e:Event):void {
if(alpha>=ALPHA_ON){
alpha = ALPHA_ON;
removeEventListener(Event.ENTER_FRAME, fadeIn);
return
}
alpha += FADE_RATE;
}
protected function fadeOut(e:Event):void {
if(alpha<=ALPHA_OFF){
alpha = ALPHA_OFF;
removeEventListener(Event.ENTER_FRAME, fadeOut);
return;
}
alpha -= FADE_RATE;
}
}
}
\ No newline at end of file
diff --git a/flash/ImageScroll/src/ImageScroll.mxml b/flash/ImageScroll/src/ImageScroll.mxml
deleted file mode 100644
index 3cec249fbb..0000000000
--- a/flash/ImageScroll/src/ImageScroll.mxml
+++ /dev/null
@@ -1,69 +0,0 @@
-
-
-
-
-
-
-
-
-
-
-
-
-
-
-
diff --git a/flash/ImageScroll/src/NavItem.as b/flash/ImageScroll/src/NavItem.as
deleted file mode 100644
index 723c6e7331..0000000000
--- a/flash/ImageScroll/src/NavItem.as
+++ /dev/null
@@ -1 +0,0 @@
-package {
import flash.display.Loader;
import flash.display.Shape;
import flash.display.Sprite;
import flash.net.URLRequest;
public class NavItem extends Sprite
{
private var _ref :Number;
// private var _source:String;
private var _width:int
private var _height:int
private var loader :Loader;
/*
public function imgLoaded(e:Event):void
{
this._width = e.currentTarget.width;
this._height = e.currentTarget.height;
//the background holds fills in the shape to the proper size
//while the image is loaded
var background:Shape = new Shape();
background.graphics.drawRect(0, 0, this._width, this._height);
addChild(background);
addChild(e.currentTarget.content);
}
*/
/**
* Constructor for a NavItem
* @param ref
* @param source
* @param width
*
*/
public function NavItem(ref:Number, source:String, width:Number, height:Number)
{
super();
_ref = ref;
// _source = source;
_width = width;
_height = height;
//the background holds fills in the shape to the proper size
//while the image is loaded
var background:Shape = new Shape();
background.graphics.drawRect(0, 0, _width, _height);
addChild(background);
//load the image
loader = new Loader();
// loader.contentLoaderInfo.addEventListener(Event.COMPLETE, imgLoaded);
var request:URLRequest = new URLRequest(source);
loader.load(request);
addChild(loader);
}
/**
* The reference number of the NavItem
* @return
*
*/
public function get ref():Number { return _ref; }
}
}
\ No newline at end of file
diff --git a/flash/ImageScroll/src/Navigator.as b/flash/ImageScroll/src/Navigator.as
deleted file mode 100644
index ef5698a319..0000000000
--- a/flash/ImageScroll/src/Navigator.as
+++ /dev/null
@@ -1 +0,0 @@
-package {
import flash.display.Sprite;
import flash.events.Event;
/**
* Based on the work of Peter Wright:
* http://www.f-90.co.uk/blog/
*
* This is a slide panel thumbnail navigator for displaying
* a continuous scrolling list of thumbnail images for use
* in slideshows and other navigation.
*
* @author Joel Hooks
*
*/
public class Navigator extends Sprite {
/**
* Array of NavItem objects to display in the scroll list
*/
private var _navArray :Array;
/**
* Currently selected NavItem
*/
private var _centerX :Number = 200;
/**
* The sum of all the NavItem widths
*/
private var totalWidth :Number = 0;
/**
* The current width of the container.
*
* TODO: containerHeight for vertical layouts.
* Update on app resize.
*/
private var _containerWidth:Number = 0;
/**
* The width of an individual item.
*
* TODO: This should be changed to accept variables
* as well as adding a height for vertical layouts.
*/
private var _speed:int;
private var _space:int;
/**
* Constructor for Navigator
*
* @param images XML list of images to load
* @param damping Controls the transition speed as list scrolls
* @param thumbSize the size of the thumbnail object
* @param centerX The mid-point.
* @param containerWidth The width of the container holding the navigator.
* @param slideShow is this a slideshow?
* @param slideDelatSeconds how many seconds to hold each fram in a slideshow.
*
*/
public function Navigator(xml:XML, damping:Number, centerX:Number, containerWidth:Number, zoom:Number, speed:int, spaceBetweenImages:int, media:String)
{
_centerX = centerX;
_navArray = [];
_containerWidth = containerWidth;
_speed = speed;
_space = spaceBetweenImages;
var count:int = 0;
var navItem:NavItem;
var mediaNS:Namespace = new Namespace('http://search.yahoo.com/mrss/');
var nodeName:QName = new QName(mediaNS, media);
for each( var item:XML in xml.channel.item )
{
var z:XMLList = item.child(nodeName)[0].(@isDefault=="true");;
navItem = new NavItem(count, z.@url, z.@width, z.@height);
addChild(navItem);
navItem.width *= zoom;
navItem.height *= zoom;
_navArray.push(navItem);
totalWidth += navItem.width + _space;
count++;
}
_navArray[0].x = 0;
for( var i:int=0; ienvironment = $environment;
- $this->setupApplicationPaths($this);
-
- $this['charset'] = 'UTF-8';
- mb_internal_encoding($this['charset']);
+ $this->setupCharset();
+ $this->setupApplicationPaths();
+ $this->setupConstants();
$this['debug'] = $this->share(function (Application $app) {
return Application::ENV_PROD !== $app->getEnvironment();
});
- if ($this['debug'] === true) {
+ if ($this['debug']) {
ini_set('log_errors', 'on');
ini_set('error_log', $this['root.path'].'/logs/php_error.log');
}
+ $this->register(new ConfigurationServiceProvider());
+ $this->register(new MonologServiceProvider());
+ $this->setupMonolog();
+ $this->register(new FilesystemServiceProvider());
+ $this->register(new CacheServiceProvider());
+ $this->register(new CacheConnectionServiceProvider());
+ $this->register(new PhraseanetServiceProvider());
+ $this->register(new ConfigurationTesterServiceProvider());
+ $this->register(new ORMServiceProvider());
+ $this->register(new DoctrineServiceProvider(), $this['dbs.service.conf']);
+ $this->setupDBAL();
+ $this->register(new DoctrineOrmServiceProvider(), $this['orm.service.conf']);
+ $this->setupOrms();
$this->register(new BasketMiddlewareProvider());
$this->register(new TokenMiddlewareProvider());
$this->register(new ApiApplicationMiddlewareProvider());
-
$this->register(new ACLServiceProvider());
$this->register(new APIServiceProvider());
$this->register(new AuthenticationManagerServiceProvider());
$this->register(new BrowserServiceProvider());
- $this->register(new FilesystemServiceProvider());
- $this->register(new ConfigurationServiceProvider());
- $this->register(new ConfigurationTesterServiceProvider);
$this->register(new ConvertersServiceProvider());
$this->register(new CSVServiceProvider());
$this->register(new RegistrationServiceProvider());
- $this->register(new CacheServiceProvider());
- $this->register(new CacheConnectionServiceProvider());
$this->register(new ImagineServiceProvider());
+ $this->setUpImagine();
$this->register(new JMSSerializerServiceProvider());
$this->register(new FFMpegServiceProvider());
$this->register(new FeedServiceProvider());
$this->register(new FtpServiceProvider());
$this->register(new GeonamesServiceProvider());
$this->register(new StatusServiceProvider());
- $this['geonames.server-uri'] = $this->share(function (Application $app) {
- return $app['conf']->get(['registry', 'webservices', 'geonames-server'], 'http://geonames.alchemyasp.com/');
- });
-
+ $this->setupGeonames();
$this->register(new MediaAlchemystServiceProvider());
- $this['media-alchemyst.configuration'] = $this->share(function (Application $app) {
- $configuration = [];
-
- foreach ([
- 'swftools.pdf2swf.binaries' => 'pdf2swf_binary',
- 'swftools.swfrender.binaries' => 'swf_render_binary',
- 'swftools.swfextract.binaries' => 'swf_extract_binary',
- 'unoconv.binaries' => 'unoconv_binary',
- 'mp4box.binaries' => 'mp4box_binary',
- 'gs.binaries' => 'ghostscript_binary',
- 'ffmpeg.ffmpeg.binaries' => 'ffmpeg_binary',
- 'ffmpeg.ffprobe.binaries' => 'ffprobe_binary',
- 'ffmpeg.ffmpeg.timeout' => 'ffmpeg_timeout',
- 'ffmpeg.ffprobe.timeout' => 'ffprobe_timeout',
- 'gs.timeout' => 'gs_timeout',
- 'mp4box.timeout' => 'mp4box_timeout',
- 'swftools.timeout' => 'swftools_timeout',
- 'unoconv.timeout' => 'unoconv_timeout',
- ] as $parameter => $key) {
- if ($this['conf']->has(['main', 'binaries', $key])) {
- $configuration[$parameter] = $this['conf']->get(['main', 'binaries', $key]);
- }
- }
-
- $configuration['ffmpeg.threads'] = $app['conf']->get(['registry', 'executables', 'ffmpeg-threads']) ?: null;
- $configuration['imagine.driver'] = $app['conf']->get(['registry', 'executables', 'imagine-driver']) ?: null;
-
- return $configuration;
- });
- $this['media-alchemyst.logger'] = $this->share(function (Application $app) {
- return $app['monolog'];
- });
-
+ $this->setupMediaAlchemyst();
$this->register(new MediaVorusServiceProvider());
- $this->register(new MonologServiceProvider());
- $this['monolog.name'] = 'Phraseanet logger';
- $this['monolog.handler'] = $this->share(function () {
- return new NullHandler();
- });
- $this['monolog'] = $this->share($this->extend('monolog', function (Logger $monolog) {
- $monolog->pushProcessor(new IntrospectionProcessor());
-
- return $monolog;
- }));
$this->register(new MP4BoxServiceProvider());
$this->register(new NotificationDelivererServiceProvider());
- $this->register(new ORMServiceProvider());
$this->register(new RepositoriesServiceProvider());
$this->register(new ManipulatorServiceProvider());
$this->register(new InstallerServiceProvider());
- $this->register(new PhraseanetServiceProvider());
$this->register(new PhraseaVersionServiceProvider());
$this->register(new PHPExiftoolServiceProvider());
$this->register(new RandomGeneratorServiceProvider());
$this->register(new ReCaptchaServiceProvider());
$this->register(new SubdefServiceProvider());
$this->register(new ZippyServiceProvider());
-
- $this['recaptcha.public-key'] = $this->share(function (Application $app) {
- if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
- return $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']);
- }
- });
- $this['recaptcha.private-key'] = $this->share(function (Application $app) {
- if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
- return $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']);
- }
- });
+ $this->setupRecaptacha();
if ($this['configuration.store']->isSetup()) {
$this->register(new SearchEngineServiceProvider());
@@ -322,21 +274,11 @@ class Application extends SilexApplication
'session.test' => $this->getEnvironment() === static::ENV_TEST,
'session.storage.options' => ['cookie_lifetime' => 0]
]);
-
- $this['session.storage.test'] = $this->share(function ($app) {
- return new MockArraySessionStorage();
- });
-
- $this['session.storage.handler'] = $this->share(function ($app) {
- if (!$this['phraseanet.configuration-tester']->isInstalled()) {
- return new NullSessionHandler();
- }
- return $this['session.storage.handler.factory']->create($app['conf']);
- });
-
+ $this->setupSession();
$this->register(new SerializerServiceProvider());
$this->register(new ServiceControllerServiceProvider());
$this->register(new SwiftmailerServiceProvider());
+ $this->setupSwiftMailer();
$this->register(new TasksServiceProvider());
$this->register(new TemporaryFilesystemServiceProvider());
$this->register(new TokensServiceProvider());
@@ -345,179 +287,39 @@ class Application extends SilexApplication
'cache' => $this->share(function($app) {return $app['cache.path'].'/twig';}),
],
]);
-
+ $this->setupTwig();
$this->register(new TranslationServiceProvider(), [
'locale_fallbacks' => ['fr'],
'translator.cache-options' => [
'debug' => $this['debug'],
- 'cache_dir' => $this->share(function($app) {return $app['cache.path'].'/translations';}),
+ 'cache_dir' => $this->share(function($app) {
+ return $app['cache.path'].'/translations';
+ }),
],
]);
-
- $this['translator'] = $this->share($this->extend('translator', function (CachedTranslator $translator, $app) {
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.fr.xlf', 'fr', 'messages');
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.fr.xlf', 'fr', 'validators');
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.en.xlf', 'en', 'messages');
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.en.xlf', 'en', 'validators');
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.de.xlf', 'de', 'messages');
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.de.xlf', 'de', 'validators');
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.nl.xlf', 'nl', 'messages');
- $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.nl.xlf', 'nl', 'validators');
-
- return $translator;
- }));
-
+ $this->setupTranslation();
$this->register(new FormServiceProvider());
-
- $this['form.type.extensions'] = $this->share($this->extend('form.type.extensions', function ($extensions) {
- $extensions[] = new HelpTypeExtension();
-
- return $extensions;
- }));
-
- $this->setupTwig();
+ $this->setupForm();
$this->register(new UnoconvServiceProvider());
$this->register(new UrlGeneratorServiceProvider());
$this->setupUrlGenerator();
$this->register(new UnicodeServiceProvider());
$this->register(new ValidatorServiceProvider());
$this->register(new XPDFServiceProvider());
+ $this->setupXpdf();
$this->register(new FileServeServiceProvider());
$this->register(new ManipulatorServiceProvider());
$this->register(new PluginServiceProvider());
$this->register(new PhraseaEventServiceProvider());
$this->register(new ContentNegotiationServiceProvider());
-
+ $this->register(new LocaleServiceProvider());
+ $this->setupEventDispatcher();
$this['phraseanet.exception_handler'] = $this->share(function ($app) {
$handler = PhraseaExceptionHandler::register($app['debug']);
$handler->setTranslator($app['translator']);
return $handler;
});
-
- $this['swiftmailer.transport'] = $this->share(function ($app) {
- if ($app['conf']->get(['registry', 'email', 'smtp-enabled'])) {
- $transport = new \Swift_Transport_EsmtpTransport(
- $app['swiftmailer.transport.buffer'],
- [$app['swiftmailer.transport.authhandler']],
- $app['swiftmailer.transport.eventdispatcher']
- );
-
- $encryption = null;
-
- if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls'])) {
- $encryption = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);
- }
-
- $options = $app['swiftmailer.options'] = array_replace([
- 'host' => $app['conf']->get(['registry', 'email', 'smtp-host']),
- 'port' => $app['conf']->get(['registry', 'email', 'smtp-port']),
- 'username' => $app['conf']->get(['registry', 'email', 'smtp-user']),
- 'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),
- 'encryption' => $encryption,
- 'auth_mode' => null,
- ], $app['swiftmailer.options']);
-
- $transport->setHost($options['host']);
- $transport->setPort($options['port']);
- // tls or ssl
- $transport->setEncryption($options['encryption']);
-
- if ($app['conf']->get(['registry', 'email', 'smtp-auth-enabled'])) {
- $transport->setUsername($options['username']);
- $transport->setPassword($options['password']);
- $transport->setAuthMode($options['auth_mode']);
- }
- } else {
- $transport = new \Swift_Transport_MailTransport(
- new \Swift_Transport_SimpleMailInvoker(),
- $app['swiftmailer.transport.eventdispatcher']
- );
- }
-
- return $transport;
- });
-
- $this['imagine.factory'] = $this->share(function (Application $app) {
- if ($app['conf']->get(['registry', 'executables', 'imagine-driver']) != '') {
- return $app['conf']->get(['registry', 'executables', 'imagine-driver']);
- }
- if (class_exists('\Gmagick')) {
- return 'gmagick';
- }
- if (class_exists('\Imagick')) {
- return 'imagick';
- }
- if (extension_loaded('gd')) {
- return 'gd';
- }
-
- throw new \RuntimeException('No Imagine driver available');
- });
-
- $app = $this;
- $this['phraseanet.logger'] = $this->protect(function ($databox) use ($app) {
- try {
- return \Session_Logger::load($app, $databox);
- } catch (\Exception_Session_LoggerNotFound $e) {
- return \Session_Logger::create($app, $databox, $app['browser']);
- }
- });
-
- $this['date-formatter'] = $this->share(function (Application $app) {
- return new \phraseadate($app);
- });
-
- $this['xpdf.pdftotext'] = $this->share(
- $this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) {
- if ($app['conf']->get(['registry', 'executables', 'pdf-max-pages'])) {
- $pdftotext->setPageQuantity($app['conf']->get(['registry', 'executables', 'pdf-max-pages']));
- }
-
- return $pdftotext;
- })
- );
-
- $this['dispatcher'] = $this->share(
- $this->extend('dispatcher', function ($dispatcher, Application $app) {
- $dispatcher->addListener(KernelEvents::RESPONSE, [$app, 'addUTF8Charset'], -128);
- $dispatcher->addSubscriber($app['phraseanet.logout-subscriber']);
- $dispatcher->addSubscriber($app['phraseanet.locale-subscriber']);
- $dispatcher->addSubscriber($app['phraseanet.content-negotiation-subscriber']);
- $dispatcher->addSubscriber($app['phraseanet.maintenance-subscriber']);
- $dispatcher->addSubscriber($app['phraseanet.cookie-disabler-subscriber']);
- $dispatcher->addSubscriber($app['phraseanet.session-manager-subscriber']);
- $dispatcher->addSubscriber(new PhraseaInstallSubscriber($app));
- $dispatcher->addSubscriber(new FeedEntrySubscriber($app));
- $dispatcher->addSubscriber(new RegistrationSubscriber($app));
- $dispatcher->addSubscriber(new BridgeSubscriber($app));
- $dispatcher->addSubscriber(new ExportSubscriber($app));
- $dispatcher->addSubscriber(new OrderSubscriber($app));
- $dispatcher->addSubscriber(new BasketSubscriber($app));
- $dispatcher->addSubscriber(new LazaretSubscriber($app));
- $dispatcher->addSubscriber(new ValidationSubscriber($app));
-
- return $dispatcher;
- })
- );
-
- $this['log.channels'] = ['monolog', 'task-manager.logger'];
-
- $this->register(new LocaleServiceProvider());
-
- $this->mount('/include/minify/', new Minifier());
- $this->mount('/permalink/', new Permalink());
- $this->mount('/lightbox/', new Lightbox());
-
- $app['plugins.directory'] = $app->share(function () {
- $dir = __DIR__ . '/../../../plugins';
-
- if (is_dir($dir)) {
- return realpath($dir);
- }
-
- return $dir;
- });
}
/**
@@ -526,7 +328,7 @@ class Application extends SilexApplication
public function loadPlugins()
{
call_user_func(function ($app) {
- require $app['plugins.directory'] . '/services.php';
+ require $app['plugin.path'] . '/services.php';
}, $this);
}
@@ -575,40 +377,13 @@ class Application extends SilexApplication
return $this->redirect($this->url($route, $parameters));
}
- public function addUTF8Charset(FilterResponseEvent $event)
- {
- if (HttpKernelInterface::MASTER_REQUEST !== $event->getRequestType()) {
- return;
- }
-
- $event->getResponse()->setCharset('UTF-8');
- }
-
- private function setupUrlGenerator()
- {
- $this['url_generator'] = $this->share($this->extend('url_generator', function ($urlGenerator, $app) {
- if ($app['configuration.store']->isSetup()) {
- $data = parse_url($app['conf']->get('servername'));
-
- if (isset($data['scheme'])) {
- $urlGenerator->getContext()->setScheme($data['scheme']);
- }
- if (isset($data['host'])) {
- $urlGenerator->getContext()->setHost($data['host']);
- }
- }
-
- return $urlGenerator;
- }));
- }
-
public function setupTwig()
{
$this['twig'] = $this->share(
$this->extend('twig', function ($twig, $app) {
$twig->setCache($app['cache.path'].'/twig');
- $paths = require $app['plugins.directory'] . '/twig-paths.php';
+ $paths = require $app['plugin.path'] . '/twig-paths.php';
if ($app['browser']->isTablet() || $app['browser']->isMobile()) {
$paths[] = $app['root.path'] . '/config/templates/mobile';
@@ -832,6 +607,9 @@ class Application extends SilexApplication
return [];
}
+ /**
+ * Mount all controllers
+ */
public function bindRoutes()
{
$this->mount('/', new Root());
@@ -898,6 +676,11 @@ class Application extends SilexApplication
$this->mount('/thesaurus', new Thesaurus());
$this->mount('/xmlhttp', new ThesaurusXMLHttp());
+
+ $this->mount('/include/minify/', new Minifier());
+ $this->mount('/permalink/', new Permalink());
+
+ $this->mount('/lightbox/', new Lightbox());
}
/**
@@ -920,38 +703,44 @@ class Application extends SilexApplication
return static::$flashTypes;
}
- private function setupApplicationPaths(Application $app)
+ private function setupApplicationPaths()
{
// app root path
$this['root.path'] = realpath(__DIR__ . '/../../..');
// temporary resources default path such as download zip, quarantined documents etc ..
$this['tmp.path'] = $this['root.path'].'/tmp';
+ // plugin path
+ $this['plugin.path'] = $dir = $this['root.path'].'/plugins';
+ // thumbnails path
+ $this['thumbnail.path'] = $dir = $this['root.path'].'/www/thumbnails';
// cache path for dev env
- $this['cache.dev.path'] = $app->share(function() use ($app) {
- $path = sys_get_temp_dir().'/'.md5($app['root.path']);
+ $this['cache.dev.path'] = $this->share(function() {
+ $path = sys_get_temp_dir().'/'.md5($this['root.path']);
// ensure path is created
- $app['filesystem']->mkdir($path);
+ $this['filesystem']->mkdir($path);
return $path;
});
// cache path (twig, minify, translations, configuration, doctrine metas serializer metas, profiler etc ...)
- $this['cache.path'] = $app->share(function() use ($app) {
-// if ($app->getEnvironment() !== Application::ENV_PROD) {
+ $this['cache.path'] = $this->share(function() {
+// if ($this->getEnvironment() !== Application::ENV_PROD) {
// return $this['cache.dev.path'];
// }
- $path = $app['root.path'].'/cache';
- if ($app['phraseanet.configuration']->isSetup()) {
- $path = $app['conf']->get(['main', 'storage', 'cache'], $path);
+ $defaultPath = $path = $this['root.path'].'/cache';
+ if ($this['phraseanet.configuration']->isSetup()) {
+ $path = $this['conf']->get(['main', 'storage', 'cache'], $path);
}
+ $path = $path ?: $defaultPath;
+
// ensure path is created
- $app['filesystem']->mkdir($path);
+ $this['filesystem']->mkdir($path);
return $path;
});
- $app['cache.paths'] = $app->share(function() use ($app) {
+ $this['cache.paths'] = $this->share(function() {
return array(
self::ENV_DEV => $this['cache.path'],
self::ENV_TEST => $this['cache.path'],
@@ -960,51 +749,357 @@ class Application extends SilexApplication
});
// log path
- $this['log.path'] = $app->share(function() use ($app) {
- $path = $this['root.path'].'/logs';
- if ($app['phraseanet.configuration']->isSetup()) {
- return $app['conf']->get(['main', 'storage', 'log'], $path);
+ $this['log.path'] = $this->share(function() {
+ $defaultPath = $path = $this['root.path'].'/logs';
+ if ($this['phraseanet.configuration']->isSetup()) {
+ return $this['conf']->get(['main', 'storage', 'log'], $path);
}
+ $path = $path ?: $defaultPath;
+
// ensure path is created
- $app['filesystem']->mkdir($path);
+ $this['filesystem']->mkdir($path);
return $path;
});
// temporary download file path (zip file)
- $this['tmp.download.path'] = $app->share(function() use ($app) {
- $path = $this['tmp.path'].'/download';
- if ($app['phraseanet.configuration']->isSetup()) {
- return $app['conf']->get(['main', 'storage', 'download'], $path);
+ $this['tmp.download.path'] = $this->share(function() {
+ $defaultPath = $path = $this['tmp.path'].'/download';
+ if ($this['phraseanet.configuration']->isSetup()) {
+ return $this['conf']->get(['main', 'storage', 'download'], $path);
}
+ $path = $path ?: $defaultPath;
+
// ensure path is created
- $app['filesystem']->mkdir($path);
+ $this['filesystem']->mkdir($path);
return $path;
});
// quarantined file path
- $this['tmp.lazaret.path'] = $app->share(function() use ($app) {
- $path = $this['tmp.path'].'/lazaret';
- if ($app['phraseanet.configuration']->isSetup()) {
- return $app['conf']->get(['main', 'storage', 'quarantine'], $path);
+ $this['tmp.lazaret.path'] = $this->share(function() {
+ $defaultPath = $path = $this['tmp.path'].'/lazaret';
+ if ($this['phraseanet.configuration']->isSetup()) {
+ return $this['conf']->get(['main', 'storage', 'quarantine'], $path);
}
+ $path = $path ?: $defaultPath;
+
// ensure path is created
- $app['filesystem']->mkdir($path);
+ $this['filesystem']->mkdir($path);
return $path;
});
// document caption file path
- $this['tmp.caption.path'] = $app->share(function() use ($app) {
- $path = $this['tmp.path'].'/caption';
- if ($app['phraseanet.configuration']->isSetup()) {
- return $app['conf']->get(['main', 'storage', 'caption'], $path);
+ $this['tmp.caption.path'] = $this->share(function() {
+ $defaultPath = $path = $this['tmp.path'].'/caption';
+ if ($this['phraseanet.configuration']->isSetup()) {
+ return $this['conf']->get(['main', 'storage', 'caption'], $path);
}
+ $path = $path ?: $defaultPath;
+
// ensure path is created
- $app['filesystem']->mkdir($path);
+ $this['filesystem']->mkdir($path);
return $path;
});
}
+
+
+ private function setupXpdf()
+ {
+ $this['xpdf.pdftotext'] = $this->share(
+ $this->extend('xpdf.pdftotext', function (PdfToText $pdftotext, Application $app) {
+ if ($app['conf']->get(['registry', 'executables', 'pdf-max-pages'])) {
+ $pdftotext->setPageQuantity($app['conf']->get(['registry', 'executables', 'pdf-max-pages']));
+ }
+
+ return $pdftotext;
+ })
+ );
+ }
+
+ private function setupForm()
+ {
+ $this['form.type.extensions'] = $this->share($this->extend('form.type.extensions', function ($extensions, Application $app) {
+ $extensions[] = new HelpTypeExtension();
+
+ return $extensions;
+ }));
+ }
+
+ private function setUpImagine()
+ {
+ $this['imagine.factory'] = $this->share(function (Application $app) {
+ if ($app['conf']->get(['registry', 'executables', 'imagine-driver']) != '') {
+ return $app['conf']->get(['registry', 'executables', 'imagine-driver']);
+ }
+ if (class_exists('\Gmagick')) {
+ return 'gmagick';
+ }
+ if (class_exists('\Imagick')) {
+ return 'imagick';
+ }
+ if (extension_loaded('gd')) {
+ return 'gd';
+ }
+
+ throw new \RuntimeException('No Imagine driver available');
+ });
+ }
+
+ private function setupTranslation()
+ {
+ $this['translator'] = $this->share($this->extend('translator', function (CachedTranslator $translator, Application $app) {
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.fr.xlf', 'fr', 'messages');
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.fr.xlf', 'fr', 'validators');
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.en.xlf', 'en', 'messages');
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.en.xlf', 'en', 'validators');
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.de.xlf', 'de', 'messages');
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.de.xlf', 'de', 'validators');
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/messages.nl.xlf', 'nl', 'messages');
+ $translator->addResource('xlf', __DIR__.'/../../../resources/locales/validators.nl.xlf', 'nl', 'validators');
+
+ return $translator;
+ }));
+ }
+
+ private function setupOrms()
+ {
+ $this['orm.ems'] = $this->share($this->extend('orm.ems', function ($ems, $app) {
+ GedmoExtension::registerAnnotations();
+
+ foreach ($ems->keys() as $key) {
+ $app['orm.annotation.register']($key);
+ $connection = $ems[$key]->getConnection();
+
+ $app['connection.pool.manager']->add($connection);
+
+ $types = $app['orm.ems.options'][$key]['types'];
+ $app['dbal.type.register']($connection, $types);
+ }
+
+ return $ems;
+ }));
+ }
+
+ private function setupSession()
+ {
+ $this['session.storage.test'] = $this->share(function (Application $app) {
+ return new MockArraySessionStorage();
+ });
+
+ $this['session.storage.handler'] = $this->share(function (Application $app) {
+ if (!$this['phraseanet.configuration-tester']->isInstalled()) {
+ return new NullSessionHandler();
+ }
+ return $this['session.storage.handler.factory']->create($app['conf']);
+ });
+ }
+ private function setupRecaptacha()
+ {
+ $this['recaptcha.public-key'] = $this->share(function (Application $app) {
+ if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
+ return $app['conf']->get(['registry', 'webservices', 'recaptcha-public-key']);
+ }
+ });
+ $this['recaptcha.private-key'] = $this->share(function (Application $app) {
+ if ($app['conf']->get(['registry', 'webservices', 'captcha-enabled'])) {
+ return $app['conf']->get(['registry', 'webservices', 'recaptcha-private-key']);
+ }
+ });
+ }
+
+ private function setupGeonames()
+ {
+ $this['geonames.server-uri'] = $this->share(function (Application $app) {
+
+ return $app['conf']->get(['registry', 'webservices', 'geonames-server'], 'http://geonames.alchemyasp.com/');
+ });
+ }
+
+ private function setupDBAL()
+ {
+ $this['dbs.config'] = $this->share($this->extend('dbs.config', function ($configs, $app) {
+ if ($app->getEnvironment() !== self::ENV_DEV) {
+ return $configs;
+ }
+
+ foreach($configs->keys() as $service) {
+ $app['dbal.config.register.loggers']($configs[$service]);
+ }
+
+ return $configs;
+ }));
+
+ $this['dbs.event_manager'] = $this->share($this->extend('dbs.event_manager', function ($eventManagers, $app) {
+ foreach ($eventManagers->keys() as $name) {
+ $app['dbal.evm.register.listeners']($eventManagers[$name]);
+ }
+
+ return $eventManagers;
+ }));
+ }
+
+ private function setupMediaAlchemyst()
+ {
+ $this['media-alchemyst.configuration'] = $this->share(function (Application $app) {
+ $configuration = [];
+
+ foreach ([
+ 'swftools.pdf2swf.binaries' => 'pdf2swf_binary',
+ 'swftools.swfrender.binaries' => 'swf_render_binary',
+ 'swftools.swfextract.binaries' => 'swf_extract_binary',
+ 'unoconv.binaries' => 'unoconv_binary',
+ 'mp4box.binaries' => 'mp4box_binary',
+ 'gs.binaries' => 'ghostscript_binary',
+ 'ffmpeg.ffmpeg.binaries' => 'ffmpeg_binary',
+ 'ffmpeg.ffprobe.binaries' => 'ffprobe_binary',
+ 'ffmpeg.ffmpeg.timeout' => 'ffmpeg_timeout',
+ 'ffmpeg.ffprobe.timeout' => 'ffprobe_timeout',
+ 'gs.timeout' => 'gs_timeout',
+ 'mp4box.timeout' => 'mp4box_timeout',
+ 'swftools.timeout' => 'swftools_timeout',
+ 'unoconv.timeout' => 'unoconv_timeout',
+ ] as $parameter => $key) {
+ if ($this['conf']->has(['main', 'binaries', $key])) {
+ $configuration[$parameter] = $this['conf']->get(['main', 'binaries', $key]);
+ }
+ }
+
+ $configuration['ffmpeg.threads'] = $app['conf']->get(['registry', 'executables', 'ffmpeg-threads']) ?: null;
+ $configuration['imagine.driver'] = $app['conf']->get(['registry', 'executables', 'imagine-driver']) ?: null;
+
+ return $configuration;
+ });
+ $this['media-alchemyst.logger'] = $this->share(function (Application $app) {
+ return $app['monolog'];
+ });
+ }
+
+ private function setupUrlGenerator()
+ {
+ $this['url_generator'] = $this->share($this->extend('url_generator', function ($urlGenerator, Application $app) {
+ if ($app['configuration.store']->isSetup()) {
+ $data = parse_url($app['conf']->get('servername'));
+
+ if (isset($data['scheme'])) {
+ $urlGenerator->getContext()->setScheme($data['scheme']);
+ }
+ if (isset($data['host'])) {
+ $urlGenerator->getContext()->setHost($data['host']);
+ }
+ }
+
+ return $urlGenerator;
+ }));
+ }
+
+ private function setupSwiftMailer()
+ {
+ $this['swiftmailer.transport'] = $this->share(function (Application $app) {
+ if ($app['conf']->get(['registry', 'email', 'smtp-enabled'])) {
+ $transport = new \Swift_Transport_EsmtpTransport(
+ $app['swiftmailer.transport.buffer'],
+ [$app['swiftmailer.transport.authhandler']],
+ $app['swiftmailer.transport.eventdispatcher']
+ );
+
+ $encryption = null;
+
+ if (in_array($app['conf']->get(['registry', 'email', 'smtp-secure-mode']), ['ssl', 'tls'])) {
+ $encryption = $app['conf']->get(['registry', 'email', 'smtp-secure-mode']);
+ }
+
+ $options = $app['swiftmailer.options'] = array_replace([
+ 'host' => $app['conf']->get(['registry', 'email', 'smtp-host']),
+ 'port' => $app['conf']->get(['registry', 'email', 'smtp-port']),
+ 'username' => $app['conf']->get(['registry', 'email', 'smtp-user']),
+ 'password' => $app['conf']->get(['registry', 'email', 'smtp-password']),
+ 'encryption' => $encryption,
+ 'auth_mode' => null,
+ ], $app['swiftmailer.options']);
+
+ $transport->setHost($options['host']);
+ $transport->setPort($options['port']);
+ // tls or ssl
+ $transport->setEncryption($options['encryption']);
+
+ if ($app['conf']->get(['registry', 'email', 'smtp-auth-enabled'])) {
+ $transport->setUsername($options['username']);
+ $transport->setPassword($options['password']);
+ $transport->setAuthMode($options['auth_mode']);
+ }
+ } else {
+ $transport = new \Swift_Transport_MailTransport(
+ new \Swift_Transport_SimpleMailInvoker(),
+ $app['swiftmailer.transport.eventdispatcher']
+ );
+ }
+
+ return $transport;
+ });
+ }
+
+ private function setupMonolog()
+ {
+ $this['monolog.name'] = 'phraseanet';
+ $this['monolog.handler'] = $this->share(function () {
+ return new NullHandler();
+ });
+ $this['monolog'] = $this->share($this->extend('monolog', function (Logger $logger) {
+ $logger->pushProcessor(new IntrospectionProcessor());
+
+ return $logger;
+ }));
+ }
+
+ private function setupEventDispatcher()
+ {
+ $this['dispatcher'] = $this->share(
+ $this->extend('dispatcher', function ($dispatcher, Application $app) {
+ //$dispatcher->addListener(KernelEvents::RESPONSE, [$app, 'addUTF8Charset'], -128);
+ $dispatcher->addSubscriber($app['phraseanet.logout-subscriber']);
+ $dispatcher->addSubscriber($app['phraseanet.locale-subscriber']);
+ $dispatcher->addSubscriber($app['phraseanet.content-negotiation-subscriber']);
+ $dispatcher->addSubscriber($app['phraseanet.maintenance-subscriber']);
+ $dispatcher->addSubscriber($app['phraseanet.cookie-disabler-subscriber']);
+ $dispatcher->addSubscriber($app['phraseanet.session-manager-subscriber']);
+ $dispatcher->addSubscriber($app['phraseanet.record-edit-subscriber']);
+ $dispatcher->addSubscriber(new PhraseaInstallSubscriber($app));
+ $dispatcher->addSubscriber(new FeedEntrySubscriber($app));
+ $dispatcher->addSubscriber(new RegistrationSubscriber($app));
+ $dispatcher->addSubscriber(new BridgeSubscriber($app));
+ $dispatcher->addSubscriber(new ExportSubscriber($app));
+ $dispatcher->addSubscriber(new OrderSubscriber($app));
+ $dispatcher->addSubscriber(new BasketSubscriber($app));
+ $dispatcher->addSubscriber(new LazaretSubscriber($app));
+ $dispatcher->addSubscriber(new ValidationSubscriber($app));
+
+ return $dispatcher;
+ })
+ );
+ }
+
+ private function setupConstants()
+ {
+ if (!defined('JETON_MAKE_SUBDEF')) {
+ define('JETON_MAKE_SUBDEF', 0x01);
+ }
+ if (!defined('JETON_WRITE_META_DOC')) {
+ define('JETON_WRITE_META_DOC', 0x02);
+ }
+ if (!defined('JETON_WRITE_META_SUBDEF')) {
+ define('JETON_WRITE_META_SUBDEF', 0x04);
+ }
+ if (!defined('JETON_WRITE_META')) {
+ define('JETON_WRITE_META', 0x06);
+ }
+ }
+
+ private function setupCharset()
+ {
+ $this['charset'] = 'UTF-8';
+ mb_internal_encoding($this['charset']);
+ }
}
diff --git a/lib/Alchemy/Phrasea/Application/Api.php b/lib/Alchemy/Phrasea/Application/Api.php
index 326174bd97..ee6dedb33f 100644
--- a/lib/Alchemy/Phrasea/Application/Api.php
+++ b/lib/Alchemy/Phrasea/Application/Api.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -12,6 +12,9 @@
namespace Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Application as PhraseaApplication;
+use Alchemy\Phrasea\Controller\Minifier;
+use Alchemy\Phrasea\Controller\Permalink;
+use Alchemy\Phrasea\Controller\Datafiles;
use Alchemy\Phrasea\Core\Event\Subscriber\ApiCorsSubscriber;
use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Controller\Api\Oauth2;
@@ -51,7 +54,7 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
$priorities = array('application/json', 'application/yaml', 'text/yaml', 'text/javascript', 'application/javascript');
foreach (V1::$extendedContentTypes['json'] as $priorities[]);
foreach (V1::$extendedContentTypes['yaml'] as $priorities[]);
- $format = $app['format.negociator']->getBest($request->headers->get('accept') ,$priorities);
+ $format = $app['format.negociator']->getBest($request->headers->get('accept', 'application/json') ,$priorities);
// throw unacceptable http error if API can not handle asked format
if (null === $format) {
@@ -107,7 +110,10 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
});
$app->mount('/api/oauthv2', new Oauth2());
+ $app->mount('/datafiles/', new Datafiles());
$app->mount('/api/v1', new V1());
+ $app->mount('/permalink/', new Permalink());
+ $app->mount('/include/minify/', new Minifier());
$app['dispatcher'] = $app->share($app->extend('dispatcher', function ($dispatcher, PhraseaApplication $app) {
$dispatcher->addSubscriber(new ApiOauth2ErrorsSubscriber($app['phraseanet.exception_handler'], $app['translator']));
diff --git a/lib/Alchemy/Phrasea/Application/Root.php b/lib/Alchemy/Phrasea/Application/Root.php
index 58ad41be88..109b981716 100644
--- a/lib/Alchemy/Phrasea/Application/Root.php
+++ b/lib/Alchemy/Phrasea/Application/Root.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -68,7 +68,7 @@ return call_user_func(function ($environment = PhraseaApplication::ENV_PROD) {
if ($app['phraseanet.configuration-tester']->isInstalled()) {
$app->register(new DoctrineProfilerServiceProvider());
$app['db'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getConnection();
+ return $app['orm.em']->getConnection();
});
}
}
diff --git a/lib/Alchemy/Phrasea/Authentication/AccountCreator.php b/lib/Alchemy/Phrasea/Authentication/AccountCreator.php
index 3899f36400..0c72d4b82a 100644
--- a/lib/Alchemy/Phrasea/Authentication/AccountCreator.php
+++ b/lib/Alchemy/Phrasea/Authentication/AccountCreator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Authenticator.php b/lib/Alchemy/Phrasea/Authentication/Authenticator.php
index 6c59f5a606..f25a28d666 100644
--- a/lib/Alchemy/Phrasea/Authentication/Authenticator.php
+++ b/lib/Alchemy/Phrasea/Authentication/Authenticator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Context.php b/lib/Alchemy/Phrasea/Authentication/Context.php
index ee03083e77..4bba11ff27 100644
--- a/lib/Alchemy/Phrasea/Authentication/Context.php
+++ b/lib/Alchemy/Phrasea/Authentication/Context.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Exception/AccountLockedException.php b/lib/Alchemy/Phrasea/Authentication/Exception/AccountLockedException.php
index aac52236ab..894e8998e3 100644
--- a/lib/Alchemy/Phrasea/Authentication/Exception/AccountLockedException.php
+++ b/lib/Alchemy/Phrasea/Authentication/Exception/AccountLockedException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Exception/AuthenticationException.php b/lib/Alchemy/Phrasea/Authentication/Exception/AuthenticationException.php
index 34ae67da48..37a1514705 100644
--- a/lib/Alchemy/Phrasea/Authentication/Exception/AuthenticationException.php
+++ b/lib/Alchemy/Phrasea/Authentication/Exception/AuthenticationException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Exception/NotAuthenticatedException.php b/lib/Alchemy/Phrasea/Authentication/Exception/NotAuthenticatedException.php
index b8e1f76044..6dfe729bc7 100644
--- a/lib/Alchemy/Phrasea/Authentication/Exception/NotAuthenticatedException.php
+++ b/lib/Alchemy/Phrasea/Authentication/Exception/NotAuthenticatedException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Exception/RequireCaptchaException.php b/lib/Alchemy/Phrasea/Authentication/Exception/RequireCaptchaException.php
index a4e01061c6..d84eb71d9b 100644
--- a/lib/Alchemy/Phrasea/Authentication/Exception/RequireCaptchaException.php
+++ b/lib/Alchemy/Phrasea/Authentication/Exception/RequireCaptchaException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Manager.php b/lib/Alchemy/Phrasea/Authentication/Manager.php
index 707fab805a..c9c8e57ec1 100644
--- a/lib/Alchemy/Phrasea/Authentication/Manager.php
+++ b/lib/Alchemy/Phrasea/Authentication/Manager.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/PersistentCookie/Manager.php b/lib/Alchemy/Phrasea/Authentication/PersistentCookie/Manager.php
index 1ef0dc8472..986a27c62f 100644
--- a/lib/Alchemy/Phrasea/Authentication/PersistentCookie/Manager.php
+++ b/lib/Alchemy/Phrasea/Authentication/PersistentCookie/Manager.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Phrasea/FailureManager.php b/lib/Alchemy/Phrasea/Authentication/Phrasea/FailureManager.php
index d39272f516..d0340f3f03 100644
--- a/lib/Alchemy/Phrasea/Authentication/Phrasea/FailureManager.php
+++ b/lib/Alchemy/Phrasea/Authentication/Phrasea/FailureManager.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Phrasea/NativeAuthentication.php b/lib/Alchemy/Phrasea/Authentication/Phrasea/NativeAuthentication.php
index aab144f653..bf6601fed4 100644
--- a/lib/Alchemy/Phrasea/Authentication/Phrasea/NativeAuthentication.php
+++ b/lib/Alchemy/Phrasea/Authentication/Phrasea/NativeAuthentication.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Phrasea/OldPasswordEncoder.php b/lib/Alchemy/Phrasea/Authentication/Phrasea/OldPasswordEncoder.php
index de098e413d..454e8914dd 100644
--- a/lib/Alchemy/Phrasea/Authentication/Phrasea/OldPasswordEncoder.php
+++ b/lib/Alchemy/Phrasea/Authentication/Phrasea/OldPasswordEncoder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Phrasea/PasswordEncoder.php b/lib/Alchemy/Phrasea/Authentication/Phrasea/PasswordEncoder.php
index cda23a5b07..e37cc41d45 100644
--- a/lib/Alchemy/Phrasea/Authentication/Phrasea/PasswordEncoder.php
+++ b/lib/Alchemy/Phrasea/Authentication/Phrasea/PasswordEncoder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/AbstractProvider.php b/lib/Alchemy/Phrasea/Authentication/Provider/AbstractProvider.php
index 4c2f15777c..f2c2028cc1 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/AbstractProvider.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/AbstractProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Facebook.php b/lib/Alchemy/Phrasea/Authentication/Provider/Facebook.php
index 409263eb3b..3cce15fcd4 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Facebook.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Facebook.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Factory.php b/lib/Alchemy/Phrasea/Authentication/Provider/Factory.php
index b5be6801a9..c5149b3102 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Factory.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Factory.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Github.php b/lib/Alchemy/Phrasea/Authentication/Provider/Github.php
index 3e1f6b868a..e1c35b1eca 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Github.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Github.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/GooglePlus.php b/lib/Alchemy/Phrasea/Authentication/Provider/GooglePlus.php
index aa5e7212ab..09ddc0e527 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/GooglePlus.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/GooglePlus.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Linkedin.php b/lib/Alchemy/Phrasea/Authentication/Provider/Linkedin.php
index 004955b119..1b23fa2c6c 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Linkedin.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Linkedin.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/ProviderInterface.php b/lib/Alchemy/Phrasea/Authentication/Provider/ProviderInterface.php
index 287d6331ee..d1d91d4248 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/ProviderInterface.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/ProviderInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Token/Identity.php b/lib/Alchemy/Phrasea/Authentication/Provider/Token/Identity.php
index 43d34ccaf0..f9e87dc0fe 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Token/Identity.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Token/Identity.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Token/Token.php b/lib/Alchemy/Phrasea/Authentication/Provider/Token/Token.php
index 3eef168354..6b964aa354 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Token/Token.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Token/Token.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Twitter.php b/lib/Alchemy/Phrasea/Authentication/Provider/Twitter.php
index 908b906022..95b6287f4d 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Twitter.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Twitter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/Provider/Viadeo.php b/lib/Alchemy/Phrasea/Authentication/Provider/Viadeo.php
index db9b84ec54..0a5bfd873f 100644
--- a/lib/Alchemy/Phrasea/Authentication/Provider/Viadeo.php
+++ b/lib/Alchemy/Phrasea/Authentication/Provider/Viadeo.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/ProvidersCollection.php b/lib/Alchemy/Phrasea/Authentication/ProvidersCollection.php
index 82625c09b6..da93d53533 100644
--- a/lib/Alchemy/Phrasea/Authentication/ProvidersCollection.php
+++ b/lib/Alchemy/Phrasea/Authentication/ProvidersCollection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Authentication/SuggestionFinder.php b/lib/Alchemy/Phrasea/Authentication/SuggestionFinder.php
index 48cd43e687..b842e200ca 100644
--- a/lib/Alchemy/Phrasea/Authentication/SuggestionFinder.php
+++ b/lib/Alchemy/Phrasea/Authentication/SuggestionFinder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Attribute/AttributeInterface.php b/lib/Alchemy/Phrasea/Border/Attribute/AttributeInterface.php
index 44298f2055..12b7d8c861 100644
--- a/lib/Alchemy/Phrasea/Border/Attribute/AttributeInterface.php
+++ b/lib/Alchemy/Phrasea/Border/Attribute/AttributeInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Attribute/Factory.php b/lib/Alchemy/Phrasea/Border/Attribute/Factory.php
index 8ff5853e30..6f5f1cde1f 100644
--- a/lib/Alchemy/Phrasea/Border/Attribute/Factory.php
+++ b/lib/Alchemy/Phrasea/Border/Attribute/Factory.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Attribute/MetaField.php b/lib/Alchemy/Phrasea/Border/Attribute/MetaField.php
index b1132faa7e..e3a2465d86 100644
--- a/lib/Alchemy/Phrasea/Border/Attribute/MetaField.php
+++ b/lib/Alchemy/Phrasea/Border/Attribute/MetaField.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Attribute/Metadata.php b/lib/Alchemy/Phrasea/Border/Attribute/Metadata.php
index ef1d600b9d..314acb6d78 100644
--- a/lib/Alchemy/Phrasea/Border/Attribute/Metadata.php
+++ b/lib/Alchemy/Phrasea/Border/Attribute/Metadata.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Attribute/Status.php b/lib/Alchemy/Phrasea/Border/Attribute/Status.php
index 46d910fc70..1a78b7a58e 100644
--- a/lib/Alchemy/Phrasea/Border/Attribute/Status.php
+++ b/lib/Alchemy/Phrasea/Border/Attribute/Status.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Attribute/Story.php b/lib/Alchemy/Phrasea/Border/Attribute/Story.php
index 718ec5a1a1..9c24bd0a8d 100644
--- a/lib/Alchemy/Phrasea/Border/Attribute/Story.php
+++ b/lib/Alchemy/Phrasea/Border/Attribute/Story.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/AbstractChecker.php b/lib/Alchemy/Phrasea/Border/Checker/AbstractChecker.php
index a91a51d50f..fee62d05c3 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/AbstractChecker.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/AbstractChecker.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/CheckerInterface.php b/lib/Alchemy/Phrasea/Border/Checker/CheckerInterface.php
index aa50bfa2bd..014298557e 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/CheckerInterface.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/CheckerInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/Colorspace.php b/lib/Alchemy/Phrasea/Border/Checker/Colorspace.php
index 83b1a9574d..4562c6056f 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/Colorspace.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/Colorspace.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/Dimension.php b/lib/Alchemy/Phrasea/Border/Checker/Dimension.php
index 2b023b54cf..a3e7ff480d 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/Dimension.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/Dimension.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/Extension.php b/lib/Alchemy/Phrasea/Border/Checker/Extension.php
index aa228422fb..0e45c0e56a 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/Extension.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/Extension.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/Filename.php b/lib/Alchemy/Phrasea/Border/Checker/Filename.php
index b7dad16ee7..04032deeee 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/Filename.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/Filename.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/MediaType.php b/lib/Alchemy/Phrasea/Border/Checker/MediaType.php
index 48e9f8b9eb..2d154de227 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/MediaType.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/MediaType.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/Response.php b/lib/Alchemy/Phrasea/Border/Checker/Response.php
index 1bc0a11fd5..2383c98b17 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/Response.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/Response.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/Sha256.php b/lib/Alchemy/Phrasea/Border/Checker/Sha256.php
index a51f31da58..1f66475929 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/Sha256.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/Sha256.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Checker/UUID.php b/lib/Alchemy/Phrasea/Border/Checker/UUID.php
index 28815c1ab0..6c195bf38b 100644
--- a/lib/Alchemy/Phrasea/Border/Checker/UUID.php
+++ b/lib/Alchemy/Phrasea/Border/Checker/UUID.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/CustomExtensionGuesser.php b/lib/Alchemy/Phrasea/Border/CustomExtensionGuesser.php
index 551e2cacf7..d8cf369228 100644
--- a/lib/Alchemy/Phrasea/Border/CustomExtensionGuesser.php
+++ b/lib/Alchemy/Phrasea/Border/CustomExtensionGuesser.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/File.php b/lib/Alchemy/Phrasea/Border/File.php
index 532299fe02..2a9e5de76f 100644
--- a/lib/Alchemy/Phrasea/Border/File.php
+++ b/lib/Alchemy/Phrasea/Border/File.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Manager.php b/lib/Alchemy/Phrasea/Border/Manager.php
index 5019e865e1..7541be9f27 100644
--- a/lib/Alchemy/Phrasea/Border/Manager.php
+++ b/lib/Alchemy/Phrasea/Border/Manager.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Border;
use Alchemy\Phrasea\Border\Checker\CheckerInterface;
use Alchemy\Phrasea\Border\Attribute\AttributeInterface;
+use Alchemy\Phrasea\Media\Subdef\OptionType\Boolean;
use Alchemy\Phrasea\Metadata\Tag\TfArchivedate;
use Alchemy\Phrasea\Metadata\Tag\TfQuarantine;
use Alchemy\Phrasea\Metadata\Tag\TfBasename;
@@ -80,7 +81,7 @@ class Manager
* @param type $forceBehavior Force a behavior, one of the self::FORCE_* constant
* @return int One of the self::RECORD_CREATED or self::LAZARET_CREATED constants
*/
- public function process(LazaretSession $session, File $file, $callable = null, $forceBehavior = null)
+ public function process(LazaretSession $session, File $file, $callable = null, $forceBehavior = null, $nosubdef = false)
{
$visa = $this->getVisa($file);
@@ -93,7 +94,7 @@ class Manager
$this->addMediaAttributes($file);
- $element = $this->createRecord($file);
+ $element = $this->createRecord($file, $nosubdef);
$code = self::RECORD_CREATED;
} else {
@@ -128,7 +129,7 @@ class Manager
$visa = new Visa();
foreach ($this->checkers as $checker) {
- $visa->addResponse($checker->check($this->app['EM'], $file));
+ $visa->addResponse($checker->check($this->app['orm.em'], $file));
}
return $visa;
@@ -229,10 +230,9 @@ class Manager
* @param File $file The package file
* @return \record_adater
*/
- protected function createRecord(File $file)
+ protected function createRecord(File $file, $nosubdef=false)
{
$element = \record_adapter::createFromFile($file, $this->app);
-
$date = new \DateTime();
$file->addAttribute(
@@ -303,7 +303,9 @@ class Manager
$this->app['phraseanet.metadata-setter']->replaceMetadata($newMetadata, $element);
- $element->rebuild_subdefs();
+ if(!$nosubdef) {
+ $element->rebuild_subdefs();
+ }
return $element;
}
@@ -358,7 +360,7 @@ class Manager
$lazaretFile->setSession($session);
- $this->app['EM']->persist($lazaretFile);
+ $this->app['orm.em']->persist($lazaretFile);
foreach ($file->getAttributes() as $fileAttribute) {
$attribute = new LazaretAttribute();
@@ -367,7 +369,7 @@ class Manager
$attribute->setLazaretFile($lazaretFile);
$lazaretFile->addAttribute($attribute);
- $this->app['EM']->persist($attribute);
+ $this->app['orm.em']->persist($attribute);
}
foreach ($visa->getResponses() as $response) {
@@ -379,11 +381,11 @@ class Manager
$lazaretFile->addCheck($check);
- $this->app['EM']->persist($check);
+ $this->app['orm.em']->persist($check);
}
}
- $this->app['EM']->flush();
+ $this->app['orm.em']->flush();
return $lazaretFile;
}
diff --git a/lib/Alchemy/Phrasea/Border/MetaBagInterface.php b/lib/Alchemy/Phrasea/Border/MetaBagInterface.php
index 24a05a77e6..c719686995 100644
--- a/lib/Alchemy/Phrasea/Border/MetaBagInterface.php
+++ b/lib/Alchemy/Phrasea/Border/MetaBagInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/MetaFieldsBag.php b/lib/Alchemy/Phrasea/Border/MetaFieldsBag.php
index ccd6a8637e..5f8f790a4a 100644
--- a/lib/Alchemy/Phrasea/Border/MetaFieldsBag.php
+++ b/lib/Alchemy/Phrasea/Border/MetaFieldsBag.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/MetadataBag.php b/lib/Alchemy/Phrasea/Border/MetadataBag.php
index fa0dada52d..2c8187a6c4 100644
--- a/lib/Alchemy/Phrasea/Border/MetadataBag.php
+++ b/lib/Alchemy/Phrasea/Border/MetadataBag.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/MimeGuesserConfiguration.php b/lib/Alchemy/Phrasea/Border/MimeGuesserConfiguration.php
index cfda50f3e9..f7504e6a47 100644
--- a/lib/Alchemy/Phrasea/Border/MimeGuesserConfiguration.php
+++ b/lib/Alchemy/Phrasea/Border/MimeGuesserConfiguration.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Border/Visa.php b/lib/Alchemy/Phrasea/Border/Visa.php
index f9d708a417..edcf3bdc30 100644
--- a/lib/Alchemy/Phrasea/Border/Visa.php
+++ b/lib/Alchemy/Phrasea/Border/Visa.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/CLI.php b/lib/Alchemy/Phrasea/CLI.php
index 8ec5d3c6bb..9bb63c8783 100644
--- a/lib/Alchemy/Phrasea/CLI.php
+++ b/lib/Alchemy/Phrasea/CLI.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -137,7 +137,7 @@ class CLI extends Application
parent::loadPlugins();
call_user_func(function ($cli) {
- require $cli['plugins.directory'] . '/commands.php';
+ require $cli['plugin.path'] . '/commands.php';
}, $this);
}
}
diff --git a/lib/Alchemy/Phrasea/Cache/ApcCache.php b/lib/Alchemy/Phrasea/Cache/ApcCache.php
index a61407380b..24b6b87484 100644
--- a/lib/Alchemy/Phrasea/Cache/ApcCache.php
+++ b/lib/Alchemy/Phrasea/Cache/ApcCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/ArrayCache.php b/lib/Alchemy/Phrasea/Cache/ArrayCache.php
index bd3c763883..d492a70424 100644
--- a/lib/Alchemy/Phrasea/Cache/ArrayCache.php
+++ b/lib/Alchemy/Phrasea/Cache/ArrayCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/Cache.php b/lib/Alchemy/Phrasea/Cache/Cache.php
index e97ce9f22e..04fe604b60 100644
--- a/lib/Alchemy/Phrasea/Cache/Cache.php
+++ b/lib/Alchemy/Phrasea/Cache/Cache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/Exception.php b/lib/Alchemy/Phrasea/Cache/Exception.php
index b990c32279..fc34bb5d84 100644
--- a/lib/Alchemy/Phrasea/Cache/Exception.php
+++ b/lib/Alchemy/Phrasea/Cache/Exception.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/Factory.php b/lib/Alchemy/Phrasea/Cache/Factory.php
index ccbf471d59..e2bc409daa 100644
--- a/lib/Alchemy/Phrasea/Cache/Factory.php
+++ b/lib/Alchemy/Phrasea/Cache/Factory.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -46,7 +46,7 @@ class Factory
$cache = $this->createMemcache($options);
break;
case 'memcached':
- case 'memcachecached':
+ case 'memcachedcache':
$cache = $this->createMemcached($options);
break;
case 'redis':
diff --git a/lib/Alchemy/Phrasea/Cache/Manager.php b/lib/Alchemy/Phrasea/Cache/Manager.php
index fa01631d16..59022be7f4 100644
--- a/lib/Alchemy/Phrasea/Cache/Manager.php
+++ b/lib/Alchemy/Phrasea/Cache/Manager.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/MemcacheCache.php b/lib/Alchemy/Phrasea/Cache/MemcacheCache.php
index 918c90804f..6612a1bd82 100644
--- a/lib/Alchemy/Phrasea/Cache/MemcacheCache.php
+++ b/lib/Alchemy/Phrasea/Cache/MemcacheCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/MemcachedCache.php b/lib/Alchemy/Phrasea/Cache/MemcachedCache.php
index 82ee182aab..85927af33f 100644
--- a/lib/Alchemy/Phrasea/Cache/MemcachedCache.php
+++ b/lib/Alchemy/Phrasea/Cache/MemcachedCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/RedisCache.php b/lib/Alchemy/Phrasea/Cache/RedisCache.php
index 54ada036e4..64bbbf8317 100644
--- a/lib/Alchemy/Phrasea/Cache/RedisCache.php
+++ b/lib/Alchemy/Phrasea/Cache/RedisCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/WinCacheCache.php b/lib/Alchemy/Phrasea/Cache/WinCacheCache.php
index 88f9b59239..f6e1dc765b 100644
--- a/lib/Alchemy/Phrasea/Cache/WinCacheCache.php
+++ b/lib/Alchemy/Phrasea/Cache/WinCacheCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Cache/XcacheCache.php b/lib/Alchemy/Phrasea/Cache/XcacheCache.php
index 191dca10b3..8ca17fa423 100644
--- a/lib/Alchemy/Phrasea/Cache/XcacheCache.php
+++ b/lib/Alchemy/Phrasea/Cache/XcacheCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/AbstractCheckCommand.php b/lib/Alchemy/Phrasea/Command/AbstractCheckCommand.php
index 7054b86fec..2b2ae0ecf4 100644
--- a/lib/Alchemy/Phrasea/Command/AbstractCheckCommand.php
+++ b/lib/Alchemy/Phrasea/Command/AbstractCheckCommand.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php
index 72ebfab158..ba6c6936c2 100644
--- a/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php
+++ b/lib/Alchemy/Phrasea/Command/BuildMissingSubdefs.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -38,9 +38,6 @@ class BuildMissingSubdefs extends Command
$n = 0;
foreach ($this->container['phraseanet.appbox']->get_databoxes() as $databox) {
-
- $subdefStructure = $databox->get_subdef_structure();
-
$sql = 'SELECT record_id FROM record WHERE parent_record_id = 0';
$stmt = $databox->get_connection()->prepare($sql);
$stmt->execute();
@@ -50,38 +47,14 @@ class BuildMissingSubdefs extends Command
foreach ($rs as $row) {
$record = $databox->get_record($row['record_id']);
- try {
- $record->get_hd_file();
- } catch (FileNotFoundException $e) {
- continue;
- }
+ $wanted_subdefs = $record->get_missing_subdefs();
- $group = $subdefStructure->getSubdefGroup($record->get_type());
+ if (count($wanted_subdefs) > 0) {
+ $record->generate_subdefs($databox, $this->container, $wanted_subdefs);
- if ($group) {
- foreach ($group as $subdef) {
-
- $todo = false;
-
- if ( ! $record->has_subdef($subdef->get_name())) {
- $todo = true;
- }
- if (in_array($subdef->get_name(), ['preview', 'thumbnail', 'thumbnailgif'])) {
- try {
- $sub = $record->get_subdef($subdef->get_name());
- if ( ! $sub->is_physically_present()) {
- $todo = true;
- }
- } catch (\Exception_Media_SubdefNotFound $e) {
- $todo = true;
- }
- }
-
- if ($todo) {
- $this->container['subdef.generator']->generateSubdefs($record, [$subdef->get_name()]);
- $this->container['monolog']->addInfo("generate " . $subdef->get_name() . " for record " . $record->get_record_id());
- $n ++;
- }
+ foreach ($wanted_subdefs as $subdef) {
+ $this->container['monolog']->addInfo("generate " .$subdef . " for record " . $record->get_record_id());
+ $n ++;
}
}
diff --git a/lib/Alchemy/Phrasea/Command/BuildSubdefs.php b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php
new file mode 100644
index 0000000000..bc8bc777df
--- /dev/null
+++ b/lib/Alchemy/Phrasea/Command/BuildSubdefs.php
@@ -0,0 +1,196 @@
+setDescription('Build subviews for given subview names and record types');
+ $this->addArgument('databox', InputArgument::REQUIRED, 'The databox id');
+ $this->addArgument('type', InputArgument::REQUIRED, 'Types of the document to rebuild');
+ $this->addArgument('subdefs', InputArgument::REQUIRED, 'Names of sub-definition to re-build');
+ $this->addOption('max_record', 'max', InputOption::VALUE_OPTIONAL, 'Max record id');
+ $this->addOption('min_record', 'min', InputOption::VALUE_OPTIONAL, 'Min record id');
+ $this->addOption('with-substitution', 'wsubstit', InputOption::VALUE_NONE, 'Regenerate subdefs for substituted records as well');
+ $this->addOption('substitution-only', 'substito', InputOption::VALUE_NONE, 'Regenerate subdefs for substituted records only');
+
+ return $this;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ protected function doExecute(InputInterface $input, OutputInterface $output)
+ {
+ $availableTypes = array('document', 'audio', 'video', 'image', 'flash', 'map');
+
+ $typesOption = $input->getArgument('type');
+
+ $recordsType = explode(',', $typesOption);
+ $recordsType = array_filter($recordsType, function($type) use($availableTypes) {
+ return in_array($type, $availableTypes);
+ });
+
+ if (count($recordsType) === 0) {
+ $output->write(sprintf('Invalid records type provided %s', implode(', ', $availableTypes)));
+ return;
+ }
+
+ $subdefsOption = $input->getArgument('subdefs');
+ $subdefsName = explode(',', $subdefsOption);
+
+ if (count($subdefsOption) === 0) {
+ $output->write('No subdef options provided');
+ return;
+ }
+
+ $sqlCount = "
+ SELECT COUNT(DISTINCT(r.record_id)) AS nb_records
+ FROM record r
+ INNER JOIN subdef s
+ ON (r.record_id = s.record_id)
+ WHERE s.name IN (?)
+ AND r.type IN (?)
+ ";
+
+ $types = array(Connection::PARAM_STR_ARRAY, Connection::PARAM_STR_ARRAY);
+ $params = array($subdefsName, $recordsType);
+
+ if (null !== $min = $input->getOption('min_record')) {
+ $sqlCount .= " AND (r.record_id >= ?)";
+
+ $params[] = (int) $min;
+ $types[] = \PDO::PARAM_INT;
+ }
+
+ if (null !== $max = $input->getOption('max_record')) {
+ $sqlCount .= " AND (r.record_id <= ?)";
+
+ $params[] = (int) $max;
+ $types[] = \PDO::PARAM_INT;
+ }
+
+ $substitutionOnly = $input->getOption('substitution-only');
+ $withSubstitution = $input->getOption('with-substitution');
+
+ if (false === $withSubstitution) {
+ if (true === $substitutionOnly) {
+ $sqlCount .= " AND (s.substit = 1)";
+ } else {
+ $sqlCount .= " AND (s.substit = 0)";
+ }
+ } elseif ($substitutionOnly) {
+ throw new InvalidArgumentException('Conflict, you can not ask for --substituion-only && --with-substitution parameters at the same time');
+ }
+
+ list($sqlCount, $stmtParams) = SQLParserUtils::expandListParameters($sqlCount, $params, $types);
+
+ $databox = $this->container['phraseanet.appbox']->get_databox($input->getArgument('databox'));
+
+ $connection = $databox->get_connection();
+ $stmt = $connection->prepare($sqlCount);
+ $stmt->execute($stmtParams);
+ $row = $stmt->fetch();
+ $totalRecords = $row['nb_records'];
+
+ if ($totalRecords === 0) {
+ return;
+ }
+
+ $progress = $this->getHelperSet()->get('progress');
+
+ $progress->start($output, $totalRecords);
+
+ $progress->display();
+
+ $sql = "
+ SELECT DISTINCT(r.record_id)
+ FROM record r
+ INNER JOIN subdef s
+ ON (r.record_id = s.record_id)
+ WHERE s.name IN (?)
+ AND r.type IN (?)
+ ";
+
+ $types = array(Connection::PARAM_STR_ARRAY, Connection::PARAM_STR_ARRAY);
+ $params = array($subdefsName, $recordsType);
+
+ if ($min) {
+ $sql .= " AND (r.record_id >= ?)";
+
+ $params[] = (int) $min;
+ $types[] = \PDO::PARAM_INT;
+ }
+ if ($max) {
+ $sql .= " AND (r.record_id <= ?)";
+
+ $params[] = (int) $max;
+ $types[] = \PDO::PARAM_INT;
+ }
+
+ if (false === $withSubstitution) {
+ if (true === $substitutionOnly) {
+ $sql .= " AND (s.substit = 1)";
+ } else {
+ $sql .= " AND (s.substit = 0)";
+ }
+ }
+
+ list($sql, $stmtParams) = SQLParserUtils::expandListParameters($sql, $params, $types);
+
+ $connection = $databox->get_connection();
+ $stmt = $connection->prepare($sql);
+ $stmt->execute($stmtParams);
+ $rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
+
+ foreach ($rows as $row) {
+ $output->write(sprintf(' (#%s)', $row['record_id']));
+
+ $record = new \record_adapter($this->container, $databox->get_sbas_id(), $row['record_id']);
+
+ $subdefs = array_filter($record->get_subdefs(), function($subdef) use ($subdefsName) {
+ return in_array($subdef->get_name(), $subdefsName);
+ });
+
+ foreach ($subdefs as $subdef) {
+ $subdef->remove_file();
+ if (($withSubstitution && $subdef->is_substituted()) || $substitutionOnly) {
+ $subdef->set_substituted(false);
+ }
+ }
+
+ $record->generate_subdefs($databox, $this->container, $subdefsName);
+
+ $stmt->closeCursor();
+
+ $progress->advance();
+ }
+
+ unset($rows, $record, $stmt, $connection);
+
+ $progress->finish();
+ }
+}
diff --git a/lib/Alchemy/Phrasea/Command/CheckConfig.php b/lib/Alchemy/Phrasea/Command/CheckConfig.php
index 71248eaa3d..28fddd376a 100644
--- a/lib/Alchemy/Phrasea/Command/CheckConfig.php
+++ b/lib/Alchemy/Phrasea/Command/CheckConfig.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Command.php b/lib/Alchemy/Phrasea/Command/Command.php
index dfb11235b1..2033ee3487 100644
--- a/lib/Alchemy/Phrasea/Command/Command.php
+++ b/lib/Alchemy/Phrasea/Command/Command.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/CommandInterface.php b/lib/Alchemy/Phrasea/Command/CommandInterface.php
index a531d85267..ef26a78852 100644
--- a/lib/Alchemy/Phrasea/Command/CommandInterface.php
+++ b/lib/Alchemy/Phrasea/Command/CommandInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Compile/Configuration.php b/lib/Alchemy/Phrasea/Command/Compile/Configuration.php
index fc60d5fb09..649e16a5e4 100644
--- a/lib/Alchemy/Phrasea/Command/Compile/Configuration.php
+++ b/lib/Alchemy/Phrasea/Command/Compile/Configuration.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/CreateCollection.php b/lib/Alchemy/Phrasea/Command/CreateCollection.php
index b2eb39fa35..41ccbdbc86 100644
--- a/lib/Alchemy/Phrasea/Command/CreateCollection.php
+++ b/lib/Alchemy/Phrasea/Command/CreateCollection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -37,8 +37,7 @@ class CreateCollection extends Command
protected function doExecute(InputInterface $input, OutputInterface $output)
{
- $databox = $this->container['phraseanet.appbox']
- ->get_databox((int) $input->getArgument('databox_id'));
+ $databox = $this->container['phraseanet.appbox']->get_databox((int) $input->getArgument('databox_id'));
$new_collection = \collection::create($this->container, $databox, $this->container['phraseanet.appbox'], $input->getArgument('collname'));
diff --git a/lib/Alchemy/Phrasea/Command/Developer/APIRoutesDumper.php b/lib/Alchemy/Phrasea/Command/Developer/APIRoutesDumper.php
index a92ed60ca7..6c1872be73 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/APIRoutesDumper.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/APIRoutesDumper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/AbstractRoutesDumper.php b/lib/Alchemy/Phrasea/Command/Developer/AbstractRoutesDumper.php
index 8bc224ed83..b4ab3fad17 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/AbstractRoutesDumper.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/AbstractRoutesDumper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/Behat.php b/lib/Alchemy/Phrasea/Command/Developer/Behat.php
index 21673083e0..bc666e762d 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/Behat.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/Behat.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/BowerInstall.php b/lib/Alchemy/Phrasea/Command/Developer/BowerInstall.php
index f2442d4f0d..c679ad0dec 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/BowerInstall.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/BowerInstall.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/ComposerInstall.php b/lib/Alchemy/Phrasea/Command/Developer/ComposerInstall.php
index d29fc728f2..a747f33d85 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/ComposerInstall.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/ComposerInstall.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -49,11 +49,11 @@ class ComposerInstall extends Command
try {
if ($input->getOption('no-dev')) {
- $output->write("Installing dependencies without developer packages ");
+ $output->write("Installing composer dependencies without developer packages ");
$composer->command(array_merge($commands, ['--no-dev']));
$output->writeln("OK ");
} else {
- $output->write("Installing dependencies with developer packages ");
+ $output->write("Installing composer dependencies with developer packages ");
$composer->command(array_merge($commands, ['--dev']));
$output->writeln("OK ");
}
diff --git a/lib/Alchemy/Phrasea/Command/Developer/IniReset.php b/lib/Alchemy/Phrasea/Command/Developer/IniReset.php
index 2749229bfe..73317127a3 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/IniReset.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/IniReset.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -36,6 +36,7 @@ class IniReset extends Command
->addOption('db-name', null, InputOption::VALUE_OPTIONAL, 'Databox name to reset, in case of multiple databox are mounted', null)
->addOption('dependencies', null, InputOption::VALUE_NONE, 'Fetch dependencies', null)
->addOption('run-patches', null, InputOption::VALUE_NONE, 'Reset in v3.1 states & apply all patches', null)
+ ->addOption('no-setup-dbs', null, InputOption::VALUE_NONE, 'Do not create dbs for setup tests used in phpunit test suite', null)
;
}
@@ -114,7 +115,7 @@ class IniReset extends Command
// get data paths
$dataPath = $this->container['conf']->get(['main', 'storage', 'subdefs'], $this->container['root.path'].'/datas');
- $schema = $this->container['EM']->getConnection()->getSchemaManager();
+ $schema = $this->container['orm.em']->getConnection()->getSchemaManager();
$output->writeln('Creating database "'.$dbs['ab'].'"...OK ');
$schema->dropAndCreateDatabase($dbs['ab']);
$output->writeln('Creating database "'.$dbName.'"...OK ');
@@ -163,7 +164,7 @@ class IniReset extends Command
'command' => 'system:uninstall'
)), $output);
- $process = new Process(sprintf('php ' . __DIR__ . '/../../../../../bin/setup system:install --email=%s --password=%s --db-user=%s --db-template=%s --db-password=%s --databox=%s --appbox=%s --server-name=%s --db-host=%s --db-port=%s -y',
+ $cmd = sprintf('php ' . __DIR__ . '/../../../../../bin/setup system:install --email=%s --password=%s --db-user=%s --db-template=%s --db-password=%s --databox=%s --appbox=%s --server-name=%s --db-host=%s --db-port=%s -y',
$input->getOption('email'),
$input->getOption('password'),
$conf['main']['database']['user'],
@@ -171,12 +172,22 @@ class IniReset extends Command
$conf['main']['database']['password'],
$dbName,
$dbs['ab'],
- $conf['main']['servername'],
+ $conf['servername'],
$conf['main']['database']['host'],
$conf['main']['database']['port']
- ));
- $process->run();
+ );
+ $process = new Process($cmd);
+ $process->setTimeout(300);
+ $process->run(function ($type, $buffer) {
+ if ('err' === $type) {
+ echo 'ERR > ' . $buffer;
+ }
+ });
+ if (false === $process->isSuccessful()) {
+ $output->writeln('Failed to execute the following command "'.$cmd.'" ');
+ return 1;
+ }
$output->writeln("Install successful ! ");
}
@@ -197,15 +208,38 @@ class IniReset extends Command
$output->writeln('Mounting database "'.$databox->get_dbname().'"...OK ');
}
- $process = new Process(('php ' . __DIR__ . '/../../../../../bin/setup system:upgrade -y -f'));
- $process->run();
+ if ($input->getOption('run-patches') || false === $this->container['phraseanet.configuration']->isUpToDate()) {
+ if ($input->getOption('run-patches')) {
+ $output->write(sprintf('Upgrading... from version 3.1.21 to %s ', Version::getNumber()), true);
+ } else {
+ $output->write(sprintf('Upgrading... from version %s to %s ', $this->app['phraseanet.appbox']->get_version(), Version::getNumber()), true);
+ }
+
+ $cmd = 'php ' . __DIR__ . '/../../../../../bin/setup system:upgrade -y -f -v';
+ $process = new Process($cmd);
+ $process->setTimeout(600);
+ $process->run(function ($type, $buffer) {
+ if ('err' === $type) {
+ echo 'ERR > ' . $buffer;
+ }
+ })
+ ;
+ if (false === $process->isSuccessful()) {
+ $output->writeln('Failed to execute the following command "' . $cmd . '" ');
- // create setup dbs
- $command = $this->getApplication()->find('ini:setup-tests-dbs');
- $input = new ArrayInput(array(
- 'command' => 'ini:setup-tests-dbs'
- ));
- $command->run($input, $output);
+ return 1;
+ }
+ }
+
+
+ if (!$input->getOption('no-setup-dbs')) {
+ // create setup dbs
+ $command = $this->getApplication()->find('ini:setup-tests-dbs');
+ $input = new ArrayInput(array(
+ 'command' => 'ini:setup-tests-dbs'
+ ));
+ $command->run($input, $output);
+ }
$this->container['conf']->set(['main', 'storage', 'subdefs'], $dataPath);
diff --git a/lib/Alchemy/Phrasea/Command/Developer/InstallAll.php b/lib/Alchemy/Phrasea/Command/Developer/InstallAll.php
index 1bae667c18..8fc6c3c5b1 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/InstallAll.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/InstallAll.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/JsFixtures.php b/lib/Alchemy/Phrasea/Command/Developer/JsFixtures.php
index 7a825bc7f6..a4ac9d8922 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/JsFixtures.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/JsFixtures.php
@@ -30,12 +30,13 @@ class JsFixtures extends Command
protected function doExecute(InputInterface $input, OutputInterface $output)
{
- $dbRefPath = sys_get_temp_dir() . '/db-ref.sqlite';
- if (!file_exists($dbRefPath)) {
+ if (!file_exists($this->container['db.fixture.info']['path'])) {
throw new RuntimeException('You must generate sqlite db first, run "bin/console phraseanet:regenerate-sqlite" command.');
}
- copy($dbRefPath, sys_get_temp_dir().'/db.sqlite');
+ $this->container['orm.em'] = $this->container->extend('orm.em', function($em, $app) {
+ return $app['orm.ems'][$app['db.fixture.hash.key']];
+ });
$sbasId = current($this->container['phraseanet.appbox']->get_databoxes())->get_sbas_id();
$this->writeResponse($output, 'GET', '/login/', '/home/login/index.html');
@@ -55,6 +56,7 @@ class JsFixtures extends Command
private function deleteUser(User $user)
{
+ $user = $this->container['orm.em']->find('Phraseanet:User', $user->getId());
$this->container['manipulator.user']->delete($user);
}
@@ -103,6 +105,9 @@ class JsFixtures extends Command
{
$environment = Application::ENV_TEST;
$app = require __DIR__ . '/../../Application/Root.php';
+ $app['orm.em'] = $app->extend('orm.em', function($em, $app) {
+ return $app['orm.ems'][$app['db.fixture.hash.key']];
+ });
$user = $this->createUser($app);
diff --git a/lib/Alchemy/Phrasea/Command/Developer/LessCompiler.php b/lib/Alchemy/Phrasea/Command/Developer/LessCompiler.php
index c2e880bd1d..07391cb9c7 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/LessCompiler.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/LessCompiler.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php b/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php
index 53473c3b53..33c60bb0ef 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/RegenerateSqliteDb.php
@@ -25,7 +25,6 @@ use Alchemy\Phrasea\Model\Entities\FeedPublisher;
use Alchemy\Phrasea\Model\Entities\FeedToken;
use Alchemy\Phrasea\Model\Entities\LazaretSession;
use Alchemy\Phrasea\Model\Entities\Registration;
-use Alchemy\Phrasea\Model\Entities\Session;
use Alchemy\Phrasea\Model\Entities\Task;
use Alchemy\Phrasea\Model\Entities\Token;
use Alchemy\Phrasea\Model\Entities\User;
@@ -36,7 +35,6 @@ use Alchemy\Phrasea\Model\Entities\UsrListOwner;
use Alchemy\Phrasea\Model\Entities\UsrList;
use Alchemy\Phrasea\Model\Entities\UsrListEntry;
use Alchemy\Phrasea\Model\Entities\StoryWZ;
-use Alchemy\Phrasea\Core\Provider\ORMServiceProvider;
use Alchemy\Phrasea\Model\Entities\WebhookEvent;
use Alchemy\Phrasea\Model\Entities\WebhookEventDelivery;
use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
@@ -61,133 +59,119 @@ class RegenerateSqliteDb extends Command
{
$fs = new Filesystem();
- $source = sys_get_temp_dir().'/db-ref.sqlite';
- $target = sys_get_temp_dir().'/db-ref.sqlite.bkp';
- $json = sys_get_temp_dir().'/fixtures.json';
- $renamed = false;
+ $json = sprintf('%s/fixtures.json', sys_get_temp_dir());
- if (is_file($source)) {
- $renamed = true;
- $fs->rename($source, $target, true);
+ if ($fs->exists($json)) {
+ $fs->remove($json);
}
- try {
- $dbParams = [
- 'driver' => 'pdo_sqlite',
- 'path' => $source,
- 'charset' => 'UTF8',
- ];
+ $this->container['orm.em'] = $this->container->extend('orm.em', function($em, $app) {
+ return $app['orm.ems'][$app['db.fixture.hash.key']];
+ });
- $this->container->register(new ORMServiceProvider());
- $this->container['EM.dbal-conf'] = $dbParams;
+ $em = $this->container['orm.em'];
- $metadatas = $this->container['EM']->getMetadataFactory()->getAllMetadata();
- $schemaTool = new SchemaTool($this->container['EM']);
- $schemaTool->createSchema($metadatas);
-
- $fixtures = [];
-
- $DI = new \Pimple();
-
- $this->generateUsers($this->container['EM'], $DI);
- $this->insertOauthApps($DI);
- $this->insertOauthAccounts($DI);
- $this->insertNativeApps();
- $this->generateCollection($DI);
- $this->generateRecord($DI);
- $this->insertTwoTasks($this->container['EM']);
- $this->insertTwoBasket($this->container['EM'], $DI);
- $this->insertOneStoryInWz($this->container['EM'], $DI);
- $this->insertUsrLists($this->container['EM'], $DI);
- $this->insertOnePrivateFeed($this->container['EM'], $DI);
- $this->insertOnePublicFeed($this->container['EM'], $DI);
- $this->insertOneExtraFeed($this->container['EM'], $DI);
- $this->insertOneAggregateToken($this->container['EM'], $DI);
- $this->insertLazaretFiles($this->container['EM'], $DI);
- $this->insertAuthFailures($this->container['EM'], $DI);
- $this->insertOneRegistration($DI, $this->container['EM'], $DI['user_alt1'], $DI['coll'], 'now', 'registration_1');
- $this->insertOneRegistration($DI, $this->container['EM'], $DI['user_alt2'], $DI['coll'], '-3 months', 'registration_2');
- $this->insertOneRegistration($DI, $this->container['EM'], $DI['user_notAdmin'], $DI['coll'], 'now', 'registration_3');
- $this->insertTwoTokens($this->container['EM'], $DI);
- $this->insertOneInvalidToken($this->container['EM'], $DI);
- $this->insertOneValidationToken($this->container['EM'], $DI);
- $this->insertWebhookEvent($this->container['EM'], $DI);
- $this->insertWebhookEventDelivery($this->container['EM'], $DI);
-
- $this->container['EM']->flush();
-
- $fixtures['basket']['basket_1'] = $DI['basket_1']->getId();
- $fixtures['basket']['basket_2'] = $DI['basket_2']->getId();
- $fixtures['basket']['basket_3'] = $DI['basket_3']->getId();
- $fixtures['basket']['basket_4'] = $DI['basket_4']->getId();
-
- $fixtures['token']['token_1'] = $DI['token_1']->getValue();
- $fixtures['token']['token_2'] = $DI['token_2']->getValue();
- $fixtures['token']['token_invalid'] = $DI['token_invalid']->getValue();
- $fixtures['token']['token_validation'] = $DI['token_validation']->getValue();
-
- $fixtures['user']['test_phpunit'] = $DI['user']->getId();
- $fixtures['user']['test_phpunit_not_admin'] = $DI['user_notAdmin']->getId();
- $fixtures['user']['test_phpunit_alt1'] = $DI['user_alt1']->getId();
- $fixtures['user']['test_phpunit_alt2'] = $DI['user_alt2']->getId();
- $fixtures['user']['user_guest'] = $DI['user_guest']->getId();
-
- $fixtures['oauth']['user'] = $DI['api-app-user']->getId();
- $fixtures['oauth']['acc-user'] = $DI['api-app-acc-user']->getId();
- $fixtures['oauth']['user-not-admin'] = $DI['api-app-user-not-admin']->getId();
- $fixtures['oauth']['acc-user-not-admin'] = $DI['api-app-acc-user-not-admin']->getId();
-
- $fixtures['databox']['records'] = $DI['databox']->get_sbas_id();
-
- $fixtures['collection']['coll'] = $DI['coll']->get_base_id();
- $fixtures['collection']['coll_no_access'] = $DI['coll_no_access']->get_base_id();
- $fixtures['collection']['coll_no_status'] = $DI['coll_no_status']->get_base_id();
-
- $fixtures['record']['record_story_1'] = $DI['record_story_1']->get_record_id();
- $fixtures['record']['record_story_2'] = $DI['record_story_2']->get_record_id();
- $fixtures['record']['record_story_3'] = $DI['record_story_3']->get_record_id();
-
- $fixtures['record']['record_1'] = $DI['record_1']->get_record_id();
- $fixtures['record']['record_2'] = $DI['record_2']->get_record_id();
- $fixtures['record']['record_3'] = $DI['record_3']->get_record_id();
- $fixtures['record']['record_4'] = $DI['record_4']->get_record_id();
- $fixtures['record']['record_5'] = $DI['record_5']->get_record_id();
- $fixtures['record']['record_6'] = $DI['record_6']->get_record_id();
- $fixtures['record']['record_7'] = $DI['record_7']->get_record_id();
-
- $fixtures['registrations']['registration_1'] = $DI['registration_1']->getId();
- $fixtures['registrations']['registration_2'] = $DI['registration_2']->getId();
- $fixtures['registrations']['registration_3'] = $DI['registration_3']->getId();
-
- $fixtures['lazaret']['lazaret_1'] = $DI['lazaret_1']->getId();
-
- $fixtures['user']['user_1'] = $DI['user_1']->getId();
- $fixtures['user']['user_2'] = $DI['user_1']->getId();
- $fixtures['user']['user_3'] = $DI['user_1']->getId();
- $fixtures['user']['user_1_deleted'] = $DI['user_1_deleted']->getId();
- $fixtures['user']['user_2_deleted'] = $DI['user_2_deleted']->getId();
- $fixtures['user']['user_3_deleted'] = $DI['user_3_deleted']->getId();
- $fixtures['user']['user_template'] = $DI['user_template']->getId();
-
- $fixtures['feed']['public']['feed'] = $DI['feed_public']->getId();
- $fixtures['feed']['public']['entry'] = $DI['feed_public_entry']->getId();
- $fixtures['feed']['public']['token'] = $DI['feed_public_token']->getId();
-
- $fixtures['feed']['private']['feed'] = $DI['feed_private']->getId();
- $fixtures['feed']['private']['entry'] = $DI['feed_private_entry']->getId();
- $fixtures['feed']['private']['token'] = $DI['feed_private_token']->getId();
-
- $fixtures['webhook']['event'] = $DI['event_webhook_1']->getId();
- } catch (\Exception $e) {
- $output->writeln("".$e->getMessage()." ");
- if ($renamed) {
- $fs->remove($source);
- $fs->rename($target, $source);
- }
- throw $e;
+ if ($fs->exists($em->getConnection()->getParams()['path'])) {
+ $fs->remove($em->getConnection()->getParams()['path']);
}
- $fs->remove($target);
+ $schemaTool = new SchemaTool($em);
+ $schemaTool->createSchema($em->getMetadataFactory()->getAllMetadata());
+
+ $fixtures = [];
+
+ $DI = new \Pimple();
+
+ $this->generateUsers($em, $DI);
+ $this->insertOauthApps($DI);
+ $this->insertOauthAccounts($DI);
+ $this->insertNativeApps();
+ $this->generateCollection($DI);
+ $this->generateRecord($DI);
+ $this->insertTwoTasks($em);
+ $this->insertTwoBasket($em, $DI);
+ $this->insertOneStoryInWz($em, $DI);
+ $this->insertUsrLists($em, $DI);
+ $this->insertOnePrivateFeed($em, $DI);
+ $this->insertOnePublicFeed($em, $DI);
+ $this->insertOneExtraFeed($em, $DI);
+ $this->insertOneAggregateToken($em, $DI);
+ $this->insertLazaretFiles($em, $DI);
+ $this->insertAuthFailures($em, $DI);
+ $this->insertOneRegistration($DI, $em, $DI['user_alt1'], $DI['coll'], 'now', 'registration_1');
+ $this->insertOneRegistration($DI, $em, $DI['user_alt2'], $DI['coll'], '-3 months', 'registration_2');
+ $this->insertOneRegistration($DI, $em, $DI['user_notAdmin'], $DI['coll'], 'now', 'registration_3');
+ $this->insertTwoTokens($em, $DI);
+ $this->insertOneInvalidToken($em, $DI);
+ $this->insertOneValidationToken($em, $DI);
+ $this->insertWebhookEvent($em, $DI);
+ $this->insertWebhookEventDelivery($em, $DI);
+
+ $em->flush();
+
+ $fixtures['basket']['basket_1'] = $DI['basket_1']->getId();
+ $fixtures['basket']['basket_2'] = $DI['basket_2']->getId();
+ $fixtures['basket']['basket_3'] = $DI['basket_3']->getId();
+ $fixtures['basket']['basket_4'] = $DI['basket_4']->getId();
+
+ $fixtures['token']['token_1'] = $DI['token_1']->getValue();
+ $fixtures['token']['token_2'] = $DI['token_2']->getValue();
+ $fixtures['token']['token_invalid'] = $DI['token_invalid']->getValue();
+ $fixtures['token']['token_validation'] = $DI['token_validation']->getValue();
+
+ $fixtures['user']['test_phpunit'] = $DI['user']->getId();
+ $fixtures['user']['test_phpunit_not_admin'] = $DI['user_notAdmin']->getId();
+ $fixtures['user']['test_phpunit_alt1'] = $DI['user_alt1']->getId();
+ $fixtures['user']['test_phpunit_alt2'] = $DI['user_alt2']->getId();
+ $fixtures['user']['user_guest'] = $DI['user_guest']->getId();
+
+ $fixtures['oauth']['user'] = $DI['api-app-user']->getId();
+ $fixtures['oauth']['acc-user'] = $DI['api-app-acc-user']->getId();
+ $fixtures['oauth']['user-not-admin'] = $DI['api-app-user-not-admin']->getId();
+ $fixtures['oauth']['acc-user-not-admin'] = $DI['api-app-acc-user-not-admin']->getId();
+
+ $fixtures['databox']['records'] = $DI['databox']->get_sbas_id();
+
+ $fixtures['collection']['coll'] = $DI['coll']->get_base_id();
+ $fixtures['collection']['coll_no_access'] = $DI['coll_no_access']->get_base_id();
+ $fixtures['collection']['coll_no_status'] = $DI['coll_no_status']->get_base_id();
+
+ $fixtures['record']['record_story_1'] = $DI['record_story_1']->get_record_id();
+ $fixtures['record']['record_story_2'] = $DI['record_story_2']->get_record_id();
+ $fixtures['record']['record_story_3'] = $DI['record_story_3']->get_record_id();
+
+ $fixtures['record']['record_1'] = $DI['record_1']->get_record_id();
+ $fixtures['record']['record_2'] = $DI['record_2']->get_record_id();
+ $fixtures['record']['record_3'] = $DI['record_3']->get_record_id();
+ $fixtures['record']['record_4'] = $DI['record_4']->get_record_id();
+ $fixtures['record']['record_5'] = $DI['record_5']->get_record_id();
+ $fixtures['record']['record_6'] = $DI['record_6']->get_record_id();
+ $fixtures['record']['record_7'] = $DI['record_7']->get_record_id();
+
+ $fixtures['registrations']['registration_1'] = $DI['registration_1']->getId();
+ $fixtures['registrations']['registration_2'] = $DI['registration_2']->getId();
+ $fixtures['registrations']['registration_3'] = $DI['registration_3']->getId();
+
+ $fixtures['lazaret']['lazaret_1'] = $DI['lazaret_1']->getId();
+
+ $fixtures['user']['user_1'] = $DI['user_1']->getId();
+ $fixtures['user']['user_2'] = $DI['user_1']->getId();
+ $fixtures['user']['user_3'] = $DI['user_1']->getId();
+ $fixtures['user']['user_1_deleted'] = $DI['user_1_deleted']->getId();
+ $fixtures['user']['user_2_deleted'] = $DI['user_2_deleted']->getId();
+ $fixtures['user']['user_3_deleted'] = $DI['user_3_deleted']->getId();
+ $fixtures['user']['user_template'] = $DI['user_template']->getId();
+
+ $fixtures['feed']['public']['feed'] = $DI['feed_public']->getId();
+ $fixtures['feed']['public']['entry'] = $DI['feed_public_entry']->getId();
+ $fixtures['feed']['public']['token'] = $DI['feed_public_token']->getId();
+
+ $fixtures['feed']['private']['feed'] = $DI['feed_private']->getId();
+ $fixtures['feed']['private']['entry'] = $DI['feed_private_entry']->getId();
+ $fixtures['feed']['private']['token'] = $DI['feed_private_token']->getId();
+
+ $fixtures['webhook']['event'] = $DI['event_webhook_1']->getId();
+
$fs->dumpFile($json, json_encode($fixtures, defined('JSON_PRETTY_PRINT') ? JSON_PRETTY_PRINT : 0));
return 0;
@@ -195,23 +179,28 @@ class RegenerateSqliteDb extends Command
private function insertOauthApps(\Pimple $DI)
{
- $DI['api-app-user'] = $this->container['manipulator.api-application']->create(
- 'test application for user',
- ApiApplication::WEB_TYPE,
- 'an api application description',
- 'http://website.com/',
- $DI['user'],
- 'http://callback.com/callback/'
- );
+ if (null === $DI['api-app-user'] = $this->container['repo.api-applications']->findOneByName('api-app-user')) {
+ $DI['api-app-user'] = $this->container['manipulator.api-application']->create(
+ 'test-web',
+ ApiApplication::WEB_TYPE,
+ '',
+ 'http://website.com/',
+ $DI['user'],
+ 'http://callback.com/callback/'
+ );
+ }
+
+ if (null === $DI['api-app-user-not-admin'] = $this->container['repo.api-applications']->findOneByName('test-desktop')) {
+ $DI['api-app-user-not-admin'] = $this->container['manipulator.api-application']->create(
+ 'test-desktop',
+ ApiApplication::WEB_TYPE,
+ '',
+ 'http://website.com/',
+ $DI['user_notAdmin'],
+ 'http://callback.com/callback/'
+ );
+ }
- $DI['api-app-user-not-admin'] = $this->container['manipulator.api-application']->create(
- 'test application for user',
- ApiApplication::WEB_TYPE,
- 'an api application description',
- 'http://website.com/',
- $DI['user_notAdmin'],
- 'http://callback.com/callback/'
- );
}
public function insertOauthAccounts(\Pimple $DI)
diff --git a/lib/Alchemy/Phrasea/Command/Developer/RoutesDumper.php b/lib/Alchemy/Phrasea/Command/Developer/RoutesDumper.php
index 2c26cb0d20..1523d7af60 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/RoutesDumper.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/RoutesDumper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/SetupTestsDbs.php b/lib/Alchemy/Phrasea/Command/Developer/SetupTestsDbs.php
index eeef2e86d5..438420edb3 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/SetupTestsDbs.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/SetupTestsDbs.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -44,22 +44,22 @@ class SetupTestsDbs extends Command
$dbs[] = $settings['database']['ab_name'];
$dbs[] = $settings['database']['db_name'];
- $schema = $this->container['EM']->getConnection()->getSchemaManager();
+ $schema = $this->container['orm.em']->getConnection()->getSchemaManager();
foreach($dbs as $name) {
$output->writeln('Creating database "'.$name.'"...OK ');
$schema->dropAndCreateDatabase($name);
}
- $this->container['EM']->getConnection()->executeUpdate('
+ $this->container['orm.em']->getConnection()->executeUpdate('
GRANT ALL PRIVILEGES ON '.$settings['database']['ab_name'].'.* TO \''.$settings['database']['user'].'\'@\''.$settings['database']['host'].'\' IDENTIFIED BY \''.$settings['database']['password'].'\' WITH GRANT OPTION
');
- $this->container['EM']->getConnection()->executeUpdate('
+ $this->container['orm.em']->getConnection()->executeUpdate('
GRANT ALL PRIVILEGES ON '.$settings['database']['db_name'].'.* TO \''.$settings['database']['user'].'\'@\''.$settings['database']['host'].'\' IDENTIFIED BY \''.$settings['database']['password'].'\' WITH GRANT OPTION
');
- $this->container['EM']->getConnection()->executeUpdate('SET @@global.sql_mode= ""');
+ $this->container['orm.em']->getConnection()->executeUpdate('SET @@global.sql_mode= ""');
return 0;
}
diff --git a/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php b/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php
index 822a55908d..8f4098c4ec 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/Uninstaller.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/Utils/BowerDriver.php b/lib/Alchemy/Phrasea/Command/Developer/Utils/BowerDriver.php
index 6625ceb8bc..48628daee3 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/Utils/BowerDriver.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/Utils/BowerDriver.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/Utils/ComposerDriver.php b/lib/Alchemy/Phrasea/Command/Developer/Utils/ComposerDriver.php
index 2d7a4bd5f2..572cd9f42e 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/Utils/ComposerDriver.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/Utils/ComposerDriver.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/Utils/RecessDriver.php b/lib/Alchemy/Phrasea/Command/Developer/Utils/RecessDriver.php
index f49899f988..f4e5db4abd 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/Utils/RecessDriver.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/Utils/RecessDriver.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Developer/Utils/UglifyJsDriver.php b/lib/Alchemy/Phrasea/Command/Developer/Utils/UglifyJsDriver.php
index 73c93bff02..cf6a0f5b88 100644
--- a/lib/Alchemy/Phrasea/Command/Developer/Utils/UglifyJsDriver.php
+++ b/lib/Alchemy/Phrasea/Command/Developer/Utils/UglifyJsDriver.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/MailTest.php b/lib/Alchemy/Phrasea/Command/MailTest.php
index ee94a4de5a..3a27989ff8 100644
--- a/lib/Alchemy/Phrasea/Command/MailTest.php
+++ b/lib/Alchemy/Phrasea/Command/MailTest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php b/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php
index 9d3ae8e735..c12bc83ca6 100644
--- a/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php
+++ b/lib/Alchemy/Phrasea/Command/Plugin/AbstractPluginCommand.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Plugin/AddPlugin.php b/lib/Alchemy/Phrasea/Command/Plugin/AddPlugin.php
index b3da2e4604..adae116434 100644
--- a/lib/Alchemy/Phrasea/Command/Plugin/AddPlugin.php
+++ b/lib/Alchemy/Phrasea/Command/Plugin/AddPlugin.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -40,7 +40,7 @@ class AddPlugin extends AbstractPluginCommand
$manifest = $this->container['plugins.plugins-validator']->validatePlugin($temporaryDir);
$output->writeln(" OK found ".$manifest->getName()." ");
- $targetDir = $this->container['plugins.directory'] . DIRECTORY_SEPARATOR . $manifest->getName();
+ $targetDir = $this->container['plugin.path'] . DIRECTORY_SEPARATOR . $manifest->getName();
$output->write("Setting up composer...");
$this->container['plugins.composer-installer']->install($temporaryDir);
diff --git a/lib/Alchemy/Phrasea/Command/Plugin/ListPlugin.php b/lib/Alchemy/Phrasea/Command/Plugin/ListPlugin.php
index 3da4c15332..0209d76350 100644
--- a/lib/Alchemy/Phrasea/Command/Plugin/ListPlugin.php
+++ b/lib/Alchemy/Phrasea/Command/Plugin/ListPlugin.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Plugin/RemovePlugin.php b/lib/Alchemy/Phrasea/Command/Plugin/RemovePlugin.php
index a40b64e27f..8da24288dc 100644
--- a/lib/Alchemy/Phrasea/Command/Plugin/RemovePlugin.php
+++ b/lib/Alchemy/Phrasea/Command/Plugin/RemovePlugin.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -40,7 +40,7 @@ class RemovePlugin extends AbstractPluginCommand
$this->container['plugins.assets-manager']->remove($name);
$output->writeln(" OK ");
- $path = $this->container['plugins.directory'] . DIRECTORY_SEPARATOR . $name;
+ $path = $this->container['plugin.path'] . DIRECTORY_SEPARATOR . $name;
$output->write("Removing $name ...");
$this->container['filesystem']->remove($path);
diff --git a/lib/Alchemy/Phrasea/Command/RecordAdd.php b/lib/Alchemy/Phrasea/Command/RecordAdd.php
index 8e64ce657d..11369e3126 100644
--- a/lib/Alchemy/Phrasea/Command/RecordAdd.php
+++ b/lib/Alchemy/Phrasea/Command/RecordAdd.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -83,7 +83,7 @@ class RecordAdd extends Command
$file = new File($this->container, $media, $collection, $originalName);
$session = new LazaretSession();
- $this->container['EM']->persist($session);
+ $this->container['orm.em']->persist($session);
$forceBehavior = null;
diff --git a/lib/Alchemy/Phrasea/Command/RescanTechnicalDatas.php b/lib/Alchemy/Phrasea/Command/RescanTechnicalDatas.php
index 6cfff7d3f1..d5358c314a 100644
--- a/lib/Alchemy/Phrasea/Command/RescanTechnicalDatas.php
+++ b/lib/Alchemy/Phrasea/Command/RescanTechnicalDatas.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php b/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php
index 70f6e10cbb..b3f58f1c96 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/CheckEnvironment.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Setup/CrossDomainGenerator.php b/lib/Alchemy/Phrasea/Command/Setup/CrossDomainGenerator.php
index 636824f1a9..e0517f3db8 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/CrossDomainGenerator.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/CrossDomainGenerator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Setup/H264ConfigurationDumper.php b/lib/Alchemy/Phrasea/Command/Setup/H264ConfigurationDumper.php
index 103efb04f4..f056ed386d 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/H264ConfigurationDumper.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/H264ConfigurationDumper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Setup/H264MappingGenerator.php b/lib/Alchemy/Phrasea/Command/Setup/H264MappingGenerator.php
index c66f94a31c..9e0fd0a676 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/H264MappingGenerator.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/H264MappingGenerator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Command\Setup;
use Alchemy\Phrasea\Command\Command;
use Alchemy\Phrasea\Http\H264PseudoStreaming\H264Factory;
+use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
use Symfony\Component\Console\Input\InputArgument;
use Symfony\Component\Console\Input\InputInterface;
use Symfony\Component\Console\Output\OutputInterface;
@@ -52,7 +53,7 @@ class H264MappingGenerator extends Command
$conf = [
'enabled' => $enabled,
'type' => $type,
- 'mapping' => array_replace_recursive($mode->getMapping(), $currentMapping),
+ 'mapping' => $mode->getMapping(),
];
if ($input->getOption('write')) {
@@ -77,7 +78,11 @@ class H264MappingGenerator extends Command
$ret = [];
foreach ($paths as $path) {
- $ret[$path] = $this->pathsToConf($path);
+ $sanitizedPath = rtrim($path, '/');
+ if (array_key_exists($sanitizedPath, $ret)) {
+ continue;
+ }
+ $ret[$sanitizedPath] = $this->pathsToConf($sanitizedPath);
}
return $ret;
@@ -88,7 +93,7 @@ class H264MappingGenerator extends Command
static $n = 0;
$n++;
- return ['mount-point' => 'mp4-videos-'.$n, 'directory' => $path, 'passphrase' => \random::generatePassword(32)];
+ return ['mount-point' => 'mp4-videos-'.$n, 'directory' => $path, 'passphrase' => $this->container['random.low']->generateString(32, TokenManipulator::LETTERS_AND_NUMBERS)];
}
private function extractPath(\appbox $appbox)
diff --git a/lib/Alchemy/Phrasea/Command/Setup/Install.php b/lib/Alchemy/Phrasea/Command/Setup/Install.php
index bd637738ca..961113eb4e 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/Install.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/Install.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -93,6 +93,7 @@ class Install extends Command
}
$abConn = $this->getABConn($input, $output, $dialog);
+
list($dbConn, $template) = $this->getDBConn($input, $output, $abConn, $dialog);
list($email, $password) = $this->getCredentials($input, $output, $dialog);
$dataPath = $this->getDataPath($input, $output, $dialog);
@@ -126,7 +127,7 @@ class Install extends Command
private function getABConn(InputInterface $input, OutputInterface $output, DialogHelper $dialog)
{
- $abConn = null;
+ $abConn = $info = null;
if (!$input->getOption('appbox')) {
$output->writeln("\n--- Database credentials --- \n");
@@ -137,14 +138,15 @@ class Install extends Command
$dbPassword = $dialog->askHiddenResponse($output, "DB password (hidden) : ");
$abName = $dialog->ask($output, "DB name (phraseanet) : ", 'phraseanet');
+ $info = [
+ 'host' => $hostname,
+ 'port' => $port,
+ 'user' => $dbUser,
+ 'password' => $dbPassword,
+ 'dbname' => $abName,
+ ];
try {
- $abConn = $this->container['dbal.provider']->get([
- 'host' => $hostname,
- 'port' => $port,
- 'user' => $dbUser,
- 'password' => $dbPassword,
- 'dbname' => $abName,
- ]);
+ $abConn = $this->container['dbal.provider']($info);
$abConn->connect();
$output->writeln("\n\tApplication-Box : Connection successful ! \n");
} catch (\Exception $e) {
@@ -152,23 +154,31 @@ class Install extends Command
}
} while (!$abConn);
} else {
- $abConn = $this->container['dbal.provider']->get([
+ $info = [
'host' => $input->getOption('db-host'),
'port' => $input->getOption('db-port'),
'user' => $input->getOption('db-user'),
'password' => $input->getOption('db-password'),
'dbname' => $input->getOption('appbox'),
- ]);
+ ];
+
+ $abConn = $this->container['dbal.provider']($info);
$abConn->connect();
$output->writeln("\n\tApplication-Box : Connection successful ! \n");
}
+ // add dbs.option & orm.options services to use orm.em later
+ if ($abConn && $info) {
+ $this->container['dbs.options'] = array_merge($this->container['db.options.from_info']($info), $this->container['dbs.options']);
+ $this->container['orm.ems.options'] = array_merge($this->container['orm.em.options.from_info']($info), $this->container['orm.ems.options']);
+ }
+
return $abConn;
}
private function getDBConn(InputInterface $input, OutputInterface $output, Connection $abConn, DialogHelper $dialog)
{
- $dbConn = $template = null;
+ $dbConn = $template = $info = null;
if (!$input->getOption('databox')) {
do {
$retry = false;
@@ -176,13 +186,15 @@ class Install extends Command
if ($dbName) {
try {
- $dbConn = $this->container['dbal.provider']->get([
+ $info = [
'host' => $abConn->getHost(),
'port' => $abConn->getPort(),
'user' => $abConn->getUsername(),
'password' => $abConn->getPassword(),
'dbname' => $dbName,
- ]);
+ ];
+
+ $dbConn = $this->container['dbal.provider']($info);
$dbConn->connect();
$output->writeln("\n\tData-Box : Connection successful ! \n");
@@ -199,18 +211,26 @@ class Install extends Command
}
} while ($retry);
} else {
- $dbConn = $this->container['dbal.provider']->get([
+ $info = [
'host' => $input->getOption('db-host'),
'port' => $input->getOption('db-port'),
'user' => $input->getOption('db-user'),
'password' => $input->getOption('db-password'),
'dbname' => $input->getOption('databox'),
- ]);
+ ];
+
+ $dbConn = $this->container['dbal.provider']($info);
$dbConn->connect();
$output->writeln("\n\tData-Box : Connection successful ! \n");
$template = $input->getOption('db-template') ? : 'en';
}
+ // add dbs.option & orm.options services to use orm.em later
+ if ($dbConn && $info) {
+ $this->container['dbs.options'] = array_merge($this->container['db.options.from_info']($info), $this->container['dbs.options']);
+ $this->container['orm.ems.options'] = array_merge($this->container['orm.em.options.from_info']($info), $this->container['orm.ems.options']);
+ }
+
return [$dbConn, $template];
}
diff --git a/lib/Alchemy/Phrasea/Command/Setup/PluginsReset.php b/lib/Alchemy/Phrasea/Command/Setup/PluginsReset.php
index ee9aa660f8..aca8b5a542 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/PluginsReset.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/PluginsReset.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -26,8 +26,8 @@ class PluginsReset extends Command
protected function doExecute(InputInterface $input, OutputInterface $output)
{
- $this->container['filesystem']->remove($this->container['plugins.directory']);
- $this->container['filesystem']->mirror(__DIR__ . '/../../../../conf.d/plugins', $this->container['plugins.directory']);
+ $this->container['filesystem']->remove($this->container['plugin.path']);
+ $this->container['filesystem']->mirror(__DIR__ . '/../../../../conf.d/plugins', $this->container['plugin.path']);
return 0;
}
diff --git a/lib/Alchemy/Phrasea/Command/Setup/StaticConfigurationDumper.php b/lib/Alchemy/Phrasea/Command/Setup/StaticConfigurationDumper.php
deleted file mode 100644
index 7b600a4836..0000000000
--- a/lib/Alchemy/Phrasea/Command/Setup/StaticConfigurationDumper.php
+++ /dev/null
@@ -1,56 +0,0 @@
-setDescription('Dump the virtual host configuration depending on Phraseanet configuration');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function doExecute(InputInterface $input, OutputInterface $output)
- {
- $output->writeln('');
-
- if (!$this->container['phraseanet.static-file-factory']->isStaticFileModeEnabled()) {
- $output->writeln('Static file support is disabled ');
- $ret = 1;
- } else {
- $output->writeln('Static file support is enabled ');
- $ret = 0;
- }
-
- try {
- $configuration = $this->container['phraseanet.static-file-factory']->getMode(true, true)->getVirtualHostConfiguration();
- $output->writeln('Static file configuration seems OK ');
- $output->writeln($configuration);
- } catch (RuntimeException $e) {
- $output->writeln('Static file configuration seems invalid ');
- $ret = 1;
- }
-
- $output->writeln('');
-
- return $ret;
- }
-}
diff --git a/lib/Alchemy/Phrasea/Command/Setup/StaticMappingGenerator.php b/lib/Alchemy/Phrasea/Command/Setup/StaticMappingGenerator.php
deleted file mode 100644
index 1ecaff8592..0000000000
--- a/lib/Alchemy/Phrasea/Command/Setup/StaticMappingGenerator.php
+++ /dev/null
@@ -1,64 +0,0 @@
-addOption('write', 'w', null, 'Writes the configuration')
- ->addOption('enabled', 'e', null, 'Set the enable toggle to `true`')
- ->addArgument('type', InputArgument::REQUIRED, 'The configuration type, either `nginx` or `apache`')
- ->setDescription('Generates Phraseanet Static file configuration');
- }
-
- /**
- * {@inheritdoc}
- */
- protected function doExecute(InputInterface $input, OutputInterface $output)
- {
- $enabled = $input->getOption('enabled');
- $type = strtolower($input->getArgument('type'));
-
- $factory = new StaticFileFactory($this->container['monolog'], true, $type, $this->container['phraseanet.thumb-symlinker']);
- $mode = $factory->getMode(true);
-
- $conf = array(
- 'enabled' => $enabled,
- 'type' => $type,
- 'mapping' => $mode->getMapping(),
- );
-
- if ($input->getOption('write')) {
- $output->write("Writing configuration ...");
- $this->container['phraseanet.configuration']['static-file'] = $conf;
- $output->writeln(" OK ");
- $output->writeln("");
- $output->write("It is now strongly recommended to use static-file:dump-configuration command to upgrade your virtual-host");
- } else {
- $output->writeln("Configuration will not be written, use --write option to write it");
- $output->writeln("");
- $output->writeln(Yaml::dump(array('static-file' => $conf), 4));
- }
-
- return 0;
- }
-}
diff --git a/lib/Alchemy/Phrasea/Command/Setup/XSendFileConfigurationDumper.php b/lib/Alchemy/Phrasea/Command/Setup/XSendFileConfigurationDumper.php
index ec20cfe039..ffa248c863 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/XSendFileConfigurationDumper.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/XSendFileConfigurationDumper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php b/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php
index ad34b56844..ff853e8093 100644
--- a/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php
+++ b/lib/Alchemy/Phrasea/Command/Setup/XSendFileMappingGenerator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Task/TaskRun.php b/lib/Alchemy/Phrasea/Command/Task/TaskRun.php
index 95af57fa06..1190ac3010 100644
--- a/lib/Alchemy/Phrasea/Command/Task/TaskRun.php
+++ b/lib/Alchemy/Phrasea/Command/Task/TaskRun.php
@@ -74,7 +74,7 @@ class TaskRun extends Command
$job->addSubscriber(new MemoryLimitSubscriber($maxMemory, $logger));
}
if ($task->isSingleRun()) {
- $job->addSubscriber(new FinishedJobRemoverSubscriber($this->container['EM']));
+ $job->addSubscriber(new FinishedJobRemoverSubscriber($this->container['orm.em']));
}
$job->run(new JobData($this->container, $task));
diff --git a/lib/Alchemy/Phrasea/Command/Upgrade/DatasUpgraderInterface.php b/lib/Alchemy/Phrasea/Command/Upgrade/DatasUpgraderInterface.php
index a35c511866..87f4714676 100644
--- a/lib/Alchemy/Phrasea/Command/Upgrade/DatasUpgraderInterface.php
+++ b/lib/Alchemy/Phrasea/Command/Upgrade/DatasUpgraderInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Upgrade/Step31.php b/lib/Alchemy/Phrasea/Command/Upgrade/Step31.php
index 4d0768e978..1b0132908b 100644
--- a/lib/Alchemy/Phrasea/Command/Upgrade/Step31.php
+++ b/lib/Alchemy/Phrasea/Command/Upgrade/Step31.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php b/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php
index 2c59a141ff..177c6861dc 100644
--- a/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php
+++ b/lib/Alchemy/Phrasea/Command/Upgrade/Step35.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php b/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php
index 8944acbb5a..1d82c8f7cb 100644
--- a/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php
+++ b/lib/Alchemy/Phrasea/Command/UpgradeDBDatas.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php
index 7dc73aa1fc..b2dcf1ea25 100644
--- a/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php
+++ b/lib/Alchemy/Phrasea/Controller/AbstractDelivery.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -21,7 +21,6 @@ abstract class AbstractDelivery implements ControllerProviderInterface
public function deliverContent(Request $request, \record_adapter $record, $subdef, $watermark, $stamp, Application $app)
{
$file = $record->get_subdef($subdef);
-
$pathOut = $file->get_pathfile();
if ($watermark === true && $file->get_type() === \media_subdef::TYPE_IMAGE) {
@@ -30,43 +29,18 @@ abstract class AbstractDelivery implements ControllerProviderInterface
$pathOut = \recordutils_image::stamp($app, $file);
}
- $log_id = null;
- try {
- $logger = $app['phraseanet.logger']($record->get_databox());
- $log_id = $logger->get_id();
-
- $referrer = 'NO REFERRER';
-
- if (isset($_SERVER['HTTP_REFERER'])) {
- $referrer = $_SERVER['HTTP_REFERER'];
- }
-
- $record->log_view($log_id, $referrer, $app['conf']->get(['main', 'key']));
- } catch (\Exception $e) {
-
- }
-
$disposition = $request->query->get('download') ? DeliverDataInterface::DISPOSITION_ATTACHMENT : DeliverDataInterface::DISPOSITION_INLINE;
$response = $app['phraseanet.file-serve']->deliverFile($pathOut, $file->get_file(), $disposition, $file->get_mime());
- $response->setPrivate();
- /* @var $response \Symfony\Component\HttpFoundation\Response */
- if ($file->getEtag()) {
- $response->setEtag($file->getEtag());
- $response->setLastModified($file->get_modification_date());
- }
-
- if (false === $record->is_grouping() && $subdef !== 'document') {
+ if (in_array($subdef, array('document', 'preview'))) {
+ $response->setPrivate();
+ $this->logView($app, $record, $request);
+ } elseif ($subdef !== 'thumbnail') {
try {
- if ($file->getDataboxSubdef()->get_class() == \databox_subdef::CLASS_THUMBNAIL) {
- // default expiration is 5 days
- $expiration = 60 * 60 * 24 * 5;
- $response->setExpires(new \DateTime(sprintf('+%d seconds', $expiration)));
-
- $response->setMaxAge($expiration);
- $response->setSharedMaxAge($expiration);
- $response->setPublic();
+ if ($file->getDataboxSubdef()->get_class() != \databox_subdef::CLASS_THUMBNAIL) {
+ $response->setPrivate();
+ $this->logView($app, $record, $request);
}
} catch (\Exception $e) {
@@ -77,4 +51,15 @@ abstract class AbstractDelivery implements ControllerProviderInterface
return $response;
}
+
+ private function logView(Application $app, \record_adapter $record, Request $request)
+ {
+ try {
+ $logger = $app['phraseanet.logger']($record->get_databox());
+ $log_id = $logger->get_id();
+ $record->log_view($log_id, $request->headers->get('referer', 'NO REFERRER'), $app['phraseanet.configuration']['main']['key']);
+ } catch (\Exception $e) {
+
+ }
+ }
}
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Collection.php b/lib/Alchemy/Phrasea/Controller/Admin/Collection.php
index 1e937d8c7e..0d1d5ad807 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Collection.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Collection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -105,15 +105,6 @@ class Collection implements ControllerProviderInterface
$controllers->post('/{bas_id}/picture/stamp-logo/delete/', 'controller.admin.collection:deleteStamp')
->assert('bas_id', '\d+')
->bind('admin_collection_delete_stamp');
-
- $controllers->post('/{bas_id}/picture/banner/', 'controller.admin.collection:setBanner')
- ->assert('bas_id', '\d+')
- ->bind('admin_collection_submit_banner');
-
- $controllers->post('/{bas_id}/picture/banner/delete/', 'controller.admin.collection:deleteBanner')
- ->assert('bas_id', '\d+')
- ->bind('admin_collection_delete_banner');
-
$controllers->get('/{bas_id}/informations/details/', 'controller.admin.collection:getDetails')
->assert('bas_id', '\d+')
->bind('admin_collection_display_document_details');
@@ -267,41 +258,6 @@ class Collection implements ControllerProviderInterface
]);
}
- /**
- * Delete the collection banner
- *
- * @param Application $app The silex application
- * @param Request $request The current request
- * @param integer $bas_id The collection base_id
- * @return JsonResponse|RedirectResponse
- */
- public function deleteBanner(Application $app, Request $request, $bas_id)
- {
- $success = false;
-
- $collection = \collection::get_from_base_id($app, $bas_id);
-
- try {
- $app['phraseanet.appbox']->write_collection_pic($app['media-alchemyst'], $app['filesystem'], $collection, null, \collection::PIC_PRESENTATION);
- $success = true;
- } catch (\Exception $e) {
-
- }
-
- if ('json' === $app['request']->getRequestFormat()) {
- return $app->json([
- 'success' => $success,
- 'msg' => $success ? $app->trans('Successful removal') : $app->trans('An error occured'),
- 'bas_id' => $collection->get_base_id()
- ]);
- }
-
- return $app->redirectPath('admin_display_collection', [
- 'bas_id' => $collection->get_base_id(),
- 'success' => (int) $success,
- ]);
- }
-
/**
* Delete the collection stamp
*
@@ -408,56 +364,6 @@ class Collection implements ControllerProviderInterface
]);
}
- /**
- * Set a collection banner
- *
- * @param Application $app The silex application
- * @param Request $request The current request
- * @param integer $bas_id The collection base_id
- * @return RedirectResponse
- */
- public function setBanner(Application $app, Request $request, $bas_id)
- {
- if (null === $file = $request->files->get('newBanner')) {
- $app->abort(400);
- }
-
- if ($file->getClientSize() > 1024 * 1024) {
- return $app->redirectPath('admin_display_collection', [
- 'bas_id' => $bas_id,
- 'success' => 0,
- 'error' => 'file-too-big',
- ]);
- }
-
- if (!$file->isValid()) {
- return $app->redirectPath('admin_display_collection', [
- 'bas_id' => $bas_id,
- 'success' => 0,
- 'error' => 'file-invalid',
- ]);
- }
-
- $collection = \collection::get_from_base_id($app, $bas_id);
-
- try {
- $app['phraseanet.appbox']->write_collection_pic($app['media-alchemyst'], $app['filesystem'], $collection, $file, \collection::PIC_PRESENTATION);
-
- $app['filesystem']->remove($file->getPathname());
- } catch (\Exception $e) {
- return $app->redirectPath('admin_display_collection', [
- 'bas_id' => $bas_id,
- 'success' => 0,
- 'error' => 'file-error',
- ]);
- }
-
- return $app->redirectPath('admin_display_collection', [
- 'bas_id' => $bas_id,
- 'success' => 1,
- ]);
- }
-
/**
* Set a collection stamp
*
@@ -631,7 +537,6 @@ class Collection implements ControllerProviderInterface
$msg = $app->trans('Successful removal');
}
} catch (\Exception $e) {
-
}
if ('json' === $app['request']->getRequestFormat()) {
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php b/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php
index 172acc8978..6ed8fe1b67 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/ConnectedUsers.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -47,7 +47,7 @@ class ConnectedUsers implements ControllerProviderInterface
$date = new \DateTime('-2 hours');
$params = ['date' => $date->format('Y-m-d h:i:s')];
- $query = $app['EM']->createQuery($dql);
+ $query = $app['orm.em']->createQuery($dql);
$query->setParameters($params);
$sessions = $query->getResult();
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php b/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php
index cb604fa485..4f21177602 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Dashboard.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Databox.php b/lib/Alchemy/Phrasea/Controller/Admin/Databox.php
index 24943d81a6..ee3fc77f34 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Databox.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Databox.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php b/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php
index 004ef96117..b2f78f8cd4 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Databoxes.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -115,6 +115,9 @@ class Databoxes implements ControllerProviderInterface
case 'mount-failed' :
$errorMsg = $app->trans('Database could not be mounted');
break;
+ case 'innodb-support' :
+ $errorMsg = _('Database server does not support InnoDB storage engine');
+ break;
}
return $app['twig']->render('admin/databases.html.twig', [
@@ -155,7 +158,7 @@ class Databoxes implements ControllerProviderInterface
$dataTemplate = new \SplFileInfo($app['root.path'] . '/lib/conf.d/data_templates/' . $dataTemplate . '.xml');
try {
- $connbas = $app['dbal.provider']->get([
+ $connbas = $app['dbal.provider']([
'host' => $hostname,
'port' => $port,
'user' => $user,
@@ -172,6 +175,7 @@ class Databoxes implements ControllerProviderInterface
$base->registerAdmin($app['authentication']->getUser());
$app['acl']->get($app['authentication']->getUser())->delete_data_from_cache();
+ $connbas->close();
return $app->redirectPath('admin_database', ['databox_id' => $base->get_sbas_id(), 'success' => 1, 'reload-tree' => 1]);
} catch (\Exception $e) {
return $app->redirectPath('admin_databases', ['success' => 0, 'error' => 'base-failed']);
@@ -188,7 +192,7 @@ class Databoxes implements ControllerProviderInterface
try {
$data_template = new \SplFileInfo($app['root.path'] . '/lib/conf.d/data_templates/' . $dataTemplate . '.xml');
- $connbas = $app['dbal.provider']->get([
+ $connbas = $app['db.provider']([
'host' => $hostname,
'port' => $port,
'user' => $userDb,
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php
index 015dd54d8d..bbbbf967fb 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Fields.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Fields.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Publications.php b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php
index 5cbe535ccd..45fefa7c0c 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Publications.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Publications.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -67,10 +67,10 @@ class Publications implements ControllerProviderInterface
$publisher->setFeed($feed);
- $app['EM']->persist($feed);
- $app['EM']->persist($publisher);
+ $app['orm.em']->persist($feed);
+ $app['orm.em']->persist($publisher);
- $app['EM']->flush();
+ $app['orm.em']->flush();
return $app->redirectPath('admin_feeds_list');
})->bind('admin_feeds_create');
@@ -101,8 +101,8 @@ class Publications implements ControllerProviderInterface
$feed->setSubtitle($request->request->get('subtitle', ''));
$feed->setCollection($collection);
$feed->setIsPublic('1' === $request->request->get('public'));
- $app['EM']->persist($feed);
- $app['EM']->flush();
+ $app['orm.em']->persist($feed);
+ $app['orm.em']->flush();
return $app->redirectPath('admin_feeds_list');
})->before(function (Request $request) use ($app) {
@@ -171,8 +171,8 @@ class Publications implements ControllerProviderInterface
unset($media);
$feed->setIconUrl(true);
- $app['EM']->persist($feed);
- $app['EM']->flush();
+ $app['orm.em']->persist($feed);
+ $app['orm.em']->flush();
$app['filesystem']->copy($tmpname, $app['root.path'] . '/config/feed_' . $feed->getId() . '.jpg');
$app['filesystem']->copy($tmpname, sprintf('%s/www/custom/feed_%d.jpg', $app['root.path'], $feed->getId()));
@@ -202,10 +202,10 @@ class Publications implements ControllerProviderInterface
$feed->addPublisher($publisher);
- $app['EM']->persist($feed);
- $app['EM']->persist($publisher);
+ $app['orm.em']->persist($feed);
+ $app['orm.em']->persist($publisher);
- $app['EM']->flush();
+ $app['orm.em']->flush();
} catch (\Exception $e) {
$error = "An error occured";
}
@@ -230,8 +230,8 @@ class Publications implements ControllerProviderInterface
if ($feed->isPublisher($user) && !$feed->isOwner($user)) {
$feed->removePublisher($publisher);
- $app['EM']->remove($publisher);
- $app['EM']->flush();
+ $app['orm.em']->remove($publisher);
+ $app['orm.em']->flush();
}
} catch (\Exception $e) {
$error = "An error occured";
@@ -254,8 +254,8 @@ class Publications implements ControllerProviderInterface
unlink('custom/feed_' . $feed->getId() . '.jpg');
}
- $app['EM']->remove($feed);
- $app['EM']->flush();
+ $app['orm.em']->remove($feed);
+ $app['orm.em']->flush();
return $app->redirectPath('admin_feeds_list');
})
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Root.php b/lib/Alchemy/Phrasea/Controller/Admin/Root.php
index 302a314f63..c7055443d5 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Root.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -159,32 +159,29 @@ class Root implements ControllerProviderInterface
})->bind('admin_display_tree');
$controllers->get('/test-paths/', function (Application $app, Request $request) {
-
- if (!$request->isXmlHttpRequest() || !array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
+ if (!$request->isXmlHttpRequest()) {
+ $app->abort(400);
+ }
+ if (!array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
$app->abort(400, $app->trans('Bad request format, only JSON is allowed'));
}
- if (0 !== count($tests = $request->query->get('tests', []))) {
+ if (0 === count($tests = $request->query->get('tests', []))) {
$app->abort(400, $app->trans('Missing tests parameter'));
}
- if (null !== $path = $request->query->get('path')) {
+ if (null === $path = $request->query->get('path')) {
$app->abort(400, $app->trans('Missing path parameter'));
}
foreach ($tests as $test) {
switch ($test) {
case 'writeable':
- if (!is_writable($path)) {
- $result = false;
- }
+ $result = is_writable($path);
break;
case 'readable':
default:
- if (!is_readable($path)) {
- $result = true;
- }
- break;
+ $result = is_readable($path);
}
}
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/SearchEngine.php b/lib/Alchemy/Phrasea/Controller/Admin/SearchEngine.php
index 92fc1bee12..45530d43fd 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/SearchEngine.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/SearchEngine.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Setup.php b/lib/Alchemy/Phrasea/Controller/Admin/Setup.php
index 15fdbf51df..42196b81f9 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Setup.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Setup.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php
index 587cf3dcb0..1476378348 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Subdefs.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php b/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php
index 0ed3fe795a..62af248363 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/TaskManager.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -30,10 +30,12 @@ class TaskManager implements ControllerProviderInterface
$app['firewall']->addMandatoryAuthentication($controllers);
+ $converter = function ($task) use ($app) {
+ return $app['converter.task']->convert($task);
+ };
+
$controllers->before(function (Request $request) use ($app) {
$app['firewall']->requireRight('taskmanager');
- })->convert('task', function ($id) use ($app) {
- return $app['converter.task']->convert($id);
});
$controllers
@@ -70,38 +72,47 @@ class TaskManager implements ControllerProviderInterface
$controllers
->get('/task/{task}/log', 'controller.admin.task:getTaskLog')
+ ->convert('task', $converter)
->bind('admin_tasks_task_log');
$controllers
->post('/task/{task}/delete', 'controller.admin.task:postTaskDelete')
+ ->convert('task', $converter)
->bind('admin_tasks_task_delete');
$controllers
->post('/task/{task}/start', 'controller.admin.task:postStartTask')
+ ->convert('task', $converter)
->bind('admin_tasks_task_start');
$controllers
->post('/task/{task}/stop', 'controller.admin.task:postStopTask')
+ ->convert('task', $converter)
->bind('admin_tasks_task_stop');
$controllers
->post('/task/{task}/resetcrashcounter', 'controller.admin.task:postResetCrashes')
+ ->convert('task', $converter)
->bind('admin_tasks_task_reset');
$controllers
->post('/task/{task}/save', 'controller.admin.task:postSaveTask')
+ ->convert('task', $converter)
->bind('admin_tasks_task_save');
$controllers
->post('/task/{task}/facility', 'controller.admin.task:postTaskFacility')
+ ->convert('task', $converter)
->bind('admin_tasks_task_facility');
$controllers
->post('/task/{task}/xml-from-form', 'controller.admin.task:postXMLFromForm')
+ ->convert('task', $converter)
->bind('admin_tasks_xml_from_form');
$controllers
->get('/task/{task}', 'controller.admin.task:getTask')
+ ->convert('task', $converter)
->bind('admin_tasks_task_show');
$controllers
diff --git a/lib/Alchemy/Phrasea/Controller/Admin/Users.php b/lib/Alchemy/Phrasea/Controller/Admin/Users.php
index fd5fc8a565..70702c73ec 100644
--- a/lib/Alchemy/Phrasea/Controller/Admin/Users.php
+++ b/lib/Alchemy/Phrasea/Controller/Admin/Users.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -648,7 +648,7 @@ class Users implements ControllerProviderInterface
}
$basList = array_keys($app['acl']->get($app['authentication']->getUser())->get_granted_base(['manage']));
- $models = $app['EM.native-query']->getModelForUser($app['authentication']->getUser(), $basList);
+ $models = $app['orm.em.native-query']->getModelForUser($app['authentication']->getUser(), $basList);
return $app['twig']->render('/admin/user/import/view.html.twig', [
'nb_user_to_add' => $nbUsrToAdd,
diff --git a/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php b/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php
index f2bb6494a3..f212ea76b5 100644
--- a/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php
+++ b/lib/Alchemy/Phrasea/Controller/Api/Oauth2.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Api/V1.php b/lib/Alchemy/Phrasea/Controller/Api/V1.php
index 55bee046b5..be355d8b11 100644
--- a/lib/Alchemy/Phrasea/Controller/Api/V1.php
+++ b/lib/Alchemy/Phrasea/Controller/Api/V1.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -43,6 +43,7 @@ use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
use Symfony\Component\HttpFoundation\File\UploadedFile;
use Alchemy\Phrasea\Model\Repositories\BasketRepository;
use Alchemy\Phrasea\Model\Entities\LazaretSession;
+use Alchemy\Phrasea\Core\Event\RecordEdit;
class V1 implements ControllerProviderInterface
{
@@ -116,6 +117,8 @@ class V1 implements ControllerProviderInterface
$controllers->post('/records/add/', 'controller.api.v1:add_record');
+ $controllers->post('/embed/substitute/', 'controller.api.v1:substitute');
+
$controllers->match('/search/', 'controller.api.v1:search');
$controllers->match('/records/search/', 'controller.api.v1:search_records');
@@ -198,6 +201,7 @@ class V1 implements ControllerProviderInterface
$controllers->get('/me/', 'controller.api.v1:get_current_user');
+
return $controllers;
}
@@ -327,7 +331,7 @@ class V1 implements ControllerProviderInterface
*/
private function get_cache_info(Application $app)
{
- $caches = ['main' => $app['cache'], 'op_code' => $app['opcode-cache'], 'doctrine_metadatas' => $app['EM']->getConfiguration()->getMetadataCacheImpl(), 'doctrine_query' => $app['EM']->getConfiguration()->getQueryCacheImpl(), 'doctrine_result' => $app['EM']->getConfiguration()->getResultCacheImpl(),];
+ $caches = ['main' => $app['cache'], 'op_code' => $app['opcode-cache'], 'doctrine_metadatas' => $app['orm.em']->getConfiguration()->getMetadataCacheImpl(), 'doctrine_query' => $app['orm.em']->getConfiguration()->getQueryCacheImpl(), 'doctrine_result' => $app['orm.em']->getConfiguration()->getResultCacheImpl(),];
$ret = [];
@@ -523,8 +527,8 @@ class V1 implements ControllerProviderInterface
$session = new LazaretSession();
$session->setUser($app['authentication']->getUser());
- $app['EM']->persist($session);
- $app['EM']->flush();
+ $app['orm.em']->persist($session);
+ $app['orm.em']->flush();
$reasons = $output = null;
@@ -552,13 +556,15 @@ class V1 implements ControllerProviderInterface
return $this->getBadRequest($app, $request, sprintf('Invalid forceBehavior value `%s`', $request->get('forceBehavior')));
}
- $app['border-manager']->process($session, $Package, $callback, $behavior);
+ $nosubdef = $request->get('nosubdefs')==='' || \p4field::isyes($request->get('nosubdefs'));
+ $app['border-manager']->process($session, $Package, $callback, $behavior, $nosubdef);
$ret = ['entity' => null,];
if ($output instanceof \record_adapter) {
$ret['entity'] = '0';
$ret['url'] = '/records/' . $output->get_sbas_id() . '/' . $output->get_record_id() . '/';
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_UPLOAD, new RecordEdit($output));
}
if ($output instanceof LazaretFile) {
$ret['entity'] = '1';
@@ -567,6 +573,49 @@ class V1 implements ControllerProviderInterface
return Result::create($request, $ret)->createResponse();
}
+
+ public function substitute(Application $app, Request $request)
+ {
+ $ret = array();
+
+ if (count($request->files->get('file')) == 0) {
+ throw new API_V1_exception_badrequest('Missing file parameter');
+ }
+ if (!$request->files->get('file') instanceof Symfony\Component\HttpFoundation\File\UploadedFile) {
+ throw new API_V1_exception_badrequest('You can upload one file at time');
+ }
+ $file = $request->files->get('file');
+ // @var $file Symfony\Component\HttpFoundation\File\UploadedFile
+ if (!$file->isValid()) {
+ throw new API_V1_exception_badrequest('Datas corrupted, please try again');
+ }
+ if (!$request->get('databox_id')) {
+ throw new API_V1_exception_badrequest('Missing databox_id parameter');
+ }
+ if (!$request->get('record_id')) {
+ throw new API_V1_exception_badrequest('Missing record_id parameter');
+ }
+ if (!$request->get('name')) {
+ throw new API_V1_exception_badrequest('Missing name parameter');
+ }
+ $media = $app['mediavorus']->guess($file->getPathname());
+ // @var $record \record_adapter
+ $record = $this->app['phraseanet.appbox']->get_databox($request->get('databox_id'))->get_record($request->get('record_id'));
+ $base_id = $record->get_base_id();
+ $collection = \collection::get_from_base_id($this->app, $base_id);
+ if (!$app['authentication']->getUser()->ACL()->has_right_on_base($base_id, 'canaddrecord')) {
+ throw new API_V1_exception_forbidden(sprintf('You do not have access to collection %s', $collection->get_label($this->app['locale.I18n'])));
+ }
+ $record->substitute_subdef($request->get('name'), $media, $app);
+ foreach ($record->get_embedable_medias() as $name => $media) {
+ if ($name == $request->get('name') &&
+ null !== ($subdef = $this->list_embedable_media($record, $media, $this->app['phraseanet.registry']))) {
+ $ret[] = $subdef;
+ }
+ }
+
+ return Result::create($request, $ret)->createResponse();
+ }
public function list_quarantine(Application $app, Request $request)
{
@@ -717,7 +766,7 @@ class V1 implements ControllerProviderInterface
$that = $this;
$baskets = array_map(function (Basket $basket) use ($that, $app) {
return $that->list_basket($app, $basket);
- }, (array) $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id)->get_container_baskets($app['EM'], $app['authentication']->getUser()));
+ }, (array) $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id)->get_container_baskets($app['orm.em'], $app['authentication']->getUser()));
$record = $app['phraseanet.appbox']->get_databox($databox_id)->get_record($record_id);
@@ -862,6 +911,9 @@ class V1 implements ControllerProviderInterface
$record->set_binary_status(strrev($datas));
+ // @todo Move event dispatch inside record_adapter class (keeps things encapsulated)
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($record));
+
$ret = ["status" => $this->list_record_status($record)];
return Result::create($request, $ret)->createResponse();
@@ -984,8 +1036,8 @@ class V1 implements ControllerProviderInterface
$Basket->setUser($app['authentication']->getUser());
$Basket->setName($name);
- $app['EM']->persist($Basket);
- $app['EM']->flush();
+ $app['orm.em']->persist($Basket);
+ $app['orm.em']->flush();
return Result::create($request, ["basket" => $this->list_basket($app, $Basket)])->createResponse();
}
@@ -1000,8 +1052,8 @@ class V1 implements ControllerProviderInterface
*/
public function delete_basket(Application $app, Request $request, Basket $basket)
{
- $app['EM']->remove($basket);
- $app['EM']->flush();
+ $app['orm.em']->remove($basket);
+ $app['orm.em']->flush();
return $this->search_baskets($app, $request);
}
@@ -1091,8 +1143,8 @@ class V1 implements ControllerProviderInterface
{
$basket->setName($request->get('name'));
- $app['EM']->persist($basket);
- $app['EM']->flush();
+ $app['orm.em']->persist($basket);
+ $app['orm.em']->flush();
return Result::create($request, ["basket" => $this->list_basket($app, $basket)])->createResponse();
}
@@ -1109,8 +1161,8 @@ class V1 implements ControllerProviderInterface
{
$basket->setDescription($request->get('description'));
- $app['EM']->persist($basket);
- $app['EM']->flush();
+ $app['orm.em']->persist($basket);
+ $app['orm.em']->flush();
return Result::create($request, ["basket" => $this->list_basket($app, $basket)])->createResponse();
}
@@ -1278,7 +1330,19 @@ class V1 implements ControllerProviderInterface
$permalink = null;
}
- return ['name' => $media->get_name(), 'permalink' => $permalink, 'height' => $media->get_height(), 'width' => $media->get_width(), 'filesize' => $media->get_size(), 'devices' => $media->getDevices(), 'player_type' => $media->get_type(), 'mime_type' => $media->get_mime(),];
+ return [
+ 'name' => $media->get_name(),
+ 'permalink' => $permalink,
+ 'height' => $media->get_height(),
+ 'width' => $media->get_width(),
+ 'filesize' => $media->get_size(),
+ 'devices' => $media->getDevices(),
+ 'player_type' => $media->get_type(),
+ 'mime_type' => $media->get_mime(),
+ 'substituted' => $media->is_substituted(),
+ 'created_on' => $media->get_creation_date()->format(DATE_ATOM),
+ 'updated_on' => $media->get_modification_date()->format(DATE_ATOM),
+ ];
}
/**
diff --git a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php
index 811f1b7af3..b8a4732072 100644
--- a/lib/Alchemy/Phrasea/Controller/Client/Baskets.php
+++ b/lib/Alchemy/Phrasea/Controller/Client/Baskets.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -63,8 +63,8 @@ class Baskets implements ControllerProviderInterface
try {
$repository = $app['repo.basket-elements'];
$basketElement = $repository->findUserElement($request->request->get('p0'), $app['authentication']->getUser());
- $app['EM']->remove($basketElement);
- $app['EM']->flush();
+ $app['orm.em']->remove($basketElement);
+ $app['orm.em']->flush();
} catch (\Exception $e) {
}
@@ -87,8 +87,8 @@ class Baskets implements ControllerProviderInterface
$basket = $app['converter.basket']->convert($request->request->get('courChuId'));
$app['acl.basket']->isOwner($basket, $app['authentication']->getUser());
- $app['EM']->remove($basket);
- $app['EM']->flush();
+ $app['orm.em']->remove($basket);
+ $app['orm.em']->flush();
unset($basket);
} catch (\Exception $e) {
@@ -113,8 +113,8 @@ class Baskets implements ControllerProviderInterface
$basket->setName($request->request->get('p0'));
$basket->setUser($app['authentication']->getUser());
- $app['EM']->persist($basket);
- $app['EM']->flush();
+ $app['orm.em']->persist($basket);
+ $app['orm.em']->flush();
} catch (\Exception $e) {
@@ -145,9 +145,9 @@ class Baskets implements ControllerProviderInterface
$basketElement->setBasket($basket);
$basket->addElement($basketElement);
- $app['EM']->persist($basket);
+ $app['orm.em']->persist($basket);
- $app['EM']->flush();
+ $app['orm.em']->flush();
} catch (\Exception $e) {
}
diff --git a/lib/Alchemy/Phrasea/Controller/Client/Root.php b/lib/Alchemy/Phrasea/Controller/Client/Root.php
index 5e9372b813..be2c4fd72b 100644
--- a/lib/Alchemy/Phrasea/Controller/Client/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Client/Root.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -30,6 +30,7 @@ class Root implements ControllerProviderInterface
$controllers = $app['controllers_factory'];
$controllers->before(function (Request $request) use ($app) {
+
if (!$app['authentication']->isAuthenticated() && null !== $request->query->get('nolog')) {
return $app->redirectPath('login_authenticate_as_guest', ['redirect' => 'client']);
}
@@ -233,6 +234,8 @@ class Root implements ControllerProviderInterface
*/
public function getClient(Application $app, Request $request)
{
+ $app['session']->getFlashBag()->add('step_by_step', '');
+
try {
\Session_Logger::updateClientInfos($app, 2);
} catch (SessionNotFound $e) {
diff --git a/lib/Alchemy/Phrasea/Controller/Datafiles.php b/lib/Alchemy/Phrasea/Controller/Datafiles.php
index 52e6722296..a7a03906a7 100644
--- a/lib/Alchemy/Phrasea/Controller/Datafiles.php
+++ b/lib/Alchemy/Phrasea/Controller/Datafiles.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Exception.php b/lib/Alchemy/Phrasea/Controller/Exception.php
index 3d9e32b13d..e2f75e8660 100644
--- a/lib/Alchemy/Phrasea/Controller/Exception.php
+++ b/lib/Alchemy/Phrasea/Controller/Exception.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Lightbox.php b/lib/Alchemy/Phrasea/Controller/Lightbox.php
index fff5578a9b..9434052482 100644
--- a/lib/Alchemy/Phrasea/Controller/Lightbox.php
+++ b/lib/Alchemy/Phrasea/Controller/Lightbox.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -211,15 +211,15 @@ class Lightbox implements ControllerProviderInterface
);
if ($basket->getIsRead() === false) {
- $basket = $app['EM']->merge($basket);
+ $basket = $app['orm.em']->merge($basket);
$basket->setIsRead(true);
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) {
- $basket = $app['EM']->merge($basket);
+ $basket = $app['orm.em']->merge($basket);
$basket->getValidation()->getParticipant($app['authentication']->getUser())->setIsAware(true);
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
$template = 'lightbox/validate.html.twig';
@@ -258,15 +258,15 @@ class Lightbox implements ControllerProviderInterface
);
if ($basket->getIsRead() === false) {
- $basket = $app['EM']->merge($basket);
+ $basket = $app['orm.em']->merge($basket);
$basket->setIsRead(true);
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
if ($basket->getValidation() && $basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) {
- $basket = $app['EM']->merge($basket);
+ $basket = $app['orm.em']->merge($basket);
$basket->getValidation()->getParticipant($app['authentication']->getUser())->setIsAware(true);
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
$template = 'lightbox/validate.html.twig';
@@ -348,9 +348,9 @@ class Lightbox implements ControllerProviderInterface
$validationDatas->setNote($note);
- $app['EM']->merge($validationDatas);
+ $app['orm.em']->merge($validationDatas);
- $app['EM']->flush();
+ $app['orm.em']->flush();
if ($app['browser']->isMobile()) {
$datas = $app['twig']->render('lightbox/sc_note.html.twig', ['basket_element' => $basket_element]);
@@ -408,9 +408,9 @@ class Lightbox implements ControllerProviderInterface
->getValidation()
->getParticipant($app['authentication']->getUser());
- $app['EM']->merge($basket_element);
+ $app['orm.em']->merge($basket_element);
- $app['EM']->flush();
+ $app['orm.em']->flush();
$releasable = false;
if ($participant->isReleasable() === true) {
@@ -468,8 +468,8 @@ class Lightbox implements ControllerProviderInterface
$participant->setIsConfirmed(true);
- $app['EM']->merge($participant);
- $app['EM']->flush();
+ $app['orm.em']->merge($participant);
+ $app['orm.em']->flush();
$datas = ['error' => false, 'datas' => $app->trans('Envoie avec succes')];
} catch (ControllerException $e) {
diff --git a/lib/Alchemy/Phrasea/Controller/Minifier.php b/lib/Alchemy/Phrasea/Controller/Minifier.php
index ba17e24f45..fe471634c1 100644
--- a/lib/Alchemy/Phrasea/Controller/Minifier.php
+++ b/lib/Alchemy/Phrasea/Controller/Minifier.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Permalink.php b/lib/Alchemy/Phrasea/Controller/Permalink.php
index 3fff663b2b..f86a45196b 100644
--- a/lib/Alchemy/Phrasea/Controller/Permalink.php
+++ b/lib/Alchemy/Phrasea/Controller/Permalink.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php b/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php
index aed726ce3c..a4239ea019 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/BasketController.php
@@ -95,13 +95,13 @@ class BasketController implements ControllerProviderInterface
{
if ($basket->getIsRead() === false) {
$basket->setIsRead(true);
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
if ($basket->getValidation()) {
if ($basket->getValidation()->getParticipant($app['authentication']->getUser())->getIsAware() === false) {
$basket->getValidation()->getParticipant($app['authentication']->getUser())->setIsAware(true);
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
}
@@ -121,7 +121,7 @@ class BasketController implements ControllerProviderInterface
$Basket->setUser($app['authentication']->getUser());
$Basket->setDescription($request->request->get('desc'));
- $app['EM']->persist($Basket);
+ $app['orm.em']->persist($Basket);
$n = 0;
@@ -136,14 +136,14 @@ class BasketController implements ControllerProviderInterface
$basket_element->setRecord($record);
$basket_element->setBasket($Basket);
- $app['EM']->persist($basket_element);
+ $app['orm.em']->persist($basket_element);
$Basket->addElement($basket_element);
$n++;
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
if ($request->getRequestFormat() === 'json') {
$data = [
@@ -162,8 +162,8 @@ class BasketController implements ControllerProviderInterface
public function deleteBasket(Application $app, Request $request, BasketEntity $basket)
{
- $app['EM']->remove($basket);
- $app['EM']->flush();
+ $app['orm.em']->remove($basket);
+ $app['orm.em']->flush();
$data = [
'success' => true
@@ -179,7 +179,7 @@ class BasketController implements ControllerProviderInterface
public function removeBasketElement(Application $app, Request $request, BasketEntity $basket, $basket_element_id)
{
- $basketElement = $app['EM']->getRepository('Phraseanet:BasketElement')->find($basket_element_id);
+ $basketElement = $app['orm.em']->getRepository('Phraseanet:BasketElement')->find($basket_element_id);
$ord = $basketElement->getOrd();
foreach ($basket->getElements() as $basket_element) {
@@ -188,12 +188,12 @@ class BasketController implements ControllerProviderInterface
}
if ($basket_element->getId() === (int) $basket_element_id) {
$basket->removeElement($basket_element);
- $app['EM']->remove($basket_element);
+ $app['orm.em']->remove($basket_element);
}
}
- $app['EM']->persist($basket);
- $app['EM']->flush();
+ $app['orm.em']->persist($basket);
+ $app['orm.em']->flush();
$data = ['success' => true, 'message' => $app->trans('Record removed from basket')];
@@ -212,8 +212,8 @@ class BasketController implements ControllerProviderInterface
$basket->setName($request->request->get('name', ''));
$basket->setDescription($request->request->get('description'));
- $app['EM']->merge($basket);
- $app['EM']->flush();
+ $app['orm.em']->merge($basket);
+ $app['orm.em']->flush();
$success = true;
$msg = $app->trans('Basket has been updated');
@@ -259,11 +259,11 @@ class BasketController implements ControllerProviderInterface
if (isset($order[$basketElement->getId()])) {
$basketElement->setOrd($order[$basketElement->getId()]);
- $app['EM']->merge($basketElement);
+ $app['orm.em']->merge($basketElement);
}
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
$ret = ['success' => true, 'message' => $app->trans('Basket updated')];
} catch (\Exception $e) {
@@ -278,8 +278,8 @@ class BasketController implements ControllerProviderInterface
$basket->setArchived($archive_status);
- $app['EM']->merge($basket);
- $app['EM']->flush();
+ $app['orm.em']->merge($basket);
+ $app['orm.em']->flush();
if ($archive_status) {
$message = $app->trans('Basket has been archived');
@@ -314,7 +314,7 @@ class BasketController implements ControllerProviderInterface
$basket_element->setRecord($record);
$basket_element->setBasket($basket);
- $app['EM']->persist($basket_element);
+ $app['orm.em']->persist($basket_element);
$basket->addElement($basket_element);
@@ -327,14 +327,14 @@ class BasketController implements ControllerProviderInterface
$validationData->setParticipant($participant);
$validationData->setBasketElement($basket_element);
- $app['EM']->persist($validationData);
+ $app['orm.em']->persist($validationData);
}
}
$n++;
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
$data = [
'success' => true
@@ -365,7 +365,7 @@ class BasketController implements ControllerProviderInterface
$n++;
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
$data = ['success' => true, 'message' => $app->trans('%quantity% records moved', ['%quantity%' => $n])];
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php b/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php
index d57f902db3..8cd68f601c 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Bridge.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php b/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php
index ab3bcd847c..c3062f2900 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/DoDownload.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -180,12 +180,19 @@ class DoDownload implements ControllerProviderInterface
$app['session']->save();
ignore_user_abort(true);
- \set_export::build_zip(
- $app,
- $token,
- $list,
- sprintf($app['tmp.download.path'].'/%s.zip', $token->getValue()) // Dest file
- );
+ if ($list['count'] > 1) {
+ \set_export::build_zip(
+ $app,
+ $token,
+ $list,
+ sprintf($app['tmp.download.path'].'/%s.zip', $token->getValue()) // Dest file
+ );
+ } else {
+ $list['complete'] = true;
+ $token->setData(serialize($list));
+ $app['orm.em']->persist($token);
+ $app['orm.em']->flush();
+ }
return $app->json([
'success' => true,
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Download.php b/lib/Alchemy/Phrasea/Controller/Prod/Download.php
index a8c0fff73b..65a03e26ce 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Download.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Download.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php
index 4d91f935d7..bdca7d5da0 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Edit.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Edit.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -11,6 +11,8 @@
namespace Alchemy\Phrasea\Controller\Prod;
+use Alchemy\Phrasea\Core\Event\RecordEdit;
+use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Vocabulary\Controller as VocabularyController;
use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Metadata\Tag\TfEditdate;
@@ -292,6 +294,7 @@ class Edit implements ControllerProviderInterface
$media = $app['mediavorus']->guess($value->get_pathfile());
$app['subdef.substituer']->substitute($reg_record, $name, $media);
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($reg_record));
$app['phraseanet.logger']($reg_record->get_databox())->log(
$reg_record,
\Session_Logger::EVENT_SUBSTITUTE,
@@ -311,15 +314,6 @@ class Edit implements ControllerProviderInterface
$databoxes = $records->databoxes();
$databox = array_pop($databoxes);
- $meta_struct = $databox->get_meta_structure();
- $write_edit_el = false;
- $date_obj = new \DateTime();
- foreach ($meta_struct->get_elements() as $meta_struct_el) {
- if ($meta_struct_el->get_tag() instanceof TfEditdate) {
- $write_edit_el = $meta_struct_el;
- }
- }
-
$elements = $records->toArray();
foreach ($request->request->get('mds') as $rec) {
@@ -346,31 +340,7 @@ class Edit implements ControllerProviderInterface
if (isset($rec['metadatas']) && is_array($rec['metadatas'])) {
$record->set_metadatas($rec['metadatas']);
- }
-
- /**
- * todo : this should not work
- */
- if ($write_edit_el instanceof \databox_field) {
- $fields = $record->get_caption()->get_fields([$write_edit_el->get_name()], true);
- $field = array_pop($fields);
-
- $meta_id = null;
-
- if ($field && !$field->is_multi()) {
- $values = $field->get_values();
- $meta_id = array_pop($values)->getId();
- }
-
- $metas = [
- [
- 'meta_struct_id' => $write_edit_el->get_id(),
- 'meta_id' => $meta_id,
- 'value' => $date_obj->format('Y-m-d h:i:s'),
- ]
- ];
-
- $record->set_metadatas($metas, true);
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($record));
}
$newstat = $record->get_status();
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Export.php b/lib/Alchemy/Phrasea/Controller/Prod/Export.php
index f2b41ab2a5..67a8b7150d 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Export.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Export.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -91,6 +91,8 @@ class Export implements ControllerProviderInterface
}
$success = false;
+ $msg = _('Error while connecting to FTP');
+
try {
$ftpClient = $app['phraseanet.ftp.client']($request->request->get('address', ''), 21, 90, !!$request->request->get('ssl'));
$ftpClient->login($request->request->get('login', 'anonymous'), $request->request->get('password', 'anonymous'));
@@ -98,7 +100,6 @@ class Export implements ControllerProviderInterface
$msg = $app->trans('Connection to FTP succeed');
$success = true;
} catch (\Exception $e) {
- $msg = $app->trans('Error while connecting to FTP');
}
return $app->json([
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Feed.php b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php
index 221e656f50..563ac0afd5 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Feed.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Feed.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -78,12 +78,12 @@ class Feed implements ControllerProviderInterface
->setRecordId($record->get_record_id())
->setSbasId($record->get_sbas_id());
$entry->addItem($item);
- $app['EM']->persist($item);
+ $app['orm.em']->persist($item);
}
- $app['EM']->persist($entry);
- $app['EM']->persist($feed);
- $app['EM']->flush();
+ $app['orm.em']->persist($entry);
+ $app['orm.em']->persist($feed);
+ $app['orm.em']->flush();
$app['dispatcher']->dispatch(PhraseaEvents::FEED_ENTRY_CREATE, new FeedEntryEvent($entry, $request->request->get('notify')));
@@ -159,11 +159,11 @@ class Feed implements ControllerProviderInterface
}
$item = $app['repo.feed-items']->find($item_sort_datas[0]);
$item->setOrd($item_sort_datas[1]);
- $app['EM']->persist($item);
+ $app['orm.em']->persist($item);
}
- $app['EM']->persist($entry);
- $app['EM']->flush();
+ $app['orm.em']->persist($entry);
+ $app['orm.em']->flush();
return $app->json([
'error' => false,
@@ -190,8 +190,8 @@ class Feed implements ControllerProviderInterface
$app->abort(403, $app->trans('Action Forbidden : You are not the publisher'));
}
- $app['EM']->remove($entry);
- $app['EM']->flush();
+ $app['orm.em']->remove($entry);
+ $app['orm.em']->flush();
return $app->json(['error' => false, 'message' => 'succes']);
})
@@ -209,7 +209,7 @@ class Feed implements ControllerProviderInterface
$datas = $app['twig']->render('prod/results/feeds.html.twig', [
'feeds' => $feeds,
- 'feed' => new Aggregate($app['EM'], $feeds),
+ 'feed' => new Aggregate($app['orm.em'], $feeds),
'page' => $page
]);
@@ -238,7 +238,7 @@ class Feed implements ControllerProviderInterface
$feeds = $app['repo.feeds']->getAllForUser($app['acl']->get($app['authentication']->getUser()));
- $link = $app['feed.aggregate-link-generator']->generate(new Aggregate($app['EM'], $feeds),
+ $link = $app['feed.aggregate-link-generator']->generate(new Aggregate($app['orm.em'], $feeds),
$app['authentication']->getUser(),
AggregateLinkGenerator::FORMAT_RSS,
null, $renew
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Language.php b/lib/Alchemy/Phrasea/Controller/Prod/Language.php
index 0700729108..ae9572e469 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Language.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Language.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php
index a511eb896b..36631e2f23 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Lazaret.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -242,8 +242,8 @@ class Lazaret implements ControllerProviderInterface
}
//Delete lazaret file
- $app['EM']->remove($lazaretFile);
- $app['EM']->flush();
+ $app['orm.em']->remove($lazaretFile);
+ $app['orm.em']->flush();
$ret['success'] = true;
} catch (\Exception $e) {
@@ -295,8 +295,8 @@ class Lazaret implements ControllerProviderInterface
$lazaretFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getFilename();
$lazaretThumbFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getThumbFilename();
- $app['EM']->remove($lazaretFile);
- $app['EM']->flush();
+ $app['orm.em']->remove($lazaretFile);
+ $app['orm.em']->flush();
try {
$app['filesystem']->remove([$lazaretFileName, $lazaretThumbFileName]);
@@ -317,22 +317,58 @@ class Lazaret implements ControllerProviderInterface
*/
public function emptyLazaret(Application $app, Request $request)
{
- $ret = ['success' => false, 'message' => '', 'result' => []];
+ $ret = array(
+ 'success' => false,
+ 'message' => '',
+ 'result' => array(
+ 'tobedone' => 0,
+ 'done' => 0,
+ 'todo' => 0,
+ 'max' => '',
+ )
+ );
- $lazaretFiles = $app['repo.lazaret-files']->findAll();
+ $maxTodo = -1; // all
+ if($request->get('max') !== null) {
+ $maxTodo = (int)($request->get('max'));
+ $ret['result']['max'] = $maxTodo;
+ if( $maxTodo <= 0) {
+ $maxTodo = -1; // all
+ }
+ }
+ $ret['result']['max'] = $maxTodo;
- $app['EM']->beginTransaction();
+ $repo = $app['repo.lazaret-files'];
+
+ $ret['result']['tobedone'] = $repo->createQueryBuilder('id')
+ ->select('COUNT(id)')
+ ->getQuery()
+ ->getSingleScalarResult();
+
+ if($maxTodo == -1) {
+ // all
+ $lazaretFiles = $repo->findAll();
+ }
+ else {
+ // limit maxTodo
+ $lazaretFiles = $repo->findBy(array(), null, $maxTodo);
+ }
+
+
+ $app['orm.em']->beginTransaction();
try {
foreach ($lazaretFiles as $lazaretFile) {
$this->denyLazaretFile($app, $lazaretFile);
+ $ret['result']['done']++;
}
- $app['EM']->commit();
+ $app['orm.em']->commit();
$ret['success'] = true;
} catch (\Exception $e) {
- $app['EM']->rollback();
+ $app['orm.em']->rollback();
$ret['message'] = $app->trans('An error occured');
}
+ $ret['result']['todo'] = $ret['result']['tobedone'] - $ret['result']['done'];
return $app->json($ret);
}
@@ -400,8 +436,8 @@ class Lazaret implements ControllerProviderInterface
);
//Delete lazaret file
- $app['EM']->remove($lazaretFile);
- $app['EM']->flush();
+ $app['orm.em']->remove($lazaretFile);
+ $app['orm.em']->flush();
$ret['success'] = true;
} catch (\Exception $e) {
@@ -437,6 +473,6 @@ class Lazaret implements ControllerProviderInterface
$lazaretThumbFileName = $app['tmp.lazaret.path'].'/'.$lazaretFile->getThumbFilename();
- return $app['phraseanet.file-serve']->deliverFile($lazaretThumbFileName, $lazaretFile->getOriginalName(), DeliverDataInterface::DISPOSITION_INLINE, 'image/jpeg', 3600);
+ return $app['phraseanet.file-serve']->deliverFile($lazaretThumbFileName, $lazaretFile->getOriginalName(), DeliverDataInterface::DISPOSITION_INLINE, 'image/jpeg');
}
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php
index 69eea98c43..feded8b21c 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/MoveCollection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Order.php b/lib/Alchemy/Phrasea/Controller/Prod/Order.php
index 27dafc0a25..a76c9c8d19 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Order.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Order.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -124,7 +124,7 @@ class Order implements ControllerProviderInterface
$orderElement->setOrder($order);
$orderElement->setBaseId($record->get_base_id());
$orderElement->setRecordId($record->get_record_id());
- $app['EM']->persist($orderElement);
+ $app['orm.em']->persist($orderElement);
}
}
@@ -145,8 +145,8 @@ class Order implements ControllerProviderInterface
try {
$app['dispatcher']->dispatch(PhraseaEvents::ORDER_CREATE, new OrderEvent($order));
- $app['EM']->persist($order);
- $app['EM']->flush();
+ $app['orm.em']->persist($order);
+ $app['orm.em']->flush();
$msg = $app->trans('The records have been properly ordered');
$success = true;
} catch (\Exception $e) {
@@ -242,8 +242,8 @@ class Order implements ControllerProviderInterface
$basket->setUser($order->getUser());
$basket->setPusher($app['authentication']->getUser());
- $app['EM']->persist($basket);
- $app['EM']->flush();
+ $app['orm.em']->persist($basket);
+ $app['orm.em']->flush();
}
$n = 0;
@@ -275,10 +275,10 @@ class Order implements ControllerProviderInterface
}
$success = true;
- $app['EM']->persist($basket);
- $app['EM']->persist($orderElement);
- $app['EM']->persist($order);
- $app['EM']->flush();
+ $app['orm.em']->persist($basket);
+ $app['orm.em']->persist($orderElement);
+ $app['orm.em']->persist($order);
+ $app['orm.em']->flush();
} catch (\Exception $e) {
}
@@ -320,7 +320,7 @@ class Order implements ControllerProviderInterface
$orderElement->setOrderMaster($app['authentication']->getUser());
$orderElement->setDeny(true);
- $app['EM']->persist($orderElement);
+ $app['orm.em']->persist($orderElement);
$n++;
}
}
@@ -332,8 +332,8 @@ class Order implements ControllerProviderInterface
}
$success = true;
- $app['EM']->persist($order);
- $app['EM']->flush();
+ $app['orm.em']->persist($order);
+ $app['orm.em']->flush();
} catch (\Exception $e) {
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php
index 2806ecfa64..4fcecaab27 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Printer.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Printer.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Property.php b/lib/Alchemy/Phrasea/Controller/Prod/Property.php
index afdf8910c8..23c5e9f92d 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Property.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Property.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -187,16 +187,23 @@ class Property implements ControllerProviderInterface
{
$typeLst = $request->request->get('types', []);
$records = RecordsRequest::fromRequest($app, $request, false, ['canmodifrecord']);
+ $mimeLst = $request->request->get('mimes', []);
$forceType = $request->request->get('force_types', '');
$updated = [];
foreach ($records as $record) {
try {
$recordType = !empty($forceType) ? $forceType : (isset($typeLst[$record->get_serialize_key()]) ? $typeLst[$record->get_serialize_key()] : null);
+ $mimeType = isset($mimeLst[$record->get_serialize_key()]) ? $mimeLst[$record->get_serialize_key()] : null;
if ($recordType) {
$record->set_type($recordType);
- $updated[$record->get_serialize_key()] = $recordType;
+ $updated[$record->get_serialize_key()]['record_type'] = $recordType;
+ }
+
+ if ($mimeType) {
+ $record->set_mime($mimeType);
+ $updated[$record->get_serialize_key()]['mime_type'] = $mimeType;
}
} catch (\Exception $e) {
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Push.php b/lib/Alchemy/Phrasea/Controller/Prod/Push.php
index d27add32cb..5f268549d7 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Push.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Push.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -192,14 +192,14 @@ class Push implements ControllerProviderInterface
$Basket->setPusher($app['authentication']->getUser());
$Basket->setIsRead(false);
- $app['EM']->persist($Basket);
+ $app['orm.em']->persist($Basket);
foreach ($pusher->get_elements() as $element) {
$BasketElement = new BasketElement();
$BasketElement->setRecord($element);
$BasketElement->setBasket($Basket);
- $app['EM']->persist($BasketElement);
+ $app['orm.em']->persist($BasketElement);
$Basket->addElement($BasketElement);
@@ -218,7 +218,7 @@ class Push implements ControllerProviderInterface
}
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
$arguments = [
'basket' => $Basket->getId(),
@@ -238,7 +238,7 @@ class Push implements ControllerProviderInterface
$app['phraseanet.logger']($BasketElement->getRecord($app)->get_databox())
->log($BasketElement->getRecord($app), \Session_Logger::EVENT_VALIDATE, $user_receiver->getId(), '');
- $app['EM']->flush();
+ $app['orm.em']->flush();
$message = $app->trans('%quantity_records% records have been sent to %quantity_users% users', [
'%quantity_records%' => count($pusher->get_elements()),
@@ -264,7 +264,7 @@ class Push implements ControllerProviderInterface
'message' => $app->trans('Unable to send the documents')
];
- $app['EM']->beginTransaction();
+ $app['orm.em']->beginTransaction();
try {
$pusher = new RecordHelper\Push($app, $app['request']);
@@ -291,21 +291,21 @@ class Push implements ControllerProviderInterface
$Basket->setUser($app['authentication']->getUser());
$Basket->setIsRead(false);
- $app['EM']->persist($Basket);
+ $app['orm.em']->persist($Basket);
foreach ($pusher->get_elements() as $element) {
$BasketElement = new BasketElement();
$BasketElement->setRecord($element);
$BasketElement->setBasket($Basket);
- $app['EM']->persist($BasketElement);
+ $app['orm.em']->persist($BasketElement);
$Basket->addElement($BasketElement);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
- $app['EM']->refresh($Basket);
+ $app['orm.em']->refresh($Basket);
if (!$Basket->getValidation()) {
$Validation = new ValidationSession();
@@ -320,7 +320,7 @@ class Push implements ControllerProviderInterface
}
$Basket->setValidation($Validation);
- $app['EM']->persist($Validation);
+ $app['orm.em']->persist($Validation);
} else {
$Validation = $Basket->getValidation();
}
@@ -368,7 +368,7 @@ class Push implements ControllerProviderInterface
$validationParticipant->setCanAgree($participant['agree']);
$validationParticipant->setCanSeeOthers($participant['see_others']);
- $app['EM']->persist($validationParticipant);
+ $app['orm.em']->persist($validationParticipant);
foreach ($Basket->getElements() as $BasketElement) {
$ValidationData = new ValidationData();
@@ -390,8 +390,8 @@ class Push implements ControllerProviderInterface
);
}
- $app['EM']->merge($BasketElement);
- $app['EM']->persist($ValidationData);
+ $app['orm.em']->merge($BasketElement);
+ $app['orm.em']->persist($ValidationData);
$app['phraseanet.logger']($BasketElement->getRecord($app)->get_databox())
->log($BasketElement->getRecord($app), \Session_Logger::EVENT_PUSH, $participantUser->getId(), '');
@@ -399,9 +399,9 @@ class Push implements ControllerProviderInterface
$validationParticipant->addData($ValidationData);
}
- $validationParticipant = $app['EM']->merge($validationParticipant);
+ $validationParticipant = $app['orm.em']->merge($validationParticipant);
- $app['EM']->flush();
+ $app['orm.em']->flush();
$arguments = [
'basket' => $Basket->getId(),
@@ -419,9 +419,9 @@ class Push implements ControllerProviderInterface
$app['dispatcher']->dispatch(PhraseaEvents::VALIDATION_CREATE, new ValidationEvent($validationParticipant, $Basket, $url, $request->request->get('message'), $receipt, (int) $request->request->get('duration')));
}
- $app['EM']->merge($Basket);
- $app['EM']->merge($Validation);
- $app['EM']->flush();
+ $app['orm.em']->merge($Basket);
+ $app['orm.em']->merge($Validation);
+ $app['orm.em']->flush();
$message = $app->trans('%quantity_records% records have been sent for validation to %quantity_users% users', [
'%quantity_records%' => count($pusher->get_elements()),
@@ -433,10 +433,10 @@ class Push implements ControllerProviderInterface
'message' => $message
];
- $app['EM']->commit();
+ $app['orm.em']->commit();
} catch (ControllerException $e) {
$ret['message'] = $e->getMessage();
- $app['EM']->rollback();
+ $app['orm.em']->rollback();
}
return $app->json($ret);
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Query.php b/lib/Alchemy/Phrasea/Controller/Prod/Query.php
index 5fa55de50d..3daa44827f 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Query.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Query.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -152,7 +152,7 @@ class Query implements ControllerProviderInterface
$explain .= '' . $result->getDuration() . ' s
dans index ' . $result->getIndexes();
$explain .= "";
- $infoResult = '' . $app->trans('reponses:: %total% reponses', ['%total%' => $result->getTotal()]) . ' | ' . $app->trans('reponses:: %number% documents selectionnes', ['%number%' => ' ']);
+ $infoResult = '' .$app->trans('%total% reponses', ['%total%' => ''.$result->getTotal().' ']) . ' ';
$json['infos'] = $infoResult;
$json['navigation'] = $string;
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Records.php b/lib/Alchemy/Phrasea/Controller/Prod/Records.php
index 40b02a4ecb..1519263683 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Records.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Records.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -122,7 +122,7 @@ class Records implements ControllerProviderInterface
]),
"others" => $app['twig']->render('prod/preview/appears_in.html.twig', [
'parents' => $record->get_grouping_parents(),
- 'baskets' => $record->get_container_baskets($app['EM'], $app['authentication']->getUser())
+ 'baskets' => $record->get_container_baskets($app['orm.em'], $app['authentication']->getUser())
]),
"current" => $train,
"history" => $app['twig']->render('prod/preview/short_history.html.twig', [
@@ -135,7 +135,9 @@ class Records implements ControllerProviderInterface
'record' => $record
]),
"pos" => $record->get_number(),
- "title" => str_replace(['[[em]]', '[[/em]]'], ['', ' '], $record->get_title($query, $searchEngine))
+ "title" => str_replace(array('[[em]]', '[[/em]]'), array('', ' '), $record->get_title($query, $searchEngine)),
+ "collection_name" => $record->get_collection()->get_name(),
+ "collection_logo" => $record->get_collection()->getLogo($record->get_base_id(), $app)
]);
}
@@ -162,14 +164,14 @@ class Records implements ControllerProviderInterface
$basketElements = $basketElementsRepository->findElementsByRecord($record);
foreach ($basketElements as $element) {
- $app['EM']->remove($element);
+ $app['orm.em']->remove($element);
$deleted[] = $element->getRecord($app)->get_serialize_key();
}
$attachedStories = $StoryWZRepository->findByRecord($app, $record);
foreach ($attachedStories as $attachedStory) {
- $app['EM']->remove($attachedStory);
+ $app['orm.em']->remove($attachedStory);
}
$deleted[] = $record->get_serialize_key();
@@ -179,7 +181,7 @@ class Records implements ControllerProviderInterface
}
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
return $app->json($deleted);
}
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Root.php b/lib/Alchemy/Phrasea/Controller/Prod/Root.php
index d91ba571dc..8c14998c7e 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Root.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -102,10 +102,13 @@ class Root implements ControllerProviderInterface
}
}
+ $helper = new Helper\Prod($app, $app['request']);
+
return $app['twig']->render('prod/index.html.twig', [
'module_name' => 'Production',
'WorkZone' => new Helper\WorkZone($app, $app['request']),
- 'module_prod' => new Helper\Prod($app, $app['request']),
+ 'module_prod' => $helper,
+ 'search_datas' => $helper->get_search_datas(),
'cssfile' => $cssfile,
'module' => 'prod',
'events' => $app['events-manager'],
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Share.php b/lib/Alchemy/Phrasea/Controller/Prod/Share.php
index 01dc12cd2f..d28213aab2 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Share.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Share.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Story.php b/lib/Alchemy/Phrasea/Controller/Prod/Story.php
index 242d51ab9c..08682d064f 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Story.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Story.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -14,6 +14,8 @@ namespace Alchemy\Phrasea\Controller\Prod;
use Alchemy\Phrasea\Controller\Exception as ControllerException;
use Alchemy\Phrasea\Controller\RecordsRequest;
use Alchemy\Phrasea\Model\Entities\StoryWZ;
+use Alchemy\Phrasea\Core\Event\RecordEdit;
+use Alchemy\Phrasea\Core\PhraseaEvents;
use Silex\Application;
use Silex\ControllerProviderInterface;
use Symfony\Component\HttpFoundation\Request;
@@ -78,9 +80,9 @@ class Story implements ControllerProviderInterface
$StoryWZ->setUser($app['authentication']->getUser());
$StoryWZ->setRecord($Story);
- $app['EM']->persist($StoryWZ);
+ $app['orm.em']->persist($StoryWZ);
- $app['EM']->flush();
+ $app['orm.em']->flush();
if ($request->getRequestFormat() == 'json') {
$data = [
@@ -132,6 +134,8 @@ class Story implements ControllerProviderInterface
$n++;
}
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($Story));
+
$data = [
'success' => true
, 'message' => $app->trans('%quantity% records added', ['%quantity%' => $n])
@@ -159,6 +163,9 @@ class Story implements ControllerProviderInterface
, 'message' => $app->trans('Record removed from story')
];
+
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($Story));
+
if ($request->getRequestFormat() == 'json') {
return $app->json($data);
} else {
@@ -222,6 +229,8 @@ class Story implements ControllerProviderInterface
$stmt->closeCursor();
$ret = ['success' => true, 'message' => $app->trans('Story updated')];
+
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_EDIT, new RecordEdit($story));
} catch (ControllerException $e) {
$ret = ['success' => false, 'message' => $e->getMessage()];
} catch (\Exception $e) {
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/TOU.php b/lib/Alchemy/Phrasea/Controller/Prod/TOU.php
index 35e3c6081c..b784ab0006 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/TOU.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/TOU.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php
index df68e79c5f..0e08f2a79d 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Tools.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Tools.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -87,23 +87,30 @@ class Tools implements ControllerProviderInterface
$controllers->post('/image/', function (Application $app, Request $request) {
$return = ['success' => true];
- $selection = RecordsRequest::fromRequest($app, $request, false, ['canmodifrecord']);
+ $force = $request->request->get('force_substitution') == '1';
+
+ $selection = RecordsRequest::fromRequest($app, $request, false, array('canmodifrecord'));
foreach ($selection as $record) {
-
$substituted = false;
foreach ($record->get_subdefs() as $subdef) {
if ($subdef->is_substituted()) {
$substituted = true;
+
+ if ($force) {
+ // unset flag
+ $subdef->set_substituted(false);
+ }
break;
}
}
- if (!$substituted || $request->request->get('ForceThumbSubstit') == '1') {
+ if (!$substituted || $force) {
$record->rebuild_subdefs();
}
}
+
return $app->json($return);
})->bind('prod_tools_image');
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php b/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php
index f4e983d132..45f98c337f 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Tooltip.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
index 8028d3f669..4202438e2d 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/Upload.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -14,7 +14,7 @@ namespace Alchemy\Phrasea\Controller\Prod;
use Alchemy\Phrasea\Border\File;
use Alchemy\Phrasea\Border\Attribute\Status;
use Alchemy\Phrasea\Core\Event\LazaretEvent;
-use Alchemy\Phrasea\Core\PhraseaEvents;
+use Alchemy\Phrasea\Core\Event\RecordEdit;use Alchemy\Phrasea\Core\PhraseaEvents;
use DataURI\Parser;
use DataURI\Exception\Exception as DataUriException;
use Alchemy\Phrasea\Model\Entities\LazaretSession;
@@ -51,6 +51,8 @@ class Upload implements ControllerProviderInterface
$controllers->get('/flash-version/', 'controller.prod.upload:getFlashUploadForm')
->bind('upload_flash_form');
+ $controllers->get('/html5-version/', 'controller.prod.upload:getHtml5UploadForm')
+ ->bind('upload_html5_form');
$controllers->post('/', 'controller.prod.upload:upload')
->bind('upload');
@@ -71,12 +73,25 @@ class Upload implements ControllerProviderInterface
$maxFileSize = $this->getUploadMaxFileSize();
return $app['twig']->render(
- 'prod/upload/upload-flash.html.twig', [
- 'sessionId' => session_id(),
- 'collections' => $this->getGrantedCollections($app['acl']->get($app['authentication']->getUser())),
- 'maxFileSize' => $maxFileSize,
- 'maxFileSizeReadable' => \p4string::format_octets($maxFileSize)
- ]);
+ 'prod/upload/upload-flash.html.twig', array(
+ 'sessionId' => session_id(),
+ 'collections' => $this->getGrantedCollections($app['acl']->get($app['authentication']->getUser())),
+ 'maxFileSize' => $maxFileSize,
+ 'maxFileSizeReadable' => \p4string::format_octets($maxFileSize)
+ ));
+ }
+
+ public function getHtml5UploadForm(Application $app, Request $request)
+ {
+ $maxFileSize = $this->getUploadMaxFileSize();
+
+ return $app['twig']->render(
+ 'prod/upload/upload.html.twig', array(
+ 'sessionId' => session_id(),
+ 'collections' => $this->getGrantedCollections($app['acl']->get($app['authentication']->getUser())),
+ 'maxFileSize' => $maxFileSize,
+ 'maxFileSizeReadable' => \p4string::format_octets($maxFileSize)
+ ));
}
/**
@@ -162,7 +177,7 @@ class Upload implements ControllerProviderInterface
$lazaretSession = new LazaretSession();
$lazaretSession->setUser($app['authentication']->getUser());
- $app['EM']->persist($lazaretSession);
+ $app['orm.em']->persist($lazaretSession);
$packageFile = new File($app, $media, $collection, $file->getClientOriginalName());
@@ -208,6 +223,8 @@ class Upload implements ControllerProviderInterface
$element = 'record';
$message = $app->trans('The record was successfully created');
+ $app['dispatcher']->dispatch(PhraseaEvents::RECORD_UPLOAD, new RecordEdit($elementCreated));
+
// try to create thumbnail from data URI
if ('' !== $b64Image = $request->request->get('b64_image', '')) {
try {
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
index a82626d46a..c19cc93879 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/UsrLists.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -170,9 +170,9 @@ class UsrLists implements ControllerProviderInterface
$List->setName($list_name);
$List->addOwner($Owner);
- $app['EM']->persist($Owner);
- $app['EM']->persist($List);
- $app['EM']->flush();
+ $app['orm.em']->persist($Owner);
+ $app['orm.em']->persist($List);
+ $app['orm.em']->flush();
$datas = [
'success' => true
@@ -261,7 +261,7 @@ class UsrLists implements ControllerProviderInterface
$list->setName($list_name);
- $app['EM']->flush();
+ $app['orm.em']->flush();
$datas = [
'success' => true
@@ -290,8 +290,8 @@ class UsrLists implements ControllerProviderInterface
throw new ControllerException($app->trans('You are not authorized to do this'));
}
- $app['EM']->remove($list);
- $app['EM']->flush();
+ $app['orm.em']->remove($list);
+ $app['orm.em']->flush();
$datas = [
'success' => true
@@ -329,8 +329,8 @@ class UsrLists implements ControllerProviderInterface
$user_entry = $entry_repository->findEntryByListAndUsrId($list, $usr_id);
- $app['EM']->remove($user_entry);
- $app['EM']->flush();
+ $app['orm.em']->remove($user_entry);
+ $app['orm.em']->flush();
$datas = [
'success' => true
@@ -381,12 +381,12 @@ class UsrLists implements ControllerProviderInterface
$list->addEntrie($entry);
- $app['EM']->persist($entry);
+ $app['orm.em']->persist($entry);
$inserted_usr_ids[] = $user_entry->getId();
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
if (count($inserted_usr_ids) > 1) {
$datas = [
@@ -476,14 +476,14 @@ class UsrLists implements ControllerProviderInterface
$list->addOwner($owner);
- $app['EM']->persist($owner);
+ $app['orm.em']->persist($owner);
}
$role = $app['request']->request->get('role');
$owner->setRole($role);
- $app['EM']->flush();
+ $app['orm.em']->flush();
$datas = [
'success' => true
@@ -521,8 +521,8 @@ class UsrLists implements ControllerProviderInterface
$owner = $owners_repository->findByListAndUsrId($list, $usr_id);
- $app['EM']->remove($owner);
- $app['EM']->flush();
+ $app['orm.em']->remove($owner);
+ $app['orm.em']->flush();
$datas = [
'success' => true
diff --git a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php
index 2b2f404089..29bceffb21 100644
--- a/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php
+++ b/lib/Alchemy/Phrasea/Controller/Prod/WorkZone.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -150,11 +150,11 @@ class WorkZone implements ControllerProviderInterface
$StoryWZ->setUser($app['authentication']->getUser());
$StoryWZ->setRecord($Story);
- $app['EM']->persist($StoryWZ);
+ $app['orm.em']->persist($StoryWZ);
$done++;
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
if ($alreadyFixed === 0) {
if ($done <= 1) {
@@ -192,8 +192,8 @@ class WorkZone implements ControllerProviderInterface
throw new NotFoundHttpException('Story not found');
}
- $app['EM']->remove($StoryWZ);
- $app['EM']->flush();
+ $app['orm.em']->remove($StoryWZ);
+ $app['orm.em']->flush();
if ($request->getRequestFormat() == 'json') {
return $app->json([
diff --git a/lib/Alchemy/Phrasea/Controller/RecordsRequest.php b/lib/Alchemy/Phrasea/Controller/RecordsRequest.php
index 347a6e73f9..1386fd437c 100644
--- a/lib/Alchemy/Phrasea/Controller/RecordsRequest.php
+++ b/lib/Alchemy/Phrasea/Controller/RecordsRequest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Report/Activity.php b/lib/Alchemy/Phrasea/Controller/Report/Activity.php
index fbcd11a2cb..4f4866b071 100644
--- a/lib/Alchemy/Phrasea/Controller/Report/Activity.php
+++ b/lib/Alchemy/Phrasea/Controller/Report/Activity.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -133,9 +133,7 @@ class Activity implements ControllerProviderInterface
$conf = [
'user' => [$app->trans('report:: utilisateur'), 0, 1, 0, 0],
'nbdoc' => [$app->trans('report:: nombre de documents'), 0, 0, 0, 0],
- 'poiddoc' => [$app->trans('report:: poids des documents'), 0, 0, 0, 0],
'nbprev' => [$app->trans('report:: nombre de preview'), 0, 0, 0, 0],
- 'poidprev' => [$app->trans('report:: poids des previews'), 0, 0, 0, 0]
];
$activity = new \module_report_activity(
@@ -347,7 +345,7 @@ class Activity implements ControllerProviderInterface
'ddate' => [$app->trans('report:: jour'), 0, 0, 0, 0],
'total' => [$app->trans('report:: total des telechargements'), 0, 0, 0, 0],
'preview' => [$app->trans('report:: preview'), 0, 0, 0, 0],
- 'document' => [$app->trans('report:: document original'), 0, 0, 0, 0]
+ 'document' => [$app->trans('report:: document'), 0, 0, 0, 0]
];
$activity = new \module_report_activity(
diff --git a/lib/Alchemy/Phrasea/Controller/Report/Informations.php b/lib/Alchemy/Phrasea/Controller/Report/Informations.php
index 9dd99d5596..3028f4b632 100644
--- a/lib/Alchemy/Phrasea/Controller/Report/Informations.php
+++ b/lib/Alchemy/Phrasea/Controller/Report/Informations.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Report/Root.php b/lib/Alchemy/Phrasea/Controller/Report/Root.php
index 721bff0c84..c78740f400 100644
--- a/lib/Alchemy/Phrasea/Controller/Report/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Report/Root.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -302,6 +302,10 @@ class Root implements ControllerProviderInterface
*/
public function doReportDownloads(Application $app, Request $request)
{
+
+ // no_// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
+
$download = new \module_report_download(
$app,
$request->request->get('dmin'),
@@ -333,25 +337,36 @@ class Root implements ControllerProviderInterface
$download->setHasLimit(false);
$download->setPrettyString(false);
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
$this->doReport($app, $request, $download, $conf);
- return $this->getCSVResponse($app, $download, 'download');
+ $r = $this->getCSVResponse($app, $download, 'download');
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, var_export($r, true)), FILE_APPEND);
+
+ return $r;
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
$report = $this->doReport($app, $request, $download, $conf);
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
if ($report instanceof Response) {
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
return $report;
}
return $app->json([
'rs' => $app['twig']->render('report/ajax_data_content.html.twig', [
- 'result' => isset($report['report']) ? $report['report'] : $report,
- 'is_infouser' => false,
- 'is_nav' => false,
- 'is_groupby' => false,
- 'is_plot' => false,
- 'is_doc' => false
+ 'result' => isset($report['report']) ? $report['report'] : $report,
+ 'is_infouser' => false,
+ 'is_nav' => false,
+ 'is_groupby' => false,
+ 'is_plot' => false,
+ 'is_doc' => false
]),
'display_nav' => $report['display_nav'], // do we display the prev and next button ?
'next' => $report['next_page'], //Number of the next page
@@ -383,7 +398,7 @@ class Root implements ControllerProviderInterface
$conf_pref = [];
foreach (\module_report::getPreff($app, $request->request->get('sbasid')) as $field) {
- $conf_pref[strtolower($field)] = [$field, 0, 0, 0, 0];
+ $conf_pref[$field] = array($field, 0, 0, 0, 0);
}
$conf = array_merge([
@@ -401,7 +416,11 @@ class Root implements ControllerProviderInterface
$this->doReport($app, $request, $document, $conf, 'record_id');
- return $this->getCSVResponse($app, $document, 'documents');
+ $r = $this->getCSVResponse($app, $document, 'documents');
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, var_export($r, true)), FILE_APPEND);
+
+ return $r;
}
$report = $this->doReport($app, $request, $document, $conf, 'record_id');
@@ -509,6 +528,7 @@ class Root implements ControllerProviderInterface
$response = new CSVFileResponse($filename, function () use ($app, $result) {
$app['csv.exporter']->export('php://output', $result);
});
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
return $response;
}
@@ -548,6 +568,7 @@ class Root implements ControllerProviderInterface
unset($conf['ip']);
}
}
+
//save initial conf
$base_conf = $conf;
//format conf according user preferences
@@ -612,13 +633,20 @@ class Root implements ControllerProviderInterface
$filter->addFilter('record_id', '=', $request->request->get('word', ''));
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
//set filters to current report
$report->setFilter($filter->getTabFilter());
$report->setActiveColumn($filter->getActiveColumn());
$report->setPostingFilter($filter->getPostingFilter());
// display a new arraywhere results are group
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
if ('' !== $groupby = $request->request->get('groupby', '')) {
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
$report->setConfig(false);
$groupby = current(explode(' ', $groupby));
@@ -644,6 +672,8 @@ class Root implements ControllerProviderInterface
]);
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
//set Limit
if ($report->getEnableLimit()
&& ('' !== $page = $request->request->get('page', ''))
@@ -653,6 +683,8 @@ class Root implements ControllerProviderInterface
$report->setLimit(false, false);
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
//time to build our report
if (false === $what) {
$reportArray = $report->buildReport($conf);
@@ -660,6 +692,8 @@ class Root implements ControllerProviderInterface
$reportArray = $report->buildReport($conf, $what, $request->request->get('tbl', false));
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
return $reportArray;
}
@@ -681,19 +715,33 @@ class Root implements ControllerProviderInterface
foreach (array_keys($report->getDisplay()) as $k) {
$headers[$k] = $k;
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s \n\n", __FILE__, __LINE__, var_export($headers, true)), FILE_APPEND);
+
// set headers as first row
$result = $report->getResult();
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s \n\n", __FILE__, __LINE__, var_export($result[0], true)), FILE_APPEND);
+
array_unshift($result, $headers);
- $collection = new CallbackCollection($result, function ($row) use ($report) {
+ $collection = new CallbackCollection($result, function ($row) use ($headers) {
// restrict fields to the displayed ones
- return array_map('strip_tags', array_intersect_key($row, $report->getDisplay()));
+ // return array_map("strip_tags", array_intersect_key($row, $report->getDisplay()));
+ $ret = array();
+ foreach($headers as $f) {
+ $ret[$f] = array_key_exists($f, $row) ? strip_tags($row[$f]) : '';
+ }
+ return $ret;
});
$filename = sprintf('report_export_%s_%s.csv', $type, date('Ymd'));
- $response = new CSVFileResponse($filename, function () use ($app, $collection) {
+
+ $cb = function () use ($app, $collection) {
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, var_export($collection, true)), FILE_APPEND);
$app['csv.exporter']->export('php://output', $collection);
- });
+ };
+
+ $response = new CSVFileResponse($filename, $cb);
return $response;
}
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Account.php b/lib/Alchemy/Phrasea/Controller/Root/Account.php
index 09e40d5ab1..07b622916a 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Account.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Account.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -267,7 +267,7 @@ class Account implements ControllerProviderInterface
WHERE s.user = :usr_id
ORDER BY s.created DESC';
- $query = $app['EM']->createQuery($dql);
+ $query = $app['orm.em']->createQuery($dql);
$query->setMaxResults(100);
$query->setParameters(['usr_id' => $app['session']->get('usr_id')]);
$sessions = $query->getResult();
@@ -364,7 +364,7 @@ class Account implements ControllerProviderInterface
if (0 === count(array_diff($accountFields, array_keys($request->request->all())))) {
$app['authentication']->getUser()
- ->setGender($request->request->get("form_gender"))
+ ->setGender((int) $request->request->get("form_gender"))
->setFirstName($request->request->get("form_firstname"))
->setLastName($request->request->get("form_lastname"))
->setAddress($request->request->get("form_address"))
@@ -393,10 +393,10 @@ class Account implements ControllerProviderInterface
$ftpCredential->setReceptionFolder($request->request->get("form_destFTP"));
$ftpCredential->setRepositoryPrefixName($request->request->get("form_prefixFTPfolder"));
- $app['EM']->persist($ftpCredential);
- $app['EM']->persist($app['authentication']->getUser());
+ $app['orm.em']->persist($ftpCredential);
+ $app['orm.em']->persist($app['authentication']->getUser());
- $app['EM']->flush();
+ $app['orm.em']->flush();
$app->addFlash('success', $app->trans('login::notification: Changements enregistres'));
}
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Developers.php b/lib/Alchemy/Phrasea/Controller/Root/Developers.php
index 2ef31ce6ce..802161cc9d 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Developers.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Developers.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Login.php b/lib/Alchemy/Phrasea/Controller/Root/Login.php
index dfd4bbb63a..74066f1c0a 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Login.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Login.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -367,12 +367,12 @@ class Login implements ControllerProviderInterface
}
}
- $app['EM']->persist($user);
- $app['EM']->flush();
+ $app['orm.em']->persist($user);
+ $app['orm.em']->flush();
if (null !== $provider) {
- $this->attachProviderToUser($app['EM'], $provider, $user);
- $app['EM']->flush();
+ $this->attachProviderToUser($app['orm.em'], $provider, $user);
+ $app['orm.em']->flush();
}
$registrationsOK = [];
@@ -620,9 +620,11 @@ class Login implements ControllerProviderInterface
$url = $app->url('login_renew_password', ['token' => $token->getValue()], true);
+ $expirationDate = new \DateTime('+1 day');
$mail = MailRequestPasswordUpdate::create($app, $receiver);
$mail->setLogin($user->getLogin());
$mail->setButtonUrl($url);
+ $mail->setExpiration($expirationDate);
$app['notification.deliverer']->deliver($mail);
$app->addFlash('info', $app->trans('phraseanet:: Un email vient de vous etre envoye'));
@@ -807,10 +809,10 @@ class Login implements ControllerProviderInterface
$app['dispatcher']->dispatch(PhraseaEvents::VALIDATION_REMINDER, new ValidationEvent($participant, $basket, $url));
$participant->setReminded(new \DateTime('now'));
- $app['EM']->persist($participant);
+ $app['orm.em']->persist($participant);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
$session = $app['authentication']->openAccount($user);
@@ -820,16 +822,18 @@ class Login implements ControllerProviderInterface
$width = $height = null;
if ($app['request']->cookies->has('screen')) {
- $data = explode('x', $app['request']->cookies->get('screen'));
- $width = $data[0];
- $height = $data[1];
+ $data = array_filter((explode('x', $app['request']->cookies->get('screen', ''))));
+ if (count($data) === 2) {
+ $width = $data[0];
+ $height = $data[1];
+ }
}
$session->setIpAddress($app['request']->getClientIp())
->setScreenHeight($height)
->setScreenWidth($width);
- $app['EM']->persist($session);
- $app['EM']->flush();
+ $app['orm.em']->persist($session);
+ $app['orm.em']->flush();
return $session;
}
@@ -879,8 +883,8 @@ class Login implements ControllerProviderInterface
}
if (null !== $user) {
- $this->attachProviderToUser($app['EM'], $provider, $user);
- $app['EM']->flush();
+ $this->attachProviderToUser($app['orm.em'], $provider, $user);
+ $app['orm.em']->flush();
$this->postAuthProcess($app, $user);
@@ -896,8 +900,8 @@ class Login implements ControllerProviderInterface
if ($app['authentication.providers.account-creator']->isEnabled()) {
$user = $app['authentication.providers.account-creator']->create($app, $token->getId(), $token->getIdentity()->getEmail(), $token->getTemplates());
- $this->attachProviderToUser($app['EM'], $provider, $user);
- $app['EM']->flush();
+ $this->attachProviderToUser($app['orm.em'], $provider, $user);
+ $app['orm.em']->flush();
$this->postAuthProcess($app, $user);
@@ -992,8 +996,8 @@ class Login implements ControllerProviderInterface
$response->headers->setCookie(new Cookie('persistent', $token, time() + $app['phraseanet.configuration']['session']['lifetime']));
- $app['EM']->persist($session);
- $app['EM']->flush();
+ $app['orm.em']->persist($session);
+ $app['orm.em']->flush();
}
$event = new PostAuthenticate($request, $response, $user, $context);
diff --git a/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php b/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php
index 9465b4f45d..92fbcf5043 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/RSSFeeds.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -68,7 +68,7 @@ class RSSFeeds implements ControllerProviderInterface
$feeds = $app['repo.feeds']->getAllForUser($app['acl']->get($user));
- $aggregate = new Aggregate($app['EM'], $feeds, $token);
+ $aggregate = new Aggregate($app['orm.em'], $feeds, $token);
$request = $app['request'];
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Root.php b/lib/Alchemy/Phrasea/Controller/Root/Root.php
index a20a297c7e..15966e7b11 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Root.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Root.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/Root/Session.php b/lib/Alchemy/Phrasea/Controller/Root/Session.php
index 7819216fa2..34d049261d 100644
--- a/lib/Alchemy/Phrasea/Controller/Root/Session.php
+++ b/lib/Alchemy/Phrasea/Controller/Root/Session.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -90,7 +90,7 @@ class Session implements ControllerProviderInterface
'notifications' => $app['events-manager']->get_notifications()
]);
- $baskets = $app['EM']->getRepository('Phraseanet:Basket')->findUnreadActiveByUser($app['authentication']->getUser());
+ $baskets = $app['orm.em']->getRepository('Phraseanet:Basket')->findUnreadActiveByUser($app['authentication']->getUser());
foreach ($baskets as $basket) {
$ret['changed'][] = $basket->getId();
@@ -161,13 +161,13 @@ class Session implements ControllerProviderInterface
$module = new SessionModule();
$module->setModuleId($moduleId);
$module->setSession($session);
- $app['EM']->persist($module);
+ $app['orm.em']->persist($module);
} else {
- $app['EM']->persist($session->getModuleById($moduleId)->setUpdated(new \DateTime()));
+ $app['orm.em']->persist($session->getModuleById($moduleId)->setUpdated(new \DateTime()));
}
- $app['EM']->persist($session);
- $app['EM']->flush();
+ $app['orm.em']->persist($session);
+ $app['orm.em']->flush();
$ret['status'] = 'ok';
@@ -219,8 +219,8 @@ class Session implements ControllerProviderInterface
$app->abort(403, 'Unauthorized');
}
- $app['EM']->remove($session);
- $app['EM']->flush();
+ $app['orm.em']->remove($session);
+ $app['orm.em']->flush();
if ($app['request']->isXmlHttpRequest()) {
return $app->json([
diff --git a/lib/Alchemy/Phrasea/Controller/Setup.php b/lib/Alchemy/Phrasea/Controller/Setup.php
index d795316cdf..126035668f 100644
--- a/lib/Alchemy/Phrasea/Controller/Setup.php
+++ b/lib/Alchemy/Phrasea/Controller/Setup.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -148,13 +148,15 @@ class Setup implements ControllerProviderInterface
$databox_name = $request->request->get('db_name');
try {
- $abConn = $app['dbal.provider']->get([
+ $abInfo = [
'host' => $database_host,
'port' => $database_port,
'user' => $database_user,
'password' => $database_password,
'dbname' => $appbox_name,
- ]);
+ ];
+
+ $abConn = $app['dbal.provider']($abInfo);
$abConn->connect();
} catch (\Exception $e) {
return $app->redirectPath('install_step2', [
@@ -164,13 +166,15 @@ class Setup implements ControllerProviderInterface
try {
if ($databox_name) {
- $dbConn = $app['dbal.provider']->get([
+ $dbInfo = [
'host' => $database_host,
'port' => $database_port,
'user' => $database_user,
'password' => $database_password,
'dbname' => $databox_name,
- ]);
+ ];
+
+ $dbConn = $app['dbal.provider']($dbInfo);
$dbConn->connect();
}
} catch (\Exception $e) {
@@ -179,6 +183,17 @@ class Setup implements ControllerProviderInterface
]);
}
+ $app['dbs.options'] = array_merge(
+ $app['db.options.from_info']($dbInfo),
+ $app['db.options.from_info']($abInfo),
+ $app['dbs.options']
+ );
+ $app['orm.ems.options'] = array_merge(
+ $app['orm.em.options.from_info']($dbInfo),
+ $app['orm.em.options.from_info']($abInfo),
+ $app['orm.ems.options']
+ );
+
$email = $request->request->get('email');
$password = $request->request->get('password');
$template = $request->request->get('db_template');
diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php
index c4b0ec0b97..c3a6753f71 100644
--- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php
+++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Thesaurus.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -43,10 +43,8 @@ class Thesaurus implements ControllerProviderInterface
$controllers->match('linkfield2.php', 'controller.thesaurus:linkFieldStep2');
$controllers->match('linkfield3.php', 'controller.thesaurus:linkFieldStep3');
$controllers->match('loadth.php', 'controller.thesaurus:loadThesaurus')->bind('thesaurus_loadth');
- $controllers->match('newsy_dlg.php', 'controller.thesaurus:newSynonymDialog');
$controllers->match('newterm.php', 'controller.thesaurus:newTerm');
$controllers->match('properties.php', 'controller.thesaurus:properties');
- $controllers->match('search.php', 'controller.thesaurus:search');
$controllers->match('thesaurus.php', 'controller.thesaurus:thesaurus')->bind('thesaurus_thesaurus');
$controllers->match('xmlhttp/accept.x.php', 'controller.thesaurus:acceptXml');
@@ -1117,23 +1115,6 @@ class Thesaurus implements ControllerProviderInterface
]);
}
- public function newSynonymDialog(Application $app, Request $request)
- {
- $languages = [];
-
- foreach ($app['locales.available'] as $lng_code => $lng) {
- $lng_code = explode('_', $lng_code);
- $languages[$lng_code[0]] = $lng;
- }
-
- return $app['twig']->render('thesaurus/new-synonym-dialog.html.twig', [
- 'piv' => $request->get('piv'),
- 'typ' => $request->get('typ'),
- 'languages' => $languages,
- ]);
- }
-
-
public function newTerm(Application $app, Request $request)
{
list($term, $context) = $this->splitTermAndContext($request->get("t"));
@@ -1216,11 +1197,6 @@ class Thesaurus implements ControllerProviderInterface
]);
}
- public function search(Application $app, Request $request)
- {
- return $app['twig']->render('thesaurus/search.html.twig');
- }
-
public function thesaurus(Application $app, Request $request)
{
$flags = $jsFlags = [];
diff --git a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php
index 34a3d7c809..6831d7afda 100644
--- a/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php
+++ b/lib/Alchemy/Phrasea/Controller/Thesaurus/Xmlhttp.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/User/Notifications.php b/lib/Alchemy/Phrasea/Controller/User/Notifications.php
index 88a56334a0..d13c0b52da 100644
--- a/lib/Alchemy/Phrasea/Controller/User/Notifications.php
+++ b/lib/Alchemy/Phrasea/Controller/User/Notifications.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Controller/User/Preferences.php b/lib/Alchemy/Phrasea/Controller/User/Preferences.php
index e0280822f8..a642cc8376 100644
--- a/lib/Alchemy/Phrasea/Controller/User/Preferences.php
+++ b/lib/Alchemy/Phrasea/Controller/User/Preferences.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/CLIProvider/CLIDriversServiceProvider.php b/lib/Alchemy/Phrasea/Core/CLIProvider/CLIDriversServiceProvider.php
index a1c149c31c..9f9c4a331c 100644
--- a/lib/Alchemy/Phrasea/Core/CLIProvider/CLIDriversServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/CLIProvider/CLIDriversServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/CLIProvider/ComposerSetupServiceProvider.php b/lib/Alchemy/Phrasea/Core/CLIProvider/ComposerSetupServiceProvider.php
index 3072ec1310..86e75f983e 100644
--- a/lib/Alchemy/Phrasea/Core/CLIProvider/ComposerSetupServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/CLIProvider/ComposerSetupServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/CLIProvider/DoctrineMigrationServiceProvider.php b/lib/Alchemy/Phrasea/Core/CLIProvider/DoctrineMigrationServiceProvider.php
index 6f5c82fac0..b83d88c317 100644
--- a/lib/Alchemy/Phrasea/Core/CLIProvider/DoctrineMigrationServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/CLIProvider/DoctrineMigrationServiceProvider.php
@@ -20,7 +20,7 @@ class DoctrineMigrationServiceProvider implements ServiceProviderInterface
public function register(Application $app)
{
$app['doctrine-migration.configuration'] = $app->share(function ($app) {
- $configuration = new YamlConfiguration($app['EM']->getConnection());
+ $configuration = new YamlConfiguration($app['orm.em']->getConnection());
$configuration->load(__DIR__.'/../../../../conf.d/migrations.yml');
$configuration->setMigrationsDirectory(__DIR__.'/../../../../Alchemy/Phrasea/Setup/DoctrineMigration');
diff --git a/lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php b/lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php
index 50dfb22149..88696f0ccf 100644
--- a/lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/CLIProvider/LessBuilderServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/CLIProvider/PluginServiceProvider.php b/lib/Alchemy/Phrasea/Core/CLIProvider/PluginServiceProvider.php
index 7d505c4c3d..11af241578 100644
--- a/lib/Alchemy/Phrasea/Core/CLIProvider/PluginServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/CLIProvider/PluginServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -31,11 +31,11 @@ class PluginServiceProvider implements ServiceProviderInterface
});
$app['plugins.autoloader-generator'] = $app->share(function (Application $app) {
- return new AutoloaderGenerator($app['plugins.directory']);
+ return new AutoloaderGenerator($app['plugin.path']);
});
$app['plugins.assets-manager'] = $app->share(function (Application $app) {
- return new AssetsManager($app['filesystem'], $app['plugins.directory'], $app['root.path']);
+ return new AssetsManager($app['filesystem'], $app['plugin.path'], $app['root.path']);
});
$app['plugins.composer-installer'] = $app->share(function (Application $app) {
@@ -46,10 +46,10 @@ class PluginServiceProvider implements ServiceProviderInterface
$phpBinary = $finder->find();
}
- return new ComposerInstaller($app['composer-setup'], $app['plugins.directory'], $phpBinary);
+ return new ComposerInstaller($app['composer-setup'], $app['plugin.path'], $phpBinary);
});
$app['plugins.explorer'] = $app->share(function (Application $app) {
- return new PluginsExplorer($app['plugins.directory']);
+ return new PluginsExplorer($app['plugin.path']);
});
$app['plugins.importer'] = $app->share(function (Application $app) {
diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Compiler.php b/lib/Alchemy/Phrasea/Core/Configuration/Compiler.php
index 7987efcf2b..dafb988f1c 100644
--- a/lib/Alchemy/Phrasea/Core/Configuration/Compiler.php
+++ b/lib/Alchemy/Phrasea/Core/Configuration/Compiler.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php b/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php
index 48c59b0551..d426695e82 100644
--- a/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php
+++ b/lib/Alchemy/Phrasea/Core/Configuration/Configuration.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Configuration/ConfigurationInterface.php b/lib/Alchemy/Phrasea/Core/Configuration/ConfigurationInterface.php
index fa769fdc9c..15a709b5ae 100644
--- a/lib/Alchemy/Phrasea/Core/Configuration/ConfigurationInterface.php
+++ b/lib/Alchemy/Phrasea/Core/Configuration/ConfigurationInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Connection/ConnectionProvider.php b/lib/Alchemy/Phrasea/Core/Connection/ConnectionPoolManager.php
similarity index 50%
rename from lib/Alchemy/Phrasea/Core/Connection/ConnectionProvider.php
rename to lib/Alchemy/Phrasea/Core/Connection/ConnectionPoolManager.php
index d32d92922b..a71d803d0f 100644
--- a/lib/Alchemy/Phrasea/Core/Connection/ConnectionProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Connection/ConnectionPoolManager.php
@@ -17,37 +17,59 @@ use Doctrine\DBAL\Driver\Connection;
use Doctrine\DBAL\DriverManager;
use Psr\Log\LoggerInterface;
-class ConnectionProvider
+class ConnectionPoolManager
{
- private $config;
/**
- * @var Connection[]
+ * @var \PDO[]
*/
private $connections = [];
- private $eventManager;
private $logger;
- public function __construct(Configuration $config, EventManager $eventManager, LoggerInterface $logger)
+ public function __construct(LoggerInterface $logger = null)
{
$this->logger = $logger;
- $this->config = $config;
- $this->eventManager = $eventManager;
}
public function __destruct()
{
- foreach ($this->connections as $conn) {
- $conn->close();
- }
-
+ $this->closeAll();
$this->connections = [];
}
- /**
- * @param $params
- *
- * @return Connection
- */
+ public function closeAll()
+ {
+ foreach ($this->connections as $key => $conn) {
+ $conn->close();
+ }
+ }
+
+ public function opened()
+ {
+ return $this->filter(function($connection) {
+ return $connection->isConnected();
+ });
+ }
+
+ public function closed()
+ {
+ return $this->filter(function($connection) {
+ return !$connection->isConnected();
+ });
+ }
+
+ public function filter(Callable $callback)
+ {
+ return array_filter($this->connections, $callback);
+ }
+
+ public function add(Connection $connection)
+ {
+ $key = md5(serialize($connection->getParams()));
+ if (!isset($this->connections[$key])) {
+ $this->connections[$key] = $connection;
+ }
+ }
+
public function get(array $params)
{
$params = array_replace([
@@ -61,6 +83,6 @@ class ConnectionProvider
return $this->connections[$key];
}
- return $this->connections[$key] = new ReconnectableConnection(DriverManager::getConnection($params, $this->config, $this->eventManager), $this->logger);
+ return $this->connections[$key] = DriverManager::getConnection($params);
}
}
diff --git a/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2EndEvent.php b/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2EndEvent.php
index 6e353d228c..40f2bd6146 100644
--- a/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2EndEvent.php
+++ b/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2EndEvent.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2StartEvent.php b/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2StartEvent.php
index 421547c386..db5c80a3e1 100644
--- a/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2StartEvent.php
+++ b/lib/Alchemy/Phrasea/Core/Event/ApiOAuth2StartEvent.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/ApiResultEvent.php b/lib/Alchemy/Phrasea/Core/Event/ApiResultEvent.php
index ac712ea0f3..f253ac1b06 100644
--- a/lib/Alchemy/Phrasea/Core/Event/ApiResultEvent.php
+++ b/lib/Alchemy/Phrasea/Core/Event/ApiResultEvent.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Collection/CollectionEvent.php b/lib/Alchemy/Phrasea/Core/Event/Collection/CollectionEvent.php
index 8cd2b0c7c3..358a77d45a 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Collection/CollectionEvent.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Collection/CollectionEvent.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/LogoutEvent.php b/lib/Alchemy/Phrasea/Core/Event/LogoutEvent.php
index 16c0d2d920..1ecef92341 100644
--- a/lib/Alchemy/Phrasea/Core/Event/LogoutEvent.php
+++ b/lib/Alchemy/Phrasea/Core/Event/LogoutEvent.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/PostAuthenticate.php b/lib/Alchemy/Phrasea/Core/Event/PostAuthenticate.php
index 589cc62025..46fc84fd14 100644
--- a/lib/Alchemy/Phrasea/Core/Event/PostAuthenticate.php
+++ b/lib/Alchemy/Phrasea/Core/Event/PostAuthenticate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/PreAuthenticate.php b/lib/Alchemy/Phrasea/Core/Event/PreAuthenticate.php
index e85187394f..8ee97eec7d 100644
--- a/lib/Alchemy/Phrasea/Core/Event/PreAuthenticate.php
+++ b/lib/Alchemy/Phrasea/Core/Event/PreAuthenticate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/RecordEdit.php b/lib/Alchemy/Phrasea/Core/Event/RecordEdit.php
new file mode 100644
index 0000000000..ddc63c905c
--- /dev/null
+++ b/lib/Alchemy/Phrasea/Core/Event/RecordEdit.php
@@ -0,0 +1,52 @@
+records = $data->toArray();
+ $this->collections = $data->collections();
+ $this->databoxes = $data->databoxes();
+ } elseif ($data instanceof \record_adapter) {
+ $this->records[] = $data;
+ $this->collections[] = $data->get_collection();
+ $this->databoxes[] = $data->get_databox();
+ }
+
+ }
+
+ public function getRecords()
+ {
+ return $this->records;
+ }
+
+ public function getCollections()
+ {
+ return $this->collections;
+ }
+
+ public function getDataboxes()
+ {
+ return $this->databoxes;
+ }
+}
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiCorsSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiCorsSubscriber.php
index c172607f69..92d0567d73 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiCorsSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiCorsSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiExceptionHandlerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiExceptionHandlerSubscriber.php
index fc7bf099f6..a146edee82 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiExceptionHandlerSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiExceptionHandlerSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiOauth2ErrorsSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiOauth2ErrorsSubscriber.php
index 4d3b23553a..bff0cad60f 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiOauth2ErrorsSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ApiOauth2ErrorsSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/BridgeExceptionSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/BridgeExceptionSubscriber.php
index 7adea8158f..8ac3c62b1d 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/BridgeExceptionSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/BridgeExceptionSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ContentNegotiationSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ContentNegotiationSubscriber.php
index 9769e71571..305fe27ddb 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/ContentNegotiationSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/ContentNegotiationSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php
index 65709b032f..6245e53085 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/CookiesDisablerSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/DebuggerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/DebuggerSubscriber.php
index 256479bfb3..b1425c2484 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/DebuggerSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/DebuggerSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/DoctrineQueriesLoggerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/DoctrineQueriesLoggerSubscriber.php
new file mode 100644
index 0000000000..eadbaf0bf3
--- /dev/null
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/DoctrineQueriesLoggerSubscriber.php
@@ -0,0 +1,53 @@
+app = $app;
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return [
+ KernelEvents::RESPONSE => [
+ ['logQueries', -255],
+ ],
+ ];
+ }
+
+ public function logQueries(GetResponseEvent $event)
+ {
+ if (Application::ENV_DEV !== $this->app->getEnvironment()) {
+ return;
+ }
+
+ foreach ($this->app['orm.query.logger']->queries as $query ) {
+ $this->app['orm.sql-logger']->debug($query['sql'], array(
+ 'params' => $query['params'],
+ 'types' => $query['types'],
+ 'time' => $query['executionMS']
+ ));
+ }
+
+ }
+}
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/FirewallSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/FirewallSubscriber.php
index a3dd0b7586..11ef14a195 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/FirewallSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/FirewallSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/JsonRequestSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/JsonRequestSubscriber.php
index 540c53e957..ad8f58c540 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/JsonRequestSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/JsonRequestSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/LogoutSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/LogoutSubscriber.php
index 4724020b25..ae3e63062c 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/LogoutSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/LogoutSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/MaintenanceSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/MaintenanceSubscriber.php
index f2034c84a3..daabc5620a 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/MaintenanceSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/MaintenanceSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PersistentCookieSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PersistentCookieSubscriber.php
index df37817ec8..83bd1070e3 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PersistentCookieSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PersistentCookieSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaExceptionHandlerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaExceptionHandlerSubscriber.php
index 8a69018b99..dbf2fe2782 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaExceptionHandlerSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaExceptionHandlerSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaInstallSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaInstallSubscriber.php
index ae0f9b415a..91d7efaaac 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaInstallSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaInstallSubscriber.php
@@ -16,6 +16,7 @@ use Alchemy\Phrasea\Core\PhraseaEvents;
use Alchemy\Phrasea\Model\Entities\ApiApplication;
use Silex\Application;
use Symfony\Component\EventDispatcher\EventSubscriberInterface;
+use Symfony\Component\Process\Process;
class PhraseaInstallSubscriber implements EventSubscriberInterface
{
@@ -37,6 +38,7 @@ class PhraseaInstallSubscriber implements EventSubscriberInterface
{
$this->createNavigatorApplication();
$this->createOfficePluginApplication();
+ $this->generateProxies();
}
private function createNavigatorApplication()
@@ -74,4 +76,11 @@ class PhraseaInstallSubscriber implements EventSubscriberInterface
$this->app['manipulator.api-application']->update($application);
}
+
+ private function generateProxies()
+ {
+ $process = new Process('php ' . $this->app['root.path']. '/bin/developer orm:generate:proxies');
+ $process->setTimeout(300);
+ $process->run();
+ }
}
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php
index efadff7a38..0382763be2 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/PhraseaLocaleSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/RecordEditSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/RecordEditSubscriber.php
new file mode 100644
index 0000000000..be89f0349e
--- /dev/null
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/RecordEditSubscriber.php
@@ -0,0 +1,83 @@
+getRecords();
+ $databoxes = $event->getDataboxes();
+ $databox = array_pop($databoxes);
+
+ $metaStructure = $databox->get_meta_structure();
+ $editDateField = false;
+ foreach ($metaStructure->get_elements() as $meta) {
+ if ($meta->get_tag() instanceof TfEditdate) {
+ $editDateField = $meta;
+ }
+ }
+
+ if ($editDateField instanceof \databox_field) {
+ foreach ($records as $record) {
+ $this->updateRecord($record, $editDateField);
+ }
+ }
+ }
+
+ private function updateRecord($record, $field)
+ {
+ if (false === $record->is_grouping()) {
+ foreach ($record->get_grouping_parents() as $story) {
+ $this->updateEditField($story, $field);
+ }
+ }
+ $this->updateEditField($record, $field);
+ }
+
+
+ private function updateEditField($record, $editField)
+ {
+ $fields = $record->get_caption()->get_fields(array($editField->get_name()), true);
+ $field = array_pop($fields);
+
+ $metaId = null;
+
+ if ($field && !$field->is_multi()) {
+ $values = $field->get_values();
+ $metaId = array_pop($values)->getId();
+ }
+
+ $date = new \DateTime();
+ $record->set_metadatas(array(
+ array(
+ 'meta_struct_id' => $editField->get_id(),
+ 'meta_id' => $metaId,
+ 'value' => $date->format('Y-m-d H:i:s'),
+ )
+ ), true);
+ }
+
+ public static function getSubscribedEvents()
+ {
+ return array(
+ PhraseaEvents::RECORD_EDIT => 'onEdit',
+ PhraseaEvents::RECORD_UPLOAD => 'onEdit',
+ );
+ }
+}
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/RegistrationSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/RegistrationSubscriber.php
index f3c4e80cbd..1be37d197a 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/RegistrationSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/RegistrationSubscriber.php
@@ -34,7 +34,7 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
];
try {
- $rs = $this->app['EM.native-query']->getAdminsOfBases(array_keys($baseIds));
+ $rs = $this->app['orm.em.native-query']->getAdminsOfBases(array_keys($baseIds));
$adminUsers = array_map(function ($row) { return $row[0]; }, $rs);
} catch (\Exception $e) {
return;
@@ -82,7 +82,7 @@ class RegistrationSubscriber extends AbstractNotificationSubscriber
];
try {
- $rs = $this->app['EM.native-query']->getAdminsOfBases(array_keys($baseIds));
+ $rs = $this->app['orm.em.native-query']->getAdminsOfBases(array_keys($baseIds));
$adminUsers = array_map(function ($row) { return $row[0]; }, $rs);
} catch (\Exception $e) {
return;
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php
index a101810ce8..0cd51d857e 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/SessionManagerSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -142,12 +142,12 @@ class SessionManagerSubscriber implements EventSubscriberInterface
$module->setSession($session);
$session->addModule($module);
- $this->app['EM']->persist($module);
+ $this->app['orm.em']->persist($module);
} else {
- $this->app['EM']->persist($session->getModuleById($moduleId)->setUpdated(new \DateTime()));
+ $this->app['orm.em']->persist($session->getModuleById($moduleId)->setUpdated(new \DateTime()));
}
- $this->app['EM']->persist($session);
- $this->app['EM']->flush();
+ $this->app['orm.em']->persist($session);
+ $this->app['orm.em']->flush();
}
private function isFlashUploadRequest(Request $request)
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/TrustedProxySubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/TrustedProxySubscriber.php
index b705268c65..079c884016 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/TrustedProxySubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/TrustedProxySubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Event/Subscriber/XSendFileSubscriber.php b/lib/Alchemy/Phrasea/Core/Event/Subscriber/XSendFileSubscriber.php
index e16e5d2819..f41403c5b3 100644
--- a/lib/Alchemy/Phrasea/Core/Event/Subscriber/XSendFileSubscriber.php
+++ b/lib/Alchemy/Phrasea/Core/Event/Subscriber/XSendFileSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/PhraseaEvents.php b/lib/Alchemy/Phrasea/Core/PhraseaEvents.php
index 47fc6bd6f4..3ae5985c3e 100644
--- a/lib/Alchemy/Phrasea/Core/PhraseaEvents.php
+++ b/lib/Alchemy/Phrasea/Core/PhraseaEvents.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -29,16 +29,25 @@ final class PhraseaEvents
const ORDER_CREATE = 'order.create';
const ORDER_DELIVER = 'order.deliver';
const ORDER_DENY = 'order.deny';
+
const FEED_ENTRY_CREATE = 'feed-entry.create';
+
const REGISTRATION_CREATE = 'registration.create';
const REGISTRATION_AUTOREGISTER = 'registration.autoregister';
+
const BASKET_PUSH = 'basket.push';
+
const VALIDATION_CREATE = 'validation.create';
const VALIDATION_DONE = 'validation.done';
const VALIDATION_REMINDER = 'validation.reminder';
const LAZARET_CREATE = 'lazaret.create';
+
const BRIDGE_UPLOAD_FAILURE = 'bridge.upload-failure';
+
const EXPORT_MAIL_FAILURE = 'export.mail-failure';
const EXPORT_CREATE = 'export.create';
+
+ const RECORD_EDIT = 'record.edit';
+ const RECORD_UPLOAD = 'record.upload';
}
diff --git a/lib/Alchemy/Phrasea/Core/PhraseaExceptionHandler.php b/lib/Alchemy/Phrasea/Core/PhraseaExceptionHandler.php
index ab597e6079..ce7d392c90 100644
--- a/lib/Alchemy/Phrasea/Core/PhraseaExceptionHandler.php
+++ b/lib/Alchemy/Phrasea/Core/PhraseaExceptionHandler.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php
index b344edbc71..1a1ae27de3 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/AuthenticationManagerServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -32,7 +32,7 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
public function register(Application $app)
{
$app['authentication'] = $app->share(function (Application $app) {
- return new Authenticator($app, $app['browser'], $app['session'], $app['EM']);
+ return new Authenticator($app, $app['browser'], $app['session'], $app['orm.em']);
});
$app['authentication.persistent-manager'] = $app->share(function (Application $app) {
@@ -98,7 +98,7 @@ class AuthenticationManagerServiceProvider implements ServiceProviderInterface
$app['auth.native.failure-manager'] = $app->share(function (Application $app) {
$authConf = $app['conf']->get(['authentication', 'captcha']);
- return new FailureManager($app['repo.auth-failures'], $app['EM'], $app['recaptcha'], isset($authConf['trials-before-display']) ? $authConf['trials-before-display'] : 9);
+ return new FailureManager($app['repo.auth-failures'], $app['orm.em'], $app['recaptcha'], isset($authConf['trials-before-display']) ? $authConf['trials-before-display'] : 9);
});
$app['auth.password-checker'] = $app->share(function (Application $app) {
diff --git a/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php
index f797c9eb15..79db4326f4 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/BorderManagerServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php
index 368126fd36..cdd7ff26e4 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/BrowserServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/CSVServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/CSVServiceProvider.php
index 6f92ded40d..c37cb15a34 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/CSVServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/CSVServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php
index 7eaecc3298..e820128174 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/CacheServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php
index d16756cba5..2d299c1fea 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php
index 9be12c08f9..3bc90dd90a 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/ConfigurationTesterServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/ContentNegotiationServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ContentNegotiationServiceProvider.php
index afcb36ee25..c702f2d190 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/ContentNegotiationServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/ContentNegotiationServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/FeedServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/FeedServiceProvider.php
index 4ca2f87326..f96d2595e3 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/FeedServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/FeedServiceProvider.php
@@ -25,10 +25,10 @@ class FeedServiceProvider implements ServiceProviderInterface
public function register(Application $app)
{
$app['feed.user-link-generator'] = $app->share(function ($app) {
- return new FeedLinkGenerator($app['url_generator'], $app['EM'], $app['random.low']);
+ return new FeedLinkGenerator($app['url_generator'], $app['orm.em'], $app['random.low']);
});
$app['feed.aggregate-link-generator'] = $app->share(function ($app) {
- return new AggregateLinkGenerator($app['url_generator'], $app['EM'], $app['random.medium']);
+ return new AggregateLinkGenerator($app['url_generator'], $app['orm.em'], $app['random.medium']);
});
$app['feed.link-generator-collection'] = $app->share(function ($app) {
$collection = new LinkGeneratorCollection();
diff --git a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php
index 8ed200e297..d110c2f9bb 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/FileServeServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -15,6 +15,8 @@ use Alchemy\Phrasea\Core\Event\Subscriber\XSendFileSubscriber;
use Alchemy\Phrasea\Http\H264PseudoStreaming\H264Factory;
use Alchemy\Phrasea\Http\ServeFileResponseFactory;
use Alchemy\Phrasea\Http\StaticFile\StaticFileFactory;
+use Alchemy\Phrasea\Http\StaticFile\StaticMode;
+use Alchemy\Phrasea\Http\StaticFile\Symlink\SymLinker;
use Alchemy\Phrasea\Http\XSendFile\XSendFileFactory;
use Silex\Application;
use Silex\ServiceProviderInterface;
@@ -34,16 +36,12 @@ class FileServeServiceProvider implements ServiceProviderInterface
return H264Factory::create($app);
});
- $app['phraseanet.static-file-factory'] = $app->share(function ($app) {
- return StaticFileFactory::create($app);
- });
-
$app['phraseanet.h264'] = $app->share(function ($app) {
return $app['phraseanet.h264-factory']->createMode(false);
});
- $app['phraseanet.static-file'] = $app->share(function ($app) {
- return $app['phraseanet.static-file-factory']->getMode(false);
+ $app['phraseanet.static-file'] = $app->share(function (Application $app) {
+ return new StaticMode(SymLinker::create($app));
});
$app['phraseanet.file-serve'] = $app->share(function (Application $app) {
diff --git a/lib/Alchemy/Phrasea/Core/Provider/FtpServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/FtpServiceProvider.php
index 904ba32cd1..42e9acf169 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/FtpServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/FtpServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/InstallerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/InstallerServiceProvider.php
index 3fc83218f8..db822fb636 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/InstallerServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/InstallerServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/JMSSerializerServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/JMSSerializerServiceProvider.php
index 46d9b8c8c2..c847461e81 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/JMSSerializerServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/JMSSerializerServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php
index 5985de5ebc..f677d98294 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/LocaleServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/ManipulatorServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ManipulatorServiceProvider.php
index f76aa0bace..169acc3cc0 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/ManipulatorServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/ManipulatorServiceProvider.php
@@ -34,7 +34,7 @@ class ManipulatorServiceProvider implements ServiceProviderInterface
public function register(SilexApplication $app)
{
$app['manipulator.task'] = $app->share(function (SilexApplication $app) {
- return new TaskManipulator($app['EM'], $app['task-manager.notifier'], $app['translator'], $app['repo.tasks']);
+ return new TaskManipulator($app['orm.em'], $app['task-manager.notifier'], $app['translator'], $app['repo.tasks']);
});
$app['manipulator.user'] = $app->share(function ($app) {
@@ -42,11 +42,11 @@ class ManipulatorServiceProvider implements ServiceProviderInterface
});
$app['manipulator.token'] = $app->share(function ($app) {
- return new TokenManipulator($app['EM'], $app['random.medium'], $app['repo.tokens']);
+ return new TokenManipulator($app['orm.em'], $app['random.medium'], $app['repo.tokens']);
});
$app['manipulator.preset'] = $app->share(function ($app) {
- return new PresetManipulator($app['EM'], $app['repo.presets']);
+ return new PresetManipulator($app['orm.em'], $app['repo.presets']);
});
$app['manipulator.acl'] = $app->share(function ($app) {
@@ -54,43 +54,43 @@ class ManipulatorServiceProvider implements ServiceProviderInterface
});
$app['model.user-manager'] = $app->share(function ($app) {
- return new UserManager($app['EM'], $app['phraseanet.appbox']->get_connection());
+ return new UserManager($app['orm.em'], $app['phraseanet.appbox']->get_connection());
});
$app['manipulator.registration'] = $app->share(function ($app) {
- return new RegistrationManipulator($app, $app['EM'], $app['acl'], $app['phraseanet.appbox'], $app['repo.registrations']);
+ return new RegistrationManipulator($app, $app['orm.em'], $app['acl'], $app['phraseanet.appbox'], $app['repo.registrations']);
});
$app['manipulator.api-application'] = $app->share(function ($app) {
- return new ApiApplicationManipulator($app['EM'], $app['repo.api-applications'], $app['random.medium']);
+ return new ApiApplicationManipulator($app['orm.em'], $app['repo.api-applications'], $app['random.medium']);
});
$app['manipulator.api-account'] = $app->share(function ($app) {
- return new ApiAccountManipulator($app['EM'], $app['repo.api-accounts']);
+ return new ApiAccountManipulator($app['orm.em'], $app['repo.api-accounts']);
});
$app['manipulator.api-oauth-code'] = $app->share(function ($app) {
- return new ApiOauthCodeManipulator($app['EM'], $app['repo.api-oauth-codes'], $app['random.medium']);
+ return new ApiOauthCodeManipulator($app['orm.em'], $app['repo.api-oauth-codes'], $app['random.medium']);
});
$app['manipulator.api-oauth-token'] = $app->share(function ($app) {
- return new ApiOauthTokenManipulator($app['EM'], $app['repo.api-oauth-tokens'], $app['random.medium']);
+ return new ApiOauthTokenManipulator($app['orm.em'], $app['repo.api-oauth-tokens'], $app['random.medium']);
});
$app['manipulator.api-oauth-refresh-token'] = $app->share(function ($app) {
- return new ApiOauthRefreshTokenManipulator($app['EM'], $app['repo.api-oauth-refresh-tokens'], $app['random.medium']);
+ return new ApiOauthRefreshTokenManipulator($app['orm.em'], $app['repo.api-oauth-refresh-tokens'], $app['random.medium']);
});
$app['manipulator.api-log'] = $app->share(function ($app) {
- return new ApiLogManipulator($app['EM'], $app['repo.api-logs']);
+ return new ApiLogManipulator($app['orm.em'], $app['repo.api-logs']);
});
$app['manipulator.webhook-event'] = $app->share(function ($app) {
- return new WebhookEventManipulator($app['EM'], $app['repo.webhook-event']);
+ return new WebhookEventManipulator($app['orm.em'], $app['repo.webhook-event']);
});
$app['manipulator.webhook-delivery'] = $app->share(function ($app) {
- return new WebhookEventDeliveryManipulator($app['EM'], $app['repo.webhook-delivery']);
+ return new WebhookEventDeliveryManipulator($app['orm.em'], $app['repo.webhook-delivery']);
});
}
diff --git a/lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php
index 395eff6142..14a93919c7 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/ORMServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -12,22 +12,22 @@
namespace Alchemy\Phrasea\Core\Provider;
use Alchemy\Phrasea\Application as PhraseaApplication;
-use Alchemy\Phrasea\Cache\ArrayCache;
+use Alchemy\Phrasea\Core\Connection\ConnectionPoolManager;
use Alchemy\Phrasea\Core\Connection\ConnectionProvider;
-use Alchemy\Phrasea\Exception\RuntimeException;
-use Alchemy\Phrasea\Model\MonologSQLLogger;
+use Doctrine\Common\EventManager;
+use Doctrine\DBAL\Connection;
+use Doctrine\DBAL\DriverManager;
+use Doctrine\DBAL\Configuration;
+use Alchemy\Phrasea\Exception\InvalidArgumentException;
use Alchemy\Phrasea\Model\NativeQueryProvider;
use Doctrine\Common\Annotations\AnnotationReader;
-use Doctrine\Common\Annotations\AnnotationRegistry;
-use Doctrine\Common\Annotations\FileCacheReader;
-use Doctrine\Common\EventManager;
-use Doctrine\Common\Persistence\Mapping\Driver\MappingDriverChain;
-use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
-use Doctrine\ORM\Mapping\Driver\DriverChain;
-use Doctrine\ORM\EntityManager;
-use Doctrine\ORM\Configuration as ORMConfiguration;
+use Doctrine\Common\Annotations\CachedReader;
+use Doctrine\Common\Cache\ArrayCache;
+use Doctrine\DBAL\Logging\DebugStack;
use Doctrine\DBAL\Types\Type;
-use Gedmo\DoctrineExtensions;
+use Doctrine\ORM\Configuration as ORMConfig;
+use Doctrine\ORM\EntityManager;
+use Doctrine\ORM\Mapping\Driver\AnnotationDriver;
use Gedmo\Timestampable\TimestampableListener;
use Monolog\Handler\RotatingFileHandler;
use Silex\Application;
@@ -37,154 +37,629 @@ class ORMServiceProvider implements ServiceProviderInterface
{
public function register(Application $app)
{
- $app['EM.sql-logger.file'] = $app->share(function (Application $app) {
- return $app['log.path'].'/doctrine-log.log';
- });
- $app['EM.sql-logger.max-files'] = 5;
-
- $app['EM.sql-logger'] = $app->share(function (Application $app) {
- $logger = new $app['monolog.logger.class']('doctrine-logger');
- $logger->pushHandler(new RotatingFileHandler($app['EM.sql-logger.file'], $app['EM.sql-logger.max-files']));
-
- return new MonologSQLLogger($logger, 'yaml');
+ /**
+ * Provide configuration for DoctrineServiceProvider.
+ */
+ $app['dbs.service.conf'] = $app->share(function() use ($app) {
+ return array(
+ 'dbs.options' => $app['dbs.options']
+ );
});
- $app['EM.driver'] = $app->share(function (Application $app) {
- AnnotationRegistry::registerFile(
- $app['root.path'].'/vendor/doctrine/orm/lib/Doctrine/ORM/Mapping/Driver/DoctrineAnnotations.php'
+ /**
+ * Provide configuration for DoctrineORMServiceProvider.
+ */
+ $app['orm.service.conf'] = $app->share(function() use ($app) {
+ return array(
+ // Override "orm.cache.configurer" service provided for benefiting
+ // of "phraseanet.cache-service"
+ "orm.cache.configurer" => $app->protect(function($name, ORMConfig $config, $options) use ($app) {
+ $config->setMetadataCacheImpl($app['phraseanet.cache-service']->factory(
+ 'ORM_metadata', $app['orm.cache.driver'], $app['orm.cache.options']
+ ));
+ $config->setQueryCacheImpl($app['phraseanet.cache-service']->factory(
+ 'ORM_query', $app['orm.cache.driver'], $app['orm.cache.options']
+ ));
+ $config->setResultCacheImpl($app['phraseanet.cache-service']->factory(
+ 'ORM_result', $app['orm.cache.driver'], $app['orm.cache.options']
+ ));
+ $config->setHydrationCacheImpl($app['phraseanet.cache-service']->factory(
+ 'ORM_hydration', $app['orm.cache.driver'], $app['orm.cache.options']
+ ));
+ }),
+ "orm.proxies_dir" => $app['root.path'].'/resources/proxies',
+ "orm.auto_generate_proxies" => $app['debug'],
+ "orm.proxies_namespace" => 'Alchemy\Phrasea\Model\Proxies',
+ "orm.em.options" => $app['orm.ems.options']
);
-
- $annotationReader = new AnnotationReader();
- $fileCacheReader = new FileCacheReader(
- $annotationReader,
- $app['cache.path'].'/doctrine',
- $app['debug']
- );
-
- $driverChain = new MappingDriverChain();
- DoctrineExtensions::registerAbstractMappingIntoDriverChainORM(
- $driverChain,
- $fileCacheReader
- );
-
- $annotationDriver = new AnnotationDriver(
- $annotationReader,
- [$app['root.path'].'/lib/Alchemy/Phrasea/Model/Entities']
- );
-
- $driverChain->addDriver($annotationDriver, 'Alchemy\Phrasea\Model\Entities');
-
- return $driverChain;
});
- $app['EM.config'] = $app->share(function (Application $app) {
- $config = new ORMConfiguration();
+ /**
+ * Provides DSN string using database information
+ */
+ $app['db.dsn'] = $app->protect(function(array $params) use ($app) {
+ $params = $app['db.info']($params);
- if ($app->getEnvironment() === PhraseaApplication::ENV_DEV) {
- $config->setSQLLogger($app['EM.sql-logger']);
+ switch ($params['driver']) {
+ case 'pdo_mysql':
+
+ return sprintf('%s://%s:%s@%s:%s/%s',
+ $params['driver'],
+ $params['user'],
+ $params['password'],
+ $params['host'],
+ $params['port'],
+ $params['dbname']
+ );
+ case 'pdo_sqlite':
+
+ return sprintf('%s:%s',
+ $params['driver'],
+ $params['path']
+ );
+ }
+ });
+
+ /**
+ * Hash a DSN string
+ */
+ $app['hash.dsn'] = $app->protect(function($dsn) {
+
+ return md5($dsn);
+ });
+
+ /**
+ * Return database test configuration
+ */
+ $app['db.test.info'] = $app->share(function() use ($app) {
+
+ return $app['conf']->get(['main', 'database-test'], array());
+ });
+
+ /**
+ * Return application box database configuration
+ */
+ $app['db.appbox.info'] = $app->share(function() use ($app) {
+
+ return $app['conf']->get(['main', 'database'], array());
+ });
+
+ /**
+ * Return database fixture configuration
+ */
+ $app['db.fixture.info'] = $app->share(function() use ($app) {
+ return [
+ 'driver' => 'pdo_sqlite',
+ 'path' => sprintf('%s/%s', $app['tmp.path'], 'db-ref.sqlite'),
+ 'charset' => 'UTF8',
+ ];
+ });
+
+ /**
+ * Return databox database configuration
+ */
+ $app['db.databox.info'] = $app->share(function() use ($app) {
+ if (false === $app['phraseanet.configuration']->isSetup()) {
+
+ return array();
}
- $config->setMetadataCacheImpl($app['phraseanet.cache-service']->factory(
- 'ORMmetadata', $app['EM.opcode-cache-type'], $app['EM.opcode-cache-options']
+ $info = $app['db.appbox.info'];
+
+ $connection = $app['dbal.provider']($info);
+
+ $connection->connect();
+ //@todo cache this request ?
+ $sql = <<prepare($sql);
+ $stmt->execute();
+
+ $databox = $stmt->fetchAll(\PDO::FETCH_ASSOC);
+
+ $connection->close();
+ unset($stmt, $connection);
+
+ return $databox;
+ });
+
+ /**
+ * Return unique key for fixture database
+ */
+ $app['db.fixture.hash.key'] = $app->share(function() use ($app) {
+ $info = $app['db.fixture.info'];
+
+ return $app['hash.dsn']($app['db.dsn']($info));
+ });
+
+ /**
+ * Return unique key for test database
+ */
+ $app['db.test.hash.key'] = $app->share(function() use ($app) {
+ $info = $app['db.test.info'];
+
+ return $app['hash.dsn']($app['db.dsn']($info));
+ });
+
+ /**
+ * Return unique for appbox database
+ */
+ $app['db.appbox.hash.key'] = $app->share(function() use ($app) {
+ $info = $app['db.appbox.info'];
+
+ return $app['hash.dsn']($app['db.dsn']($info));
+ });
+
+ /**
+ * Return configuration option for test database in DoctrineServiceProvider
+ */
+ $app['db.test.options'] = $app->share(function() use ($app) {
+
+ return array($app['db.test.hash.key'] => $app['db.test.info']);
+ });
+
+ /**
+ * Return configuration option for test database in DoctrineServiceProvider
+ */
+ $app['db.fixture.options'] = $app->share(function() use ($app) {
+
+ return array($app['db.fixture.hash.key'] => $app['db.fixture.info']);
+ });
+
+ /**
+ * Return configuration option for appbox database in DoctrineServiceProvider
+ */
+ $app['db.appbox.options'] = $app->share(function() use ($app) {
+
+ return array($app['db.appbox.hash.key'] => $app['db.appbox.info']);
+ });
+
+ /**
+ * Return configuration option for databox databases in DoctrineServiceProvider
+ */
+ $app['dbs.databox.options'] = $app->share(function() use ($app) {
+ $options = array();
+
+ foreach($app['db.databox.info'] as $info) {
+ $info = $app['db.info']($info);
+
+ $key = $app['hash.dsn']($app['db.dsn']($info));
+
+ $options[$key] = $info;
+ }
+
+ return $options;
+ });
+
+ /**
+ * Return DoctrineServiceProvider database options, it merges all previous
+ * set database configuration
+ */
+ $app['dbs.options'] = $app->share(function() use ($app) {
+ if (false === $app['phraseanet.configuration']->isSetup()) {
+
+ return [];
+ }
+
+ return array_merge(
+ $app['db.appbox.options'],
+ $app['dbs.databox.options'],
+ $app['db.fixture.options'],
+ $app['db.test.options']
+ );
+ });
+
+ /**
+ * Return DoctrineORMServiceProvider information for a database from its parameters
+ */
+ $app['orm.em.options.from_info'] = $app->protect(function(array $info) use ($app) {
+ $info = $app['db.info']($info);
+
+ $key = $app['hash.dsn']($app['db.dsn']($info));
+
+ return array($key => $app['orm.options']($key));
+ });
+
+ /**
+ * Return DoctrineServiceProvider information for a database from its parameters
+ */
+ $app['db.options.from_info'] = $app->protect(function(array $info) use ($app) {
+ $info = $app['db.info']($info);
+
+ $key = $app['hash.dsn']($app['db.dsn']($info));
+
+ return array($key => $info);
+ });
+
+ /**
+ * Add orm on the fly, used only when a new databox is mounted.
+ * This allow to use new EM instance right after the database is mounted.
+ */
+ $app['orm.add'] = $app->protect(function($info) use ($app) {
+ $info = $app['db.info']($info);
+
+ $key = $app['hash.dsn']($app['db.dsn']($info));
+
+ $evm = new EventManager();
+ $app['dbal.evm.register.listeners']($evm);
+ $app['dbs.event_manager'][$key] = $evm;
+
+ $app['dbs.config'][$key] = new Configuration();
+
+ $app['dbs'][$key] = $app['dbs']->share(function () use ($app, $info, $key) {
+ return DriverManager::getConnection($info,$app['dbs.config'][$key] ,$app['dbs.event_manager'][$key]);
+ });
+
+ $options = $app['orm.options']($key);
+ $config = $app['orm.config.new']($key, $options);
+
+ $app['orm.annotation.register']($key);
+
+ $app['orm.ems'][$key] = $app['orm.ems']->share(function ($ems) use ($app, $key, $options, $config) {
+ $connection = $app['dbs'][$key];
+ $app['connection.pool.manager']->add($connection);
+
+ $types = $options['types'];
+ $app['dbal.type.register']($connection, $types);
+
+ return EntityManager::create(
+ $connection,
+ $config,
+ $app['dbs.event_manager'][$options['connection']]
+ );
+ });
+
+ return $key;
+ });
+
+ $app['dbal.evm.register.listeners'] = $app->protect(function($evm) use($app) {
+ $evm->addEventSubscriber(new TimestampableListener());
+ });
+
+ $app['dbal.config.register.loggers'] = $app->protect(function($config) use($app) {
+ if ($app->getEnvironment() === PhraseaApplication::ENV_DEV) {
+ $config->setSQLLogger($app['orm.query.logger']);
+ }
+ });
+
+ $app['orm.annotation.register'] = $app->protect(function($key) use($app) {
+ $driver = new AnnotationDriver($app['orm.annotation.reader'], array(
+ $app['root.path'].'/vendor/gedmo/doctrine-extensions/lib/Gedmo/Translatable/Entity/MappedSuperclass',
+ $app['root.path'].'/vendor/gedmo/doctrine-extensions/lib/Gedmo/Loggable/Entity/MappedSuperclass',
+ $app['root.path'].'/vendor/gedmo/doctrine-extensions/lib/Gedmo/Tree/Entity/MappedSuperclass',
));
- $config->setQueryCacheImpl($app['phraseanet.cache-service']->factory(
- 'ORMquery', $app['EM.opcode-cache-type'], $app['EM.opcode-cache-options']
- ));
- $config->setResultCacheImpl($app['phraseanet.cache-service']->factory(
- 'ORMresult', $app['EM.cache-type'], $app['EM.cache-options']
- ));
+ $app['orm.add_mapping_driver']($driver, 'Gedmo', $key);
+ });
- $config->setAutoGenerateProxyClasses($app['debug']);
+ $app['dbal.type.register'] = $app->protect(function(Connection $connection, $types) {
+ $platform = $connection->getDatabasePlatform();
- $config->setMetadataDriverImpl($app['EM.driver']);
+ foreach (array_keys((array) $types) as $type) {
+ $platform->registerDoctrineTypeMapping($type, $type);
+ }
+ });
- $config->setProxyDir($app['root.path'].'/resources/proxies');
- $config->setProxyNamespace('Alchemy\Phrasea\Model\Proxies');
- $config->setAutoGenerateProxyClasses($app['debug']);
- $config->addEntityNamespace('Phraseanet', 'Alchemy\Phrasea\Model\Entities');
+ $app['orm.config.new'] = $app->protect(function($key, $options) use($app) {
+ $config = new ORMConfig();
+ $app['orm.cache.configurer']($key, $config, $options);
+
+ $config->setProxyDir($app['orm.proxies_dir']);
+ $config->setProxyNamespace($app['orm.proxies_namespace']);
+ $config->setAutoGenerateProxyClasses($app['orm.auto_generate_proxies']);
+
+ $config->setCustomStringFunctions($app['orm.custom.functions.string']);
+ $config->setCustomNumericFunctions($app['orm.custom.functions.numeric']);
+ $config->setCustomDatetimeFunctions($app['orm.custom.functions.datetime']);
+ $config->setCustomHydrationModes($app['orm.custom.hydration_modes']);
+
+ $config->setClassMetadataFactoryName($app['orm.class_metadata_factory_name']);
+ $config->setDefaultRepositoryClassName($app['orm.default_repository_class']);
+
+ $config->setEntityListenerResolver($app['orm.entity_listener_resolver']);
+ $config->setRepositoryFactory($app['orm.repository_factory']);
+
+ $config->setNamingStrategy($app['orm.strategy.naming']);
+ $config->setQuoteStrategy($app['orm.strategy.quote']);
+
+ $chain = $app['orm.mapping_driver_chain.locator']($key);
+
+ foreach ((array)$options['mappings'] as $entity) {
+ if (!is_array($entity)) {
+ throw new \InvalidArgumentException(
+ "The 'orm.em.options' option 'mappings' should be an array of arrays."
+ );
+ }
+
+ if (!empty($entity['resources_namespace'])) {
+ $entity['path'] = $app['psr0_resource_locator']->findFirstDirectory($entity['resources_namespace']);
+ }
+
+ if (isset($entity['alias'])) {
+ $config->addEntityNamespace($entity['alias'], $entity['namespace']);
+ }
+
+ switch ($entity['type']) {
+ case 'annotation':
+ $useSimpleAnnotationReader =
+ isset($entity['use_simple_annotation_reader'])
+ ? $entity['use_simple_annotation_reader']
+ : true;
+ $driver = $config->newDefaultAnnotationDriver((array) $entity['path'], $useSimpleAnnotationReader);
+ $chain->addDriver($driver, $entity['namespace']);
+ break;
+ case 'yml':
+ $driver = new YamlDriver($entity['path']);
+ $chain->addDriver($driver, $entity['namespace']);
+ break;
+ case 'simple_yml':
+ $driver = new SimplifiedYamlDriver(array($entity['path'] => $entity['namespace']));
+ $chain->addDriver($driver, $entity['namespace']);
+ break;
+ case 'xml':
+ $driver = new XmlDriver($entity['path']);
+ $chain->addDriver($driver, $entity['namespace']);
+ break;
+ case 'simple_xml':
+ $driver = new SimplifiedXmlDriver(array($entity['path'] => $entity['namespace']));
+ $chain->addDriver($driver, $entity['namespace']);
+ break;
+ case 'php':
+ $driver = new StaticPHPDriver($entity['path']);
+ $chain->addDriver($driver, $entity['namespace']);
+ break;
+ default:
+ throw new \InvalidArgumentException(sprintf('"%s" is not a recognized driver', $entity['type']));
+ break;
+ }
+ }
+ $config->setMetadataDriverImpl($chain);
+
+ foreach ((array) $options['types'] as $typeName => $typeClass) {
+ if (Type::hasType($typeName)) {
+ Type::overrideType($typeName, $typeClass);
+ } else {
+ Type::addType($typeName, $typeClass);
+ }
+ }
return $config;
});
- $app['EM.opcode-cache-type'] = $app->share(function (Application $app) {
- if ($app['configuration.store']->isSetup()) {
- return $app['conf']->get(['main', 'opcodecache', 'type']);
+ $app['orm.ems.options'] = $app->share(function() use ($app) {
+ if (false === $app['phraseanet.configuration']->isSetup()) {
+ return [];
}
- return 'ArrayCache';
+ return array_merge(
+ $app['orm.em.appbox.options'],
+ $app['orm.ems.databox.options'],
+ $app['orm.em.fixture.options'],
+ $app['orm.em.test.options']
+
+ );
});
- $app['EM.opcode-cache-options'] = $app->share(function (Application $app) {
- if ($app['configuration.store']->isSetup()) {
- return $app['conf']->get(['main', 'opcodecache', 'options']);
+
+ /**
+ * Check database connection information
+ */
+ $app['db.info'] = $app->protect(function(array $info){
+ if (!isset($info['driver'])) {
+ $info['driver'] = 'pdo_mysql';
}
- return [];
+ if (!isset($info['charset'])) {
+ $info['charset'] = 'utf8';
+ }
+
+ switch ($info['driver']) {
+ case 'pdo_mysql':
+ foreach (array('user', 'password', 'host', 'dbname', 'port') as $param) {
+ if (!array_key_exists($param, $info)) {
+ throw new InvalidArgumentException(sprintf('Missing "%s" argument for database connection using driver %s', $param, $info['driver']));
+ }
+ }
+ break;
+ case 'pdo_sqlite':
+ if (!array_key_exists('path', $info)) {
+ throw new InvalidArgumentException(sprintf('Missing "path" argument for database connection using driver %s', $info['driver']));
+ }
+ break;
+ }
+
+ return $info;
});
- $app['EM.cache-type'] = $app->share(function (Application $app) {
+ /**
+ * Return configuration option for appbox database in DoctrineORMServiceProvider
+ */
+ $app['orm.em.appbox.options'] = $app->share(function() use ($app) {
+ $key = $app['db.appbox.hash.key'];
+
+ return array($key => $app['orm.options']($key));
+ });
+
+ /**
+ * Return configuration option for fixture database in DoctrineORMServiceProvider
+ */
+ $app['orm.em.fixture.options'] = $app->share(function() use ($app) {
+ $key = $app['db.fixture.hash.key'];
+
+ return array($key => $app['orm.options']($key));
+ });
+
+ /**
+ * Return configuration option for test database in DoctrineORMServiceProvider
+ */
+ $app['orm.em.test.options'] = $app->share(function() use ($app) {
+ $key = $app['db.test.hash.key'];
+
+ return array($key => $app['orm.options']($key));
+ });
+
+ /**
+ * Return configuration option for databox databases in DoctrineORMServiceProvider
+ */
+ $app['orm.ems.databox.options'] = $app->share(function() use ($app) {
+ $options = array();
+
+ foreach ($app['db.databox.info'] as $base) {
+ $info = $app['db.info']($base);
+
+ $key = $app['hash.dsn']($app['db.dsn']($info));
+
+ $options[$key] = $app['orm.options']($key);
+ }
+
+ return $options;
+ });
+
+ /**
+ * Return orm configuration for a connection given its unique id
+ */
+ $app['orm.options'] = $app->protect(function($connection) use ($app) {
+ return array(
+ "connection" => $connection,
+ "mappings" => array(
+ array(
+ "type" => "annotation",
+ "alias" => "Phraseanet",
+ "use_simple_annotation_reader" => false,
+ "namespace" => 'Alchemy\Phrasea\Model\Entities',
+ "path" => $app['root.path'].'/lib/Alchemy/Phrasea/Model/Entities',
+ )
+ ),
+ "types" => array(
+ 'blob' => 'Alchemy\Phrasea\Model\Types\Blob',
+ 'enum' => 'Alchemy\Phrasea\Model\Types\Enum',
+ 'longblob' => 'Alchemy\Phrasea\Model\Types\LongBlob',
+ 'varbinary' => 'Alchemy\Phrasea\Model\Types\VarBinary',
+ 'binary' => 'Alchemy\Phrasea\Model\Types\Binary',
+ 'binary_string' => 'Alchemy\Phrasea\Model\Types\BinaryString',
+ )
+ );
+ });
+
+ /**
+ * Path to doctrine log file
+ */
+ $app['orm.monolog.handler.file'] = $app->share(function (Application $app) {
+ return $app['log.path'].'/doctrine.log';
+ });
+
+ /**
+ * Maximum files of logs
+ */
+ $app['orm.monolog.handler.file.max-files'] = 5;
+
+ /**
+ * Monolog handler for doctrine
+ */
+ $app['orm.monolog.handler'] = $app->share(function(Application $app) {
+ return new RotatingFileHandler($app['orm.monolog.handler.file'], $app['orm.monolog.handler.file.max-files']);
+ });
+
+ /**
+ * Monolog instance for doctrine
+ */
+ $app['orm.monolog.logger'] = $app->share(function (Application $app) {
+ $logger = new $app['monolog.logger.class']('doctrine-logger');
+
+ $logger->pushHandler($app['orm.monolog.handler']);
+
+ return $logger;
+ });
+
+ /**
+ * Doctrine query logger
+ */
+ $app['orm.query.logger'] = $app->share(function () {
+ return new DebugStack();
+ });
+
+ /**
+ * Return cache driver
+ */
+ $app['orm.cache.driver'] = $app->share(function (Application $app) {
if ($app['configuration.store']->isSetup()) {
return $app['conf']->get(['main', 'cache', 'type']);
}
- return 'ArrayCache';
+ return 'array';
});
- $app['EM.cache-options'] = $app->share(function (Application $app) {
+
+ /**
+ * Return cache options
+ */
+ $app['orm.cache.options'] = $app->share(function (Application $app) {
if ($app['configuration.store']->isSetup()) {
return $app['conf']->get(['main', 'cache', 'options']);
}
return [];
});
- $app['EM.events-manager'] = $app->share(function (Application $app) {
- $evm = new EventManager();
- $evm->addEventSubscriber(new TimestampableListener());
- return $evm;
- });
+ /**
+ * Retrieve a registered DBALConnection using configuration parameters
+ */
+ $app['db.provider'] = $app->protect(function (array $info) use ($app) {
+ $info = $app['db.info']($info);
- $app['EM.dbal-conf'] = $app->share(function (Application $app) {
- if ('test' === $app->getEnvironment()) {
- return $app['conf']->get(['main', 'database-test']);
+ $key = $app['hash.dsn']($app['db.dsn']($info));
+
+ if (!isset($app['dbs'][$key])) {
+ return $app['dbal.provider']($info);
}
- return $app['conf']->get(['main', 'database']);
+ return $app['dbs'][$key];
});
- $app['dbal.provider'] = $app->share(function (Application $app) {
- return new ConnectionProvider($app['EM.config'], $app['EM.events-manager'], isset($app['task-manager.logger']) ? $app['task-manager.logger'] : $app['monolog']);
+ /**
+ * Returns a new DBALConnection instance using configuration parameters
+ */
+ $app['dbal.provider'] = $app->protect(function (array $info) use ($app) {
+ $info = $app['db.info']($info);
+
+ $connection = DriverManager::getConnection($info);
+
+ $app['connection.pool.manager']->add($connection);
+
+ return $connection;
});
- $app['EM'] = $app->share(function (Application $app) {
- try {
- $em = EntityManager::create($app['EM.dbal-conf'], $app['EM.config'], $app['EM.events-manager']);
- } catch (\Exception $e) {
- throw new RuntimeException("Unable to create database connection", $e->getCode(), $e);
+ $app['connection.pool.manager'] = $app->share(function() use ($app) {
+ return new ConnectionPoolManager();
+ });
+
+ /**
+ * Return an instance of native cache query for default ORM
+ * @todo return an instance of NativeQueryProvider for given orm;
+ */
+ $app['orm.orm.em.native-query'] = $app->share(function ($app) {
+ return new NativeQueryProvider($app['orm.em']);
+ });
+
+ /**
+ * Return an instance of annotation cache reader
+ */
+ $app['orm.annotation.reader'] = $app->share(function() use ($app) {
+ $cache = new ArrayCache();
+ if ($app->getEnvironment() !== PhraseaApplication::ENV_DEV) {
+ $cache = $app['phraseanet.cache-service']->factory(
+ 'ORM_annotation', $app['orm.cache.driver'], $app['orm.cache.options']
+ );
}
- $platform = $em->getConnection()->getDatabasePlatform();
-
- $types = [
- 'blob' => 'Alchemy\Phrasea\Model\Types\Blob',
- 'enum' => 'Alchemy\Phrasea\Model\Types\Blob',
- 'longblob' => 'Alchemy\Phrasea\Model\Types\LongBlob',
- 'varbinary' => 'Alchemy\Phrasea\Model\Types\VarBinary',
- 'binary' => 'Alchemy\Phrasea\Model\Types\Binary',
- 'binary_string' => 'Alchemy\Phrasea\Model\Types\BinaryString',
- ];
-
- foreach ($types as $type => $class) {
- if (!Type::hasType($type)) {
- Type::addType($type, $class);
- }
- $platform->registerDoctrineTypeMapping($type, $type);
- }
-
- return $em;
- });
-
- $app['EM.native-query'] = $app->share(function ($app) {
- return new NativeQueryProvider($app['EM']);
+ return new CachedReader(new AnnotationReader(), $cache);
});
}
diff --git a/lib/Alchemy/Phrasea/Core/Provider/PhraseaEventServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PhraseaEventServiceProvider.php
index ece1f1b21e..ba556228e9 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/PhraseaEventServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/PhraseaEventServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -16,6 +16,7 @@ use Alchemy\Phrasea\Core\Event\Subscriber\CookiesDisablerSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\LogoutSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\MaintenanceSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\PhraseaLocaleSubscriber;
+use Alchemy\Phrasea\Core\Event\Subscriber\RecordEditSubscriber;
use Alchemy\Phrasea\Core\Event\Subscriber\SessionManagerSubscriber;
use Silex\Application;
use Silex\ServiceProviderInterface;
@@ -42,6 +43,9 @@ class PhraseaEventServiceProvider implements ServiceProviderInterface
$app['phraseanet.content-negotiation-subscriber'] = $app->share(function (Application $app) {
return new ContentNegotiationSubscriber($app);
});
+ $app['phraseanet.record-edit-subscriber'] = $app->share(function (Application $app) {
+ return new RecordEditSubscriber();
+ });
}
public function boot(Application $app)
diff --git a/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php
index 98a9adce1b..debec3bdc4 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/PhraseaVersionServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php
index e718cc0854..37b67a283a 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/PhraseanetServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -68,13 +68,25 @@ class PhraseanetServiceProvider implements ServiceProviderInterface
return $reader;
});
- $app['phraseanet.metadata-setter'] = $app->share(function (SilexApplication $app) {
+ $app['phraseanet.metadata-setter'] = $app->share(function () {
return new PhraseanetMetadataSetter();
});
$app['phraseanet.user-query'] = function (SilexApplication $app) {
return new \User_Query($app);
};
+
+ $app['phraseanet.logger'] = $app->protect(function ($databox) use ($app) {
+ try {
+ return \Session_Logger::load($app, $databox);
+ } catch (\Exception_Session_LoggerNotFound $e) {
+ return \Session_Logger::create($app, $databox, $app['browser']);
+ }
+ });
+
+ $app['date-formatter'] = $app->share(function (SilexApplication $app) {
+ return new \phraseadate($app);
+ });
}
public function boot(SilexApplication $app)
diff --git a/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php
index 1a9d2e7693..71984c8dc4 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/PluginServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -37,7 +37,7 @@ class PluginServiceProvider implements ServiceProviderInterface
});
$app['plugins.manager'] = $app->share(function (Application $app) {
- return new PluginManager($app['plugins.directory'], $app['plugins.plugins-validator'], $app['conf']);
+ return new PluginManager($app['plugin.path'], $app['plugins.plugins-validator'], $app['conf']);
});
}
diff --git a/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php
index 5b6af0898d..83db767a2f 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/RegistrationServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/RepositoriesServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/RepositoriesServiceProvider.php
index 3020c30fcb..7904b1d56d 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/RepositoriesServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/RepositoriesServiceProvider.php
@@ -20,106 +20,106 @@ class RepositoriesServiceProvider implements ServiceProviderInterface
public function register(Application $app)
{
$app['repo.users'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:User');
+ return $app['orm.em']->getRepository('Phraseanet:User');
});
$app['repo.auth-failures'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:AuthFailure');
+ return $app['orm.em']->getRepository('Phraseanet:AuthFailure');
});
$app['repo.sessions'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:Session');
+ return $app['orm.em']->getRepository('Phraseanet:Session');
});
$app['repo.tasks'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:Task');
+ return $app['orm.em']->getRepository('Phraseanet:Task');
});
$app['repo.registrations'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:Registration');
+ return $app['orm.em']->getRepository('Phraseanet:Registration');
});
$app['repo.baskets'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:Basket');
+ return $app['orm.em']->getRepository('Phraseanet:Basket');
});
$app['repo.basket-elements'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:BasketElement');
+ return $app['orm.em']->getRepository('Phraseanet:BasketElement');
});
$app['repo.validation-participants'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:ValidationParticipant');
+ return $app['orm.em']->getRepository('Phraseanet:ValidationParticipant');
});
$app['repo.story-wz'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:StoryWZ');
+ return $app['orm.em']->getRepository('Phraseanet:StoryWZ');
});
$app['repo.orders'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:Order');
+ return $app['orm.em']->getRepository('Phraseanet:Order');
});
$app['repo.order-elements'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:OrderElement');
+ return $app['orm.em']->getRepository('Phraseanet:OrderElement');
});
$app['repo.feeds'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:Feed');
+ return $app['orm.em']->getRepository('Phraseanet:Feed');
});
$app['repo.feed-entries'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:FeedEntry');
+ return $app['orm.em']->getRepository('Phraseanet:FeedEntry');
});
$app['repo.feed-items'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:FeedItem');
+ return $app['orm.em']->getRepository('Phraseanet:FeedItem');
});
$app['repo.feed-publishers'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:FeedPublisher');
+ return $app['orm.em']->getRepository('Phraseanet:FeedPublisher');
});
$app['repo.feed-tokens'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:FeedToken');
+ return $app['orm.em']->getRepository('Phraseanet:FeedToken');
});
$app['repo.aggregate-tokens'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:AggregateToken');
+ return $app['orm.em']->getRepository('Phraseanet:AggregateToken');
});
$app['repo.usr-lists'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:UsrList');
+ return $app['orm.em']->getRepository('Phraseanet:UsrList');
});
$app['repo.usr-list-owners'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:UsrListOwner');
+ return $app['orm.em']->getRepository('Phraseanet:UsrListOwner');
});
$app['repo.usr-list-entries'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:UsrListEntry');
+ return $app['orm.em']->getRepository('Phraseanet:UsrListEntry');
});
$app['repo.lazaret-files'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:LazaretFile');
+ return $app['orm.em']->getRepository('Phraseanet:LazaretFile');
});
$app['repo.usr-auth-providers'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:UsrAuthProvider');
+ return $app['orm.em']->getRepository('Phraseanet:UsrAuthProvider');
});
$app['repo.ftp-exports'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:FtpExport');
+ return $app['orm.em']->getRepository('Phraseanet:FtpExport');
});
$app['repo.user-queries'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:UserQuery');
+ return $app['orm.em']->getRepository('Phraseanet:UserQuery');
});
$app['repo.tokens'] = $app->share(function ($app) {
- return $app['EM']->getRepository('Phraseanet:Token');
+ return $app['orm.em']->getRepository('Phraseanet:Token');
});
$app['repo.presets'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:Preset');
+ return $app['orm.em']->getRepository('Phraseanet:Preset');
});
$app['repo.api-accounts'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:ApiAccount');
+ return $app['orm.em']->getRepository('Phraseanet:ApiAccount');
});
$app['repo.api-logs'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:ApiLog');
+ return $app['orm.em']->getRepository('Phraseanet:ApiLog');
});
$app['repo.api-applications'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:ApiApplication');
+ return $app['orm.em']->getRepository('Phraseanet:ApiApplication');
});
$app['repo.api-oauth-codes'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:ApiOauthCode');
+ return $app['orm.em']->getRepository('Phraseanet:ApiOauthCode');
});
$app['repo.api-oauth-tokens'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:ApiOauthToken');
+ return $app['orm.em']->getRepository('Phraseanet:ApiOauthToken');
});
$app['repo.api-oauth-refresh-tokens'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:ApiOauthRefreshToken');
+ return $app['orm.em']->getRepository('Phraseanet:ApiOauthRefreshToken');
});
$app['repo.webhook-event'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:WebhookEvent');
+ return $app['orm.em']->getRepository('Phraseanet:WebhookEvent');
});
$app['repo.webhook-delivery'] = $app->share(function (PhraseaApplication $app) {
- return $app['EM']->getRepository('Phraseanet:WebhookEventDelivery');
+ return $app['orm.em']->getRepository('Phraseanet:WebhookEventDelivery');
});
}
diff --git a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php
index d53cc5527f..2cbf034914 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/SearchEngineServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/TemporaryFilesystemServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/TemporaryFilesystemServiceProvider.php
index 4ea2ab506d..814bf311f3 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/TemporaryFilesystemServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/TemporaryFilesystemServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php
index d2597efa72..e71b159736 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/TokensServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php b/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php
index 454e4905b3..3c40f13828 100644
--- a/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php
+++ b/lib/Alchemy/Phrasea/Core/Provider/UnicodeServiceProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Response/CSVFileResponse.php b/lib/Alchemy/Phrasea/Core/Response/CSVFileResponse.php
index 03610411b6..4c404bfd48 100644
--- a/lib/Alchemy/Phrasea/Core/Response/CSVFileResponse.php
+++ b/lib/Alchemy/Phrasea/Core/Response/CSVFileResponse.php
@@ -2,7 +2,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2013 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Core/Version.php b/lib/Alchemy/Phrasea/Core/Version.php
index 4551f73806..e3c38e719a 100644
--- a/lib/Alchemy/Phrasea/Core/Version.php
+++ b/lib/Alchemy/Phrasea/Core/Version.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -14,7 +14,7 @@ namespace Alchemy\Phrasea\Core;
class Version
{
protected static $number = '3.9.0-alpha.20';
- protected static $name = 'Epanterias';
+ protected static $name = 'Herrerasaurus';
public static function getNumber()
{
diff --git a/lib/Alchemy/Phrasea/Exception/Exception.php b/lib/Alchemy/Phrasea/Exception/Exception.php
index d5cc8b47f3..10db8e9ecb 100644
--- a/lib/Alchemy/Phrasea/Exception/Exception.php
+++ b/lib/Alchemy/Phrasea/Exception/Exception.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Exception/FormProcessingException.php b/lib/Alchemy/Phrasea/Exception/FormProcessingException.php
index 6d4f353802..6e04c76f62 100644
--- a/lib/Alchemy/Phrasea/Exception/FormProcessingException.php
+++ b/lib/Alchemy/Phrasea/Exception/FormProcessingException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Exception/InvalidArgumentException.php b/lib/Alchemy/Phrasea/Exception/InvalidArgumentException.php
index aa08d4ff22..b640e83c7a 100644
--- a/lib/Alchemy/Phrasea/Exception/InvalidArgumentException.php
+++ b/lib/Alchemy/Phrasea/Exception/InvalidArgumentException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Exception/LogicException.php b/lib/Alchemy/Phrasea/Exception/LogicException.php
index 95cffc4488..10a0604ac6 100644
--- a/lib/Alchemy/Phrasea/Exception/LogicException.php
+++ b/lib/Alchemy/Phrasea/Exception/LogicException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Exception/RuntimeException.php b/lib/Alchemy/Phrasea/Exception/RuntimeException.php
index f5cec9145f..0de758bbce 100644
--- a/lib/Alchemy/Phrasea/Exception/RuntimeException.php
+++ b/lib/Alchemy/Phrasea/Exception/RuntimeException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Exception/SessionNotFound.php b/lib/Alchemy/Phrasea/Exception/SessionNotFound.php
index 95c81afd8f..45269e707e 100644
--- a/lib/Alchemy/Phrasea/Exception/SessionNotFound.php
+++ b/lib/Alchemy/Phrasea/Exception/SessionNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Feed/Aggregate.php b/lib/Alchemy/Phrasea/Feed/Aggregate.php
index acb9909976..4a6a315df5 100644
--- a/lib/Alchemy/Phrasea/Feed/Aggregate.php
+++ b/lib/Alchemy/Phrasea/Feed/Aggregate.php
@@ -81,7 +81,7 @@ class Aggregate implements FeedInterface
$feeds = $app['repo.feeds']->getAllForUser($app['acl']->get($user), $restrictions);
$token = $app['repo.aggregate-tokens']->findOneBy(['user' => $user]);
- return new static($app['EM'], $feeds, $token);
+ return new static($app['orm.em'], $feeds, $token);
}
/**
@@ -239,6 +239,6 @@ class Aggregate implements FeedInterface
*/
public static function getPublic(Application $app)
{
- return new static($app['EM'], $app['repo.feeds']->findBy(['public' => true], ['updatedOn' => 'DESC']));
+ return new static($app['orm.em'], $app['repo.feeds']->findBy(['public' => true], ['updatedOn' => 'DESC']));
}
}
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/Geoname.php b/lib/Alchemy/Phrasea/Form/Constraint/Geoname.php
index f51949262f..0ee37c4f87 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/Geoname.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/Geoname.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/GeonameValidator.php b/lib/Alchemy/Phrasea/Form/Constraint/GeonameValidator.php
index 3fad29fe8c..c6ea16f915 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/GeonameValidator.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/GeonameValidator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/NewEmail.php b/lib/Alchemy/Phrasea/Form/Constraint/NewEmail.php
index a6cfc01318..00c34c7448 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/NewEmail.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/NewEmail.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/NewEmailValidator.php b/lib/Alchemy/Phrasea/Form/Constraint/NewEmailValidator.php
index 936b9fabc2..ee74336291 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/NewEmailValidator.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/NewEmailValidator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/NewLogin.php b/lib/Alchemy/Phrasea/Form/Constraint/NewLogin.php
index 781cb90235..c47d8183fc 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/NewLogin.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/NewLogin.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/NewLoginValidator.php b/lib/Alchemy/Phrasea/Form/Constraint/NewLoginValidator.php
index 88b244d939..e4590891de 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/NewLoginValidator.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/NewLoginValidator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/PasswordToken.php b/lib/Alchemy/Phrasea/Form/Constraint/PasswordToken.php
index f1cc83eb08..21a41fe059 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/PasswordToken.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/PasswordToken.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Constraint/PasswordTokenValidator.php b/lib/Alchemy/Phrasea/Form/Constraint/PasswordTokenValidator.php
index 874319d6b9..be095376ed 100644
--- a/lib/Alchemy/Phrasea/Form/Constraint/PasswordTokenValidator.php
+++ b/lib/Alchemy/Phrasea/Form/Constraint/PasswordTokenValidator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Login/PhraseaAuthenticationForm.php b/lib/Alchemy/Phrasea/Form/Login/PhraseaAuthenticationForm.php
index e40edd2bf9..7b41e73938 100644
--- a/lib/Alchemy/Phrasea/Form/Login/PhraseaAuthenticationForm.php
+++ b/lib/Alchemy/Phrasea/Form/Login/PhraseaAuthenticationForm.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -15,6 +15,7 @@ use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert;
use Silex\Application;
+use Symfony\Component\OptionsResolver\OptionsResolverInterface;
class PhraseaAuthenticationForm extends AbstractType
{
@@ -71,4 +72,15 @@ class PhraseaAuthenticationForm extends AbstractType
{
return null;
}
+
+ public function setDefaultOptions(OptionsResolverInterface $resolver)
+ {
+ $csrf = true;
+ if (isset($this->app['phraseanet.configuration']['auth-csrf-protection'])) {
+ $csrf = (Boolean) $this->app['phraseanet.configuration']['auth-csrf-protection'];
+ }
+ $resolver->setDefaults(array(
+ 'csrf_protection' => $csrf,
+ ));
+ }
}
diff --git a/lib/Alchemy/Phrasea/Form/Login/PhraseaForgotPasswordForm.php b/lib/Alchemy/Phrasea/Form/Login/PhraseaForgotPasswordForm.php
index bb51348a3f..40c46aa4e2 100644
--- a/lib/Alchemy/Phrasea/Form/Login/PhraseaForgotPasswordForm.php
+++ b/lib/Alchemy/Phrasea/Form/Login/PhraseaForgotPasswordForm.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Login/PhraseaRecoverPasswordForm.php b/lib/Alchemy/Phrasea/Form/Login/PhraseaRecoverPasswordForm.php
index 7669a42ed7..7c6c59560b 100644
--- a/lib/Alchemy/Phrasea/Form/Login/PhraseaRecoverPasswordForm.php
+++ b/lib/Alchemy/Phrasea/Form/Login/PhraseaRecoverPasswordForm.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php b/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php
index 837ad767a8..924b5b6292 100644
--- a/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php
+++ b/lib/Alchemy/Phrasea/Form/Login/PhraseaRegisterForm.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Login/PhraseaRenewPasswordForm.php b/lib/Alchemy/Phrasea/Form/Login/PhraseaRenewPasswordForm.php
index 82d9496a81..3c4cc20a83 100644
--- a/lib/Alchemy/Phrasea/Form/Login/PhraseaRenewPasswordForm.php
+++ b/lib/Alchemy/Phrasea/Form/Login/PhraseaRenewPasswordForm.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Form/Type/GeonameType.php b/lib/Alchemy/Phrasea/Form/Type/GeonameType.php
index cfa0075d81..68b530f521 100644
--- a/lib/Alchemy/Phrasea/Form/Type/GeonameType.php
+++ b/lib/Alchemy/Phrasea/Form/Type/GeonameType.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/DatabaseHelper.php b/lib/Alchemy/Phrasea/Helper/DatabaseHelper.php
index 3c4268ea66..2d39b5f0c7 100644
--- a/lib/Alchemy/Phrasea/Helper/DatabaseHelper.php
+++ b/lib/Alchemy/Phrasea/Helper/DatabaseHelper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -11,6 +11,8 @@
namespace Alchemy\Phrasea\Helper;
+use Doctrine\DBAL\Connection;
+
class DatabaseHelper extends Helper
{
public function checkConnection()
@@ -21,60 +23,46 @@ class DatabaseHelper extends Helper
$password = $this->request->query->get('password');
$db_name = $this->request->query->get('db_name');
- $connection_ok = $db_ok = $is_databox = $is_appbox = $empty = false;
+ $is_databox = $is_appbox = $empty = false;
- try {
- $conn = $this->app['dbal.provider']->get([
- 'host' => $hostname,
- 'port' => $port,
- 'user' => $user,
- 'password' => $password
- ]);
- $conn->connect();
- $connection_ok = true;
- } catch (\Exception $e) {
+ /** @var Connection $connection */
+ $connection = $this->app['dbal.provider']([
+ 'host' => $hostname,
+ 'port' => $port,
+ 'user' => $user,
+ 'password' => $password,
+ 'dbname' => $db_name,
+ ]);
- }
+ if (false !== $dbOK = $connection->isConnected()) {
+ $sql = "SHOW TABLE STATUS";
+ $stmt = $connection->prepare($sql);
+ $stmt->execute();
- if (null !== $db_name && $connection_ok) {
- try {
- $conn = $this->app['dbal.provider']->get([
- 'host' => $hostname,
- 'port' => $port,
- 'user' => $user,
- 'password' => $password,
- 'dbname' => $db_name,
- ]);
+ $empty = $stmt->rowCount() === 0;
- $conn->connect();
+ $rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
+ $stmt->closeCursor();
- $db_ok = true;
-
- $sql = "SHOW TABLE STATUS";
- $stmt = $conn->prepare($sql);
- $stmt->execute();
-
- $empty = $stmt->rowCount() === 0;
-
- $rs = $stmt->fetchAll(\PDO::FETCH_ASSOC);
- $stmt->closeCursor();
-
- foreach ($rs as $row) {
- if ($row["Name"] === 'sitepreff') {
- $is_appbox = true;
- }
- if ($row["Name"] === 'pref') {
- $is_databox = true;
- }
+ foreach ($rs as $row) {
+ if ($row["Name"] === 'sitepreff') {
+ $is_appbox = true;
+ }
+ if ($row["Name"] === 'pref') {
+ $is_databox = true;
}
- } catch (\Exception $e) {
-
}
+ $connection->close();
}
+ unset($connection);
+
+ $this->app['connection.pool.manager']->closeAll();
+
return [
- 'connection' => $connection_ok,
- 'database' => $db_ok,
+ 'connection' => $dbOK,
+ 'innodb' => true,
+ 'database' => $dbOK,
'is_empty' => $empty,
'is_appbox' => $is_appbox,
'is_databox' => $is_databox
diff --git a/lib/Alchemy/Phrasea/Helper/Helper.php b/lib/Alchemy/Phrasea/Helper/Helper.php
index 2e0ea2f546..db38bb432a 100644
--- a/lib/Alchemy/Phrasea/Helper/Helper.php
+++ b/lib/Alchemy/Phrasea/Helper/Helper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/PathHelper.php b/lib/Alchemy/Phrasea/Helper/PathHelper.php
index 42de7e1d8e..64800d47d6 100644
--- a/lib/Alchemy/Phrasea/Helper/PathHelper.php
+++ b/lib/Alchemy/Phrasea/Helper/PathHelper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/Prod.php b/lib/Alchemy/Phrasea/Helper/Prod.php
index d5dcd67d3a..e7f8bf22f4 100644
--- a/lib/Alchemy/Phrasea/Helper/Prod.php
+++ b/lib/Alchemy/Phrasea/Helper/Prod.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -99,4 +99,4 @@ class Prod extends Helper
{
return md5(time() . mt_rand(100000, 999999));
}
-}
\ No newline at end of file
+}
diff --git a/lib/Alchemy/Phrasea/Helper/Record/Bridge.php b/lib/Alchemy/Phrasea/Helper/Record/Bridge.php
index 90c177ae86..8bfcbd62c6 100644
--- a/lib/Alchemy/Phrasea/Helper/Record/Bridge.php
+++ b/lib/Alchemy/Phrasea/Helper/Record/Bridge.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/Record/Helper.php b/lib/Alchemy/Phrasea/Helper/Record/Helper.php
index af36132b8b..d522ef0616 100644
--- a/lib/Alchemy/Phrasea/Helper/Record/Helper.php
+++ b/lib/Alchemy/Phrasea/Helper/Record/Helper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/Record/Printer.php b/lib/Alchemy/Phrasea/Helper/Record/Printer.php
index 261e28d921..b8e1bbc305 100644
--- a/lib/Alchemy/Phrasea/Helper/Record/Printer.php
+++ b/lib/Alchemy/Phrasea/Helper/Record/Printer.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/Record/Push.php b/lib/Alchemy/Phrasea/Helper/Record/Push.php
index 9b2b01c708..74fcfe6c76 100644
--- a/lib/Alchemy/Phrasea/Helper/Record/Push.php
+++ b/lib/Alchemy/Phrasea/Helper/Record/Push.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/User/Edit.php b/lib/Alchemy/Phrasea/Helper/User/Edit.php
index 8359eed2a8..2a174dc8bc 100644
--- a/lib/Alchemy/Phrasea/Helper/User/Edit.php
+++ b/lib/Alchemy/Phrasea/Helper/User/Edit.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -18,6 +18,7 @@ use Alchemy\Phrasea\Notification\Mail\MailSuccessEmailUpdate;
use Alchemy\Phrasea\Notification\Receiver;
use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpKernel\Exception\AccessDeniedHttpException;
+use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
class Edit extends \Alchemy\Phrasea\Helper\Helper
{
@@ -598,7 +599,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
$user->setFirstName($parm['first_name'])
->setLastName($parm['last_name'])
- ->setGender($parm['gender'])
+ ->setGender((int) $parm['gender'])
->setEmail($parm['email'])
->setAddress($parm['address'])
->setZipCode($parm['zip'])
@@ -644,6 +645,9 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
{
$template = $this->app['repo.users']->find($this->request->get('template'));
+ if (null === $template) {
+ throw new NotFoundHttpException(sprintf('Given template "%s" could not be found', $this->request->get('template')));
+ }
if (null === $template->getTemplateOwner() || $template->getTemplateOwner()->getId() !== $this->app['authentication']->getUser()->getId()) {
throw new AccessDeniedHttpException('You are not the owner of the template');
}
@@ -652,11 +656,7 @@ class Edit extends \Alchemy\Phrasea\Helper\Helper
foreach ($this->users as $usr_id) {
$user = $this->app['repo.users']->find($usr_id);
-
- if ($user->isTemplate()) {
- continue;
- }
-
+
$this->app['acl']->get($user)->apply_model($template, $base_ids);
}
diff --git a/lib/Alchemy/Phrasea/Helper/User/Manage.php b/lib/Alchemy/Phrasea/Helper/User/Manage.php
index b4ed5729c5..26bd94a098 100644
--- a/lib/Alchemy/Phrasea/Helper/User/Manage.php
+++ b/lib/Alchemy/Phrasea/Helper/User/Manage.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Helper/WorkZone.php b/lib/Alchemy/Phrasea/Helper/WorkZone.php
index 45e2d4b35f..281d57ec6b 100644
--- a/lib/Alchemy/Phrasea/Helper/WorkZone.php
+++ b/lib/Alchemy/Phrasea/Helper/WorkZone.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -48,8 +48,8 @@ class WorkZone extends Helper
$basket->setName($this->app->trans('Default basket'));
$basket->setUser($this->app['authentication']->getUser());
- $this->app['EM']->persist($basket);
- $this->app['EM']->flush();
+ $this->app['orm.em']->persist($basket);
+ $this->app['orm.em']->flush();
$baskets = [$basket];
}
diff --git a/lib/Alchemy/Phrasea/Http/AbstractServerMode.php b/lib/Alchemy/Phrasea/Http/AbstractServerMode.php
index 1e5a7ae381..728d7b5c0a 100644
--- a/lib/Alchemy/Phrasea/Http/AbstractServerMode.php
+++ b/lib/Alchemy/Phrasea/Http/AbstractServerMode.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/DeliverDataInterface.php b/lib/Alchemy/Phrasea/Http/DeliverDataInterface.php
index a254e1103c..f28d950772 100644
--- a/lib/Alchemy/Phrasea/Http/DeliverDataInterface.php
+++ b/lib/Alchemy/Phrasea/Http/DeliverDataInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -27,7 +27,7 @@ interface DeliverDataInterface
* @param string|null $mimeType
* @param integer $cacheDuration
*/
- public function deliverFile($file, $filename = null, $disposition = self::DISPOSITION_INLINE, $mimeType = null, $cacheDuration = 3600);
+ public function deliverFile($file, $filename = null, $disposition = self::DISPOSITION_INLINE, $mimeType = null, $cacheDuration = null);
/**
* Return a HTTP Response ready to deliver data
@@ -38,5 +38,5 @@ interface DeliverDataInterface
* @param string $disposition
* @param integer $cacheDuration
*/
- public function deliverData($data, $filename, $mimeType, $disposition = self::DISPOSITION_INLINE, $cacheDuration = 3600);
+ public function deliverData($data, $filename, $mimeType, $disposition = self::DISPOSITION_INLINE, $cacheDuration = null);
}
diff --git a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Apache.php b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Apache.php
index 9c8d45be50..b5fbdc53c6 100644
--- a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Apache.php
+++ b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Apache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Factory.php b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Factory.php
index 68664f33b6..3e1223d086 100644
--- a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Factory.php
+++ b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Factory.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Interface.php b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Interface.php
index a9f9ab793f..85b965dedd 100644
--- a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Interface.php
+++ b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/H264Interface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Nginx.php b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Nginx.php
index 2dcc4b3bc2..3d47148db0 100644
--- a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Nginx.php
+++ b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/Nginx.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/NullMode.php b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/NullMode.php
index 32addaa8dd..23ba92f036 100644
--- a/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/NullMode.php
+++ b/lib/Alchemy/Phrasea/Http/H264PseudoStreaming/NullMode.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php b/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php
index 476f09473b..4a79907ec3 100644
--- a/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php
+++ b/lib/Alchemy/Phrasea/Http/ServeFileResponseFactory.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -38,12 +38,13 @@ class ServeFileResponseFactory implements DeliverDataInterface
/**
* {@inheritdoc}
*/
- public function deliverFile($file, $filename = '', $disposition = self::DISPOSITION_INLINE, $mimeType = null ,$cacheDuration = 0)
+ public function deliverFile($file, $filename = '', $disposition = self::DISPOSITION_INLINE, $mimeType = null, $cacheDuration = null)
{
$response = new BinaryFileResponse($file);
$response->setContentDisposition($disposition, $this->sanitizeFilename($filename), $this->sanitizeFilenameFallback($filename));
- $response->setMaxAge($cacheDuration);
- $response->setPrivate();
+ if (null !== $cacheDuration) {
+ $response->setMaxAge($cacheDuration);
+ }
if (null !== $mimeType) {
$response->headers->set('Content-Type', $mimeType);
@@ -55,7 +56,7 @@ class ServeFileResponseFactory implements DeliverDataInterface
/**
* {@inheritdoc}
*/
- public function deliverData($data, $filename, $mimeType, $disposition = self::DISPOSITION_INLINE, $cacheDuration = 0)
+ public function deliverData($data, $filename, $mimeType, $disposition = self::DISPOSITION_INLINE, $cacheDuration = null)
{
$response = new Response($data);
$response->headers->set('Content-Disposition', $response->headers->makeDisposition(
@@ -64,7 +65,9 @@ class ServeFileResponseFactory implements DeliverDataInterface
$this->sanitizeFilenameFallback($filename
)));
$response->headers->set('Content-Type', $mimeType);
- $response->setMaxAge($cacheDuration);
+ if (null !== $cacheDuration) {
+ $response->setMaxAge($cacheDuration);
+ }
return $response;
}
diff --git a/lib/Alchemy/Phrasea/Http/ServerModeInterface.php b/lib/Alchemy/Phrasea/Http/ServerModeInterface.php
index f4d3985282..2ad08cb242 100644
--- a/lib/Alchemy/Phrasea/Http/ServerModeInterface.php
+++ b/lib/Alchemy/Phrasea/Http/ServerModeInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/Apache.php b/lib/Alchemy/Phrasea/Http/StaticFile/Apache.php
deleted file mode 100644
index f200550987..0000000000
--- a/lib/Alchemy/Phrasea/Http/StaticFile/Apache.php
+++ /dev/null
@@ -1,52 +0,0 @@
-mapping = $mapping;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getVirtualHostConfiguration()
- {
- $output = "\n";
- $output .= " Alias ".$this->mapping['mount-point']." ".$this->mapping['directory']."\n";
- $output .= "\n";
- $output .= " mapping['directory'].">\n";
- $output .= " Order allow,deny\n";
- $output .= " Allow from all\n";
- $output .= " \n";
- $output .= "\n";
-
- return $output;
- }
-}
diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/Nginx.php b/lib/Alchemy/Phrasea/Http/StaticFile/Nginx.php
deleted file mode 100644
index a105f93336..0000000000
--- a/lib/Alchemy/Phrasea/Http/StaticFile/Nginx.php
+++ /dev/null
@@ -1,48 +0,0 @@
-mapping = $mapping;
- }
-
- /**
- * {@inheritdoc}
- */
- public function getVirtualHostConfiguration()
- {
- $output = "\n";
- $output .= " location " . $this->mapping['mount-point']. " {\n";
- $output .= " alias ".$this->mapping['directory'].";\n";
- $output .= " }\n";
-
- return $output;
- }
-}
diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/NullMode.php b/lib/Alchemy/Phrasea/Http/StaticFile/NullMode.php
deleted file mode 100644
index 9a9f40608c..0000000000
--- a/lib/Alchemy/Phrasea/Http/StaticFile/NullMode.php
+++ /dev/null
@@ -1,30 +0,0 @@
-logger = $logger;
- $this->enabled = (Boolean) $enabled;
- $this->type = strtolower($type);
- $this->symlinker = $symlinker;
-
- $this->mapping = array(
- 'mount-point' => $symlinker->getDefaultAlias(),
- 'directory' => $symlinker->getSymlinkDir()
- );
- }
-
- /**
- * Creates a new instance of StaticFileFactory Factory according to the application
- * configuration.
- *
- * @param Application $app
- * @return StaticFileFactory
- */
- public static function create(Application $app)
- {
- $conf = $app['phraseanet.configuration']['static-file'];
-
- return new self($app['monolog'], $conf['enabled'], $conf['type'], $app['phraseanet.thumb-symlinker']);
- }
-
- /**
- * Returns a new instance of ModeInterface
- *
- * @param bool $throwException
- * @param bool $forceMode
- *
- * @return Apache|Nginx|NullMode
- * @throws InvalidArgumentException
- */
- public function getMode($throwException = false, $forceMode = false)
- {
- if (false === $this->enabled && true !== $forceMode) {
- return new NullMode();
- }
-
- switch ($this->type) {
- case 'nginx':
- return new Nginx($this->mapping, $this->symlinker);
- break;
- case 'apache':
- case 'apache2':
- return new Apache($this->mapping, $this->symlinker);
- default:
- $this->logger->error('Invalid static file configuration.');
- if ($throwException) {
- throw new InvalidArgumentException(sprintf(
- 'Invalid static file type value "%s"',
- $this->type
- ));
- }
-
- return new NullMode();
- }
- }
-
- /**
- * @return bool
- */
- public function isStaticFileModeEnabled()
- {
- return $this->enabled;
- }
-}
diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/StaticFileModeInterface.php b/lib/Alchemy/Phrasea/Http/StaticFile/StaticFileModeInterface.php
deleted file mode 100644
index 33a9ad31ee..0000000000
--- a/lib/Alchemy/Phrasea/Http/StaticFile/StaticFileModeInterface.php
+++ /dev/null
@@ -1,25 +0,0 @@
-symlinker = $symlinker;
-
- parent::__construct($mapping);
}
/**
@@ -33,7 +31,7 @@ abstract class AbstractStaticMode extends AbstractServerMode
{
$this->ensureSymlink($pathFile);
- return Url::factory(sprintf('%s/%s', $this->mapping['mount-point'], $this->symlinker->getSymlinkBasePath($pathFile)));
+ return Url::factory(sprintf('/thumbnails/%s', $this->symlinker->getSymlinkBasePath($pathFile)));
}
/**
diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php
index ab151ad722..9141c6e7f1 100644
--- a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php
+++ b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinker.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -21,9 +21,6 @@ use Guzzle\Http\Url;
*/
class SymLinker
{
- /** Mount Point Alias Name */
- const ALIAS = 'thumb';
-
protected $encoder;
protected $fs;
protected $symlinkDir;
@@ -33,7 +30,7 @@ class SymLinker
return new SymLinker(
$app['phraseanet.thumb-symlinker-encoder'],
$app['filesystem'],
- isset($app['phraseanet.configuration']['static-file']['symlink-directory']) ? $app['phraseanet.configuration']['static-file']['symlink-directory'] : $app['root.path'] . '/tmp/symlinks'
+ $app['thumbnail.path']
);
}
@@ -49,11 +46,6 @@ class SymLinker
return $this->symlinkDir;
}
- public function getDefaultAlias()
- {
- return sprintf('/%s', self::ALIAS);
- }
-
public function symlink($pathFile)
{
$this->fs->symlink($pathFile, $this->getSymlinkPath($pathFile)) ;
@@ -68,7 +60,7 @@ class SymLinker
{
$symlinkName = $this->getSymlink($pathFile);
- return sprintf('%s/%s/%s',
+ return sprintf('%s/%s/%s.jpg',
substr($symlinkName, 0, 2),
substr($symlinkName, 2, 2),
substr($symlinkName, 4)
diff --git a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php
index b659d4e912..9ffaa5a22b 100644
--- a/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php
+++ b/lib/Alchemy/Phrasea/Http/StaticFile/Symlink/SymLinkerEncoder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/XSendFile/ApacheMode.php b/lib/Alchemy/Phrasea/Http/XSendFile/ApacheMode.php
index eac5ed9b22..6ba010a68a 100644
--- a/lib/Alchemy/Phrasea/Http/XSendFile/ApacheMode.php
+++ b/lib/Alchemy/Phrasea/Http/XSendFile/ApacheMode.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/XSendFile/ModeInterface.php b/lib/Alchemy/Phrasea/Http/XSendFile/ModeInterface.php
index a685fe6a0e..afb22eb3cb 100644
--- a/lib/Alchemy/Phrasea/Http/XSendFile/ModeInterface.php
+++ b/lib/Alchemy/Phrasea/Http/XSendFile/ModeInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/XSendFile/NginxMode.php b/lib/Alchemy/Phrasea/Http/XSendFile/NginxMode.php
index a82e961a04..da8411678c 100644
--- a/lib/Alchemy/Phrasea/Http/XSendFile/NginxMode.php
+++ b/lib/Alchemy/Phrasea/Http/XSendFile/NginxMode.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/XSendFile/NullMode.php b/lib/Alchemy/Phrasea/Http/XSendFile/NullMode.php
index 916b976656..0c50108c0e 100644
--- a/lib/Alchemy/Phrasea/Http/XSendFile/NullMode.php
+++ b/lib/Alchemy/Phrasea/Http/XSendFile/NullMode.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Http/XSendFile/XSendFileFactory.php b/lib/Alchemy/Phrasea/Http/XSendFile/XSendFileFactory.php
index b10fed85e1..990458afe8 100644
--- a/lib/Alchemy/Phrasea/Http/XSendFile/XSendFileFactory.php
+++ b/lib/Alchemy/Phrasea/Http/XSendFile/XSendFileFactory.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/Audio.php b/lib/Alchemy/Phrasea/Media/Subdef/Audio.php
index b29286fbc0..9bfc3b86c5 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/Audio.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/Audio.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/FlexPaper.php b/lib/Alchemy/Phrasea/Media/Subdef/FlexPaper.php
index 34eb4c8bb2..30ec0f3e87 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/FlexPaper.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/FlexPaper.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/Gif.php b/lib/Alchemy/Phrasea/Media/Subdef/Gif.php
index 4fc6d181ba..c36c261a57 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/Gif.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/Gif.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/Image.php b/lib/Alchemy/Phrasea/Media/Subdef/Image.php
index dd1c2e0bb3..47610df7f1 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/Image.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/Image.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Boolean.php b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Boolean.php
index 2a06c5a134..350a6c78ac 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Boolean.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Boolean.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Enum.php b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Enum.php
index 5c0a1bcaf9..5dc486ca89 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Enum.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Enum.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Multi.php b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Multi.php
index f869b71135..cdab5d34b2 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Multi.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Multi.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/OptionType.php b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/OptionType.php
index f001985749..bad9f48781 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/OptionType.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/OptionType.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Range.php b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Range.php
index 4ea031ee15..12acd8ebaa 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Range.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/OptionType/Range.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/Provider.php b/lib/Alchemy/Phrasea/Media/Subdef/Provider.php
index d8b57bd005..906daaab7d 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/Provider.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/Provider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/Subdef.php b/lib/Alchemy/Phrasea/Media/Subdef/Subdef.php
index 321c5b4678..71882f47b7 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/Subdef.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/Subdef.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Subdef/Video.php b/lib/Alchemy/Phrasea/Media/Subdef/Video.php
index 50ef3af8b8..62df1b3996 100644
--- a/lib/Alchemy/Phrasea/Media/Subdef/Video.php
+++ b/lib/Alchemy/Phrasea/Media/Subdef/Video.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Type/Audio.php b/lib/Alchemy/Phrasea/Media/Type/Audio.php
index 50b355dd38..688c42ce4c 100644
--- a/lib/Alchemy/Phrasea/Media/Type/Audio.php
+++ b/lib/Alchemy/Phrasea/Media/Type/Audio.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Type/Document.php b/lib/Alchemy/Phrasea/Media/Type/Document.php
index f6fbbaa972..a27826de92 100644
--- a/lib/Alchemy/Phrasea/Media/Type/Document.php
+++ b/lib/Alchemy/Phrasea/Media/Type/Document.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Type/Flash.php b/lib/Alchemy/Phrasea/Media/Type/Flash.php
index 630cc31bb2..2d17938345 100644
--- a/lib/Alchemy/Phrasea/Media/Type/Flash.php
+++ b/lib/Alchemy/Phrasea/Media/Type/Flash.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Type/Image.php b/lib/Alchemy/Phrasea/Media/Type/Image.php
index 7719da6215..a536524868 100644
--- a/lib/Alchemy/Phrasea/Media/Type/Image.php
+++ b/lib/Alchemy/Phrasea/Media/Type/Image.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Type/Type.php b/lib/Alchemy/Phrasea/Media/Type/Type.php
index 1fbaec82f5..b0b15a727e 100644
--- a/lib/Alchemy/Phrasea/Media/Type/Type.php
+++ b/lib/Alchemy/Phrasea/Media/Type/Type.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Media/Type/Video.php b/lib/Alchemy/Phrasea/Media/Type/Video.php
index 5db0337f2c..a0e7e00481 100644
--- a/lib/Alchemy/Phrasea/Media/Type/Video.php
+++ b/lib/Alchemy/Phrasea/Media/Type/Video.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataReader.php b/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataReader.php
index 36c252e7e9..dcb0bbcb48 100644
--- a/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataReader.php
+++ b/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataReader.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataSetter.php b/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataSetter.php
index 153d87bcf5..ae7d491f49 100644
--- a/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataSetter.php
+++ b/lib/Alchemy/Phrasea/Metadata/PhraseanetMetadataSetter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Metadata/TagProvider.php b/lib/Alchemy/Phrasea/Metadata/TagProvider.php
index 9d1f38ffc4..5be1c1b28c 100644
--- a/lib/Alchemy/Phrasea/Metadata/TagProvider.php
+++ b/lib/Alchemy/Phrasea/Metadata/TagProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Model/Entities/ValidationParticipant.php b/lib/Alchemy/Phrasea/Model/Entities/ValidationParticipant.php
index 564c9f6b88..f042865007 100644
--- a/lib/Alchemy/Phrasea/Model/Entities/ValidationParticipant.php
+++ b/lib/Alchemy/Phrasea/Model/Entities/ValidationParticipant.php
@@ -58,7 +58,7 @@ class ValidationParticipant
/**
* @ORM\ManyToOne(targetEntity="ValidationSession", inversedBy="participants", cascade={"persist"})
- * @ORM\JoinColumn(name="ValidationSession_id", referencedColumnName="id")
+ * @ORM\JoinColumn(name="validation_session_id", referencedColumnName="id")
*/
private $session;
diff --git a/lib/Alchemy/Phrasea/Model/Manager/UserManager.php b/lib/Alchemy/Phrasea/Model/Manager/UserManager.php
index 731ac865a3..eb44ee1349 100644
--- a/lib/Alchemy/Phrasea/Model/Manager/UserManager.php
+++ b/lib/Alchemy/Phrasea/Model/Manager/UserManager.php
@@ -217,6 +217,7 @@ class UserManager
$this->cleanFtpExports($user);
$this->cleanAuthProvider($user);
$this->cleanUserSessions($user);
+ $this->cleanOauthApplication($user);
}
/**
@@ -235,4 +236,18 @@ class UserManager
$stmt->closeCursor();
}
}
+ private function cleanOauthApplication(User $user)
+ {
+ $accounts = $this->objectManager->getRepository('Phraseanet:ApiAccount')->findByUser($user);
+
+ foreach ($accounts as $account) {
+ $this->objectManager->remove($account);
+ }
+
+ $apps = $this->objectManager->getRepository('Phraseanet:ApiApplication')->findByCreator($user);
+
+ foreach ($apps as $app) {
+ $this->objectManager->remove($app);
+ }
+ }
}
diff --git a/lib/Alchemy/Phrasea/Model/MonologSQLLogger.php b/lib/Alchemy/Phrasea/Model/MonologSQLLogger.php
deleted file mode 100644
index d071551911..0000000000
--- a/lib/Alchemy/Phrasea/Model/MonologSQLLogger.php
+++ /dev/null
@@ -1,84 +0,0 @@
-logger = $logger;
- $this->outputType = $type;
- }
-
- /**
- * {@inheritdoc}
- */
- public function startQuery($sql, array $params = null, array $types = null)
- {
- $this->start = microtime(true);
-
- $this->output["sql"] = $sql;
-
- if ($params) {
- $this->output["params"] = $params;
- }
- }
-
- /**
- * {@inheritdoc}
- */
- public function stopQuery()
- {
- $mstime = microtime(true) - $this->start;
-
- $this->output["times"] = $mstime . " seconds";
- if ($this->outputType == self::JSON) {
- $this->log(json_encode($this->output));
- } elseif ($this->outputType == self::YAML) {
- $this->log(\Symfony\Component\Yaml\Yaml::dump($this->output));
- } else {
- $this->log(var_export($this->output, true));
- }
- }
-
- protected function log($message)
- {
- $this->logger->debug($message);
- }
-}
diff --git a/lib/Alchemy/Phrasea/Model/Repositories/ApiAccountRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/ApiAccountRepository.php
index 2bc3036d1b..99e22e0ed9 100644
--- a/lib/Alchemy/Phrasea/Model/Repositories/ApiAccountRepository.php
+++ b/lib/Alchemy/Phrasea/Model/Repositories/ApiAccountRepository.php
@@ -24,4 +24,13 @@ class ApiAccountRepository extends EntityRepository
return $qb->getQuery()->getOneOrNullResult();
}
+
+ public function findByUser(User $user)
+ {
+ $qb = $this->createQueryBuilder('acc');
+ $qb->where($qb->expr()->eq('acc.user', ':user'));
+ $qb->setParameter(':user', $user);
+
+ return $qb->getQuery()->getResult();
+ }
}
diff --git a/lib/Alchemy/Phrasea/Model/Repositories/FeedItemRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/FeedItemRepository.php
index 5a79735566..0cc6a701c6 100644
--- a/lib/Alchemy/Phrasea/Model/Repositories/FeedItemRepository.php
+++ b/lib/Alchemy/Phrasea/Model/Repositories/FeedItemRepository.php
@@ -79,10 +79,10 @@ class FeedItemRepository extends EntityRepository
try {
$record = $item->getRecord($app);
} catch (NotFoundHttpException $e) {
- $app['EM']->remove($item);
+ $app['orm.em']->remove($item);
continue;
} catch (\Exception_Record_AdapterNotFound $e) {
- $app['EM']->remove($item);
+ $app['orm.em']->remove($item);
continue;
}
@@ -97,7 +97,7 @@ class FeedItemRepository extends EntityRepository
}
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
$execution++;
} while (count($items) < $nbItems && count($result) !== 0);
diff --git a/lib/Alchemy/Phrasea/Model/Repositories/RegistrationRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/RegistrationRepository.php
index 1ca55cbc84..65a25d5004 100644
--- a/lib/Alchemy/Phrasea/Model/Repositories/RegistrationRepository.php
+++ b/lib/Alchemy/Phrasea/Model/Repositories/RegistrationRepository.php
@@ -71,13 +71,13 @@ class RegistrationRepository extends EntityRepository
SELECT dbname, sbas.sbas_id, time_limited,
UNIX_TIMESTAMP( limited_from ) AS limited_from,
UNIX_TIMESTAMP( limited_to ) AS limited_to,
- bas.server_coll_id, usr.usr_id, basusr.actif,
+ bas.server_coll_id, Users.id, basusr.actif,
bas.base_id AS bas_id , " . $rsm->generateSelectClause(['d' => 'd',]) . "
- FROM (usr, bas, sbas)
- LEFT JOIN basusr ON ( usr.usr_id = basusr.usr_id AND bas.base_id = basusr.base_id )
- LEFT JOIN Registrations d ON ( d.user_id = usr.usr_id AND bas.base_id = d.base_id )
+ FROM (Users, bas, sbas)
+ LEFT JOIN basusr ON ( Users.id = basusr.usr_id AND bas.base_id = basusr.base_id )
+ LEFT JOIN Registrations d ON ( d.user_id = Users.id AND bas.base_id = d.base_id )
WHERE bas.active = 1 AND bas.sbas_id = sbas.sbas_id
- AND usr.usr_id = ?
+ AND Users.id = ?
AND model_of = 0";
$query = $this->_em->createNativeQuery($sql, $rsm);
diff --git a/lib/Alchemy/Phrasea/Model/Repositories/UserRepository.php b/lib/Alchemy/Phrasea/Model/Repositories/UserRepository.php
index aeebf18b85..cadb199b4a 100644
--- a/lib/Alchemy/Phrasea/Model/Repositories/UserRepository.php
+++ b/lib/Alchemy/Phrasea/Model/Repositories/UserRepository.php
@@ -50,6 +50,16 @@ class UserRepository extends EntityRepository
return $this->findOneBy(['login' => $login]);
}
+ /**
+ * Finds deleted users.
+ *
+ * @return User[]
+ */
+ public function findDeleted()
+ {
+ return $this->findBy(['deleted' => true]);
+ }
+
/**
* Finds a user by email.
*
diff --git a/lib/Alchemy/Phrasea/Notification/Attachment.php b/lib/Alchemy/Phrasea/Notification/Attachment.php
new file mode 100644
index 0000000000..a11ffda2aa
--- /dev/null
+++ b/lib/Alchemy/Phrasea/Notification/Attachment.php
@@ -0,0 +1,50 @@
+path = $path;
+ $this->filename = $filename;
+ $this->contentType = $contentType;
+ }
+
+ /**
+ * @return \Swift_Mime_Attachment the attachment as a swift attachment
+ */
+ public function As_Swift_Attachment()
+ {
+ $swa = \Swift_Attachment::fromPath($this->path);
+ if($this->filename !== '') {
+ $swa->setFilename($this->filename);
+ }
+ if($this->contentType !== '') {
+ $swa->setContentType($this->contentType);
+ }
+ return $swa;
+ }
+}
diff --git a/lib/Alchemy/Phrasea/Notification/Deliverer.php b/lib/Alchemy/Phrasea/Notification/Deliverer.php
index 0a79e87138..6c7ef99b21 100644
--- a/lib/Alchemy/Phrasea/Notification/Deliverer.php
+++ b/lib/Alchemy/Phrasea/Notification/Deliverer.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -47,7 +47,7 @@ class Deliverer
* @throws LogicException In case no Receiver provided
* @throws LogicException In case a read-receipt is asked but no Emitter provided
*/
- public function deliver(MailInterface $mail, $readReceipt = false)
+ public function deliver(MailInterface $mail, $readReceipt = false, array $attachments = null)
{
if (!$mail->getReceiver()) {
throw new LogicException('You must provide a receiver for a mail notification');
@@ -63,6 +63,12 @@ class Deliverer
$message->setReplyTo($mail->getEmitter()->getEmail(), $mail->getEmitter()->getName());
}
+ if(is_array($attachments)) {
+ foreach($attachments as $attachment) {
+ $message->attach($attachment->As_Swift_Attachment());
+ }
+ }
+
if ($readReceipt) {
if (!$mail->getEmitter()) {
throw new LogicException('You must provide an emitter for a ReadReceipt');
diff --git a/lib/Alchemy/Phrasea/Notification/Emitter.php b/lib/Alchemy/Phrasea/Notification/Emitter.php
index 868182a734..afa30161ea 100644
--- a/lib/Alchemy/Phrasea/Notification/Emitter.php
+++ b/lib/Alchemy/Phrasea/Notification/Emitter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/EmitterInterface.php b/lib/Alchemy/Phrasea/Notification/EmitterInterface.php
index 25d5c6036c..ae8a642669 100644
--- a/lib/Alchemy/Phrasea/Notification/EmitterInterface.php
+++ b/lib/Alchemy/Phrasea/Notification/EmitterInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/AbstractMail.php b/lib/Alchemy/Phrasea/Notification/Mail/AbstractMail.php
index c57a00c875..051522162f 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/AbstractMail.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/AbstractMail.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/AbstractMailWithLink.php b/lib/Alchemy/Phrasea/Notification/Mail/AbstractMailWithLink.php
index 98b2d8ce95..9d430b4815 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/AbstractMailWithLink.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/AbstractMailWithLink.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoBridgeUploadFailed.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoBridgeUploadFailed.php
index 00641a4076..cae332ab3b 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoBridgeUploadFailed.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoBridgeUploadFailed.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewOrder.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewOrder.php
index c56b901d14..8135ad90a4 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewOrder.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewOrder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewPublication.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewPublication.php
index d544777442..7816d40bb2 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewPublication.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoNewPublication.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderCancelled.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderCancelled.php
index a8da22facb..90ef58dce7 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderCancelled.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderCancelled.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderDelivered.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderDelivered.php
index a976be10a2..c9eeab07bf 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderDelivered.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoOrderDelivered.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoPushReceived.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoPushReceived.php
index e658c3833d..23204a8c43 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoPushReceived.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoPushReceived.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoRecordQuarantined.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoRecordQuarantined.php
index 564fc1557b..72ca797f67 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoRecordQuarantined.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoRecordQuarantined.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoSomebodyAutoregistered.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoSomebodyAutoregistered.php
index 973985f597..7a2209f1d9 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoSomebodyAutoregistered.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoSomebodyAutoregistered.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoUserRegistered.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoUserRegistered.php
index 8e195d2d46..a9fac3949e 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoUserRegistered.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoUserRegistered.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationDone.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationDone.php
index 057de54c78..b667fd0b6d 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationDone.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationDone.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationReminder.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationReminder.php
index 8ad444c23c..3fa4644260 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationReminder.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationReminder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationRequest.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationRequest.php
index 2aa87739c8..4838ab7630 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationRequest.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInfoValidationRequest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailInterface.php b/lib/Alchemy/Phrasea/Notification/Mail/MailInterface.php
index add19be4ad..7e923c1346 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailInterface.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailRecordsExport.php b/lib/Alchemy/Phrasea/Notification/Mail/MailRecordsExport.php
index ddbfd57a41..4eb33e280e 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailRecordsExport.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailRecordsExport.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailConfirmation.php b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailConfirmation.php
index 42df9ef8e4..16193c3c9a 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailConfirmation.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailConfirmation.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailUpdate.php b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailUpdate.php
index c7caa69122..e44636ab86 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailUpdate.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestEmailUpdate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordSetup.php b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordSetup.php
index 0a1f596f7f..bd895ea92f 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordSetup.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordSetup.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordUpdate.php b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordUpdate.php
index 5bb1c3dc48..51ca25304d 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordUpdate.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailRequestPasswordUpdate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessAccessRequest.php b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessAccessRequest.php
index 2685faa88b..9cbb8b7c6e 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessAccessRequest.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessAccessRequest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationRegistered.php b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationRegistered.php
index 785a9cc6ff..154681de77 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationRegistered.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationRegistered.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationUnregistered.php b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationUnregistered.php
index f936269420..0d4b018e65 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationUnregistered.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailConfirmationUnregistered.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailUpdate.php b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailUpdate.php
index c8f30d9615..f3da1907c6 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailUpdate.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessEmailUpdate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPReceiver.php b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPReceiver.php
index 7accb17fff..ed2da4b52a 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPReceiver.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPReceiver.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPSender.php b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPSender.php
index df1d86aebf..601da922c0 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPSender.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailSuccessFTPSender.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailTest.php b/lib/Alchemy/Phrasea/Notification/Mail/MailTest.php
index b8a591544e..e5bf996d1c 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailTest.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailTest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Mail/MailWithLinkInterface.php b/lib/Alchemy/Phrasea/Notification/Mail/MailWithLinkInterface.php
index 6c86cbcf2a..15b1f50992 100644
--- a/lib/Alchemy/Phrasea/Notification/Mail/MailWithLinkInterface.php
+++ b/lib/Alchemy/Phrasea/Notification/Mail/MailWithLinkInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/Receiver.php b/lib/Alchemy/Phrasea/Notification/Receiver.php
index e3671c882c..a867139aa9 100644
--- a/lib/Alchemy/Phrasea/Notification/Receiver.php
+++ b/lib/Alchemy/Phrasea/Notification/Receiver.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Notification/ReceiverInterface.php b/lib/Alchemy/Phrasea/Notification/ReceiverInterface.php
index e544e73bb6..f697b99a20 100644
--- a/lib/Alchemy/Phrasea/Notification/ReceiverInterface.php
+++ b/lib/Alchemy/Phrasea/Notification/ReceiverInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Out/Module/PDF.php b/lib/Alchemy/Phrasea/Out/Module/PDF.php
index f51a2449d2..cd98a10810 100644
--- a/lib/Alchemy/Phrasea/Out/Module/PDF.php
+++ b/lib/Alchemy/Phrasea/Out/Module/PDF.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -234,19 +234,24 @@ class PDF
$wimg = $himg = 50;
// 1px = 3.77952 mm
$finalWidth = round($subdef->get_width() / 3.779528, 2);
- $finalheight = round($subdef->get_height() / 3.779528, 2);
- if ($finalWidth > 0 && $finalheight > 0) {
- if ($finalWidth > $finalheight && ($wimg < $finalWidth))
- $finalheight = $wimg * $finalheight / $finalWidth;
- else if ($finalheight > $finalWidth && $himg < $finalheight)
- $finalWidth = $himg * $finalWidth / $finalheight;
- else if ($finalheight == $finalWidth && $himg < $finalheight) {
- $finalheight = $wimg * $finalheight / $finalWidth;
- $finalWidth = $himg * $finalWidth / $finalheight;
+ $finalHeight = round($subdef->get_height() / 3.779528, 2);
+ $aspectH = $finalWidth/$finalHeight;
+ $aspectW = $finalHeight/$finalWidth;
+
+ if ($finalWidth > 0 && $finalHeight > 0) {
+ if ($finalWidth > $finalHeight && $finalWidth > $wimg) {
+ $finalWidth = $wimg;
+ $finalHeight = $wimg * $aspectW;
+ } else if ($finalHeight > $finalWidth && $finalHeight > $himg) {
+ $finalHeight = $himg;
+ $finalWidth = $himg * $aspectH;
+ } else if ($finalHeight == $finalWidth & $finalWidth > $wimg) {
+ $finalHeight = $wimg;
+ $finalWidth = $himg;
}
}
- if ($this->pdf->GetY() > $this->pdf->getPageHeight() - (6 + $finalheight + 20))
+ if ($this->pdf->GetY() > $this->pdf->getPageHeight() - (6 + $finalHeight + 20))
$this->pdf->AddPage();
$title = "record : " . $rec->get_title();
@@ -283,7 +288,7 @@ class PDF
if ($fimg) {
$y = $this->pdf->GetY();
- $this->pdf->Image($fimg, $lmargin, $y, $finalWidth, $finalheight);
+ $this->pdf->Image($fimg, $lmargin, $y, $finalWidth, $finalHeight);
$this->pdf->SetY($y + 3);
}
@@ -303,8 +308,8 @@ class PDF
$this->pdf->Write(6, "\n");
$nf++;
}
- if ($this->pdf->PageNo() == $p0 && ($this->pdf->GetY() - $y0) < $finalheight)
- $this->pdf->SetY($y0 + $finalheight);
+ if ($this->pdf->PageNo() == $p0 && ($this->pdf->GetY() - $y0) < $finalHeight)
+ $this->pdf->SetY($y0 + $finalHeight);
$ndoc++;
}
$this->pdf->SetLeftMargin($lmargin);
@@ -437,28 +442,34 @@ class PDF
&& $subdef->get_type() == \media_subdef::TYPE_IMAGE)
$f = \recordutils_image::watermark($this->app, $subdef);
+ // original height / original width x new width = new height
$wimg = $himg = 150; // preview dans un carre de 150 mm
// 1px = 3.77952 mm
$finalWidth = round($subdef->get_width() / 3.779528, 2);
- $finalheight = round($subdef->get_height() / 3.779528, 2);
- if ($finalWidth > 0 && $finalheight > 0) {
- if ($finalWidth > $finalheight && ($wimg < $finalWidth))
- $finalheight = $wimg * $finalheight / $finalWidth;
- else if ($finalheight > $finalWidth && $himg < $finalheight)
- $finalWidth = $himg * $finalWidth / $finalheight;
- else if ($finalheight == $finalWidth && $himg < $finalheight) {
- $finalheight = $wimg * $finalheight / $finalWidth;
- $finalWidth = $himg * $finalWidth / $finalheight;
+ $finalHeight = round($subdef->get_height() / 3.779528, 2);
+ $aspectH = $finalWidth/$finalHeight;
+ $aspectW = $finalHeight/$finalWidth;
+
+ if ($finalWidth > 0 && $finalHeight > 0) {
+ if ($finalWidth > $finalHeight && $finalWidth > $wimg) {
+ $finalWidth = $wimg;
+ $finalHeight = $wimg * $aspectW;
+ } else if ($finalHeight > $finalWidth && $finalHeight > $himg) {
+ $finalHeight = $himg;
+ $finalWidth = $himg * $aspectH;
+ } else if ($finalHeight == $finalWidth & $finalWidth > $wimg) {
+ $finalHeight = $wimg;
+ $finalWidth = $himg;
}
}
- $this->pdf->Image($f, (210 - $finalWidth) / 2, $y, $finalWidth, $finalheight);
+ $this->pdf->Image($f, (210 - $finalWidth) / 2, $y, $finalWidth, $finalHeight);
if ($miniConv != NULL) {
foreach ($miniConv as $oneF)
unlink($oneF);
}
- $this->pdf->SetXY($lmargin, $y += ( $finalheight + 5));
+ $this->pdf->SetXY($lmargin, $y += ( $finalHeight + 5));
$nf = 0;
if ($write_caption) {
diff --git a/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php b/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php
index 848b7c2c4a..31fa1051c6 100644
--- a/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php
+++ b/lib/Alchemy/Phrasea/Out/Tool/PhraseaPDF.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Exception/ComposerInstallException.php b/lib/Alchemy/Phrasea/Plugin/Exception/ComposerInstallException.php
index 2111ae9fa2..7f9ca606e0 100644
--- a/lib/Alchemy/Phrasea/Plugin/Exception/ComposerInstallException.php
+++ b/lib/Alchemy/Phrasea/Plugin/Exception/ComposerInstallException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Exception/ImportFailureException.php b/lib/Alchemy/Phrasea/Plugin/Exception/ImportFailureException.php
index 3c537fa880..9edb3f437c 100644
--- a/lib/Alchemy/Phrasea/Plugin/Exception/ImportFailureException.php
+++ b/lib/Alchemy/Phrasea/Plugin/Exception/ImportFailureException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Exception/JsonValidationException.php b/lib/Alchemy/Phrasea/Plugin/Exception/JsonValidationException.php
index cff4adf620..dc27b4385c 100644
--- a/lib/Alchemy/Phrasea/Plugin/Exception/JsonValidationException.php
+++ b/lib/Alchemy/Phrasea/Plugin/Exception/JsonValidationException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Exception/PluginValidationException.php b/lib/Alchemy/Phrasea/Plugin/Exception/PluginValidationException.php
index 977bee010f..2826ac2fee 100644
--- a/lib/Alchemy/Phrasea/Plugin/Exception/PluginValidationException.php
+++ b/lib/Alchemy/Phrasea/Plugin/Exception/PluginValidationException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Exception/RegistrationFailureException.php b/lib/Alchemy/Phrasea/Plugin/Exception/RegistrationFailureException.php
index c92da03d31..491a8e7cf9 100644
--- a/lib/Alchemy/Phrasea/Plugin/Exception/RegistrationFailureException.php
+++ b/lib/Alchemy/Phrasea/Plugin/Exception/RegistrationFailureException.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Importer/FolderImporter.php b/lib/Alchemy/Phrasea/Plugin/Importer/FolderImporter.php
index 082b0bd17f..0872f2d94c 100644
--- a/lib/Alchemy/Phrasea/Plugin/Importer/FolderImporter.php
+++ b/lib/Alchemy/Phrasea/Plugin/Importer/FolderImporter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Importer/ImportStrategy.php b/lib/Alchemy/Phrasea/Plugin/Importer/ImportStrategy.php
index 16fb71b408..5159dae6fd 100644
--- a/lib/Alchemy/Phrasea/Plugin/Importer/ImportStrategy.php
+++ b/lib/Alchemy/Phrasea/Plugin/Importer/ImportStrategy.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Importer/Importer.php b/lib/Alchemy/Phrasea/Plugin/Importer/Importer.php
index 3b52c55046..1fe753ef09 100644
--- a/lib/Alchemy/Phrasea/Plugin/Importer/Importer.php
+++ b/lib/Alchemy/Phrasea/Plugin/Importer/Importer.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Importer/ImporterInterface.php b/lib/Alchemy/Phrasea/Plugin/Importer/ImporterInterface.php
index d5592d5534..2ff8a99928 100644
--- a/lib/Alchemy/Phrasea/Plugin/Importer/ImporterInterface.php
+++ b/lib/Alchemy/Phrasea/Plugin/Importer/ImporterInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Management/AutoloaderGenerator.php b/lib/Alchemy/Phrasea/Plugin/Management/AutoloaderGenerator.php
index c670dfb50e..1aa6505621 100644
--- a/lib/Alchemy/Phrasea/Plugin/Management/AutoloaderGenerator.php
+++ b/lib/Alchemy/Phrasea/Plugin/Management/AutoloaderGenerator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Management/ComposerInstaller.php b/lib/Alchemy/Phrasea/Plugin/Management/ComposerInstaller.php
index 9419b07778..60d7bdb742 100644
--- a/lib/Alchemy/Phrasea/Plugin/Management/ComposerInstaller.php
+++ b/lib/Alchemy/Phrasea/Plugin/Management/ComposerInstaller.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Management/PluginsExplorer.php b/lib/Alchemy/Phrasea/Plugin/Management/PluginsExplorer.php
index 2728919f1a..eccc45b0e8 100644
--- a/lib/Alchemy/Phrasea/Plugin/Management/PluginsExplorer.php
+++ b/lib/Alchemy/Phrasea/Plugin/Management/PluginsExplorer.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Plugin.php b/lib/Alchemy/Phrasea/Plugin/Plugin.php
index fceed2e45d..9abd1e6b89 100644
--- a/lib/Alchemy/Phrasea/Plugin/Plugin.php
+++ b/lib/Alchemy/Phrasea/Plugin/Plugin.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/PluginManager.php b/lib/Alchemy/Phrasea/Plugin/PluginManager.php
index b6cc4f253e..c3cfae8b2b 100644
--- a/lib/Alchemy/Phrasea/Plugin/PluginManager.php
+++ b/lib/Alchemy/Phrasea/Plugin/PluginManager.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/PluginProviderInterface.php b/lib/Alchemy/Phrasea/Plugin/PluginProviderInterface.php
index 953c7447cb..2bb60a19c0 100644
--- a/lib/Alchemy/Phrasea/Plugin/PluginProviderInterface.php
+++ b/lib/Alchemy/Phrasea/Plugin/PluginProviderInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Schema/Manifest.php b/lib/Alchemy/Phrasea/Plugin/Schema/Manifest.php
index 9be3293542..5edd9c9e49 100644
--- a/lib/Alchemy/Phrasea/Plugin/Schema/Manifest.php
+++ b/lib/Alchemy/Phrasea/Plugin/Schema/Manifest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Schema/ManifestValidator.php b/lib/Alchemy/Phrasea/Plugin/Schema/ManifestValidator.php
index abb9a71019..c2d91e92de 100644
--- a/lib/Alchemy/Phrasea/Plugin/Schema/ManifestValidator.php
+++ b/lib/Alchemy/Phrasea/Plugin/Schema/ManifestValidator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Plugin/Schema/PluginValidator.php b/lib/Alchemy/Phrasea/Plugin/Schema/PluginValidator.php
index 369d383e61..8e6abd06ae 100644
--- a/lib/Alchemy/Phrasea/Plugin/Schema/PluginValidator.php
+++ b/lib/Alchemy/Phrasea/Plugin/Schema/PluginValidator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/AbstractConfigurationPanel.php b/lib/Alchemy/Phrasea/SearchEngine/AbstractConfigurationPanel.php
index f6c8918f7c..0c5eae134e 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/AbstractConfigurationPanel.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/AbstractConfigurationPanel.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/ConfigurationPanelInterface.php b/lib/Alchemy/Phrasea/SearchEngine/ConfigurationPanelInterface.php
index f11d606d90..6160ddcaab 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/ConfigurationPanelInterface.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/ConfigurationPanelInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/ConfigurationPanel.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/ConfigurationPanel.php
index d9e97f60d4..df1431e0fd 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/ConfigurationPanel.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/ConfigurationPanel.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php
index 2e0044597e..d8d6cf117f 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngine.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -367,10 +367,6 @@ class PhraseaEngine implements SearchEngineInterface
$query = "all";
}
- if ($options->getRecordType()) {
- $query .= ' AND recordtype=' . $options->getRecordType();
- }
-
$sql = 'SELECT query, query_time, duration, total FROM cache WHERE session_id = :ses_id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':ses_id' => $this->app['session']->get('phrasea_session_id')]);
@@ -647,6 +643,18 @@ class PhraseaEngine implements SearchEngineInterface
*/
private function addQuery($query, SearchEngineOptions $options)
{
+ if ($options->getFields()) {
+ $fields = array_map(function (\databox_field $field) {
+ return $field->get_name();
+ }, $options->getFields());
+ if(count($fields) == 1) {
+ $query .= ' IN ' . $fields[0];
+ }
+ else if(count($fields) > 1) {
+ $query .= ' IN (' . implode(' OR ', $fields) . ')';
+ }
+ }
+
foreach ($options->getDataboxes() as $databox) {
$this->queries[$databox->get_sbas_id()] = $query;
}
@@ -654,44 +662,54 @@ class PhraseaEngine implements SearchEngineInterface
$status = $options->getStatus();
foreach ($this->queries as $sbas => $qs) {
- if ($status) {
- $requestStat = 'xxxx';
+ $clauses = array();
- for ($i = 4; ($i <= 32); $i++) {
- if (!isset($status[$i])) {
- $requestStat = 'x' . $requestStat;
- continue;
- }
+ // the main query
+ $clauses[] = $query;
+
+ // status
+ if ($status) {
+ $requestStat = '';
+ for ($i = 31; $i >= 4; $i--) {
$val = 'x';
- if (isset($status[$i][$sbas])) {
+ if (isset($status[$i]) && isset($status[$i][$sbas])) {
if ($status[$i][$sbas] == '0') {
$val = '0';
} elseif ($status[$i][$sbas] == '1') {
$val = '1';
}
}
- $requestStat = $val . $requestStat;
+ $requestStat .= $val;
}
-
- $requestStat = ltrim($requestStat, 'x');
+ $requestStat = ltrim($requestStat.'xxxx', 'x');
if ($requestStat !== '') {
- $this->queries[$sbas] .= ' AND (recordstatus=' . $requestStat . ')';
+ $clauses[] = 'recordstatus=' . $requestStat . '';
}
}
- if ($options->getFields()) {
- $this->queries[$sbas] .= ' IN (' . implode(' OR ', array_map(function (\databox_field $field) {
- return $field->get_name();
- }, $options->getFields())) . ')';
- }
+
+ // date
if (($options->getMinDate() || $options->getMaxDate()) && $options->getDateFields()) {
if ($options->getMinDate()) {
- $this->queries[$sbas] .= ' AND ( ' . implode(' >= ' . $options->getMinDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $options->getDateFields())) . ' >= ' . $options->getMinDate()->format('Y-m-d') . ' ) ';
+ $clauses[] = implode(' >= ' . $options->getMinDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $options->getDateFields())) . ' >= ' . $options->getMinDate()->format('Y-m-d');
}
if ($options->getMaxDate()) {
- $this->queries[$sbas] .= ' AND ( ' . implode(' <= ' . $options->getMaxDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $options->getDateFields())) . ' <= ' . $options->getMaxDate()->format('Y-m-d') . ' ) ';
+ $clauses[] = implode(' <= ' . $options->getMaxDate()->format('Y-m-d') . ' OR ', array_map(function (\databox_field $field) { return $field->get_name(); }, $options->getDateFields())) . ' <= ' . $options->getMaxDate()->format('Y-m-d');
}
}
+
+ // record type
+ if ($options->getRecordType()) {
+ $clauses[] = 'recordtype=' . $options->getRecordType();
+ }
+
+ // join clauses to build a query
+ if(count($clauses) == 1) {
+ $this->queries[$sbas] = $clauses[0];
+ }
+ else{
+ $this->queries[$sbas] = '(' . join(') AND (', $clauses) . ')';
+ }
}
$this->singleParse('main', $query, $options);
diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php
index f5c999ebd5..98d6c176b7 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineQueryParser.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -729,8 +729,11 @@ class PhraseaEngineQueryParser
$prophtml = "";
$this->propAsHTML($domthe->documentElement, $prophtml, $path);
$this->proposals["BASES"]["b$bid"]["TERMS"][$path]["HTML"] = $prophtml;
+ } else {
+ $tree = NULL;
}
+
return($ambigus);
}
@@ -1767,7 +1770,7 @@ class PhraseaEngineQueryParser
$c_utf8 = "";
for ($i = 0; $i < $l; $i++) {
if (!$this->app['unicode']->has_indexer_bad_char(($c_utf8 = mb_substr($this->phq, $i, 1, 'UTF-8')))) {
- $t .= $this->app['unicode']->remove_diacritics(mb_strtolower($c_utf8));
+ $t .= mb_strtolower($c_utf8);
} else
break;
}
diff --git a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php
index fad80573df..0e7eac35a0 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/Phrasea/PhraseaEngineSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -34,12 +34,12 @@ class PhraseaEngineSubscriber implements EventSubscriberInterface
public function onCollectionCreate(CreatedEvent $event)
{
- $sql = 'SELECT u.usr_id, c.session_id
- FROM (usr u, Sessions s, basusr b)
- LEFT JOIN cache c ON (c.usr_id = u.usr_id)
- WHERE u.model_of = 0 AND u.usr_login NOT LIKE "(#deleted%"
- AND b.base_id = :base_id AND b.usr_id = u.usr_id AND b.actif=1
- AND s.usr_id = u.usr_id';
+ $sql = 'SELECT Users.id, c.session_id
+ FROM (Users, Sessions s, basusr b)
+ LEFT JOIN cache c ON (c.usr_id = Users.id)
+ WHERE Users.model_of = 0 AND Users.deleted = 0
+ AND b.base_id = :base_id AND b.usr_id = Users.id AND b.actif=1
+ AND s.usr_id = Users.id';
$stmt = $this->app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute([':base_id' => $event->getCollection()->get_base_id()]);
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineInterface.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineInterface.php
index 525849c7b4..3d64995ed4 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineInterface.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php
index 489c819d75..46076b18f0 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineLogger.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php
index 7bc6d2804c..e3018fbc82 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineOptions.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -622,11 +622,14 @@ class SearchEngineOptions
}
$bas = array_filter($bas, function ($collection) use ($app) {
- if ($app['authentication']->isAuthenticated()) {
- return $app['acl']->get($app['authentication']->getUser())->has_access_to_base($collection->get_base_id());
- } else {
- return in_array($collection, $app->getOpenCollections());
+ if($collection !== null) {
+ if ($app['authentication']->isAuthenticated()) {
+ return $app['acl']->get($app['authentication']->getUser())->has_access_to_base($collection->get_base_id());
+ } else {
+ return in_array($collection, $app->getOpenCollections());
+ }
}
+ return false; // CollectionNotFound
});
$databoxes = [];
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineResult.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineResult.php
index 343f3859ed..fb9a5f826c 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineResult.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineResult.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineSuggestion.php b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineSuggestion.php
index b51be44bdc..3997ea46e2 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SearchEngineSuggestion.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SearchEngineSuggestion.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/AbstractCharset.php b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/AbstractCharset.php
index 81ea5ff54f..ac76cf38fc 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/AbstractCharset.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/AbstractCharset.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/ConfigurationPanel.php b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/ConfigurationPanel.php
index 2264e6875f..b8e3926b1a 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/ConfigurationPanel.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/ConfigurationPanel.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php
index 686e125f92..970f0a274c 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngine.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngineSubscriber.php b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngineSubscriber.php
index c293e15ece..9ecfec1bff 100644
--- a/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngineSubscriber.php
+++ b/lib/Alchemy/Phrasea/SearchEngine/SphinxSearch/SphinxSearchEngineSubscriber.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Security/Firewall.php b/lib/Alchemy/Phrasea/Security/Firewall.php
index 058dc81523..739555d444 100644
--- a/lib/Alchemy/Phrasea/Security/Firewall.php
+++ b/lib/Alchemy/Phrasea/Security/Firewall.php
@@ -115,7 +115,7 @@ class Firewall
{
$params = [];
if (null !== $request) {
- $params['redirect'] = '..' . $request->getPathInfo();
+ $params['redirect'] = '..' . $request->getPathInfo().'?'.$request->getQueryString();
}
if (!$this->app['authentication']->isAuthenticated()) {
return new RedirectResponse($this->app->path('homepage', $params));
diff --git a/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php b/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php
index d06a95598d..54fee60df4 100644
--- a/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php
+++ b/lib/Alchemy/Phrasea/Setup/ConfigurationTester.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/DoctrineMigrations/WorkzoneMigration.php b/lib/Alchemy/Phrasea/Setup/DoctrineMigrations/WorkzoneMigration.php
index 02aeb15e06..bc9ec2945b 100644
--- a/lib/Alchemy/Phrasea/Setup/DoctrineMigrations/WorkzoneMigration.php
+++ b/lib/Alchemy/Phrasea/Setup/DoctrineMigrations/WorkzoneMigration.php
@@ -28,7 +28,7 @@ class WorkzoneMigration extends AbstractMigration
$this->addSql("CREATE TABLE ValidationSessions (id INT AUTO_INCREMENT NOT NULL, initiator_id INT NOT NULL, basket_id INT DEFAULT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, expires DATETIME DEFAULT NULL, INDEX IDX_5B9DFB067DB3B714 (initiator_id), UNIQUE INDEX UNIQ_5B9DFB061BE1FB52 (basket_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
$this->addSql("CREATE TABLE ValidationDatas (id INT AUTO_INCREMENT NOT NULL, participant_id INT DEFAULT NULL, basket_element_id INT DEFAULT NULL, agreement TINYINT(1) DEFAULT NULL, note LONGTEXT DEFAULT NULL, updated DATETIME NOT NULL, INDEX IDX_70E84DDC9D1C3019 (participant_id), INDEX IDX_70E84DDCE989605 (basket_element_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
$this->addSql("CREATE TABLE BasketElements (id INT AUTO_INCREMENT NOT NULL, basket_id INT DEFAULT NULL, record_id INT NOT NULL, sbas_id INT NOT NULL, ord INT NOT NULL, created DATETIME NOT NULL, updated DATETIME NOT NULL, INDEX IDX_C0B7ECB71BE1FB52 (basket_id), UNIQUE INDEX unique_recordcle (basket_id, sbas_id, record_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
- $this->addSql("CREATE TABLE ValidationParticipants (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, is_aware TINYINT(1) NOT NULL, is_confirmed TINYINT(1) NOT NULL, can_agree TINYINT(1) NOT NULL, can_see_others TINYINT(1) NOT NULL, reminded DATETIME DEFAULT NULL, ValidationSession_id INT DEFAULT NULL, INDEX IDX_17850D7BF25B0F5B (ValidationSession_id), INDEX IDX_17850D7BA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
+ $this->addSql("CREATE TABLE ValidationParticipants (id INT AUTO_INCREMENT NOT NULL, user_id INT NOT NULL, is_aware TINYINT(1) NOT NULL, is_confirmed TINYINT(1) NOT NULL, can_agree TINYINT(1) NOT NULL, can_see_others TINYINT(1) NOT NULL, reminded DATETIME DEFAULT NULL, validation_session_id INT DEFAULT NULL, INDEX IDX_17850D7BF25B0F5B (validation_session_id), INDEX IDX_17850D7BA76ED395 (user_id), PRIMARY KEY(id)) DEFAULT CHARACTER SET utf8 COLLATE utf8_unicode_ci ENGINE = InnoDB");
$this->addSql("ALTER TABLE Baskets ADD CONSTRAINT FK_13461873A76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
$this->addSql("ALTER TABLE Baskets ADD CONSTRAINT FK_13461873C2D98306 FOREIGN KEY (pusher_id) REFERENCES Users (id)");
$this->addSql("ALTER TABLE StoryWZ ADD CONSTRAINT FK_E0D2CBAEA76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
@@ -37,7 +37,7 @@ class WorkzoneMigration extends AbstractMigration
$this->addSql("ALTER TABLE ValidationDatas ADD CONSTRAINT FK_70E84DDC9D1C3019 FOREIGN KEY (participant_id) REFERENCES ValidationParticipants (id)");
$this->addSql("ALTER TABLE ValidationDatas ADD CONSTRAINT FK_70E84DDCE989605 FOREIGN KEY (basket_element_id) REFERENCES BasketElements (id)");
$this->addSql("ALTER TABLE BasketElements ADD CONSTRAINT FK_C0B7ECB71BE1FB52 FOREIGN KEY (basket_id) REFERENCES Baskets (id)");
- $this->addSql("ALTER TABLE ValidationParticipants ADD CONSTRAINT FK_17850D7BF25B0F5B FOREIGN KEY (ValidationSession_id) REFERENCES ValidationSessions (id)");
+ $this->addSql("ALTER TABLE ValidationParticipants ADD CONSTRAINT FK_17850D7BF25B0F5B FOREIGN KEY (validation_session_id) REFERENCES ValidationSessions (id)");
$this->addSql("ALTER TABLE ValidationParticipants ADD CONSTRAINT FK_17850D7BA76ED395 FOREIGN KEY (user_id) REFERENCES Users (id)");
}
diff --git a/lib/Alchemy/Phrasea/Setup/Information.php b/lib/Alchemy/Phrasea/Setup/Information.php
index 2ace8205f6..2a2cb2095e 100644
--- a/lib/Alchemy/Phrasea/Setup/Information.php
+++ b/lib/Alchemy/Phrasea/Setup/Information.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/InformationInterface.php b/lib/Alchemy/Phrasea/Setup/InformationInterface.php
index 38cc9462ba..3713f72942 100644
--- a/lib/Alchemy/Phrasea/Setup/InformationInterface.php
+++ b/lib/Alchemy/Phrasea/Setup/InformationInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Installer.php b/lib/Alchemy/Phrasea/Setup/Installer.php
index 5051f46844..99d9f34144 100644
--- a/lib/Alchemy/Phrasea/Setup/Installer.php
+++ b/lib/Alchemy/Phrasea/Setup/Installer.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -35,11 +35,11 @@ class Installer
$this->createConfigFile($abConn, $serverName, $binaryData, $dataPath);
try {
- $this->createAB();
+ $this->createAB($abConn);
$user = $this->createUser($email, $password);
$this->createDefaultUsers();
if (null !== $dbConn) {
- $this->createDB($dbConn, $template);
+ $this->createDB($dbConn, $template, $user);
}
} catch (\Exception $e) {
$this->rollbackInstall($abConn, $dbConn);
@@ -56,11 +56,12 @@ class Installer
$this->phraseaIndexer = $path;
}
- private function createDB(Connection $dbConn = null, $template)
+ private function createDB(Connection $dbConn = null, $template, User $admin)
{
$template = new \SplFileInfo(__DIR__ . '/../../../conf.d/data_templates/' . $template . '-simple.xml');
$databox = \databox::create($this->app, $dbConn, $template);
- $this->app['acl']->get($this->app['authentication']->getUser())
+
+ $this->app['acl']->get($admin)
->give_access_to_sbas([$databox->get_sbas_id()])
->update_rights_to_sbas(
$databox->get_sbas_id(), [
@@ -69,11 +70,11 @@ class Installer
]
);
- $collection = \collection::create($this->app, $databox, $this->app['phraseanet.appbox'], 'test', $this->app['authentication']->getUser());
+ $collection = \collection::create($this->app, $databox, $this->app['phraseanet.appbox'], 'test', $admin);
- $this->app['acl']->get($this->app['authentication']->getUser())->give_access_to_base([$collection->get_base_id()]);
- $this->app['acl']->get($this->app['authentication']->getUser())->update_rights_to_base($collection->get_base_id(), [
- 'canpush' => 1, 'cancmd' => 1
+ $this->app['acl']->get($admin)->give_access_to_base([$collection->get_base_id()]);
+ $this->app['acl']->get($admin)->update_rights_to_base($collection->get_base_id(), [
+ 'canpush' => 1, 'cancmd' => 1
, 'canputinalbum' => 1, 'candwnldhd' => 1, 'candwnldpreview' => 1, 'canadmin' => 1
, 'actif' => 1, 'canreport' => 1, 'canaddrecord' => 1, 'canmodifrecord' => 1
, 'candeleterecord' => 1, 'chgstatus' => 1, 'imgtools' => 1, 'manage' => 1
@@ -95,7 +96,6 @@ class Installer
private function createUser($email, $password)
{
$user = $this->app['manipulator.user']->createUser($email, $password, $email, true);
- $this->app['authentication']->openAccount($user);
return $user;
}
@@ -145,16 +145,19 @@ class Installer
return;
}
- private function createAB()
+ private function createAB(Connection $abConn)
{
- $metadatas = $this->app['EM']->getMetadataFactory()->getAllMetadata();
+ // set default orm to the application box
+ $this->app['orm.ems.default'] = $this->app['hash.dsn']($this->app['db.dsn']($abConn->getParams()));
- if (!empty($metadatas)) {
+ $metadata = $this->app['orm.em']->getMetadataFactory()->getAllMetadata();
+
+ if (!empty($metadata)) {
// Create SchemaTool
- $tool = new SchemaTool($this->app['EM']);
+ $tool = new SchemaTool($this->app['orm.em']);
// Create schema
- $tool->dropSchema($metadatas);
- $tool->createSchema($metadatas);
+ $tool->dropSchema($metadata);
+ $tool->createSchema($metadata);
}
$this->app['phraseanet.appbox']->insert_datas($this->app);
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php
index 5d775f3094..9fcb07072d 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/BinariesProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/CacheServerProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/CacheServerProbe.php
index 076e7c1f65..b58269a224 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/CacheServerProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/CacheServerProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/DataboxStructureProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/DataboxStructureProbe.php
index 83260d3738..868147747e 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/DataboxStructureProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/DataboxStructureProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/FilesystemProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/FilesystemProbe.php
index c532a799e9..8ba178ef2e 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/FilesystemProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/FilesystemProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/LocalesProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/LocalesProbe.php
index 6327f221d1..d7ad961b05 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/LocalesProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/LocalesProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/OpcodeCacheProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/OpcodeCacheProbe.php
index 792d6a97d8..5b269acadb 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/OpcodeCacheProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/OpcodeCacheProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/PhpProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/PhpProbe.php
index 9797cc15fc..10af411d91 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/PhpProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/PhpProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/PhraseaProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/PhraseaProbe.php
index 9842ec1a17..8c9c8127e5 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/PhraseaProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/PhraseaProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/ProbeInterface.php b/lib/Alchemy/Phrasea/Setup/Probe/ProbeInterface.php
index cbc6f40e64..74d294d94d 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/ProbeInterface.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/ProbeInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php
index 0b9859b175..ebb06e0be4 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/SearchEngineProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/SubdefsPathsProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/SubdefsPathsProbe.php
index 3eb6b09626..83bb9ac989 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/SubdefsPathsProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/SubdefsPathsProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Probe/SystemProbe.php b/lib/Alchemy/Phrasea/Setup/Probe/SystemProbe.php
index 9cc8b38441..6d8ba22e56 100644
--- a/lib/Alchemy/Phrasea/Setup/Probe/SystemProbe.php
+++ b/lib/Alchemy/Phrasea/Setup/Probe/SystemProbe.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/RequirementInterface.php b/lib/Alchemy/Phrasea/Setup/RequirementInterface.php
index 9a70af75ef..ed923bb4e9 100644
--- a/lib/Alchemy/Phrasea/Setup/RequirementInterface.php
+++ b/lib/Alchemy/Phrasea/Setup/RequirementInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php b/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php
index c87ba21520..4c1c32b8a6 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/BinariesRequirements.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/CacheServerRequirement.php b/lib/Alchemy/Phrasea/Setup/Requirements/CacheServerRequirement.php
index 334eec81ff..01b586b5d9 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/CacheServerRequirement.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/CacheServerRequirement.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/FilesystemRequirements.php b/lib/Alchemy/Phrasea/Setup/Requirements/FilesystemRequirements.php
index 804b266ad3..a76bd36760 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/FilesystemRequirements.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/FilesystemRequirements.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/LocalesRequirements.php b/lib/Alchemy/Phrasea/Setup/Requirements/LocalesRequirements.php
index 790a87b0fd..c6ec15f53d 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/LocalesRequirements.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/LocalesRequirements.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/OpcodeCacheRequirement.php b/lib/Alchemy/Phrasea/Setup/Requirements/OpcodeCacheRequirement.php
index 33d43cb567..93d2daf03a 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/OpcodeCacheRequirement.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/OpcodeCacheRequirement.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/PhpRequirements.php b/lib/Alchemy/Phrasea/Setup/Requirements/PhpRequirements.php
index d53d8d2e72..666f118b9c 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/PhpRequirements.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/PhpRequirements.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/PhraseaRequirements.php b/lib/Alchemy/Phrasea/Setup/Requirements/PhraseaRequirements.php
index ccd281f53a..940320f003 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/PhraseaRequirements.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/PhraseaRequirements.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/RequirementInterface.php b/lib/Alchemy/Phrasea/Setup/Requirements/RequirementInterface.php
index 2f818474a6..bd5374e74f 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/RequirementInterface.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/RequirementInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Requirements/SystemRequirements.php b/lib/Alchemy/Phrasea/Setup/Requirements/SystemRequirements.php
index 667b632018..15da4e21a5 100644
--- a/lib/Alchemy/Phrasea/Setup/Requirements/SystemRequirements.php
+++ b/lib/Alchemy/Phrasea/Setup/Requirements/SystemRequirements.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/MailChecker.php b/lib/Alchemy/Phrasea/Setup/Version/MailChecker.php
index ca6cd114de..9cea69a9a6 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/MailChecker.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/MailChecker.php
@@ -12,6 +12,7 @@
namespace Alchemy\Phrasea\Setup\Version;
use Alchemy\Phrasea\Application;
+use Alchemy\Phrasea\Core\Version;
/**
* In version 3.9 the user table have been removed.
@@ -30,6 +31,10 @@ class MailChecker
*/
public static function getWrongEmailUsers(Application $app, $table = 'usr')
{
+ if (version_compare(Version::getNumber(), '3.9', '>')) {
+ return [];
+ }
+
$sql = 'SELECT usr_mail, usr_id, last_conn, usr_login FROM '. $table .' WHERE usr_mail IS NOT NULL';
$stmt = $app['phraseanet.appbox']->get_connection()->prepare($sql);
$stmt->execute();
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php
index 00d896e3bc..4ae7621657 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration31.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php
index dc62369e2f..86f40280cd 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration35.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration38.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration38.php
index 25a06ca974..fda45795cb 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration38.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/Migration38.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Migration/MigrationInterface.php b/lib/Alchemy/Phrasea/Setup/Version/Migration/MigrationInterface.php
index ae1c24ad8c..b57074fc9b 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Migration/MigrationInterface.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Migration/MigrationInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/PreSchemaUpgradeCollection.php b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/PreSchemaUpgradeCollection.php
index 3bbaa2237c..d64aa0cbbe 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/PreSchemaUpgradeCollection.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/PreSchemaUpgradeCollection.php
@@ -39,20 +39,20 @@ class PreSchemaUpgradeCollection
if ($upgrade->isApplyable($app)) {
try {
$upgrade->apply(
- $app['EM'],
+ $app['orm.em'],
$app['phraseanet.appbox'],
$app['doctrine-migration.configuration']
);
$applied[] = $upgrade;
} catch (\Exception $e) {
$upgrade->rollback(
- $app['EM'],
+ $app['orm.em'],
$app['phraseanet.appbox'],
$app['doctrine-migration.configuration']
);
foreach (array_reverse($applied) as $done) {
$done->rollback(
- $app['EM'],
+ $app['orm.em'],
$app['phraseanet.appbox'],
$app['doctrine-migration.configuration']
);
diff --git a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Feeds.php b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Feeds.php
index ab9e448d5e..90e8c5d264 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Feeds.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Feeds.php
@@ -32,7 +32,7 @@ class Upgrade39Feeds implements PreSchemaUpgradeInterface
*/
public function isApplyable(Application $app)
{
- return $this->tableExists($app['EM'], 'feeds');
+ return $this->tableExists($app['orm.em'], 'feeds');
}
/**
diff --git a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Tokens.php b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Tokens.php
index d1f49ff6e2..a0ba63ab26 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Tokens.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Tokens.php
@@ -32,7 +32,7 @@ class Upgrade39Tokens implements PreSchemaUpgradeInterface
*/
public function isApplyable(Application $app)
{
- return $this->tableExists($app['EM'], 'tokens');
+ return $this->tableExists($app['orm.em'], 'tokens');
}
/**
diff --git a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Users.php b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Users.php
index 50263adfac..ce0477cba6 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Users.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/PreSchemaUpgrade/Upgrade39Users.php
@@ -65,7 +65,7 @@ class Upgrade39Users implements PreSchemaUpgradeInterface
*/
public function isApplyable(Application $app)
{
- return false === $this->tableExists($app['EM'], 'Users');
+ return false === $this->tableExists($app['orm.em'], 'Users');
}
/**
@@ -248,7 +248,7 @@ class Upgrade39Users implements PreSchemaUpgradeInterface
],
"ValidationSessions" => [
"referenced_by" => [
- "ValidationParticipants" => "ValidationSession_id"
+ "ValidationParticipants" => "validation_session_id"
],
'field' => ['initiator_id'],
],
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe31.php b/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe31.php
index db8679d88c..40f96b805e 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe31.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe31.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe35.php b/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe35.php
index 447eff638e..008a02fe12 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe35.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe35.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe38.php b/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe38.php
index d39f11d610..dbede4844f 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe38.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Probe/Probe38.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Setup/Version/Probe/ProbeInterface.php b/lib/Alchemy/Phrasea/Setup/Version/Probe/ProbeInterface.php
index 956e05469f..a48bae1f58 100644
--- a/lib/Alchemy/Phrasea/Setup/Version/Probe/ProbeInterface.php
+++ b/lib/Alchemy/Phrasea/Setup/Version/Probe/ProbeInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/ArchiveJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/ArchiveJob.php
index af6c1dc445..0f43145953 100644
--- a/lib/Alchemy/Phrasea/TaskManager/Job/ArchiveJob.php
+++ b/lib/Alchemy/Phrasea/TaskManager/Job/ArchiveJob.php
@@ -1362,8 +1362,8 @@ class ArchiveJob extends AbstractJob
{
$lazaretSession = new LazaretSession();
- $app['EM']->persist($lazaretSession);
- $app['EM']->flush();
+ $app['orm.em']->persist($lazaretSession);
+ $app['orm.em']->flush();
return $lazaretSession;
}
diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/BridgeJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/BridgeJob.php
index 1f0fefcc14..dfc60cc1c1 100644
--- a/lib/Alchemy/Phrasea/TaskManager/Job/BridgeJob.php
+++ b/lib/Alchemy/Phrasea/TaskManager/Job/BridgeJob.php
@@ -118,6 +118,7 @@ class BridgeJob extends AbstractJob
try {
$dist_id = $account->get_api()->upload($element->get_record(), $element->get_datas());
$element->set_uploaded_on(new \DateTime());
+ $element->set_status(\Bridge_Element::STATUS_DONE);
} catch (\Exception $e) {
$this->log('debug', 'Error while uploading : ' . $e->getMessage());
$element->set_status(\Bridge_Element::STATUS_ERROR);
diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php
index 0cac70e0dc..96230da582 100644
--- a/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php
+++ b/lib/Alchemy/Phrasea/TaskManager/Job/FtpJob.php
@@ -75,9 +75,9 @@ class FtpJob extends AbstractJob
{
foreach ($app['repo.ftp-exports']
->findCrashedExports(new \DateTime('-1 month')) as $export) {
- $app['EM']->remove($export);
+ $app['orm.em']->remove($export);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
private function retrieveExports(Application $app)
@@ -238,8 +238,8 @@ class FtpJob extends AbstractJob
$exportElement
->setDone(true)
->setError(false);
- $app['EM']->persist($exportElement);
- $app['EM']->flush();
+ $app['orm.em']->persist($exportElement);
+ $app['orm.em']->flush();
$this->logexport($app, $record, $obj, $ftpLog);
} catch (\Exception $e) {
$state .= $line = $this->translator->trans('task::ftp:File "%file%" (record %record_id%) de la base "%basename%" (Export du Document) : Transfert cancelled (le document n\'existe plus)', ['%file%' => basename($localfile), '%record_id%' => $record_id, '%basename%' => \phrasea::sbas_labels(\phrasea::sbasFromBas($app, $base_id), $app)]) . "\n ";
@@ -250,8 +250,8 @@ class FtpJob extends AbstractJob
$exportElement
->setDone($exportElement->isError())
->setError(true);
- $app['EM']->persist($exportElement);
- $app['EM']->flush();
+ $app['orm.em']->persist($exportElement);
+ $app['orm.em']->flush();
}
}
@@ -289,8 +289,8 @@ class FtpJob extends AbstractJob
$this->log('debug', $line);
$export->incrementCrash();
- $app['EM']->persist($export);
- $app['EM']->flush();
+ $app['orm.em']->persist($export);
+ $app['orm.em']->flush();
}
$this->finalize($app, $export);
@@ -316,16 +316,16 @@ class FtpJob extends AbstractJob
$this->send_mails($app, $export);
if ((int) $error === 0) {
- $app['EM']->remove($export);
- $app['EM']->flush();
+ $app['orm.em']->remove($export);
+ $app['orm.em']->flush();
} else {
$export->setCrash($export->getNbretry());
foreach ($export->getElements() as $element) {
if (!$element->isError()) {
- $app['EM']->remove($export);
+ $app['orm.em']->remove($export);
}
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
return $this;
diff --git a/lib/Alchemy/Phrasea/TaskManager/Job/WriteMetadataJob.php b/lib/Alchemy/Phrasea/TaskManager/Job/WriteMetadataJob.php
index f7334c2838..626e08fb84 100644
--- a/lib/Alchemy/Phrasea/TaskManager/Job/WriteMetadataJob.php
+++ b/lib/Alchemy/Phrasea/TaskManager/Job/WriteMetadataJob.php
@@ -191,9 +191,9 @@ class WriteMetadataJob extends AbstractJob
try {
$app['exiftool.writer']->write($file, $metadata);
- $this->log(sprintf('meta written for sbasid=%1$d - recordid=%2$d (%3$s)', $databox->get_sbas_id(), $record_id, $name), self::LOG_INFO);
+ $this->log('info',sprintf('meta written for sbasid=%1$d - recordid=%2$d (%3$s)', $databox->get_sbas_id(), $record_id, $name));
} catch (PHPExiftoolException $e) {
- $this->log(sprintf('meta NOT written for sbasid=%1$d - recordid=%2$d (%3$s) because "%s"', $databox->get_sbas_id(), $record_id, $name, $e->getMessage()), self::LOG_ERROR);
+ $this->log('error',sprintf('meta NOT written for sbasid=%1$d - recordid=%2$d (%3$s) because "%s"', $databox->get_sbas_id(), $record_id, $name, $e->getMessage()));
}
}
diff --git a/lib/Alchemy/Phrasea/Twig/BytesConverter.php b/lib/Alchemy/Phrasea/Twig/BytesConverter.php
index c4f3016992..a451ff120c 100644
--- a/lib/Alchemy/Phrasea/Twig/BytesConverter.php
+++ b/lib/Alchemy/Phrasea/Twig/BytesConverter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Twig/Camelize.php b/lib/Alchemy/Phrasea/Twig/Camelize.php
index bd93e93439..5933ab8553 100644
--- a/lib/Alchemy/Phrasea/Twig/Camelize.php
+++ b/lib/Alchemy/Phrasea/Twig/Camelize.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Twig/Fit.php b/lib/Alchemy/Phrasea/Twig/Fit.php
index b8b4f0741a..5520159d75 100644
--- a/lib/Alchemy/Phrasea/Twig/Fit.php
+++ b/lib/Alchemy/Phrasea/Twig/Fit.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Utilities/Less/Builder.php b/lib/Alchemy/Phrasea/Utilities/Less/Builder.php
index c5da858f8c..827c5ffdff 100644
--- a/lib/Alchemy/Phrasea/Utilities/Less/Builder.php
+++ b/lib/Alchemy/Phrasea/Utilities/Less/Builder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Utilities/Less/Compiler.php b/lib/Alchemy/Phrasea/Utilities/Less/Compiler.php
index bc39ea61da..3d021b573f 100644
--- a/lib/Alchemy/Phrasea/Utilities/Less/Compiler.php
+++ b/lib/Alchemy/Phrasea/Utilities/Less/Compiler.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Utilities/String/Camelizer.php b/lib/Alchemy/Phrasea/Utilities/String/Camelizer.php
index d8cf62ea88..51e7b7dc69 100644
--- a/lib/Alchemy/Phrasea/Utilities/String/Camelizer.php
+++ b/lib/Alchemy/Phrasea/Utilities/String/Camelizer.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php
index 858e594f0c..5740dea00c 100644
--- a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php
+++ b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/ControlProviderInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php
index 31bf8bc1c5..cdde341ad2 100644
--- a/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php
+++ b/lib/Alchemy/Phrasea/Vocabulary/ControlProvider/UserProvider.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Vocabulary/Controller.php b/lib/Alchemy/Phrasea/Vocabulary/Controller.php
index e8fee12fd7..92225d266c 100644
--- a/lib/Alchemy/Phrasea/Vocabulary/Controller.php
+++ b/lib/Alchemy/Phrasea/Vocabulary/Controller.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Vocabulary/Term.php b/lib/Alchemy/Phrasea/Vocabulary/Term.php
index 0734682c8c..d36ada231e 100644
--- a/lib/Alchemy/Phrasea/Vocabulary/Term.php
+++ b/lib/Alchemy/Phrasea/Vocabulary/Term.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/Alchemy/Phrasea/Webhook/Processor/FeedEntryProcessor.php b/lib/Alchemy/Phrasea/Webhook/Processor/FeedEntryProcessor.php
index 1b13f552ba..7f374e79da 100644
--- a/lib/Alchemy/Phrasea/Webhook/Processor/FeedEntryProcessor.php
+++ b/lib/Alchemy/Phrasea/Webhook/Processor/FeedEntryProcessor.php
@@ -12,7 +12,7 @@ class FeedEntryProcessor extends AbstractProcessor implements ProcessorInterface
return null;
}
- $entry = $this->app['EM']->getRepository('Phraseanet::Entry')->find($data->{"entry_id"});
+ $entry = $this->app['orm.em']->getRepository('Phraseanet::Entry')->find($data->{"entry_id"});
if (null === $entry) {
return null;
diff --git a/lib/classes/ACL.php b/lib/classes/ACL.php
index 1c4216f9f2..30a23b9f5e 100644
--- a/lib/classes/ACL.php
+++ b/lib/classes/ACL.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -886,7 +886,6 @@ class ACL implements cache_cacheableInterface
return $this;
} catch (\Exception $e) {
-
}
$sql = 'SELECT u.* FROM basusr u, bas b, sbas s
@@ -1473,12 +1472,10 @@ class ACL implements cache_cacheableInterface
public function delete_injected_rights_sbas(databox $databox)
{
$sql = 'DELETE FROM collusr WHERE usr_id = :usr_id AND site = :site';
- $params = [
- ':usr_id' => $this->user->getId()
- , ':site' => $this->app['conf']->get(['main', 'key'])
- ];
$stmt = $databox->get_connection()->prepare($sql);
- $stmt->execute($params);
+ $stmt->execute([
+ ':usr_id' => $this->user->getId(), ':site' => $this->app['conf']->get(['main', 'key'])
+ ]);
$stmt->closeCursor();
return $this;
diff --git a/lib/classes/API/OAuth2/Adapter.php b/lib/classes/API/OAuth2/Adapter.php
index 89114b0002..3b0e73d2ec 100644
--- a/lib/classes/API/OAuth2/Adapter.php
+++ b/lib/classes/API/OAuth2/Adapter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Application/Navigator.php b/lib/classes/API/OAuth2/Application/Navigator.php
index acaada890b..a53986aa0f 100644
--- a/lib/classes/API/OAuth2/Application/Navigator.php
+++ b/lib/classes/API/OAuth2/Application/Navigator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Application/OfficePlugin.php b/lib/classes/API/OAuth2/Application/OfficePlugin.php
index 6d0e6e0192..da85c0c1d4 100644
--- a/lib/classes/API/OAuth2/Application/OfficePlugin.php
+++ b/lib/classes/API/OAuth2/Application/OfficePlugin.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Exception.php b/lib/classes/API/OAuth2/Exception/Exception.php
index 7c748c0b4a..2816b59a45 100644
--- a/lib/classes/API/OAuth2/Exception/Exception.php
+++ b/lib/classes/API/OAuth2/Exception/Exception.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Interface.php b/lib/classes/API/OAuth2/Exception/Interface.php
index a923764773..bc31cf7e01 100644
--- a/lib/classes/API/OAuth2/Exception/Interface.php
+++ b/lib/classes/API/OAuth2/Exception/Interface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect.php b/lib/classes/API/OAuth2/Exception/Redirect.php
index aa951aeb6a..6ad47a5c95 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/AccessDenied.php b/lib/classes/API/OAuth2/Exception/Redirect/AccessDenied.php
index ba1ccf87d5..3c1f7a7225 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/AccessDenied.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/AccessDenied.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/InvalidClient.php b/lib/classes/API/OAuth2/Exception/Redirect/InvalidClient.php
index dacace9a31..401df47d55 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/InvalidClient.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/InvalidClient.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/InvalidRequest.php b/lib/classes/API/OAuth2/Exception/Redirect/InvalidRequest.php
index 6d48c641e7..5822534599 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/InvalidRequest.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/InvalidRequest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/InvalidScope.php b/lib/classes/API/OAuth2/Exception/Redirect/InvalidScope.php
index c0c0a23f44..3b170cafdb 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/InvalidScope.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/InvalidScope.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/ServerError.php b/lib/classes/API/OAuth2/Exception/Redirect/ServerError.php
index c900f04aeb..a8d204eb73 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/ServerError.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/ServerError.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php b/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php
index ab130fdbaf..6779aa1569 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/TemporaryUnavailable.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/UnauthorizedClient.php b/lib/classes/API/OAuth2/Exception/Redirect/UnauthorizedClient.php
index 4223080b03..10777698de 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/UnauthorizedClient.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/UnauthorizedClient.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/Redirect/UnsupportedResponseType.php b/lib/classes/API/OAuth2/Exception/Redirect/UnsupportedResponseType.php
index a90381e93a..337d535067 100644
--- a/lib/classes/API/OAuth2/Exception/Redirect/UnsupportedResponseType.php
+++ b/lib/classes/API/OAuth2/Exception/Redirect/UnsupportedResponseType.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate.php
index 2570c23eed..3b3f5e5dd9 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/ExpiredToken.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/ExpiredToken.php
index e50097e9ab..9af1a653f1 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/ExpiredToken.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/ExpiredToken.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InsufficientScope.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InsufficientScope.php
index 23e945b1ea..c845d62eb1 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InsufficientScope.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InsufficientScope.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidClient.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidClient.php
index 7151365e0d..f86ecee43f 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidClient.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidClient.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidRequest.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidRequest.php
index b614711aa6..ffd9b4c637 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidRequest.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidRequest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidToken.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidToken.php
index a345586b12..5750269631 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidToken.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/InvalidToken.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/BadRequest.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/BadRequest.php
index 075461546e..cc9764ed57 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/BadRequest.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/BadRequest.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Forbidden.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Forbidden.php
index e0b59fe309..7d9eaf9738 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Forbidden.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Forbidden.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Unauthorized.php b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Unauthorized.php
index b8f0de6321..a9124369f3 100644
--- a/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Unauthorized.php
+++ b/lib/classes/API/OAuth2/Exception/WWWAuthenticate/Type/Unauthorized.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Form/DevAppDesktop.php b/lib/classes/API/OAuth2/Form/DevAppDesktop.php
index 7b50727b71..35222eb83b 100644
--- a/lib/classes/API/OAuth2/Form/DevAppDesktop.php
+++ b/lib/classes/API/OAuth2/Form/DevAppDesktop.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/OAuth2/Form/DevAppInternet.php b/lib/classes/API/OAuth2/Form/DevAppInternet.php
index e05fa297b3..3db541ccd8 100644
--- a/lib/classes/API/OAuth2/Form/DevAppInternet.php
+++ b/lib/classes/API/OAuth2/Form/DevAppInternet.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/API/Webhook.php b/lib/classes/API/Webhook.php
index 08389682e9..de50697355 100644
--- a/lib/classes/API/Webhook.php
+++ b/lib/classes/API/Webhook.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Account.php b/lib/classes/Bridge/Account.php
index ac0548d620..3029b6ef15 100644
--- a/lib/classes/Bridge/Account.php
+++ b/lib/classes/Bridge/Account.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/AccountSettings.php b/lib/classes/Bridge/AccountSettings.php
index ebb25fd9fd..0c53b03dfe 100644
--- a/lib/classes/Bridge/AccountSettings.php
+++ b/lib/classes/Bridge/AccountSettings.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api.php b/lib/classes/Bridge/Api.php
index 14753a4db1..88dcf9179c 100644
--- a/lib/classes/Bridge/Api.php
+++ b/lib/classes/Bridge/Api.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Abstract.php b/lib/classes/Bridge/Api/Abstract.php
index 8b0b1a00ba..fa7e2e5364 100644
--- a/lib/classes/Bridge/Api/Abstract.php
+++ b/lib/classes/Bridge/Api/Abstract.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/AbstractCollection.php b/lib/classes/Bridge/Api/AbstractCollection.php
index 7980c74b24..d8798ce102 100644
--- a/lib/classes/Bridge/Api/AbstractCollection.php
+++ b/lib/classes/Bridge/Api/AbstractCollection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Auth/Abstract.php b/lib/classes/Bridge/Api/Auth/Abstract.php
index b8c5929ab8..66add80848 100644
--- a/lib/classes/Bridge/Api/Auth/Abstract.php
+++ b/lib/classes/Bridge/Api/Auth/Abstract.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Auth/Flickr.php b/lib/classes/Bridge/Api/Auth/Flickr.php
index ba7e413f58..2ecc3ada3c 100644
--- a/lib/classes/Bridge/Api/Auth/Flickr.php
+++ b/lib/classes/Bridge/Api/Auth/Flickr.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Auth/Interface.php b/lib/classes/Bridge/Api/Auth/Interface.php
index 5a1626e032..6fe7605dfb 100644
--- a/lib/classes/Bridge/Api/Auth/Interface.php
+++ b/lib/classes/Bridge/Api/Auth/Interface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Auth/OAuth2.php b/lib/classes/Bridge/Api/Auth/OAuth2.php
index 436b89d706..4f0d32179a 100644
--- a/lib/classes/Bridge/Api/Auth/OAuth2.php
+++ b/lib/classes/Bridge/Api/Auth/OAuth2.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Auth/Youtube.php b/lib/classes/Bridge/Api/Auth/Youtube.php
index 33adf4013c..580b23acc6 100644
--- a/lib/classes/Bridge/Api/Auth/Youtube.php
+++ b/lib/classes/Bridge/Api/Auth/Youtube.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/ContainerCollection.php b/lib/classes/Bridge/Api/ContainerCollection.php
index 6b8c342bf7..67226748c9 100644
--- a/lib/classes/Bridge/Api/ContainerCollection.php
+++ b/lib/classes/Bridge/Api/ContainerCollection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/ContainerInterface.php b/lib/classes/Bridge/Api/ContainerInterface.php
index e003933c3b..dc53afdaa6 100644
--- a/lib/classes/Bridge/Api/ContainerInterface.php
+++ b/lib/classes/Bridge/Api/ContainerInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Dailymotion.php b/lib/classes/Bridge/Api/Dailymotion.php
index 92828123d6..2facc8caa7 100644
--- a/lib/classes/Bridge/Api/Dailymotion.php
+++ b/lib/classes/Bridge/Api/Dailymotion.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/ElementCollection.php b/lib/classes/Bridge/Api/ElementCollection.php
index 6fb60a86ff..bdeab338f1 100644
--- a/lib/classes/Bridge/Api/ElementCollection.php
+++ b/lib/classes/Bridge/Api/ElementCollection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/ElementInterface.php b/lib/classes/Bridge/Api/ElementInterface.php
index 348ba35cf5..7002616604 100644
--- a/lib/classes/Bridge/Api/ElementInterface.php
+++ b/lib/classes/Bridge/Api/ElementInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Flickr.php b/lib/classes/Bridge/Api/Flickr.php
index 4b5a2be3a0..2d6b38ac3b 100644
--- a/lib/classes/Bridge/Api/Flickr.php
+++ b/lib/classes/Bridge/Api/Flickr.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Flickr/Container.php b/lib/classes/Bridge/Api/Flickr/Container.php
index 6b3c7e25d0..d6723022be 100644
--- a/lib/classes/Bridge/Api/Flickr/Container.php
+++ b/lib/classes/Bridge/Api/Flickr/Container.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Flickr/Element.php b/lib/classes/Bridge/Api/Flickr/Element.php
index 95ad3ae955..d82b801951 100644
--- a/lib/classes/Bridge/Api/Flickr/Element.php
+++ b/lib/classes/Bridge/Api/Flickr/Element.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Interface.php b/lib/classes/Bridge/Api/Interface.php
index 155029a613..c1925116ed 100644
--- a/lib/classes/Bridge/Api/Interface.php
+++ b/lib/classes/Bridge/Api/Interface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Youtube.php b/lib/classes/Bridge/Api/Youtube.php
index e5a82ec640..dd06920a7d 100644
--- a/lib/classes/Bridge/Api/Youtube.php
+++ b/lib/classes/Bridge/Api/Youtube.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Youtube/Container.php b/lib/classes/Bridge/Api/Youtube/Container.php
index 1576cfc577..82f1ed479a 100644
--- a/lib/classes/Bridge/Api/Youtube/Container.php
+++ b/lib/classes/Bridge/Api/Youtube/Container.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Api/Youtube/Element.php b/lib/classes/Bridge/Api/Youtube/Element.php
index 7162b9f172..676b38d3fc 100644
--- a/lib/classes/Bridge/Api/Youtube/Element.php
+++ b/lib/classes/Bridge/Api/Youtube/Element.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Element.php b/lib/classes/Bridge/Element.php
index 8f241a9368..b896cc363e 100644
--- a/lib/classes/Bridge/Element.php
+++ b/lib/classes/Bridge/Element.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception.php b/lib/classes/Bridge/Exception.php
index 58773754c8..befd8be039 100644
--- a/lib/classes/Bridge/Exception.php
+++ b/lib/classes/Bridge/Exception.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/AccountNotFound.php b/lib/classes/Bridge/Exception/AccountNotFound.php
index f944b8ba9c..b9119c16cb 100644
--- a/lib/classes/Bridge/Exception/AccountNotFound.php
+++ b/lib/classes/Bridge/Exception/AccountNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ActionAuthBadConnection.php b/lib/classes/Bridge/Exception/ActionAuthBadConnection.php
index f32af0bf5e..580e188804 100644
--- a/lib/classes/Bridge/Exception/ActionAuthBadConnection.php
+++ b/lib/classes/Bridge/Exception/ActionAuthBadConnection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ActionAuthNeedReconnect.php b/lib/classes/Bridge/Exception/ActionAuthNeedReconnect.php
index 64cd37e9e8..a8c939560b 100644
--- a/lib/classes/Bridge/Exception/ActionAuthNeedReconnect.php
+++ b/lib/classes/Bridge/Exception/ActionAuthNeedReconnect.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ActionForbidden.php b/lib/classes/Bridge/Exception/ActionForbidden.php
index 42d40ac06e..9124883f31 100644
--- a/lib/classes/Bridge/Exception/ActionForbidden.php
+++ b/lib/classes/Bridge/Exception/ActionForbidden.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ActionInvalidObjectId.php b/lib/classes/Bridge/Exception/ActionInvalidObjectId.php
index fdd037ceba..669d460104 100644
--- a/lib/classes/Bridge/Exception/ActionInvalidObjectId.php
+++ b/lib/classes/Bridge/Exception/ActionInvalidObjectId.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ActionMandatoryField.php b/lib/classes/Bridge/Exception/ActionMandatoryField.php
index b6c98ec02e..55f3833071 100644
--- a/lib/classes/Bridge/Exception/ActionMandatoryField.php
+++ b/lib/classes/Bridge/Exception/ActionMandatoryField.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ApiConnectorAccessTokenFailed.php b/lib/classes/Bridge/Exception/ApiConnectorAccessTokenFailed.php
index 2703ac5c2b..5bad4b0174 100644
--- a/lib/classes/Bridge/Exception/ApiConnectorAccessTokenFailed.php
+++ b/lib/classes/Bridge/Exception/ApiConnectorAccessTokenFailed.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ApiConnectorNotConfigured.php b/lib/classes/Bridge/Exception/ApiConnectorNotConfigured.php
index 579dd040f5..a005b3c60f 100644
--- a/lib/classes/Bridge/Exception/ApiConnectorNotConfigured.php
+++ b/lib/classes/Bridge/Exception/ApiConnectorNotConfigured.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ApiConnectorNotConnected.php b/lib/classes/Bridge/Exception/ApiConnectorNotConnected.php
index b230ede840..e2c20b81cd 100644
--- a/lib/classes/Bridge/Exception/ApiConnectorNotConnected.php
+++ b/lib/classes/Bridge/Exception/ApiConnectorNotConnected.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ApiConnectorNotFound.php b/lib/classes/Bridge/Exception/ApiConnectorNotFound.php
index 532c2076b2..affe1b4d98 100644
--- a/lib/classes/Bridge/Exception/ApiConnectorNotFound.php
+++ b/lib/classes/Bridge/Exception/ApiConnectorNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ApiConnectorRequestFailed.php b/lib/classes/Bridge/Exception/ApiConnectorRequestFailed.php
index a9ad88cafb..aabfb9827f 100644
--- a/lib/classes/Bridge/Exception/ApiConnectorRequestFailed.php
+++ b/lib/classes/Bridge/Exception/ApiConnectorRequestFailed.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ApiDisabled.php b/lib/classes/Bridge/Exception/ApiDisabled.php
index e50b199b70..4c35fcd0f6 100644
--- a/lib/classes/Bridge/Exception/ApiDisabled.php
+++ b/lib/classes/Bridge/Exception/ApiDisabled.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ApiNotFound.php b/lib/classes/Bridge/Exception/ApiNotFound.php
index 214c7a32b4..1b0f647cdc 100644
--- a/lib/classes/Bridge/Exception/ApiNotFound.php
+++ b/lib/classes/Bridge/Exception/ApiNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ContainerUnknown.php b/lib/classes/Bridge/Exception/ContainerUnknown.php
index 8976f1a306..06069890ea 100644
--- a/lib/classes/Bridge/Exception/ContainerUnknown.php
+++ b/lib/classes/Bridge/Exception/ContainerUnknown.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ElementNotFound.php b/lib/classes/Bridge/Exception/ElementNotFound.php
index 288c78c9ae..aad7cacd10 100644
--- a/lib/classes/Bridge/Exception/ElementNotFound.php
+++ b/lib/classes/Bridge/Exception/ElementNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ElementUnknown.php b/lib/classes/Bridge/Exception/ElementUnknown.php
index 520f27ae54..931b13ccbe 100644
--- a/lib/classes/Bridge/Exception/ElementUnknown.php
+++ b/lib/classes/Bridge/Exception/ElementUnknown.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/InvalidRecordType.php b/lib/classes/Bridge/Exception/InvalidRecordType.php
index 70ff94c36f..75e3bc44bd 100644
--- a/lib/classes/Bridge/Exception/InvalidRecordType.php
+++ b/lib/classes/Bridge/Exception/InvalidRecordType.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/ObjectUnknown.php b/lib/classes/Bridge/Exception/ObjectUnknown.php
index 796dcc3f5a..9742a01c66 100644
--- a/lib/classes/Bridge/Exception/ObjectUnknown.php
+++ b/lib/classes/Bridge/Exception/ObjectUnknown.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Bridge/Exception/TokenNotFound.php b/lib/classes/Bridge/Exception/TokenNotFound.php
index 037ab1f4fc..f0632e6f1b 100644
--- a/lib/classes/Bridge/Exception/TokenNotFound.php
+++ b/lib/classes/Bridge/Exception/TokenNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Abstract.php b/lib/classes/Exception/Abstract.php
index 0a57183885..bd51eebf10 100644
--- a/lib/classes/Exception/Abstract.php
+++ b/lib/classes/Exception/Abstract.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Databox/CollectionNotFound.php b/lib/classes/Exception/Databox/CollectionNotFound.php
index e959888f4c..81a4d70ff6 100644
--- a/lib/classes/Exception/Databox/CollectionNotFound.php
+++ b/lib/classes/Exception/Databox/CollectionNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Databox/FieldNotFound.php b/lib/classes/Exception/Databox/FieldNotFound.php
index e363600141..d1e9205495 100644
--- a/lib/classes/Exception/Databox/FieldNotFound.php
+++ b/lib/classes/Exception/Databox/FieldNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Databox/SubdefNotFound.php b/lib/classes/Exception/Databox/SubdefNotFound.php
index 21c651b49f..61738b39a8 100644
--- a/lib/classes/Exception/Databox/SubdefNotFound.php
+++ b/lib/classes/Exception/Databox/SubdefNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Databox/metadataDescriptionNotFound.php b/lib/classes/Exception/Databox/metadataDescriptionNotFound.php
index a25ecc8944..417632b83e 100644
--- a/lib/classes/Exception/Databox/metadataDescriptionNotFound.php
+++ b/lib/classes/Exception/Databox/metadataDescriptionNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/InternalServerError.php b/lib/classes/Exception/InternalServerError.php
index e0b23c71fe..35f90fd46d 100644
--- a/lib/classes/Exception/InternalServerError.php
+++ b/lib/classes/Exception/InternalServerError.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/InvalidArgument.php b/lib/classes/Exception/InvalidArgument.php
index fb8d9bf1d3..41f5502e50 100644
--- a/lib/classes/Exception/InvalidArgument.php
+++ b/lib/classes/Exception/InvalidArgument.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Media/SubdefNotFound.php b/lib/classes/Exception/Media/SubdefNotFound.php
index ad4fa4f3fd..7097d43477 100644
--- a/lib/classes/Exception/Media/SubdefNotFound.php
+++ b/lib/classes/Exception/Media/SubdefNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Record/AdapterNotFound.php b/lib/classes/Exception/Record/AdapterNotFound.php
index 66212fa906..97743416b0 100644
--- a/lib/classes/Exception/Record/AdapterNotFound.php
+++ b/lib/classes/Exception/Record/AdapterNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Session/LoggerNotFound.php b/lib/classes/Exception/Session/LoggerNotFound.php
index e2074d6c84..2560be5ea8 100644
--- a/lib/classes/Exception/Session/LoggerNotFound.php
+++ b/lib/classes/Exception/Session/LoggerNotFound.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Setup/CannotWriteLockFile.php b/lib/classes/Exception/Setup/CannotWriteLockFile.php
index 69d9d0a4cd..dc44e7db9a 100644
--- a/lib/classes/Exception/Setup/CannotWriteLockFile.php
+++ b/lib/classes/Exception/Setup/CannotWriteLockFile.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Setup/FixBadEmailAddresses.php b/lib/classes/Exception/Setup/FixBadEmailAddresses.php
index e81f9d5187..a259bb05bb 100644
--- a/lib/classes/Exception/Setup/FixBadEmailAddresses.php
+++ b/lib/classes/Exception/Setup/FixBadEmailAddresses.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Setup/PhraseaAlreadyInstalled.php b/lib/classes/Exception/Setup/PhraseaAlreadyInstalled.php
index ba22ced53c..687f51a108 100644
--- a/lib/classes/Exception/Setup/PhraseaAlreadyInstalled.php
+++ b/lib/classes/Exception/Setup/PhraseaAlreadyInstalled.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Setup/UpgradeAlreadyStarted.php b/lib/classes/Exception/Setup/UpgradeAlreadyStarted.php
index a70dd0280a..c6026364cc 100644
--- a/lib/classes/Exception/Setup/UpgradeAlreadyStarted.php
+++ b/lib/classes/Exception/Setup/UpgradeAlreadyStarted.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Upload/CannotWriteFile.php b/lib/classes/Exception/Upload/CannotWriteFile.php
index 7144fdd8dc..3399fbda68 100644
--- a/lib/classes/Exception/Upload/CannotWriteFile.php
+++ b/lib/classes/Exception/Upload/CannotWriteFile.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Upload/Error.php b/lib/classes/Exception/Upload/Error.php
index 35f2554a48..59866b5fbc 100644
--- a/lib/classes/Exception/Upload/Error.php
+++ b/lib/classes/Exception/Upload/Error.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Exception/Upload/FileTooBig.php b/lib/classes/Exception/Upload/FileTooBig.php
index 8dbcc5ff83..9df6b26d44 100644
--- a/lib/classes/Exception/Upload/FileTooBig.php
+++ b/lib/classes/Exception/Upload/FileTooBig.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/Session/Logger.php b/lib/classes/Session/Logger.php
index 2b86e5d3fa..7604d5996c 100644
--- a/lib/classes/Session/Logger.php
+++ b/lib/classes/Session/Logger.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -199,10 +199,10 @@ class Session_Logger
$module->setSession($session);
$session->addModule($module);
- $app['EM']->persist($module);
- $app['EM']->persist($session);
+ $app['orm.em']->persist($module);
+ $app['orm.em']->persist($session);
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
$appName = [
diff --git a/lib/classes/Setup/Upgrade.php b/lib/classes/Setup/Upgrade.php
index d796f9aece..6220eb4884 100644
--- a/lib/classes/Setup/Upgrade.php
+++ b/lib/classes/Setup/Upgrade.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/User/Query.php b/lib/classes/User/Query.php
index a7953a9322..66a922f36a 100644
--- a/lib/classes/User/Query.php
+++ b/lib/classes/User/Query.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/User/QueryInterface.php b/lib/classes/User/QueryInterface.php
index e2e93acf52..44ddc4e467 100644
--- a/lib/classes/User/QueryInterface.php
+++ b/lib/classes/User/QueryInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/appbox.php b/lib/classes/appbox.php
index 9fae1cbaf0..027a4890d2 100644
--- a/lib/classes/appbox.php
+++ b/lib/classes/appbox.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -55,7 +55,8 @@ class appbox extends base
{
$this->app = $app;
$connexion = $app['conf']->get(['main', 'database']);
- $this->connection = $app['dbal.provider']->get($connexion);
+
+ $this->connection = $app['db.provider']($connexion);
$this->host = $connexion['host'];
$this->port = $connexion['port'];
@@ -317,6 +318,16 @@ class appbox extends base
$app['filesystem']->mirror($this->app['root.path'] . '/' . $source, $this->app['root.path'] . '/' . $target, null, array('override' => true));
}
+ // do not apply patches
+ // just update old database schema
+ // it is need before applying patches
+ $advices = $this->upgradeDB(false, $app);
+
+ foreach ($this->get_databoxes() as $s) {
+ $advices = array_merge($advices, $s->upgradeDB(false, $app));
+ }
+
+ // then apply patches
$advices = $this->upgradeDB(true, $app);
foreach ($this->get_databoxes() as $s) {
@@ -327,9 +338,9 @@ class appbox extends base
$app['phraseanet.cache-service']->flushAll();
- if ($app['EM']->getConnection()->getDatabasePlatform()->supportsAlterTable()) {
- $tool = new SchemaTool($app['EM']);
- $metas = $app['EM']->getMetadataFactory()->getAllMetadata();
+ if ($app['orm.em']->getConnection()->getDatabasePlatform()->supportsAlterTable()) {
+ $tool = new SchemaTool($app['orm.em']);
+ $metas = $app['orm.em']->getMetadataFactory()->getAllMetadata();
$tool->updateSchema($metas, true);
}
diff --git a/lib/classes/base.php b/lib/classes/base.php
index 771ab8cd85..451b3e4502 100644
--- a/lib/classes/base.php
+++ b/lib/classes/base.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -810,6 +810,9 @@ abstract class base implements cache_cacheableInterface
$success = true;
+ // disable mail
+ $app['swiftmailer.transport'] = null;
+
foreach ($list_patches as $patch) {
// Gets doctrine migrations required for current patch
foreach ($patch->getDoctrineMigrations() as $doctrineVersion) {
@@ -822,7 +825,7 @@ abstract class base implements cache_cacheableInterface
$migration = $version->getMigration();
// Inject entity manager
- $migration->setEntityManager($app['EM']);
+ $migration->setEntityManager($app['orm.em']);
// Execute migration if not marked as migrated and not already applied by an older patch
if (!$migration->isAlreadyApplied()) {
diff --git a/lib/classes/cache/cacheableInterface.php b/lib/classes/cache/cacheableInterface.php
index 5a3b08a663..7b0c0420d0 100644
--- a/lib/classes/cache/cacheableInterface.php
+++ b/lib/classes/cache/cacheableInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/cache/databox.php b/lib/classes/cache/databox.php
index fc7f945038..2c3bdb00c9 100644
--- a/lib/classes/cache/databox.php
+++ b/lib/classes/cache/databox.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/caption/Field/ThesaurusValue.php b/lib/classes/caption/Field/ThesaurusValue.php
index 8554dd70a9..d58231bb19 100644
--- a/lib/classes/caption/Field/ThesaurusValue.php
+++ b/lib/classes/caption/Field/ThesaurusValue.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/caption/Field/Value.php b/lib/classes/caption/Field/Value.php
index 8137647df6..9029ced442 100644
--- a/lib/classes/caption/Field/Value.php
+++ b/lib/classes/caption/Field/Value.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/caption/field.php b/lib/classes/caption/field.php
index f1bf9a36c4..33c2b182d1 100644
--- a/lib/classes/caption/field.php
+++ b/lib/classes/caption/field.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -282,7 +282,7 @@ class caption_field implements cache_cacheableInterface
return $values;
}
- public static function rename_all_metadatas(databox_field $databox_field)
+ public static function rename_all_metadatas(Application $app, databox_field $databox_field)
{
$sql = 'SELECT count(id) as count_id FROM metadatas
WHERE meta_struct_id = :meta_struct_id';
diff --git a/lib/classes/caption/interface.php b/lib/classes/caption/interface.php
index 450e8550c6..4b9b79300c 100644
--- a/lib/classes/caption/interface.php
+++ b/lib/classes/caption/interface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/caption/record.php b/lib/classes/caption/record.php
index a985fff764..f2abb7479a 100644
--- a/lib/classes/caption/record.php
+++ b/lib/classes/caption/record.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/collection.php b/lib/classes/collection.php
index 74e1d0b9fc..e7b26f48c1 100644
--- a/lib/classes/collection.php
+++ b/lib/classes/collection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -421,6 +421,8 @@ class collection implements cache_cacheableInterface
$this->app['manipulator.registration']->deleteRegistrationsOnCollection($this);
$this->get_databox()->delete_data_from_cache(databox::CACHE_COLLECTIONS);
+ $appbox->delete_data_from_cache(appbox::CACHE_LIST_BASES);
+ phrasea::reset_baseDatas($appbox);
return;
}
@@ -611,9 +613,7 @@ class collection implements cache_cacheableInterface
$new_bas = $conn->lastInsertId();
$databox->delete_data_from_cache(databox::CACHE_COLLECTIONS);
-
$appbox->delete_data_from_cache(appbox::CACHE_LIST_BASES);
- cache_databox::update($app, $sbas_id, 'structure');
phrasea::reset_baseDatas($appbox);
diff --git a/lib/classes/connection/pdoStatement.php b/lib/classes/connection/pdoStatement.php
index 7386c54837..f7ebce70a3 100644
--- a/lib/classes/connection/pdoStatement.php
+++ b/lib/classes/connection/pdoStatement.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/connection/pdoStatementReconnectable.php b/lib/classes/connection/pdoStatementReconnectable.php
index 4216d55af1..04c150cbd8 100644
--- a/lib/classes/connection/pdoStatementReconnectable.php
+++ b/lib/classes/connection/pdoStatementReconnectable.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/connection/statement.php b/lib/classes/connection/statement.php
index 12317cf259..3a2243bb38 100644
--- a/lib/classes/connection/statement.php
+++ b/lib/classes/connection/statement.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox.php b/lib/classes/databox.php
index 3e865e9709..715834af46 100644
--- a/lib/classes/databox.php
+++ b/lib/classes/databox.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -122,7 +122,7 @@ class databox extends base
throw new NotFoundHttpException(sprintf('databox %d not found', $sbas_id));
}
- $this->connection = $app['dbal.provider']->get([
+ $this->connection = $app['db.provider']([
'host' => $connection_params[$sbas_id]['host'],
'port' => $connection_params[$sbas_id]['port'],
'user' => $connection_params[$sbas_id]['user'],
@@ -215,11 +215,7 @@ class databox extends base
$ret = [];
foreach ($this->get_available_collections() as $coll_id) {
- try {
- $ret[] = collection::get_from_coll_id($this->app, $this, $coll_id);
- } catch (\Exception $e) {
-
- }
+ $ret[] = collection::get_from_coll_id($this->app, $this, $coll_id);
}
return $ret;
@@ -249,6 +245,7 @@ class databox extends base
foreach ($rs as $row) {
$ret[] = (int) $row['server_coll_id'];
}
+
$this->set_data_to_cache($ret, self::CACHE_COLLECTIONS);
return $ret;
@@ -455,21 +452,6 @@ class databox extends base
public function unmount_databox()
{
- if ($this->app['phraseanet.static-file-factory']->isStaticFileModeEnabled()) {
- $sql = "SELECT path, file FROM subdef WHERE `name`='thumbnail'";
- $stmt = $this->get_connection()->prepare($sql);
- $stmt->execute();
- $rows = $stmt->fetchAll(\PDO::FETCH_ASSOC);
- $stmt->closeCursor();
- foreach ($rows as $row) {
- $pathfile = $this->app['phraseanet.thumb-symlinker']->getSymlinkPath(sprintf(
- '%s/%s',
- rtrim($row['path'], '/'),
- $row['file']
- ));
- $this->app['filesystem']->remove($pathfile);
- }
- }
foreach ($this->get_collections() as $collection) {
$collection->unmount_collection($this->app);
}
@@ -493,14 +475,14 @@ class databox extends base
}
foreach ($this->app['repo.story-wz']->findByDatabox($this->app, $this) as $story) {
- $this->app['EM']->remove($story);
+ $this->app['orm.em']->remove($story);
}
foreach ($this->app['repo.basket-elements']->findElementsByDatabox($this) as $element) {
- $this->app['EM']->remove($element);
+ $this->app['orm.em']->remove($element);
}
- $this->app['EM']->flush();
+ $this->app['orm.em']->flush();
$params = [':site_id' => $this->app['conf']->get(['main', 'key'])];
@@ -597,10 +579,19 @@ class databox extends base
$stmt->closeCursor();
$sbas_id = (int) $app['phraseanet.appbox']->get_connection()->lastInsertId();
+ $app['orm.add']([
+ 'host' => $host,
+ 'port' => $port,
+ 'dbname' => $dbname,
+ 'user' => $user,
+ 'password' => $password
+ ]);
+
$app['phraseanet.appbox']->delete_data_from_cache(appbox::CACHE_LIST_BASES);
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$databox->insert_datas();
+
$databox->setNewStructure(
$data_template, $app['conf']->get(['main', 'storage', 'subdefs'])
);
@@ -620,7 +611,7 @@ class databox extends base
*/
public static function mount(Application $app, $host, $port, $user, $password, $dbname)
{
- $conn = $app['dbal.provider']->get([
+ $conn = $app['db.provider']([
'host' => $host,
'port' => $port,
'user' => $user,
@@ -683,6 +674,8 @@ class databox extends base
*/
public function get_meta_structure()
{
+ $metaStructData = array();
+
if ($this->meta_struct) {
return $this->meta_struct;
}
@@ -704,10 +697,8 @@ class databox extends base
$this->meta_struct = new databox_descriptionStructure();
- if ($metaStructData) {
- foreach ($metaStructData as $row) {
- $this->meta_struct->add_element(databox_field::get_instance($this->app, $this, $row['id']));
- }
+ foreach ((array) $metaStructData as $row) {
+ $this->meta_struct->add_element(databox_field::get_instance($this->app, $this, $row['id']));
}
return $this->meta_struct;
diff --git a/lib/classes/databox/Field/DCES/Contributor.php b/lib/classes/databox/Field/DCES/Contributor.php
index aefe2ba28e..d0df516cee 100644
--- a/lib/classes/databox/Field/DCES/Contributor.php
+++ b/lib/classes/databox/Field/DCES/Contributor.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Coverage.php b/lib/classes/databox/Field/DCES/Coverage.php
index ad0915dabd..57df366ccb 100644
--- a/lib/classes/databox/Field/DCES/Coverage.php
+++ b/lib/classes/databox/Field/DCES/Coverage.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Creator.php b/lib/classes/databox/Field/DCES/Creator.php
index 380c5edead..a2952c908b 100644
--- a/lib/classes/databox/Field/DCES/Creator.php
+++ b/lib/classes/databox/Field/DCES/Creator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Date.php b/lib/classes/databox/Field/DCES/Date.php
index e8a97781ab..b3636f3144 100644
--- a/lib/classes/databox/Field/DCES/Date.php
+++ b/lib/classes/databox/Field/DCES/Date.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Description.php b/lib/classes/databox/Field/DCES/Description.php
index a6e01de245..9ba0e6dd2c 100644
--- a/lib/classes/databox/Field/DCES/Description.php
+++ b/lib/classes/databox/Field/DCES/Description.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Format.php b/lib/classes/databox/Field/DCES/Format.php
index f7cea07b8b..249226b22b 100644
--- a/lib/classes/databox/Field/DCES/Format.php
+++ b/lib/classes/databox/Field/DCES/Format.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Identifier.php b/lib/classes/databox/Field/DCES/Identifier.php
index 77d2d59bd7..2425dc7c2b 100644
--- a/lib/classes/databox/Field/DCES/Identifier.php
+++ b/lib/classes/databox/Field/DCES/Identifier.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Language.php b/lib/classes/databox/Field/DCES/Language.php
index bd4d9859cf..6baa7a4551 100644
--- a/lib/classes/databox/Field/DCES/Language.php
+++ b/lib/classes/databox/Field/DCES/Language.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Publisher.php b/lib/classes/databox/Field/DCES/Publisher.php
index 1e3003bf91..12a64208f5 100644
--- a/lib/classes/databox/Field/DCES/Publisher.php
+++ b/lib/classes/databox/Field/DCES/Publisher.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Relation.php b/lib/classes/databox/Field/DCES/Relation.php
index ad05a319a7..f3e7a9d819 100644
--- a/lib/classes/databox/Field/DCES/Relation.php
+++ b/lib/classes/databox/Field/DCES/Relation.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Rights.php b/lib/classes/databox/Field/DCES/Rights.php
index 68d74272e5..67be8cd49d 100644
--- a/lib/classes/databox/Field/DCES/Rights.php
+++ b/lib/classes/databox/Field/DCES/Rights.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Source.php b/lib/classes/databox/Field/DCES/Source.php
index 2f52bfbf58..7624f518b1 100644
--- a/lib/classes/databox/Field/DCES/Source.php
+++ b/lib/classes/databox/Field/DCES/Source.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Subject.php b/lib/classes/databox/Field/DCES/Subject.php
index 7f091e1858..d53ba821bb 100644
--- a/lib/classes/databox/Field/DCES/Subject.php
+++ b/lib/classes/databox/Field/DCES/Subject.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Title.php b/lib/classes/databox/Field/DCES/Title.php
index 78ddc76507..377a71e349 100644
--- a/lib/classes/databox/Field/DCES/Title.php
+++ b/lib/classes/databox/Field/DCES/Title.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCES/Type.php b/lib/classes/databox/Field/DCES/Type.php
index 47fdf732a2..6a18535c6e 100644
--- a/lib/classes/databox/Field/DCES/Type.php
+++ b/lib/classes/databox/Field/DCES/Type.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/Field/DCESAbstract.php b/lib/classes/databox/Field/DCESAbstract.php
index e9caeb2352..085de04b22 100644
--- a/lib/classes/databox/Field/DCESAbstract.php
+++ b/lib/classes/databox/Field/DCESAbstract.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/cgu.php b/lib/classes/databox/cgu.php
index 6bf4234c5d..5ee28ca337 100644
--- a/lib/classes/databox/cgu.php
+++ b/lib/classes/databox/cgu.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/descriptionStructure.php b/lib/classes/databox/descriptionStructure.php
index 01f0ca49de..5896cf882d 100644
--- a/lib/classes/databox/descriptionStructure.php
+++ b/lib/classes/databox/descriptionStructure.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/field.php b/lib/classes/databox/field.php
index 6fd13509ec..a43a461c53 100644
--- a/lib/classes/databox/field.php
+++ b/lib/classes/databox/field.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -428,7 +428,7 @@ class databox_field implements cache_cacheableInterface
$stmt->closeCursor();
if ($this->renamed) {
- caption_field::rename_all_metadatas($this);
+ caption_field::rename_all_metadatas($this->app, $this);
$this->renamed = false;
}
diff --git a/lib/classes/databox/status.php b/lib/classes/databox/status.php
index a3d429ebed..f4d00a9728 100644
--- a/lib/classes/databox/status.php
+++ b/lib/classes/databox/status.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/subdef.php b/lib/classes/databox/subdef.php
index 6ca49c1e9e..9331b17efa 100644
--- a/lib/classes/databox/subdef.php
+++ b/lib/classes/databox/subdef.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/databox/subdefsStructure.php b/lib/classes/databox/subdefsStructure.php
index 73f1ccb895..e2904f0863 100644
--- a/lib/classes/databox/subdefsStructure.php
+++ b/lib/classes/databox/subdefsStructure.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/autoregister.php b/lib/classes/eventsmanager/notify/autoregister.php
index 17f9e717a6..b1c7fb4b0d 100644
--- a/lib/classes/eventsmanager/notify/autoregister.php
+++ b/lib/classes/eventsmanager/notify/autoregister.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/bridgeuploadfail.php b/lib/classes/eventsmanager/notify/bridgeuploadfail.php
index f8496ebc12..d3b083e702 100644
--- a/lib/classes/eventsmanager/notify/bridgeuploadfail.php
+++ b/lib/classes/eventsmanager/notify/bridgeuploadfail.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/downloadmailfail.php b/lib/classes/eventsmanager/notify/downloadmailfail.php
index f1cdc15d18..8c36376168 100644
--- a/lib/classes/eventsmanager/notify/downloadmailfail.php
+++ b/lib/classes/eventsmanager/notify/downloadmailfail.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/feed.php b/lib/classes/eventsmanager/notify/feed.php
index 84e4d36575..5bbab9e7b6 100644
--- a/lib/classes/eventsmanager/notify/feed.php
+++ b/lib/classes/eventsmanager/notify/feed.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/order.php b/lib/classes/eventsmanager/notify/order.php
index 928bae6352..e09c60cbf6 100644
--- a/lib/classes/eventsmanager/notify/order.php
+++ b/lib/classes/eventsmanager/notify/order.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/orderdeliver.php b/lib/classes/eventsmanager/notify/orderdeliver.php
index 5ea6916f76..794a386526 100644
--- a/lib/classes/eventsmanager/notify/orderdeliver.php
+++ b/lib/classes/eventsmanager/notify/orderdeliver.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -26,7 +26,7 @@ class eventsmanager_notify_orderdeliver extends eventsmanager_notifyAbstract
*/
public function icon_url()
{
- return '/skins/prod/000000/images/disktt_history.gif';
+ return '/skins/prod/000000/images/disktt_history.png';
}
/**
diff --git a/lib/classes/eventsmanager/notify/ordernotdelivered.php b/lib/classes/eventsmanager/notify/ordernotdelivered.php
index 7986c0692d..e36f8ffe48 100644
--- a/lib/classes/eventsmanager/notify/ordernotdelivered.php
+++ b/lib/classes/eventsmanager/notify/ordernotdelivered.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -24,7 +24,7 @@ class eventsmanager_notify_ordernotdelivered extends eventsmanager_notifyAbstrac
public function icon_url()
{
- return '/skins/prod/000000/images/disktt_history.gif';
+ return '/skins/prod/000000/images/disktt_history.png';
}
public function datas(array $data, $unread)
diff --git a/lib/classes/eventsmanager/notify/push.php b/lib/classes/eventsmanager/notify/push.php
index e06c7d0c6c..d6f00ec6ed 100644
--- a/lib/classes/eventsmanager/notify/push.php
+++ b/lib/classes/eventsmanager/notify/push.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/register.php b/lib/classes/eventsmanager/notify/register.php
index 4a7d4dc5cc..8525d19345 100644
--- a/lib/classes/eventsmanager/notify/register.php
+++ b/lib/classes/eventsmanager/notify/register.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/uploadquarantine.php b/lib/classes/eventsmanager/notify/uploadquarantine.php
index 49bdbbc4a1..83929c5399 100644
--- a/lib/classes/eventsmanager/notify/uploadquarantine.php
+++ b/lib/classes/eventsmanager/notify/uploadquarantine.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/validate.php b/lib/classes/eventsmanager/notify/validate.php
index 138cd7295e..0cb380526f 100644
--- a/lib/classes/eventsmanager/notify/validate.php
+++ b/lib/classes/eventsmanager/notify/validate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/validationdone.php b/lib/classes/eventsmanager/notify/validationdone.php
index 38d593b334..4937eb0e04 100644
--- a/lib/classes/eventsmanager/notify/validationdone.php
+++ b/lib/classes/eventsmanager/notify/validationdone.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/eventsmanager/notify/validationreminder.php b/lib/classes/eventsmanager/notify/validationreminder.php
index 714381f5b0..d730b455c2 100644
--- a/lib/classes/eventsmanager/notify/validationreminder.php
+++ b/lib/classes/eventsmanager/notify/validationreminder.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/ftpclient.php b/lib/classes/ftpclient.php
index 6cffd73a07..ba4f5cba18 100644
--- a/lib/classes/ftpclient.php
+++ b/lib/classes/ftpclient.php
@@ -43,15 +43,21 @@ class ftpclient
throw new Exception('Nom d\'hote incorrect ' . $host);
}
- if ($ssl === true) {
- if (($this->connexion = @ftp_ssl_connect($host, $port, $timeout)) === false) {
- throw new Exception('Impossible de se connecter au serveur FTP en SSL');
- }
- } else {
- if (($this->connexion = @ftp_connect($host, $port, $timeout)) === false) {
- throw new Exception('Impossible de se connecter au serveur FTP ' . $host . ":$port $timeout");
+ try {
+ if ($ssl === true) {
+ if (($this->connexion = @ftp_ssl_connect($host, $port, $timeout)) === false) {
+ throw new Exception('Impossible de se connecter au serveur FTP en SSL');
+ }
+ } else {
+ if (($this->connexion = @ftp_connect($host, $port, $timeout)) === false) {
+ throw new Exception('Impossible de se connecter au serveur FTP ' . $host . ":$port $timeout");
+ }
}
}
+ catch(\Exception $e) {
+ // any unknown pb
+ throw $e;
+ }
return $this;
}
diff --git a/lib/classes/http/query.php b/lib/classes/http/query.php
index 7e31355233..698307c853 100644
--- a/lib/classes/http/query.php
+++ b/lib/classes/http/query.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/media/Permalink/Adapter.php b/lib/classes/media/Permalink/Adapter.php
index 94a7eec76d..c1b0273ecf 100644
--- a/lib/classes/media/Permalink/Adapter.php
+++ b/lib/classes/media/Permalink/Adapter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/media/Permalink/Interface.php b/lib/classes/media/Permalink/Interface.php
index bb2568dcb8..a37928f63f 100644
--- a/lib/classes/media/Permalink/Interface.php
+++ b/lib/classes/media/Permalink/Interface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/media/abstract.php b/lib/classes/media/abstract.php
index c807be9087..e5398bb17f 100644
--- a/lib/classes/media/abstract.php
+++ b/lib/classes/media/abstract.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/media/adapter.php b/lib/classes/media/adapter.php
index e5329da375..91f9a95417 100644
--- a/lib/classes/media/adapter.php
+++ b/lib/classes/media/adapter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/media/subdef.php b/lib/classes/media/subdef.php
index 0359862de8..d82c27d91d 100644
--- a/lib/classes/media/subdef.php
+++ b/lib/classes/media/subdef.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -205,8 +205,9 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->height = (int) $row['height'];
$this->mime = $row['mime'];
$this->file = $row['file'];
- $this->etag = $row['etag'] !== null ? $row['etag'] : md5(time() . $row['path'] .$row['file']);
$this->path = p4string::addEndSlash($row['path']);
+ $this->is_physically_present = file_exists($this->get_pathfile());
+ $this->etag = $row['etag'];
$this->is_substituted = ! ! $row['substit'];
$this->subdef_id = (int) $row['subdef_id'];
@@ -215,7 +216,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
if ($row['created_on'])
$this->creation_date = new DateTime($row['created_on']);
- $this->is_physically_present = true;
} elseif ($substitute === false) {
throw new Exception_Media_SubdefNotFound($this->name . ' not found');
}
@@ -345,8 +345,11 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
public function getEtag()
{
- if ( ! $this->etag && $this->is_physically_present()) {
- $this->setEtag(md5(time() . $this->get_pathfile()));
+ if (!$this->etag && $this->is_physically_present()) {
+ $file = new SplFileInfo($this->get_pathfile());
+ if ($file->isFile()) {
+ $this->setEtag(md5($file->getMTime()));
+ }
}
return $this->etag;
@@ -364,14 +367,21 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
return $this;
}
- public function get_url()
+ public function set_substituted($substit)
{
- $url = parent::get_url();
- if (null !== $this->getEtag()) {
- $url->getQuery()->set('etag', $this->getEtag());
- }
+ $this->is_substituted = !!$substit;
- return $url;
+ $sql = "UPDATE subdef SET substit = :substit, updated_on=NOW() WHERE subdef_id = :subdef_id";
+ $stmt = $this->record->get_databox()->get_connection()->prepare($sql);
+ $stmt->execute(array(
+ ':subdef_id' => $this->subdef_id,
+ ':substit' => $this->is_substituted
+ ));
+ $stmt->closeCursor();
+
+ $this->delete_data_from_cache();
+
+ return $this;
}
/**
@@ -725,7 +735,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$subdef->get_permalink()->delete_data_from_cache();
}
- if ($name === 'thumbnail' && $app['phraseanet.static-file-factory']->isStaticFileModeEnabled()) {
+ if ($name === 'thumbnail') {
$app['phraseanet.thumb-symlinker']->symlink($subdef->get_pathfile());
}
@@ -745,9 +755,10 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
return;
}
+ // serve thumbnails using static file service
if ($this->get_name() === 'thumbnail') {
- if ($this->app['phraseanet.static-file-factory']->isStaticFileModeEnabled() && null !== $url = $this->app['phraseanet.static-file']->getUrl($this->get_pathfile())) {
- $this->url = $url;
+ if (null !== $url = $this->app['phraseanet.static-file']->getUrl($this->get_pathfile())) {
+ $this->url = $url. "?etag=".$this->getEtag();
return;
}
@@ -763,7 +774,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$this->url = Url::factory("/datafiles/" . $this->record->get_sbas_id()
. "/" . $this->record->get_record_id() . "/"
- . $this->get_name() . "/");
+ . $this->get_name() . "/?etag=".$this->getEtag());
return;
}
diff --git a/lib/classes/module/console/aboutAuthors.php b/lib/classes/module/console/aboutAuthors.php
index 342e96073e..0f601cac8f 100644
--- a/lib/classes/module/console/aboutAuthors.php
+++ b/lib/classes/module/console/aboutAuthors.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/aboutLicense.php b/lib/classes/module/console/aboutLicense.php
index d8a8091f18..2319071c87 100644
--- a/lib/classes/module/console/aboutLicense.php
+++ b/lib/classes/module/console/aboutLicense.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/checkExtension.php b/lib/classes/module/console/checkExtension.php
index 9ccfc60470..aac66f781a 100644
--- a/lib/classes/module/console/checkExtension.php
+++ b/lib/classes/module/console/checkExtension.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/fieldsDelete.php b/lib/classes/module/console/fieldsDelete.php
index 5207f49c22..57d74c397c 100644
--- a/lib/classes/module/console/fieldsDelete.php
+++ b/lib/classes/module/console/fieldsDelete.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/fieldsList.php b/lib/classes/module/console/fieldsList.php
index c969b3c01a..b33481414e 100644
--- a/lib/classes/module/console/fieldsList.php
+++ b/lib/classes/module/console/fieldsList.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/fieldsMerge.php b/lib/classes/module/console/fieldsMerge.php
index 6b09a12201..6c7e0b540c 100644
--- a/lib/classes/module/console/fieldsMerge.php
+++ b/lib/classes/module/console/fieldsMerge.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/fieldsRename.php b/lib/classes/module/console/fieldsRename.php
index 9189a9f06d..30f8fb76eb 100644
--- a/lib/classes/module/console/fieldsRename.php
+++ b/lib/classes/module/console/fieldsRename.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/sphinxGenerateSuggestion.php b/lib/classes/module/console/sphinxGenerateSuggestion.php
index 5453d8a994..59f127bbca 100644
--- a/lib/classes/module/console/sphinxGenerateSuggestion.php
+++ b/lib/classes/module/console/sphinxGenerateSuggestion.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/systemBackupDB.php b/lib/classes/module/console/systemBackupDB.php
index 29bf4e6071..9dbb391e19 100644
--- a/lib/classes/module/console/systemBackupDB.php
+++ b/lib/classes/module/console/systemBackupDB.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/systemClearCache.php b/lib/classes/module/console/systemClearCache.php
index 5950053f75..1c49f37c8e 100644
--- a/lib/classes/module/console/systemClearCache.php
+++ b/lib/classes/module/console/systemClearCache.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/systemExport.php b/lib/classes/module/console/systemExport.php
index b6a24cdbd3..68946ccdde 100644
--- a/lib/classes/module/console/systemExport.php
+++ b/lib/classes/module/console/systemExport.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/systemMailCheck.php b/lib/classes/module/console/systemMailCheck.php
index 72b8171f03..ca93ed0313 100644
--- a/lib/classes/module/console/systemMailCheck.php
+++ b/lib/classes/module/console/systemMailCheck.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/systemTemplateGenerator.php b/lib/classes/module/console/systemTemplateGenerator.php
index 49b892ef8c..7647544770 100644
--- a/lib/classes/module/console/systemTemplateGenerator.php
+++ b/lib/classes/module/console/systemTemplateGenerator.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/console/systemUpgrade.php b/lib/classes/module/console/systemUpgrade.php
index 14a738a623..48b8641e78 100644
--- a/lib/classes/module/console/systemUpgrade.php
+++ b/lib/classes/module/console/systemUpgrade.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report.php b/lib/classes/module/report.php
index f3a96abd84..ff2286e8b4 100644
--- a/lib/classes/module/report.php
+++ b/lib/classes/module/report.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -234,6 +234,7 @@ class module_report
*
*/
protected $cor_query = [];
+ protected $dateField = 'log.date';
protected $isInformative;
/**
@@ -579,6 +580,7 @@ class module_report
return new module_report_sqlconnexion($this->app, $this);
break;
case 'download' :
+ // no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
return new module_report_sqldownload($this->app, $this);
break;
case 'question' :
@@ -778,7 +780,6 @@ class module_report
*/
protected function setConfigColumn($tab)
{
-
foreach ($tab as $column => $row) {
foreach ($row as $ind => $value) {
$title_text = "";
@@ -805,6 +806,18 @@ class module_report
}
}
+ public function setDateField($dateField)
+ {
+ $this->dateField = $dateField;
+
+ return $this;
+ }
+
+ public function getDateField()
+ {
+ return $this->dateField;
+ }
+
/**
* Build the final formated array which contains all the result,
* we construct the html code from this array
@@ -817,6 +830,8 @@ class module_report
*/
public function buildReport($tab = false, $groupby = false, $on = false)
{
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
if (sizeof($this->report) > 0) {
return $this->report;
}
@@ -824,8 +839,12 @@ class module_report
$databox = $this->app['phraseanet.appbox']->get_databox($this->sbas_id);
$conn = $databox->get_connection();
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
$this->buildReq($groupby, $on);
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\nreq=%s\n\n", __FILE__, __LINE__, $this->req), FILE_APPEND);
+
try {
try {
$stmt = $conn->prepare($this->req);
@@ -833,24 +852,31 @@ class module_report
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
} catch (DBALException $e) {
- echo $e->getMessage();
return;
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, get_class($this)), FILE_APPEND);
+
//set request field
$this->setChamp($rs);
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
//set display
$this->setDisplay($tab, $groupby);
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
//construct results
$this->buildResult($this->app, $rs);
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
//calculate prev and next page
$this->calculatePages();
//do we display navigator ?
$this->setDisplayNav();
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
//assign all variables
$this->setReport();
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
+
return $this->report;
} catch (\Exception $e) {
echo $e->getMessage();
diff --git a/lib/classes/module/report/activity.php b/lib/classes/module/report/activity.php
index 542e52d2fe..022279366f 100644
--- a/lib/classes/module/report/activity.php
+++ b/lib/classes/module/report/activity.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -43,7 +43,8 @@ class module_report_activity extends module_report
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
{
- parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
+ // parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
+ parent::__construct($app, $arg1, $arg2, $sbas_id, "");
}
/**
@@ -84,6 +85,7 @@ class module_report_activity extends module_report
return $hours;
}
+ // ==================== Site activity : Site activity =====================
/**
* @desc get the site activity per hours
* @return array
@@ -99,15 +101,12 @@ class module_report_activity extends module_report
$params = array_merge([], $filter['params']);
$sql = "
- SELECT tt.heures, SUM(1) AS nb
- FROM (
- SELECT DISTINCT(log.id), DATE_FORMAT( log.date, '%k' ) AS heures
+ SELECT CAST(DATE_FORMAT(log.date, '%k') AS UNSIGNED) AS heures, COUNT(id) AS nb
FROM log FORCE INDEX (date_site)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE (" . $filter['sql'] . ")
- ) AS tt
- GROUP BY tt.heures
- ORDER BY tt.heures ASC";
+ WHERE (" . $filter['sql'] . ") AND !ISNULL(usrid)
+ GROUP BY heures;";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
$stmt->execute($params);
@@ -196,6 +195,7 @@ class module_report_activity extends module_report
return $this->result;
}
+ // ================== Site activity : Top questions (le second radio ...) ================
/**
* get the most asked question
* @param array $tab config for html table
@@ -206,6 +206,7 @@ class module_report_activity extends module_report
$this->report['value'] = [];
$this->report['value2'] = [];
+ $this->setDateField('log_search.date');
$sqlBuilder = new module_report_sql($this->app, $this);
$filter = $sqlBuilder->getFilters()->getReportFilter();
$params = array_merge([], $filter['params']);
@@ -213,19 +214,18 @@ class module_report_activity extends module_report
($no_answer) ? $this->title = $this->app->trans('report:: questions sans reponses') : $this->title = $this->app->trans('report:: questions les plus posees');
$sql = "
- SELECT TRIM(tt.search) AS search, SUM(1) AS nb, ROUND(avg(tt.results)) AS nb_rep
- FROM (
- SELECT DISTINCT(log.id), log_search.search AS search, results
+ SELECT TRIM(log_search.search) AS search, COUNT(log_search.id) AS nb, ROUND(avg(results)) AS nb_rep
FROM (log_search)
INNER JOIN log FORCE INDEX (date_site) ON (log_search.log_id = log.id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE (" . $filter['sql'] . ")
+ WHERE (" . $filter['sql'] . ") AND !ISNULL(usrid)
AND log_search.search != 'all' " .
- ($no_answer ? ' AND log_search.results = 0 ' : '') . "
- ) AS tt
- GROUP BY tt.search
+ ($no_answer ? ' AND log_search.results = 0 ' : '') . "
+
+ GROUP BY search
ORDER BY nb DESC";
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$sql .= !$no_answer ? ' LIMIT ' . $this->nb_top : '';
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
@@ -260,12 +260,14 @@ class module_report_activity extends module_report
return $this->report;
}
+ // =========================== not called ? =====================
/**
* @desc get all downloads from one specific user
* @param $usr user id
* @param array $config config for the html table
* @return array
*/
+/*
public function getAllDownloadByUserBase($usr, $config = false)
{
$result = [];
@@ -319,7 +321,9 @@ class module_report_activity extends module_report
return $this->result;
}
+*/
+ // ============================ Downloads : Daily ==========================
/**
* @desc get all download by base by day
* @param array $tab config for html table
@@ -328,28 +332,27 @@ class module_report_activity extends module_report
public function getDownloadByBaseByDay($tab = false)
{
$this->title = $this->app->trans('report:: telechargements par jour');
-
+ $this->setDateField('log_docs.date');
$sqlBuilder = new module_report_sql($this->app, $this);
$filter = $sqlBuilder->getFilters()->getReportFilter();
$params = array_merge([], $filter['params']);
$sql = "
- SELECT tt.record_id, DATE_FORMAT(tt.the_date, GET_FORMAT(DATE, 'INTERNAL')) AS ddate, tt.final, SUM(1) AS nb
+ SELECT tt.record_id, tt.the_date AS ddate, tt.final, SUM(1) AS nb
FROM (
SELECT DISTINCT(log.id), log_docs.date AS the_date, log_docs.final, log_docs.record_id
FROM (log_docs)
- INNER JOIN record ON (record.record_id = log_docs.record_id)
INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE (" . $filter['sql'] . ")
+ LEFT JOIN record ON (log_docs.record_id = record.record_id)
+ WHERE (" . $filter['sql'] . ") AND !ISNULL(usrid)
AND (log_docs.action = 'download' OR log_docs.action = 'mail')
AND (log_docs.final = 'preview' OR log_docs.final = 'document')
) AS tt
- LEFT JOIN subdef AS s ON (s.record_id = tt.record_id)
- WHERE s.name = tt.final
GROUP BY tt.final, ddate
ORDER BY tt.the_date DESC";
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
$stmt->execute($params);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -397,6 +400,17 @@ class module_report_activity extends module_report
$this->result[$nb_row]['preview'] = '' . $total['tot_prev'] . ' ';
$this->result[$nb_row]['total'] = '' . $total['tot_dl'] . ' ';
}
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, var_export($this->result, true)), FILE_APPEND);
+ foreach($this->result as $k=>$row) {
+ $_row = array();
+ foreach((array) $tab as $k2=>$f) {
+ $_row[$k2] = array_key_exists($k2, $row) ? $row[$k2] : '';
+ }
+ $this->result[$k] = $_row;
+ }
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, var_export($this->result, true)), FILE_APPEND);
+
$this->calculatePages();
$this->setDisplayNav();
$this->setReport();
@@ -404,6 +418,7 @@ class module_report_activity extends module_report
return $this->report;
}
+ // ==================== Connections: Per users =====================
/**
* @desc get nb connexion by user , fonction ,societe etc..
* @param array $tab config for html table
@@ -422,25 +437,21 @@ class module_report_activity extends module_report
$params = array_merge([], $filter['params']);
$this->req = "
- SELECT SUM(1) AS connexion, tt.user, tt.usrid FROM (
- SELECT
- DISTINCT(log.id),
- log." . $on . " AS " . $on . ",
- log.usrid
+ SELECT COUNT(id) AS connexion, log.user, log.usrid
FROM log FORCE INDEX (date_site)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE log.user != 'API'
- AND (" . $filter['sql'] . ")
- ) AS tt
- GROUP BY tt.usrid
+ AND (" . $filter['sql'] . ") AND !ISNULL(usrid)
+ GROUP BY usrid
ORDER BY connexion DESC ";
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->req), FILE_APPEND);
+
$stmt = $sqlBuilder->getConnBas()->prepare($this->req);
$stmt->execute($params);
$sqlBuilder->setTotalrows($stmt->rowCount());
$stmt->closeCursor();
- $this->enable_limit ? $this->req .= "LIMIT 0," . $this->nb_record : "";
+ $this->enable_limit ? $this->req .= " LIMIT 0," . $this->nb_record : "";
$stmt = $sqlBuilder->getConnBas()->prepare($this->req);
$stmt->execute($params);
@@ -490,8 +501,9 @@ class module_report_activity extends module_report
return $this->report;
}
+ // ========================= Downloads : Per users =====================
/**
- * Get the deail of download by users
+ * Get the detail of download by users
*
* @param array $tab config for the html table
* @param String $on
@@ -505,25 +517,22 @@ class module_report_activity extends module_report
//set title
$this->title = $this->app->trans('report:: Detail des telechargements');
+ $this->setDateField('log_docs.date');
$sqlBuilder = new module_report_sql($this->app, $this);
$filter = $sqlBuilder->getFilters()->getReportFilter();
$params = array_merge([], $filter['params']);
$sql = "
- SELECT tt.usrid, TRIM(" . $on . ") AS " . $on . ", tt.final, sum(1) AS nb, sum(size) AS poid
- FROM (
- SELECT DISTINCT(log.id), TRIM(" . $on . ") AS " . $on . ", log_docs.record_id, log_docs.final, log.usrid
+ SELECT TRIM(" . $on . ") AS " . $on . ", SUM(1) AS nb, log_docs.final, log.usrid
FROM log_docs
INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- INNER JOIN record ON (record.record_id = log_docs.record_id)
- WHERE (" . $filter['sql'] . ")
+ LEFT JOIN record ON (record.record_id = log_docs.record_id)
+ WHERE (" . $filter['sql'] . ") AND !ISNULL(usrid)
AND (log_docs.action = 'download' OR log_docs.action = 'mail')
- ) AS tt
- LEFT JOIN subdef FORCE INDEX (unicite) ON (tt.record_id = subdef.record_id)
- WHERE subdef.name = tt.final
- GROUP BY " . $on . ", usrid
- ORDER BY nb DESC;";
+ AND (log_docs.final = 'preview' OR log_docs.final = 'document')
+ GROUP BY usrid";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
$stmt->execute($params);
@@ -534,9 +543,7 @@ class module_report_activity extends module_report
$i = -1;
$total = [
'nbdoc' => 0,
- 'poiddoc' => 0,
'nbprev' => 0,
- 'poidprev' => 0
];
$this->setChamp($rs);
@@ -547,47 +554,36 @@ class module_report_activity extends module_report
$user = $row[$on];
if (($save_user != $user) && ! is_null($user) && ! empty($user)) {
if ($i >= 0) {
- if (($this->result[$i]['nbprev'] + $this->result[$i]['nbdoc']) == 0 || ($this->result[$i]['poiddoc'] + $this->result[$i]['poidprev']) == 0) {
+ if (($this->result[$i]['nbprev'] + $this->result[$i]['nbdoc']) == 0) {
unset($this->result[$i]);
}
-
- if (isset($this->result[$i]['poiddoc']) && isset($this->result[$i]['poidprev'])) {
- $this->result[$i]['poiddoc'] = p4string::format_octets($this->result[$i]['poiddoc']);
- $this->result[$i]['poidprev'] = p4string::format_octets($this->result[$i]['poidprev']);
- }
}
$i ++;
$this->result[$i]['nbprev'] = 0;
- $this->result[$i]['poidprev'] = 0;
$this->result[$i]['nbdoc'] = 0;
- $this->result[$i]['poiddoc'] = 0;
}
//doc info
if ($row['final'] == 'document' &&
! is_null($user) && ! is_null($row['usrid'])) {
$this->result[$i]['nbdoc'] = ( ! is_null($row['nb']) ? $row['nb'] : 0);
- $this->result[$i]['poiddoc'] = ( ! is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['user'] = empty($row[$on]) ?
"" . $this->app->trans('report:: non-renseigne') . " " : $row[$on];
$total['nbdoc'] += $this->result[$i]['nbdoc'];
- $total['poiddoc'] += ( ! is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['usrid'] = $row['usrid'];
}
//preview info
- if (($row['final'] == 'preview' || $row['final'] == 'thumbnail') &&
+ if (($row['final'] == 'preview') &&
! is_null($user) &&
! is_null($row['usrid'])) {
$this->result[$i]['nbprev'] += ( ! is_null($row['nb']) ? $row['nb'] : 0);
- $this->result[$i]['poidprev'] += ( ! is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['user'] = empty($row[$on]) ?
"" . $this->app->trans('report:: non-renseigne') . " " : $row[$on];
$total['nbprev'] += ( ! is_null($row['nb']) ? $row['nb'] : 0);
- $total['poidprev'] += ( ! is_null($row['poid']) ? $row['poid'] : 0);
$this->result[$i]['usrid'] = $row['usrid'];
}
@@ -601,12 +597,20 @@ class module_report_activity extends module_report
if ($this->total > 0) {
$this->result[$nb_row]['user'] = 'TOTAL ';
$this->result[$nb_row]['nbdoc'] = '' . $total['nbdoc'] . ' ';
- $this->result[$nb_row]['poiddoc'] =
- '' . p4string::format_octets($total['poiddoc']) . ' ';
$this->result[$nb_row]['nbprev'] = '' . $total['nbprev'] . ' ';
- $this->result[$nb_row]['poidprev'] =
- '' . p4string::format_octets($total['poidprev']) . ' ';
}
+
+ foreach($this->result as $k=>$row) {
+ $_row = array();
+ foreach((array) $tab as $k2=>$f) {
+ $_row[$k2] = array_key_exists($k2, $row) ? $row[$k2] : '';
+ }
+ $_row['usrid'] = array_key_exists('usrid', $row) ? $row['usrid'] : '';
+ $this->result[$k] = $_row;
+ }
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, var_export($this->result, true)), FILE_APPEND);
+
$this->total = sizeof($this->result);
$this->calculatePages();
$this->setDisplayNav();
@@ -615,6 +619,7 @@ class module_report_activity extends module_report
return $this->report;
}
+ // ========================== ???????????????? ===========================
public static function topTenUser(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
@@ -627,12 +632,9 @@ class module_report_activity extends module_report
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
- $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
+ $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
$params = array_merge($params, $datefilter['params']);
-
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
- $params = array_merge($params, $collfilter['params']);
-
+/*
$sql = "SELECT tt.usrid, tt.user, tt.final, tt.record_id, SUM(1) AS nb, SUM(size) AS poid
FROM (
SELECT DISTINCT(log.id), log.usrid, user, final, log_date.record_id
@@ -642,12 +644,27 @@ class module_report_activity extends module_report
WHERE log.site = :site_id
AND log_date.action = 'download'
AND (" . $datefilter['sql'] . ")" .
- (('' !== $collfilter['sql']) ? "AND (" . $collfilter['sql'] . ")" : '')
- . "
+ (('' !== $collfilter['sql']) ? "AND (" . $collfilter['sql'] . ")" : '')
+ . "
) AS tt
LEFT JOIN subdef AS s ON (s.record_id = tt.record_id)
WHERE s.name = tt.final
GROUP BY tt.user, tt.final";
+*/
+ $sql = "SELECT tt.usrid, tt.user, tt.final, tt.record_id, SUM(1) AS nb, SUM(size) AS poid\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log.id), log.usrid, user, final, log_docs.record_id\n"
+ . " FROM (log_docs)\n"
+ . " INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)\n"
+ . " WHERE log.site = :site_id\n"
+ . " AND log_docs.action = 'download'\n"
+ . " AND (" . $datefilter['sql'] . ")\n"
+ . ") AS tt\n"
+ . "LEFT JOIN subdef AS s ON (s.record_id = tt.record_id)\n"
+ . "WHERE s.name = tt.final\n"
+ . "GROUP BY tt.user, tt.final";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -697,6 +714,7 @@ class module_report_activity extends module_report
return $result;
}
+ //============================= Dashboard =========================
public static function activity(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
@@ -704,12 +722,10 @@ class module_report_activity extends module_report
$res = [];
$datefilter =
module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter =
- module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
-
+ $params = array_merge($params, $datefilter['params']);
+/*
$sql = "
SELECT tt.id, HOUR(tt.heures) AS heures
FROM (
@@ -717,9 +733,19 @@ class module_report_activity extends module_report
FROM log AS log_date FORCE INDEX (date_site)
INNER JOIN log_colls FORCE INDEX (couple) ON (log_date.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . "" .
- (('' !== $collfilter['sql']) ? "AND (" . $collfilter['sql'] . ")" : '')
- . " AND log_date.site = :site_id
+ (('' !== $collfilter['sql']) ? "AND (" . $collfilter['sql'] . ")" : '')
+ . " AND log_date.site = :site_id
) AS tt";
+*/
+ $sql = "SELECT tt.id, HOUR(tt.heures) AS heures\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log_date.id), log_date.date AS heures\n"
+ . " FROM log AS log_date FORCE INDEX (date_site)\n"
+ . " WHERE " . $datefilter['sql'] . " AND !ISNULL(usrid)"
+ . " AND log_date.site = :site_id\n"
+ . " ) AS tt";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -744,6 +770,7 @@ class module_report_activity extends module_report
return $res;
}
+ //============================= Dashboard =========================
public static function activityDay(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
@@ -751,11 +778,10 @@ class module_report_activity extends module_report
$result = array();
$res = array();
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
-
+ $params = array_merge($params, $datefilter['params']);
+/*
$sql = "
SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity
FROM (
@@ -763,10 +789,22 @@ class module_report_activity extends module_report
FROM log AS log_date FORCE INDEX (date_site) INNER JOIN log_colls FORCE INDEX (couple) ON (log_date.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . "
AND log_date.site = :site_id" .
- (('' !== $collfilter['sql']) ? (" AND (" . $collfilter['sql'] . ")") : '')
+ (('' !== $collfilter['sql']) ? (" AND (" . $collfilter['sql'] . ")") : '')
. ") AS tt
GROUP by tt.ddate
ORDER BY tt.ddate ASC";
+*/
+ $sql = "SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log_date.id), DATE_FORMAT( log_date.date, '%Y-%m-%d' ) AS ddate\n"
+ . " FROM log AS log_date FORCE INDEX (date_site)\n"
+ . " WHERE " . $datefilter['sql'] . "\n"
+ . " AND log_date.site = :site_id AND !ISNULL(usrid)"
+ . ") AS tt\n"
+ . " GROUP by tt.ddate\n"
+ . " ORDER BY tt.ddate ASC";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -785,19 +823,18 @@ class module_report_activity extends module_report
return $res;
}
+ //============================= Dashboard =========================
public static function activityQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$conn = $databox->get_connection();
$result = [];
- $datefilter =
- module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter =
- module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
+ $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
+ $params = array_merge($params, $datefilter['params']);
+/*
$sql = "
SELECT tt.usrid, tt.user, sum(1) AS nb
FROM (
@@ -807,10 +844,23 @@ class module_report_activity extends module_report
INNER JOIN log_colls FORCE INDEX (couple) ON (log_date.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . "
AND log_date.site = :site_id" .
- (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
+ (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
. ") AS tt
GROUP BY tt.usrid
ORDER BY nb DESC";
+*/
+ $sql = "SELECT tt.usrid, tt.user, sum(1) AS nb\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log_date.id), log_date.usrid, log_date.user\n"
+ . " FROM (`log_search`)\n"
+ . " INNER JOIN log AS log_date FORCE INDEX (date_site) ON (log_search.log_id = log_date.id)\n"
+ . " WHERE " . $datefilter['sql'] . "\n"
+ . " AND log_date.site = :site_id"
+ . ") AS tt\n"
+ . " GROUP BY tt.usrid\n"
+ . " ORDER BY nb DESC";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -826,19 +876,18 @@ class module_report_activity extends module_report
return $result;
}
+ //============================= Dashboard =========================
public static function activiteTopQuestion(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$conn = $databox->get_connection();
$result = [];
- $datefilter =
- module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter =
- module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
+ $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
+ $params = array_merge($params, $datefilter['params']);
+/*
$sql = "
SELECT TRIM(tt.search) AS question, tt.usrid, tt.user, SUM(1) AS nb
FROM (
@@ -848,10 +897,23 @@ class module_report_activity extends module_report
INNER JOIN log_colls FORCE INDEX (couple) ON (log_date.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . "
AND log_date.site = :site_id" .
- (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
+ (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
. ") AS tt
GROUP BY tt.search
ORDER BY nb DESC";
+*/
+ $sql = "SELECT TRIM(tt.search) AS question, tt.usrid, tt.user, SUM(1) AS nb\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log_date.id), log_search.search, log_date.usrid, log_date.user\n"
+ . " FROM (`log_search`)\n"
+ . " INNER JOIN log AS log_date FORCE INDEX (date_site) ON (log_search.log_id = log_date.id)\n"
+ . " WHERE " . $datefilter['sql'] . "\n"
+ . " AND log_date.site = :site_id"
+ . ") AS tt\n"
+ . " GROUP BY tt.search\n"
+ . " ORDER BY nb DESC";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -870,17 +932,19 @@ class module_report_activity extends module_report
return $result;
}
+ //============================= Dashboard =========================
public static function activiteTopTenSiteView(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$conn = $databox->get_connection();
$result = [];
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
$params = [];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
+ $params = array_merge($params, $datefilter['params']);
+
+/*
$sql = "
SELECT tt.referrer, SUM(1) AS nb_view
FROM (
@@ -889,10 +953,22 @@ class module_report_activity extends module_report
INNER JOIN log AS log_date FORCE INDEX (date_site) ON (log_view.log_id = log_date.id)
INNER JOIN log_colls FORCE INDEX (couple) ON (log_date.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . "" .
- (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
+ (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
. ") AS tt
GROUP BY referrer
ORDER BY nb_view DESC ";
+*/
+ $sql = "SELECT tt.referrer, SUM(1) AS nb_view\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log_date.id), referrer\n"
+ . " FROM (log_view)\n"
+ . " INNER JOIN log AS log_date FORCE INDEX (date_site) ON (log_view.log_id = log_date.id)\n"
+ . " WHERE " . $datefilter['sql']
+ . ") AS tt\n"
+ . " GROUP BY referrer\n"
+ . " ORDER BY nb_view DESC ";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -914,17 +990,17 @@ class module_report_activity extends module_report
return $result;
}
+ //============================= Dashboard =========================
public static function activiteAddedDocument(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$conn = $databox->get_connection();
$result = [];
- $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
-
+ $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
$params = [];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
+ $params = array_merge($params, $datefilter['params']);
+/*
$sql = "
SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity
FROM (
@@ -934,10 +1010,22 @@ class module_report_activity extends module_report
INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . " AND log_date.action = 'add' " .
(('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
- . "
+ . "
) AS tt
GROUP BY tt.ddate
ORDER BY activity ASC ";
+*/
+ $sql = "SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log.id), DATE_FORMAT(log_docs.date, '%Y-%m-%d') AS ddate\n"
+ . " FROM (log_docs)\n"
+ . " INNER JOIN log FORCE INDEX (date_site) ON (log_docs.log_id = log.id)\n"
+ . " WHERE " . $datefilter['sql'] . " AND log_docs.action = 'add'"
+ . " ) AS tt\n"
+ . " GROUP BY tt.ddate\n"
+ . " ORDER BY activity ASC ";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -951,17 +1039,17 @@ class module_report_activity extends module_report
return $result;
}
+ //============================= Dashboard =========================
public static function activiteEditedDocument(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$conn = $databox->get_connection();
$result = [];
- $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
-
+ $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
$params = [];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
+ $params = array_merge($params, $datefilter['params']);
+/*
$sql = "
SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity
FROM (
@@ -970,10 +1058,22 @@ class module_report_activity extends module_report
INNER JOIN log FORCE INDEX (date_site) ON (log_date.log_id = log.id)
INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . " AND log_date.action = 'edit'" .
- (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
+ (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
. ") AS tt
GROUP BY tt.ddate
ORDER BY activity ASC ";
+*/
+ $sql = "SELECT tt.ddate, COUNT( DATE_FORMAT( tt.ddate, '%d' ) ) AS activity\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log.id), DATE_FORMAT( log_docs.date, '%Y-%m-%d') AS ddate\n"
+ . " FROM (log_docs)\n"
+ . " INNER JOIN log FORCE INDEX (date_site) ON (log_docs.log_id = log.id)\n"
+ . " WHERE " . $datefilter['sql'] . " AND log_docs.action = 'edit'"
+ . ") AS tt\n"
+ . " GROUP BY tt.ddate\n"
+ . " ORDER BY activity ASC ";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
@@ -988,17 +1088,17 @@ class module_report_activity extends module_report
return $result;
}
+ //============================= Dashboard =========================
public static function activiteAddedTopTenUser(Application $app, $dmin, $dmax, $sbas_id, $list_coll_id)
{
$databox = $app['phraseanet.appbox']->get_databox($sbas_id);
$conn = $databox->get_connection();
$result = [];
- $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
+ $datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax, 'log_docs.date');
$params = [];
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
-
+ $params = array_merge($params, $datefilter['params']);
+/*
$sql = "
SELECT tt.usrid, tt.user, sum( 1 ) AS nb
FROM (
@@ -1007,10 +1107,23 @@ class module_report_activity extends module_report
INNER JOIN log FORCE INDEX (date_site) ON (log_date.log_id = log.id)
INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE " . $datefilter['sql'] . " AND log_date.action = 'add'" .
- (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
+ (('' !== $collfilter['sql']) ? " AND (" . $collfilter['sql'] . ")" : '')
. ") AS tt
GROUP BY tt.usrid
ORDER BY nb ASC ";
+*/
+ $sql = ""
+ . " SELECT tt.usrid, tt.user, sum( 1 ) AS nb\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log.id), log.usrid, log.user\n"
+ . " FROM (log_docs)\n"
+ . " INNER JOIN log FORCE INDEX (date_site) ON (log_docs.log_id = log.id)\n"
+ . " WHERE " . $datefilter['sql'] . " AND log_docs.action = 'add'"
+ . ") AS tt\n"
+ . " GROUP BY tt.usrid\n"
+ . " ORDER BY nb ASC ";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
diff --git a/lib/classes/module/report/add.php b/lib/classes/module/report/add.php
index 2b31ccdf49..f42d649454 100644
--- a/lib/classes/module/report/add.php
+++ b/lib/classes/module/report/add.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/connexion.php b/lib/classes/module/report/connexion.php
index 4ca87eb6c6..7c1fdfbaf1 100644
--- a/lib/classes/module/report/connexion.php
+++ b/lib/classes/module/report/connexion.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -38,7 +38,7 @@ class module_report_connexion extends module_report
*/
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
{
- parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
+ parent::__construct($app, $arg1, $arg2, $sbas_id, '');
$this->title = $this->app->trans('report::Connexions');
}
@@ -139,23 +139,26 @@ class module_report_connexion extends module_report
$conn = $databox->get_connection();
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
$params = array_merge([
':site_id' => $app['conf']->get(['main', 'key'])
],
- $datefilter['params'],
- $collfilter['params']
+ $datefilter['params']
);
$finalfilter = $datefilter['sql'] . ' AND ';
- $finalfilter .= $collfilter['sql'] . ' AND ';
$finalfilter .= 'log_date.site = :site_id';
-
+/*
$sql = "SELECT COUNT(DISTINCT(log_date.id)) as nb
FROM log as log_date FORCE INDEX (date_site)
INNER JOIN log_colls FORCE INDEX (couple) ON (log_date.id = log_colls.log_id)
WHERE " . $finalfilter;
+*/
+ $sql = "SELECT COUNT(DISTINCT(log_date.id)) as nb\n"
+ . " FROM log as log_date FORCE INDEX (date_site)\n"
+ . " WHERE " . $finalfilter . "\n";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
diff --git a/lib/classes/module/report/dashboard.php b/lib/classes/module/report/dashboard.php
index 46fd433548..2f5eeb7670 100644
--- a/lib/classes/module/report/dashboard.php
+++ b/lib/classes/module/report/dashboard.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/dashboard/componentInterface.php b/lib/classes/module/report/dashboard/componentInterface.php
index d12b65aa9e..01a213c6da 100644
--- a/lib/classes/module/report/dashboard/componentInterface.php
+++ b/lib/classes/module/report/dashboard/componentInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/dashboard/feed.php b/lib/classes/module/report/dashboard/feed.php
index 3bc65d33f7..a8258c33a2 100644
--- a/lib/classes/module/report/dashboard/feed.php
+++ b/lib/classes/module/report/dashboard/feed.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -80,7 +80,6 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
} catch (\Exception $e) {
}
-
$tmp = new self($app, $sbasid, $sbas_coll, $dmin, $dmax);
$app['phraseanet.appbox']->set_data_to_cache($tmp, $cache_id);
@@ -138,6 +137,7 @@ class module_report_dashboard_feed implements module_report_dashboard_componentI
$this->report['nb_dl'] = module_report_download::getNbDl(
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
);
+
//Get Number of connexions
$this->report['nb_conn'] = module_report_connexion::getNbConn(
$this->app, $this->dminsql, $this->dmaxsql, $this->sbasid, $this->collection
diff --git a/lib/classes/module/report/dashboard/group.php b/lib/classes/module/report/dashboard/group.php
index 1f0d6544ad..26cb051769 100644
--- a/lib/classes/module/report/dashboard/group.php
+++ b/lib/classes/module/report/dashboard/group.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/dashboard/merge.php b/lib/classes/module/report/dashboard/merge.php
index edfb626fdd..0034ff6124 100644
--- a/lib/classes/module/report/dashboard/merge.php
+++ b/lib/classes/module/report/dashboard/merge.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/dashboard/sort.php b/lib/classes/module/report/dashboard/sort.php
index 480f3a3a19..2d8259021c 100644
--- a/lib/classes/module/report/dashboard/sort.php
+++ b/lib/classes/module/report/dashboard/sort.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/download.php b/lib/classes/module/report/download.php
index 0ef7de517d..11672d212d 100644
--- a/lib/classes/module/report/download.php
+++ b/lib/classes/module/report/download.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -21,16 +21,12 @@ class module_report_download extends module_report
'activite' => 'log.activite',
'fonction' => 'log.fonction',
'usrid' => 'log.usrid',
- 'coll_id' => 'log_colls.coll_id',
'ddate' => "log_docs.date",
'id' => 'log_docs.id',
'log_id' => 'log_docs.log_id',
'record_id' => 'log_docs.record_id',
'final' => 'log_docs.final',
- 'comment' => 'log_docs.comment',
- 'size' => 'subdef.size',
- 'mime' => 'subdef.mime',
- 'file' => 'subdef.file'
+ 'comment' => 'log_docs.comment'
];
/**
@@ -44,7 +40,7 @@ class module_report_download extends module_report
*/
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
{
- parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
+ parent::__construct($app, $arg1, $arg2, $sbas_id, '');
$this->title = $this->app->trans('report:: telechargements');
}
@@ -55,9 +51,12 @@ class module_report_download extends module_report
*/
protected function buildReq($groupby = false, $on = false)
{
+ $this->setDateField('log_docs.date');
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
$sql = $this->sqlBuilder('download')
->setOn($on)->setGroupBy($groupby)->buildSql();
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
$this->req = $sql->getSql();
$this->params = $sql->getParams();
$this->total = $sql->getTotalRows();
@@ -102,6 +101,7 @@ class module_report_download extends module_report
{
$i = 0;
$pref = parent::getPreff($app, $this->sbas_id);
+//// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, var_export($rs, true)), FILE_APPEND);
foreach ($rs as $row) {
if ($this->enable_limit && ($i > $this->nb_record))
@@ -112,23 +112,28 @@ class module_report_download extends module_report
}
if (array_key_exists('record_id', $row)) {
+//// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, $row['record_id']), FILE_APPEND);
try {
$record = new \record_adapter($app, $this->sbas_id, $row['record_id']);
+ $caption = $record->get_caption();
+ foreach ($pref as $field) {
+//// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s) %s\n\n", __FILE__, __LINE__, $field), FILE_APPEND);
+ try {
+ $this->result[$i][$field] = $caption
+ ->get_field($field)
+ ->get_serialized_values();
+ } catch (\Exception $e) {
+ $this->result[$i][$field] = '';
+ }
+ }
} catch (\Exception_Record_AdapterNotFound $e) {
- continue;
- }
-
- foreach ($pref as $field) {
- try {
- $this->result[$i][$field] = $record->get_caption()
- ->get_field($field)
- ->get_serialized_values();
- } catch (\Exception $e) {
+ foreach ($pref as $field) {
$this->result[$i][$field] = '';
}
}
}
$i ++;
+//// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
}
}
@@ -177,13 +182,11 @@ class module_report_download extends module_report
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
+ $params = array_merge($params, $datefilter['params']);
$finalfilter = $datefilter['sql'] . ' AND ';
- $finalfilter .= $collfilter['sql'] . ' AND ';
$finalfilter .= 'log.site = :site_id';
-
+/*
$sql = '
SELECT SUM(1) AS nb
FROM (
@@ -198,6 +201,18 @@ class module_report_download extends module_report
)
) AS tt
';
+*/
+ $sql = "SELECT SUM(1) AS nb\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log.id)\n"
+ . " FROM log FORCE INDEX (date_site)"
+ . " INNER JOIN log_docs"
+ . " WHERE " . $finalfilter . "\n"
+ . " AND ( log_docs.action = 'download' OR log_docs.action = 'mail' )\n"
+ . " ) AS tt";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$stmt = $conn->prepare($sql);
$stmt->execute($params);
$row = $stmt->fetch(PDO::FETCH_ASSOC);
@@ -213,8 +228,7 @@ class module_report_download extends module_report
$params = [':site_id' => $app['conf']->get(['main', 'key'])];
$datefilter = module_report_sqlfilter::constructDateFilter($dmin, $dmax);
- $collfilter = module_report_sqlfilter::constructCollectionFilter($app, $list_coll_id);
- $params = array_merge($params, $datefilter['params'], $collfilter['params']);
+ $params = array_merge($params, $datefilter['params']);
$finalfilter = "";
$array = [
@@ -223,9 +237,8 @@ class module_report_download extends module_report
];
$finalfilter .= $datefilter['sql'] . ' AND ';
- $finalfilter .= $collfilter['sql'] . ' AND ';
$finalfilter .= 'log.site = :site_id';
-
+/*
$sql = '
SELECT tt.id, tt.name, SUM(1) AS nb
FROM (
@@ -244,6 +257,20 @@ class module_report_download extends module_report
) AS tt
GROUP BY id, name
';
+*/
+ $sql = "SELECT tt.id, tt.name, SUM(1) AS nb\n"
+ . " FROM (\n"
+ . " SELECT DISTINCT(log.id) AS log_id, log_docs.record_id as id, subdef.name\n"
+ . " FROM ( log )\n"
+ . " INNER JOIN log_docs ON (log.id = log_docs.log_id)\n"
+ . " INNER JOIN subdef ON (log_docs.record_id = subdef.record_id)\n"
+ . " WHERE (" . $finalfilter . ")\n"
+ . " AND ( log_docs.action = 'download' OR log_docs.action = 'mail' )\n"
+ . " AND subdef.name = log_docs.final\n"
+ . " ) AS tt\n"
+ . " GROUP BY id, name\n";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $conn->prepare($sql);
$stmt->execute($params);
diff --git a/lib/classes/module/report/edit.php b/lib/classes/module/report/edit.php
index b435af72db..afc30e52b0 100644
--- a/lib/classes/module/report/edit.php
+++ b/lib/classes/module/report/edit.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/filter.php b/lib/classes/module/report/filter.php
index abc6568434..23ef3525e4 100644
--- a/lib/classes/module/report/filter.php
+++ b/lib/classes/module/report/filter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/nav.php b/lib/classes/module/report/nav.php
index 63b5b622f3..3dc298a6f7 100644
--- a/lib/classes/module/report/nav.php
+++ b/lib/classes/module/report/nav.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -48,7 +48,8 @@ class module_report_nav extends module_report
*/
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
{
- parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
+// parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
+ parent::__construct($app, $arg1, $arg2, $sbas_id, "");
}
private function setTotalPourcent()
@@ -60,12 +61,11 @@ class module_report_nav extends module_report
$params = array_merge([], $report_filter['params']);
$sql = '
- SELECT SUM(1) AS total FROM (
- SELECT DISTINCT (log.id)
+ SELECT COUNT(log.id) AS total
FROM log FORCE INDEX (date_site)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE ' . $report_filter['sql'] . ' AND nav != ""
- ) AS tt';
+ WHERE ' . $report_filter['sql'] . ' AND nav != "" AND !ISNULL(usrid)';
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
$stmt->execute($params);
@@ -112,16 +112,14 @@ class module_report_nav extends module_report
$params = array_merge([], $report_filter['params']);
$sql = '
- SELECT tt.nav, SUM(1) AS nb, ROUND((SUM(1) / ' . $this->total_pourcent . ' * 100), 1) AS pourcent
- FROM (
- SELECT DISTINCT(log.id), nav
+ SELECT nav, SUM(1) AS nb, ROUND((SUM(1) / ' . $this->total_pourcent . ' * 100), 1) AS pourcent
FROM log FORCE INDEX (date_site, nav)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE ' . $report_filter['sql'] . ' AND nav != ""
- ) AS tt
- GROUP BY tt.nav
+ WHERE ' . $report_filter['sql'] . ' AND nav != "" AND !ISNULL(usrid)
+ GROUP BY nav
ORDER BY nb DESC';
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$this->initialize();
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
@@ -171,16 +169,16 @@ class module_report_nav extends module_report
$params = array_merge([], $report_filter['params']);
$sql = '
- SELECT tt.os, COUNT(os) AS nb, ROUND((COUNT(os)/' . $this->total_pourcent . '*100),1) AS pourcent
- FROM (
- SELECT DISTINCT(log.id), os
+ SELECT os, COUNT(os) AS nb, ROUND((COUNT(os)/' . $this->total_pourcent . '*100),1) AS pourcent
+
FROM log FORCE INDEX (date_site, os)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE '. $report_filter['sql'] . ' AND os != ""
- ) AS tt
- GROUP BY tt.os
+ WHERE '. $report_filter['sql'] . ' AND os != "" AND !ISNULL(usrid)
+
+ GROUP BY os
ORDER BY nb DESC';
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$this->initialize();
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
@@ -229,17 +227,17 @@ class module_report_nav extends module_report
$params = array_merge([], $report_filter['params']);
$sql = '
- SELECT tt.res, COUNT(res) AS nb, ROUND((COUNT(res)/ ' . $this->total_pourcent . '*100),1) AS pourcent
- FROM (
- SELECT DISTINCT(log.id), res
+ SELECT res, COUNT(res) AS nb, ROUND((COUNT(res)/ ' . $this->total_pourcent . '*100),1) AS pourcent
+
FROM log FORCE INDEX (date_site, res)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE '. $report_filter['sql'] . ' AND res != ""
- ) AS tt
- GROUP BY tt.res
+ WHERE '. $report_filter['sql'] . ' AND res != "" AND !ISNULL(usrid)
+
+ GROUP BY res
ORDER BY nb DESC
LIMIT 0, 10';
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$this->initialize();
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
@@ -291,15 +289,16 @@ class module_report_nav extends module_report
$sql = "
SELECT tt.combo, COUNT( tt.combo ) AS nb, ROUND((COUNT(tt.combo)/" . $this->total_pourcent . "*100), 1) AS pourcent
FROM (
- SELECT DISTINCT(log.id), CONCAT( nav, '-', os ) AS combo
+ SELECT CONCAT( nav, '-', os ) AS combo
FROM log FORCE INDEX (date_site, os_nav)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE ". $report_filter['sql'] ." AND nav != '' AND os != ''
+ WHERE ". $report_filter['sql'] ." AND nav != '' AND os != '' AND !ISNULL(usrid)
) AS tt
GROUP BY tt.combo
ORDER BY nb DESC
LIMIT 0 , 10";
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$this->initialize();
$stmt = $sqlBuilder->getConnBas()->prepare($sql);
@@ -351,14 +350,12 @@ class module_report_nav extends module_report
$params = array_merge([], $report_filter['params']);
$sql = '
- SELECT tt.appli
- FROM (
- SELECT DISTINCT(log.id), appli
+ SELECT appli
FROM log FORCE INDEX (date_site, appli)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE ' . $report_filter['sql'] . ' AND appli != \'a:0:{}\'
- ) AS tt
- GROUP BY tt.appli';
+ WHERE ' . $report_filter['sql'] . ' AND appli != \'a:0:{}\' AND !ISNULL(usrid)
+ GROUP BY appli';
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
$this->initialize();
@@ -547,13 +544,14 @@ class module_report_nav extends module_report
FROM (
SELECT DISTINCT (log.id), version
FROM log FORCE INDEX (date_site, nav, version)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE nav = :browser
AND ". $report_filter['sql'] . "
) AS tt
GROUP BY version
ORDER BY nb DESC";
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $sql), FILE_APPEND);
+
$stmt = $conn->prepare($sql);
$stmt->execute($params);
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
diff --git a/lib/classes/module/report/push.php b/lib/classes/module/report/push.php
index e38fa5f48f..f189cfd87b 100644
--- a/lib/classes/module/report/push.php
+++ b/lib/classes/module/report/push.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -54,7 +54,7 @@ class module_report_push extends module_report
protected function buildReq($groupby = false, $on = false)
{
$sqlBuilder = $this->sqlBuilder('action')->setGroupBy($groupby)->setOn($on)
- ->setAction('push')->buildSql();
+ ->setAction('validate')->buildSql();
$this->req = $sqlBuilder->getSql();
$this->params = $sqlBuilder->getParams();
$this->total = $sqlBuilder->getTotalRows();
@@ -62,7 +62,7 @@ class module_report_push extends module_report
public function colFilter($field, $on = false)
{
- $sqlBuilder = $this->sqlBuilder('action')->setAction('push');
+ $sqlBuilder = $this->sqlBuilder('action')->setAction('validate');
$var = $sqlBuilder->sqlDistinctValByField($field);
$sql = $var['sql'];
$params = $var['params'];
diff --git a/lib/classes/module/report/question.php b/lib/classes/module/report/question.php
index df3d470ebe..e5464de999 100644
--- a/lib/classes/module/report/question.php
+++ b/lib/classes/module/report/question.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -39,7 +39,7 @@ class module_report_question extends module_report
*/
public function __construct(Application $app, $arg1, $arg2, $sbas_id, $collist)
{
- parent::__construct($app, $arg1, $arg2, $sbas_id, $collist);
+ parent::__construct($app, $arg1, $arg2, $sbas_id, '');
$this->title = $this->app->trans('report:: question');
}
diff --git a/lib/classes/module/report/sent.php b/lib/classes/module/report/sent.php
index f330210a86..05da9e024e 100644
--- a/lib/classes/module/report/sent.php
+++ b/lib/classes/module/report/sent.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/sql.php b/lib/classes/module/report/sql.php
index 970dd1ca03..aff62f62c4 100644
--- a/lib/classes/module/report/sql.php
+++ b/lib/classes/module/report/sql.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/sqlReportInterface.php b/lib/classes/module/report/sqlReportInterface.php
index 2adb20a551..31521fac84 100644
--- a/lib/classes/module/report/sqlReportInterface.php
+++ b/lib/classes/module/report/sqlReportInterface.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/sqlaction.php b/lib/classes/module/report/sqlaction.php
index 4a6113b614..d84b60b50e 100644
--- a/lib/classes/module/report/sqlaction.php
+++ b/lib/classes/module/report/sqlaction.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/module/report/sqlconnexion.php b/lib/classes/module/report/sqlconnexion.php
index 6156eb1fd4..9593f38604 100644
--- a/lib/classes/module/report/sqlconnexion.php
+++ b/lib/classes/module/report/sqlconnexion.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -27,7 +27,7 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
if ($this->groupby == false) {
$this->sql = "
SELECT
- DISTINCT(log_colls.log_id),
+ log.id,
log.user,
log.usrid,
log.date as ddate,
@@ -40,8 +40,9 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
log.appli,
log.ip
FROM log FORCE INDEX (date_site)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- WHERE (" . $filter['sql'] .")";
+ WHERE (" . $filter['sql'] .") AND !ISNULL(log.usrid)";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
$stmt = $this->connbas->prepare($this->sql);
$stmt->execute($this->params);
@@ -59,12 +60,13 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
FROM (
SELECT DISTINCT(log.id), TRIM(" . $this->getTransQuery($this->groupby) . ") AS " . $this->groupby . "
FROM log FORCE INDEX (date_site)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE (" . $filter['sql'] .")
) AS tt
GROUP BY " . $this->groupby. "
ORDER BY nb DESC";
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
+
$stmt = $this->connbas->prepare($this->sql);
$stmt->execute($this->params);
$this->total_row = $stmt->rowCount();
@@ -84,7 +86,6 @@ class module_report_sqlconnexion extends module_report_sql implements module_rep
FROM (
SELECT DISTINCT(log.id), ' . $this->getTransQuery($field) . ' AS val
FROM log FORCE INDEX (date_site)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE (' . $filter['sql'] . ')
) AS tt ORDER BY val ASC';
diff --git a/lib/classes/module/report/sqldownload.php b/lib/classes/module/report/sqldownload.php
index 6bf59649fe..ed26922ae8 100644
--- a/lib/classes/module/report/sqldownload.php
+++ b/lib/classes/module/report/sqldownload.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -17,6 +17,7 @@ class module_report_sqldownload extends module_report_sql implements module_repo
public function __construct(Application $app, module_report $report)
{
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
parent::__construct($app, $report);
if ($report->isInformative()) {
$this->restrict = true;
@@ -30,7 +31,9 @@ class module_report_sqldownload extends module_report_sql implements module_repo
$filter = $this->filter->getReportFilter() ? : ['params' => [], 'sql' => false];
$this->params = array_merge([], $filter['params']);
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
if ($this->groupby == false) {
+/*
$this->sql = "
SELECT DISTINCT(log.id), log.user, log.societe, log.pays, log.activite, log_colls.coll_id,
log.fonction, log.usrid, log_docs.date AS ddate, log_docs.record_id, log_docs.final, log_docs.comment
@@ -38,31 +41,35 @@ class module_report_sqldownload extends module_report_sql implements module_repo
INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)
INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE (" .$filter['sql'] . ") AND (log_docs.action = 'download' OR log_docs.action = 'mail')";
+*/
+ $this->sql = "
+ SELECT log.id, log.user, log.societe, log.pays, log.activite, record.coll_id,
+ log.fonction, log.usrid, log_docs.date AS ddate, log_docs.record_id, log_docs.final, log_docs.comment
+ FROM log_docs
+ INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_docs.log_id)
+ LEFT JOIN record ON (record.record_id=log_docs.record_id)
+ WHERE (" .$filter['sql'] . ")
+ AND !ISNULL(usrid)
+ AND (log_docs.action = 'download' OR log_docs.action = 'mail')
+ AND (log_docs.final = 'preview' OR log_docs.final = 'document')";
- if ($this->restrict) {
- $this->sql .= ' AND (log_docs.final = "document" OR log_docs.final = "preview")';
- }
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
} else {
$name = $this->groupby;
$field = $this->getTransQuery($this->groupby);
if ($name == 'record_id' && $this->on == 'DOC') {
$this->sql = '
- SELECT ' . $name . ', SUM(1) AS telechargement, tt.comment, tt.size, tt.file, tt.mime, tt.final
+ SELECT ' . $name . ', SUM(1) AS telechargement, tt.comment, tt.final
FROM (
- SELECT DISTINCT(log.id), TRIM( ' . $field . ' ) AS ' . $name . ', log_docs.comment, subdef.size, subdef.file, subdef.mime, log_docs.final
+ SELECT log.id, TRIM( ' . $field . ' ) AS ' . $name . ', log_docs.comment, log_docs.final
FROM log FORCE INDEX (date_site)
INNER JOIN log_docs ON (log.id = log_docs.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- INNER JOIN record ON (log_docs.record_id = record.record_id)
- INNER JOIN subdef ON (log_docs.record_id = subdef.record_id)';
+ LEFT JOIN record ON (log_docs.record_id = record.record_id)';
$customFieldMap = [
$field => $name,
'log_docs.comment' => 'tt.comment',
- 'subdef.size' => 'tt.size',
- 'subdef.file' => 'tt.file',
- 'subdef.mime' => 'tt.mime',
'log_docs.final' => 'tt.final',
];
@@ -73,9 +80,8 @@ class module_report_sqldownload extends module_report_sql implements module_repo
SELECT DISTINCT(log.id), TRIM(' . $field . ') AS ' . $name . '
FROM log FORCE INDEX (date_site)
INNER JOIN log_docs ON (log.id = log_docs.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- INNER JOIN record ON (log_docs.record_id = record.record_id)
- INNER JOIN subdef ON ( log_docs.record_id = subdef.record_id)';
+ LEFT JOIN record ON (log_docs.record_id = record.record_id)';
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
} else {
$this->sql = '
SELECT ' . $name . ', SUM(1) AS nombre
@@ -83,33 +89,37 @@ class module_report_sqldownload extends module_report_sql implements module_repo
SELECT DISTINCT(log.id), TRIM( ' . $this->getTransQuery($this->groupby) . ') AS ' . $name . '
FROM log FORCE INDEX (date_site)
INNER JOIN log_docs ON (log.id = log_docs.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- INNER JOIN record ON (log_docs.record_id = record.record_id)
- INNER JOIN subdef ON (record.record_id = subdef.record_id)';
+ LEFT JOIN record ON (log_docs.record_id = record.record_id)';
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
}
- $this->sql .= ' WHERE (subdef.name = log_docs.final) AND ' . $filter['sql'] . ' ';
- $this->sql .= 'AND ( log_docs.action = \'download\' OR log_docs.action = \'mail\') ';
- $this->sql .= $this->on == 'DOC' ? 'AND subdef.name = \'document\' ' : '';
+ $this->sql .= ' WHERE ' . $filter['sql'] . ' ';
+ $this->sql .= ' AND !ISNULL(usrid)';
+ $this->sql .= ' AND (log_docs.action = \'download\' OR log_docs.action = \'mail\') ';
+ $this->sql .= $this->on == 'DOC' ? ' AND (log_docs.final = "document") ' : ' AND (log_docs.final = "preview" OR log_docs.final = "document")';
$this->sql .= ') as tt';
$this->sql .= ' GROUP BY ' . $name . ' ' . ($name == 'record_id' && $this->on == 'DOC' ? ', final' : '');
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
}
$stmt = $this->connbas->prepare($this->sql);
$stmt->execute($this->params);
$this->total_row = $stmt->rowCount();
$stmt->closeCursor();
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n\n", __FILE__, __LINE__), FILE_APPEND);
if (count($customFieldMap) > 0) {
$this->sql .= $this->filter->getOrderFilter($customFieldMap) ? : '';
} else {
- $this->sql .= $this->filter->getOrderFilter() ? : '';
+ $this->sql .= $this->filter->getOrderFilter() ? : '';
}
if ($this->enable_limit) {
$this->sql .= $this->filter->getLimitFilter() ? : '';
}
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
+
return $this;
}
@@ -124,12 +134,11 @@ class module_report_sqldownload extends module_report_sql implements module_repo
SELECT DISTINCT(log.id), ' . $this->getTransQuery($field) . ' AS val
FROM log FORCE INDEX (date_site)
INNER JOIN log_docs ON (log.id = log_docs.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
- INNER JOIN record ON (log_docs.record_id = record.record_id)
- INNER JOIN subdef ON (log_docs.record_id = subdef.record_id)
+ LEFT JOIN record ON (log_docs.record_id = record.record_id)
WHERE (' . $filter['sql'] . ')
+ AND !ISNULL(log.usrid)
AND (log_docs.action = "download" OR log_docs.action = "mail")' .
- ($this->on == 'DOC' ? ' AND subdef.name = "document"' : '') .
+ ($this->on == 'DOC' ? ' AND (log_docs.final = "document") ' : ' AND (log_docs.final = "preview" OR log_docs.final = "document")') .
') AS tt';
$this->sql .= $this->filter->getOrderFilter() ? : '';
diff --git a/lib/classes/module/report/sqlfilter.php b/lib/classes/module/report/sqlfilter.php
index fef31471f7..71ef0bfa89 100644
--- a/lib/classes/module/report/sqlfilter.php
+++ b/lib/classes/module/report/sqlfilter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -32,31 +32,12 @@ class module_report_sqlfilter
$this->report = $report;
}
- public static function constructDateFilter($dmin, $dmax)
+ public static function constructDateFilter($dmin, $dmax, $dateField = 'log_date.date')
{
- return [
- 'sql' => ($dmin && $dmax ? ' log_date.date > :date_min AND log_date.date < :date_max ' : false)
- , 'params' => ($dmin && $dmax ? [':date_min' => $dmin, ':date_max' => $dmax] : [])
- ];
- }
-
- public static function constructCollectionFilter(Application $app, $list_coll_id)
- {
- $ret = ['sql' => '', 'params' => []];
- $coll_filter = [];
- foreach (array_filter(explode(',', $list_coll_id)) as $val) {
- $val = \phrasea::collFromBas($app, $val);
- if ($val) {
- $coll_filter[] = 'log_colls.coll_id = ' . $val;
- }
- }
- $collections = array_unique($coll_filter);
-
- if (count($collections) > 0) {
- $ret['sql'] = ' (' . implode(' OR ', $collections) . ') ';
- }
-
- return $ret;
+ return array(
+ 'sql' => ($dmin && $dmax ? ' '.$dateField.' > :date_min AND '.$dateField.' < :date_max ' : false)
+ , 'params' => ($dmin && $dmax ? array(':date_min' => $dmin, ':date_max' => $dmax) : array())
+ );
}
public function getCorFilter()
@@ -66,25 +47,22 @@ class module_report_sqlfilter
public function getReportFilter()
{
- $finalfilter = '';
+ $sql = '';
$params = [':log_site' => $this->app['conf']->get(['main', 'key'])];
if ($this->filter['date'] && $this->filter['date']['sql'] !== '') {
- $finalfilter .= $this->filter['date']['sql'] . ' AND ';
+ $sql .= $this->filter['date']['sql'] . ' AND ';
$params = array_merge($params, $this->filter['date']['params']);
}
if ($this->filter['user'] && $this->filter['user']['sql'] !== '') {
- $finalfilter .= $this->filter['user']['sql'] . ' AND ';
+ $sql .= $this->filter['user']['sql'] . ' AND ';
$params = array_merge($params, $this->filter['user']['params']);
}
- if ($this->filter['collection'] && $this->filter['collection']['sql'] !== '') {
- $finalfilter .= $this->filter['collection']['sql'] . ' AND ';
- $params = array_merge($params, $this->filter['collection']['params']);
- }
- $finalfilter .= ' log.site = :log_site';
- return ['sql' => $finalfilter, 'params' => $params];
+ $sql .= ' log.site = :log_site';
+
+ return array('sql' => $sql, 'params' => $params);
}
public function getGvSitFilter()
@@ -99,7 +77,7 @@ class module_report_sqlfilter
public function getUserIdFilter($id)
{
- return ['sql' => "log.usrid = :usr_id_filter", 'params' => [':usr_id_filter' => $id]];
+ return array('sql' => "log.usrid = :usr_id_filter", 'params' => array(':usr_id_filter' => $id));
}
public function getDateFilter()
@@ -112,11 +90,6 @@ class module_report_sqlfilter
return $this->filter['user'];
}
- public function getCollectionFilter()
- {
- return $this->filter['collection'];
- }
-
public function getRecordFilter()
{
return $this->filter['record'];
@@ -139,15 +112,19 @@ class module_report_sqlfilter
private function dateFilter(module_report $report)
{
$this->filter['date'] = false;
- if ($report->getDmin() && $report->getDmax()) {
- $this->filter['date'] = [
- 'sql' => ' (log.date > :date_min_f AND log.date < :date_max_f) '
- , 'params' => [
- ':date_min_f' => $report->getDmin()
- , ':date_max_f' => $report->getDmax()
- ]
- ];
+ $sql = "";
+ if($report->getDmin()) {
+ $sql = $report->getDateField().">=" . $this->conn->quote($report->getDmin());
}
+ if($report->getDmax()) {
+ if($sql != "") {
+ $sql .= " AND ";
+ }
+ $sql .= $report->getDateField()."<=" . $this->conn->quote($report->getDmax());
+ }
+ $this->filter['date'] = array(
+ 'sql' => $sql, 'params' => array()
+ );
return;
}
@@ -188,36 +165,6 @@ class module_report_sqlfilter
return;
}
-
- private function collectionFilter(module_report $report)
- {
- $this->filter['collection'] = false;
- $coll_filter = [];
-
- if ($report->getUserId() == '') {
- return;
- }
-
- $tab = array_filter(explode(",", $report->getListCollId()));
-
- if (count($tab) > 0) {
- foreach ($tab as $val) {
- $val = \phrasea::collFromBas($this->app, $val);
- if (!!$val) {
- $coll_filter[] = 'log_colls.coll_id = ' . $val;
- }
- }
-
- $collections = array_unique($coll_filter);
-
- if (count($collections) > 0) {
- $this->filter['collection'] = array('sql' => ' (' . implode(' OR ', array_unique($coll_filter)) . ') ', 'params' => array());
- }
- }
-
- return;
- }
-
private function recordFilter(module_report $report)
{
$this->filter['record'] = false;
@@ -272,7 +219,6 @@ class module_report_sqlfilter
$this->orderFilter($report);
$this->recordFilter($report);
$this->userFilter($report);
- $this->collectionFilter($report);
return;
}
diff --git a/lib/classes/module/report/sqlquestion.php b/lib/classes/module/report/sqlquestion.php
index 2a34ba6ee8..68d8d0c35f 100644
--- a/lib/classes/module/report/sqlquestion.php
+++ b/lib/classes/module/report/sqlquestion.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -25,11 +25,12 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
$this->params = array_merge([], $filter['params']);
if ($this->groupby == false) {
- $this->sql ="
- SELECT DISTINCT(log.id), log_search.date ddate, log_search.search, log.usrid, log.user, log.pays, log.societe, log.activite, log.fonction
+ $this->sql =" SELECT log.id, log_search.date ddate, log_search.search, log.usrid, log.user, log.pays, log.societe, log.activite, log.fonction
FROM log_search
- INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_search.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id) WHERE (" . $filter['sql'] .")";
+ INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_search.log_id) AND !ISNULL(usrid)
+ WHERE (" . $filter['sql'] .")";
+
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
$stmt = $this->connbas->prepare($this->sql);
$stmt->execute($this->params);
@@ -48,12 +49,13 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
SELECT DISTINCT(log.id), TRIM(" . $this->getTransQuery($this->groupby) . ") AS " . $this->groupby . "
FROM (`log_search`)
INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_search.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE (" . $filter['sql'] .")
) AS tt
GROUP BY " . $this->groupby ."
ORDER BY nb DESC";
+// no_file_put_contents("/tmp/report.txt", sprintf("%s (%s)\n%s\n\n", __FILE__, __LINE__, $this->sql), FILE_APPEND);
+
$stmt = $this->connbas->prepare($this->sql);
$stmt->execute($this->params);
$this->total_row = $stmt->rowCount();
@@ -74,7 +76,6 @@ class module_report_sqlquestion extends module_report_sql implements module_repo
SELECT DISTINCT(log.id), " . $this->getTransQuery($field) . " AS val
FROM (`log_search`)
INNER JOIN log FORCE INDEX (date_site) ON (log.id = log_search.log_id)
- INNER JOIN log_colls FORCE INDEX (couple) ON (log.id = log_colls.log_id)
WHERE (" . $filter['sql'] . ")
) as tt
ORDER BY tt.val ASC";
diff --git a/lib/classes/module/report/validate.php b/lib/classes/module/report/validate.php
index 86fda43a3e..38426e95b3 100644
--- a/lib/classes/module/report/validate.php
+++ b/lib/classes/module/report/validate.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -54,7 +54,7 @@ class module_report_validate extends module_report
protected function buildReq($groupby = false, $on = false)
{
$sqlBuilder = $this->sqlBuilder('action')->setGroupBy($groupby)->setOn($on)
- ->setAction('validate')->buildSql();
+ ->setAction('push')->buildSql();
$this->req = $sqlBuilder->getSql();
$this->params = $sqlBuilder->getParams();
$this->total = $sqlBuilder->getTotalRows();
@@ -62,7 +62,7 @@ class module_report_validate extends module_report
public function colFilter($field, $on = false)
{
- $sqlBuilder = $this->sqlBuilder('action')->setAction('validate');
+ $sqlBuilder = $this->sqlBuilder('action')->setAction('push');
$var = $sqlBuilder->sqlDistinctValByField($field);
$sql = $var['sql'];
$params = $var['params'];
diff --git a/lib/classes/p4field.php b/lib/classes/p4field.php
index fc9d9176f2..f3a65d5bf1 100644
--- a/lib/classes/p4field.php
+++ b/lib/classes/p4field.php
@@ -23,6 +23,6 @@ class p4field
{
$v = mb_strtolower(trim($v));
- return($v == '0' || $v == 'n' || $v == 'no' || $v == 'non' || $v = 'off' || $v == 'false');
+ return($v == '0' || $v == 'n' || $v == 'no' || $v == 'non' || $v == 'off' || $v == 'false');
}
}
diff --git a/lib/classes/patch/320alpha1a.php b/lib/classes/patch/320alpha1a.php
index 8b7c4bf605..2dcb793f26 100644
--- a/lib/classes/patch/320alpha1a.php
+++ b/lib/classes/patch/320alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/320alpha1b.php b/lib/classes/patch/320alpha1b.php
index a709f83a15..167435e55e 100644
--- a/lib/classes/patch/320alpha1b.php
+++ b/lib/classes/patch/320alpha1b.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/320alpha2a.php b/lib/classes/patch/320alpha2a.php
index 8fbfae522e..a4625d9ff8 100644
--- a/lib/classes/patch/320alpha2a.php
+++ b/lib/classes/patch/320alpha2a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -58,21 +58,21 @@ class patch_320alpha2a extends patchAbstract
public function apply(base $appbox, Application $app)
{
$dql = 'SELECT u FROM Phraseanet:User u WHERE u.nonce IS NULL';
- $q = $app['EM']->createQuery($dql);
+ $q = $app['orm.em']->createQuery($dql);
$q->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true);
$users = $q->getResult();
$n = 0;
foreach ($users as $user) {
$user->setNonce($app['random.medium']->generateString(64));
- $app['EM']->persist($user);
+ $app['orm.em']->persist($user);
$n++;
if ($n %100 === 0) {
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
$sql = 'SELECT task_id, `class` FROM task2';
$stmt = $appbox->get_connection()->prepare($sql);
diff --git a/lib/classes/patch/320alpha3a.php b/lib/classes/patch/320alpha3a.php
index d76dc866b6..787a0370d1 100644
--- a/lib/classes/patch/320alpha3a.php
+++ b/lib/classes/patch/320alpha3a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/320alpha4a.php b/lib/classes/patch/320alpha4a.php
index 7e8ccf48cc..c248e11514 100644
--- a/lib/classes/patch/320alpha4a.php
+++ b/lib/classes/patch/320alpha4a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/320alpha4b.php b/lib/classes/patch/320alpha4b.php
index 9f55e83a2f..60e41e95bf 100644
--- a/lib/classes/patch/320alpha4b.php
+++ b/lib/classes/patch/320alpha4b.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -16,6 +16,7 @@ use Alchemy\Phrasea\Model\Entities\FeedItem;
use Alchemy\Phrasea\Model\Entities\FeedPublisher;
use Gedmo\Timestampable\TimestampableListener;
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
+use Alchemy\Phrasea\Model\Entities\User;
class patch_320alpha4b extends patchAbstract
{
@@ -84,12 +85,13 @@ class patch_320alpha4b extends patchAbstract
$date_ref = new DateTime();
$n = 0;
- $app['EM']->getEventManager()->removeEventSubscriber(new TimestampableListener());
+ $app['orm.em']->getEventManager()->removeEventSubscriber(new TimestampableListener());
foreach ($rs as $row) {
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
- $feed = $this->get_feed($appbox, $user, $row['pub_restrict'], $row['homelink'], $app);
+
+ $feed = $this->get_feed($app, $appbox, $user, $row['pub_restrict'], $row['homelink']);
if (! $feed instanceof Feed) {
continue;
@@ -98,8 +100,8 @@ class patch_320alpha4b extends patchAbstract
$publishers = $feed->getPublishers();
$entry = new FeedEntry();
- $entry->setAuthorEmail($user->getEmail());
- $entry->setAuthorName($user->getDisplayName());
+ $entry->setAuthorEmail((string) $user->getEmail());
+ $entry->setAuthorName((string) $user->getDisplayName());
$entry->setFeed($feed);
$entry->setPublisher($publishers->first());
$entry->setTitle($row['name']);
@@ -133,31 +135,31 @@ class patch_320alpha4b extends patchAbstract
$entry->addItem($item);
$item->setRecordId($record->get_record_id());
$item->setSbasId($record->get_sbas_id());
- $app['EM']->persist($item);
+ $app['orm.em']->persist($item);
} catch (NotFoundHttpException $e) {
}
}
- $app['EM']->persist($entry);
+ $app['orm.em']->persist($entry);
$sql = 'UPDATE ssel SET deleted = "1", migrated="1"
WHERE ssel_id = :ssel_id';
$stmt = $appbox->get_connection()->prepare($sql);
$stmt->execute([':ssel_id' => $row['ssel_id']]);
$stmt->closeCursor();
- $app['EM']->persist($feed);
+ $app['orm.em']->persist($feed);
$n++;
if ($n % 1000 == 0) {
- $app['EM']->flush();
- $app['EM']->clear();
+ $app['orm.em']->flush();
+ $app['orm.em']->clear();
}
}
$this->set_feed_dates($date_ref);
- $app['EM']->flush();
- $app['EM']->clear();
+ $app['orm.em']->flush();
+ $app['orm.em']->clear();
- $app['EM']->getEventManager()->removeEventSubscriber(new TimestampableListener());
+ $app['orm.em']->getEventManager()->removeEventSubscriber(new TimestampableListener());
return true;
}
@@ -174,7 +176,7 @@ class patch_320alpha4b extends patchAbstract
}
protected static $feeds = [];
- protected function get_feed(appbox $appbox, User $user, $pub_restrict, $homelink, Application $app)
+ protected function get_feed(Application $app, appbox $appbox, User $user, $pub_restrict, $homelink)
{
$user_key = 'user_' . $user->getId();
if ($homelink == '1') {
@@ -199,15 +201,15 @@ class patch_320alpha4b extends patchAbstract
$feed->setSubtitle('');
$feed->addPublisher($publisher);
$publisher->setFeed($feed);
- $publisher->setOwner(true);
+ $publisher->setIsOwner(true);
$publisher->setUser($user);
if ($homelink) {
- $feed->setPublic(true);
+ $feed->setIsPublic(true);
- $app['EM']->persist($feed);
- $app['EM']->persist($user);
- $app['EM']->flush();
+ $app['orm.em']->persist($feed);
+ $app['orm.em']->persist($user);
+ $app['orm.em']->flush();
} elseif ($pub_restrict == 1) {
$collections = $app['acl']->get($user)->get_granted_base();
diff --git a/lib/classes/patch/320alpha5a.php b/lib/classes/patch/320alpha5a.php
index 1cabd25c1e..cc57d1b4d5 100644
--- a/lib/classes/patch/320alpha5a.php
+++ b/lib/classes/patch/320alpha5a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/320alpha6a.php b/lib/classes/patch/320alpha6a.php
index ccc9d753da..8ec6d92983 100644
--- a/lib/classes/patch/320alpha6a.php
+++ b/lib/classes/patch/320alpha6a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/320alpha8a.php b/lib/classes/patch/320alpha8a.php
index 890df24136..e06a293adb 100644
--- a/lib/classes/patch/320alpha8a.php
+++ b/lib/classes/patch/320alpha8a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/360alpha1a.php b/lib/classes/patch/360alpha1a.php
index 687b060f0c..6dae6a5edb 100644
--- a/lib/classes/patch/360alpha1a.php
+++ b/lib/classes/patch/360alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -67,9 +67,14 @@ class patch_360alpha1a extends patchAbstract
$stories = [];
- $sql = 'SELECT sbas_id, rid as record_id, usr_id
- FROM ssel
- WHERE temporaryType = "1"';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
@@ -88,9 +93,13 @@ class patch_360alpha1a extends patchAbstract
$current[$serial] = $serial;
}
- $sql = 'DELETE FROM ssel
- WHERE temporaryType="1" AND record_id = :record_id
- AND usr_id = :usr_id AND sbas_id = :sbas_id';
+ $sql = <<get_connection()->prepare($sql);
@@ -105,30 +114,52 @@ class patch_360alpha1a extends patchAbstract
$stmt->closeCursor();
- $sql = 'INSERT INTO StoryWZ
- (
- SELECT null as id, sbas_id, rid as record_id, usr_id, date as created
- FROM ssel
- WHERE temporaryType = "1"
- )';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
- $sql = 'INSERT INTO Baskets
- (
- SELECT ssel_id as id, name, descript as description, usr_id, 1 as is_read
- , pushFrom as pusher_id, 0 as archived, date as created, updater as updated
- FROM ssel
- WHERE temporaryType = "0"
- )';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
- $sql = 'SELECT ssel_id FROM ssel WHERE temporaryType = "0"';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
@@ -137,10 +168,18 @@ class patch_360alpha1a extends patchAbstract
$sselcont_ids = [];
foreach ($rs as $row) {
- $sql = 'SELECT c.sselcont_id, c.record_id, b.sbas_id
- FROM sselcont c, bas b, ssel s
- WHERE s.temporaryType = "0" AND b.base_id = c.base_id
- AND c.ssel_id = :ssel_id AND s.ssel_id = c.ssel_id';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute([':ssel_id' => $row['ssel_id']]);
@@ -160,7 +199,10 @@ class patch_360alpha1a extends patchAbstract
}
}
- $sql = 'DELETE FROM sselcont WHERE sselcont_id = :sselcont_id';
+ $sql = <<get_connection()->prepare($sql);
foreach ($sselcont_ids as $sselcont_id) {
@@ -169,68 +211,111 @@ class patch_360alpha1a extends patchAbstract
$stmt->closeCursor();
- $sql = 'INSERT INTO BasketElements
- (
- SELECT sselcont_id as id, c.ssel_id as basket_id, record_id, b.sbas_id, c.ord,
- s.date as created, s.updater as updated
- FROM sselcont c, ssel s, bas b
- WHERE temporaryType = "0" AND b.base_id = c.base_id AND s.ssel_id = c.ssel_id
- )';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
- $sql = 'UPDATE Baskets SET pusher_id = NULL WHERE pusher_id = 0';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
- $sql = 'INSERT INTO ValidationSessions
- (
- SELECT null as id, v.ssel_id as basket_id ,created_on as created
- ,updated_on as updated ,expires_on as expires
- ,v.usr_id as initiator_id
- FROM ssel s, validate v
- WHERE v.ssel_id = s.ssel_id AND v.usr_id = s.usr_id
- )';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
- $sql = 'INSERT INTO ValidationParticipants
- (
- SELECT v.id as id, v.usr_id
- , 1 AS is_aware, confirmed as is_confirmed, 1 as can_agree
- , can_see_others, last_reminder AS reminded
- , vs.`id` AS ValidationSession_id
- FROM validate v, ssel s, ValidationSessions vs
- WHERE s.ssel_id = v.ssel_id AND vs.basket_id = v.ssel_id
- )';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
- $sql = 'SELECT user_id, basket_id, p.id as participant_id
- FROM ValidationParticipants p, ValidationSessions s
- WHERE p.ValidationSession_Id = s.id';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$rs = $stmt->fetchAll(PDO::FETCH_ASSOC);
$stmt->closeCursor();
- $sql = 'INSERT INTO ValidationDatas
- (
- SELECT d.id , :participant_id as participant_id, d.sselcont_id, d.agreement
- ,d.note, d.updated_on as updated
- FROM validate v, validate_datas d, sselcont c
- WHERE c.sselcont_id = d.sselcont_id AND v.id = d.validate_id
- AND v.usr_id = :usr_id AND v.ssel_id = :basket_id
- )';
+ $sql = <<get_connection()->prepare($sql);
foreach ($rs as $row) {
$params = [
@@ -243,15 +328,21 @@ class patch_360alpha1a extends patchAbstract
$stmt->closeCursor();
- $sql = 'UPDATE ValidationDatas
- SET agreement = NULL where agreement = "0"';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
$stmt->closeCursor();
- $sql = 'UPDATE ValidationDatas
- SET agreement = "0" where agreement = "-1"';
+ $sql = <<get_connection()->prepare($sql);
$stmt->execute();
diff --git a/lib/classes/patch/360alpha1b.php b/lib/classes/patch/360alpha1b.php
index 55a86dcdd7..e7e2d989c2 100644
--- a/lib/classes/patch/360alpha1b.php
+++ b/lib/classes/patch/360alpha1b.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/360alpha2a.php b/lib/classes/patch/360alpha2a.php
index 09c66cae77..f987db2469 100644
--- a/lib/classes/patch/360alpha2a.php
+++ b/lib/classes/patch/360alpha2a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -56,7 +56,7 @@ class patch_360alpha2a extends patchAbstract
*/
public function apply(base $appbox, Application $app)
{
- $app['EM']->getConnection()->executeUpdate('UPDATE Users u SET u.email = NULL WHERE u.email IS NOT NULL AND u.deleted = 1');
+ $app['orm.em']->getConnection()->executeUpdate('UPDATE Users u SET u.email = NULL WHERE u.email IS NOT NULL AND u.deleted = 1');
return true;
}
diff --git a/lib/classes/patch/360alpha2b.php b/lib/classes/patch/360alpha2b.php
index 14ac564147..205dba4817 100644
--- a/lib/classes/patch/360alpha2b.php
+++ b/lib/classes/patch/360alpha2b.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/361alpha1a.php b/lib/classes/patch/361alpha1a.php
index a7db9cd319..5b770b40cc 100644
--- a/lib/classes/patch/361alpha1a.php
+++ b/lib/classes/patch/361alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -69,7 +69,8 @@ class patch_361alpha1a extends patchAbstract
$sbas_id = (int) $row['sbas_id'];
try {
- $connbas = $app['phraseanet.appbox']->get_databox($sbas_id)->get_connection()->connect();
+ $connbas = $app['phraseanet.appbox']->get_databox($sbas_id)->get_connection();
+ $connbas->connect();
} catch (\Exception $e) {
$conn->exec('DELETE FROM ValidationDatas WHERE basket_element_id = ' . $row['id']);
$conn->exec('DELETE FROM BasketElements WHERE id = ' . $row['id']);
@@ -93,7 +94,7 @@ class patch_361alpha1a extends patchAbstract
$n = 0;
$perPage = 100;
- $query = $app['EM']->createQuery($dql)
+ $query = $app['orm.em']->createQuery($dql)
->setFirstResult($n)
->setMaxResults($perPage);
@@ -102,7 +103,7 @@ class patch_361alpha1a extends patchAbstract
$count = count($paginator);
while ($n < $count) {
- $query = $app['EM']->createQuery($dql)
+ $query = $app['orm.em']->createQuery($dql)
->setFirstResult($n)
->setMaxResults($perPage);
@@ -121,10 +122,10 @@ class patch_361alpha1a extends patchAbstract
}
$n += $perPage;
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
return true;
}
diff --git a/lib/classes/patch/370alpha1a.php b/lib/classes/patch/370alpha1a.php
index 7bd2e8b024..cfb20f3cd3 100644
--- a/lib/classes/patch/370alpha1a.php
+++ b/lib/classes/patch/370alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/370alpha3a.php b/lib/classes/patch/370alpha3a.php
index 059df55520..86f3b59e23 100644
--- a/lib/classes/patch/370alpha3a.php
+++ b/lib/classes/patch/370alpha3a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/370alpha4a.php b/lib/classes/patch/370alpha4a.php
index fc3785b6ce..d040d0f197 100644
--- a/lib/classes/patch/370alpha4a.php
+++ b/lib/classes/patch/370alpha4a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/370alpha5a.php b/lib/classes/patch/370alpha5a.php
index a7c9799499..9386ce319a 100644
--- a/lib/classes/patch/370alpha5a.php
+++ b/lib/classes/patch/370alpha5a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/370alpha6a.php b/lib/classes/patch/370alpha6a.php
index 931a86856d..ca62ad114b 100644
--- a/lib/classes/patch/370alpha6a.php
+++ b/lib/classes/patch/370alpha6a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/370alpha7a.php b/lib/classes/patch/370alpha7a.php
index 89515dd2e7..cf6669336e 100644
--- a/lib/classes/patch/370alpha7a.php
+++ b/lib/classes/patch/370alpha7a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -81,16 +81,16 @@ class patch_370alpha7a extends patchAbstract
//order matters for foreign keys constraints
//truncate all altered tables
- $this->truncateTable($app['EM'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretAttribute');
- $this->truncateTable($app['EM'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretCheck');
- $this->truncateTable($app['EM'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretFile');
- $this->truncateTable($app['EM'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretSession');
+ $this->truncateTable($app['orm.em'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretAttribute');
+ $this->truncateTable($app['orm.em'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretCheck');
+ $this->truncateTable($app['orm.em'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretFile');
+ $this->truncateTable($app['orm.em'], 'Alchemy\\Phrasea\\Model\\Entities\\LazaretSession');
$i = 0;
foreach ($rs as $row) {
$filePath = $app['tmp.lazaret.path'].'/'.$row['filepath'];
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
@@ -140,17 +140,17 @@ class patch_370alpha7a extends patchAbstract
$lazaretFile->setCreated(new \DateTime($row['created_on']));
$lazaretFile->setSession($lazaretSession);
- $app['EM']->persist($lazaretFile);
+ $app['orm.em']->persist($lazaretFile);
if (0 === ++$i % 100) {
- $app['EM']->flush();
- $app['EM']->clear();
+ $app['orm.em']->flush();
+ $app['orm.em']->clear();
}
}
}
- $app['EM']->flush();
- $app['EM']->clear();
+ $app['orm.em']->flush();
+ $app['orm.em']->clear();
$stmt->closeCursor();
diff --git a/lib/classes/patch/370alpha8a.php b/lib/classes/patch/370alpha8a.php
index ac371288c3..65e3a1097e 100644
--- a/lib/classes/patch/370alpha8a.php
+++ b/lib/classes/patch/370alpha8a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -212,9 +212,9 @@ class patch_370alpha8a extends patchAbstract
->setSettings($settings)
->setPeriod($period)
->setStatus(Task::STATUS_STARTED);
- $app['EM']->persist($task);
+ $app['orm.em']->persist($task);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
return true;
}
diff --git a/lib/classes/patch/370alpha9a.php b/lib/classes/patch/370alpha9a.php
index cc36be8eec..e3f18145a3 100644
--- a/lib/classes/patch/370alpha9a.php
+++ b/lib/classes/patch/370alpha9a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/3715alpha1a.php b/lib/classes/patch/3715alpha1a.php
index fc1bf468f8..3fe6f1f501 100644
--- a/lib/classes/patch/3715alpha1a.php
+++ b/lib/classes/patch/3715alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/371alpha1a.php b/lib/classes/patch/371alpha1a.php
index 3a2f6ef3b1..c33cfebc10 100644
--- a/lib/classes/patch/371alpha1a.php
+++ b/lib/classes/patch/371alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/373alpha1a.php b/lib/classes/patch/373alpha1a.php
index 7b7987b93e..4fcf8be30c 100644
--- a/lib/classes/patch/373alpha1a.php
+++ b/lib/classes/patch/373alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/379alpha1a.php b/lib/classes/patch/379alpha1a.php
index 4056356a74..ebb1fc121f 100644
--- a/lib/classes/patch/379alpha1a.php
+++ b/lib/classes/patch/379alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha10a.php b/lib/classes/patch/380alpha10a.php
index 2cd7ace751..3cefc55433 100644
--- a/lib/classes/patch/380alpha10a.php
+++ b/lib/classes/patch/380alpha10a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha11a.php b/lib/classes/patch/380alpha11a.php
index 60810aa83e..9228cc2362 100644
--- a/lib/classes/patch/380alpha11a.php
+++ b/lib/classes/patch/380alpha11a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -73,7 +73,7 @@ class patch_380alpha11a extends patchAbstract
}
foreach ($rs as $row) {
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
@@ -117,14 +117,14 @@ class patch_380alpha11a extends patchAbstract
$session->addModule($module);
- $app['EM']->persist($module);
+ $app['orm.em']->persist($module);
}
}
- $app['EM']->persist($session);
+ $app['orm.em']->persist($session);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
return true;
}
diff --git a/lib/classes/patch/380alpha13a.php b/lib/classes/patch/380alpha13a.php
index 4225215676..3c0d9dc972 100644
--- a/lib/classes/patch/380alpha13a.php
+++ b/lib/classes/patch/380alpha13a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha14a.php b/lib/classes/patch/380alpha14a.php
index ca1fd3055b..a47b9e0f65 100644
--- a/lib/classes/patch/380alpha14a.php
+++ b/lib/classes/patch/380alpha14a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha15a.php b/lib/classes/patch/380alpha15a.php
index befa165a72..196656a8fa 100644
--- a/lib/classes/patch/380alpha15a.php
+++ b/lib/classes/patch/380alpha15a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha16a.php b/lib/classes/patch/380alpha16a.php
index dd1d40be12..8ee289a7f3 100644
--- a/lib/classes/patch/380alpha16a.php
+++ b/lib/classes/patch/380alpha16a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha17a.php b/lib/classes/patch/380alpha17a.php
index 2eb87a7957..9550ed3977 100644
--- a/lib/classes/patch/380alpha17a.php
+++ b/lib/classes/patch/380alpha17a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha18a.php b/lib/classes/patch/380alpha18a.php
index abe61275a8..e94700409a 100644
--- a/lib/classes/patch/380alpha18a.php
+++ b/lib/classes/patch/380alpha18a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha2a.php b/lib/classes/patch/380alpha2a.php
index 67b202e91d..ac82a0ca87 100644
--- a/lib/classes/patch/380alpha2a.php
+++ b/lib/classes/patch/380alpha2a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha2b.php b/lib/classes/patch/380alpha2b.php
index 44624d2c73..9649e36884 100644
--- a/lib/classes/patch/380alpha2b.php
+++ b/lib/classes/patch/380alpha2b.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha3a.php b/lib/classes/patch/380alpha3a.php
index b8e5f9b26a..3439109f16 100644
--- a/lib/classes/patch/380alpha3a.php
+++ b/lib/classes/patch/380alpha3a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha3b.php b/lib/classes/patch/380alpha3b.php
index e889da8bd3..a80ad9e5eb 100644
--- a/lib/classes/patch/380alpha3b.php
+++ b/lib/classes/patch/380alpha3b.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha4a.php b/lib/classes/patch/380alpha4a.php
index d16e38b77e..ace3ffa82b 100644
--- a/lib/classes/patch/380alpha4a.php
+++ b/lib/classes/patch/380alpha4a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -78,16 +78,16 @@ class patch_380alpha4a extends patchAbstract
$failure->setLocked(!!$row['locked']);
$failure->setUsername($row['login']);
- $app['EM']->persist($failure);
+ $app['orm.em']->persist($failure);
if (0 === $n++ % 1000) {
- $app['EM']->flush();
- $app['EM']->clear();
+ $app['orm.em']->flush();
+ $app['orm.em']->clear();
}
}
- $app['EM']->flush();
- $app['EM']->clear();
+ $app['orm.em']->flush();
+ $app['orm.em']->clear();
return true;
}
diff --git a/lib/classes/patch/380alpha6a.php b/lib/classes/patch/380alpha6a.php
index 4711e2d23c..e3e3f45fe6 100644
--- a/lib/classes/patch/380alpha6a.php
+++ b/lib/classes/patch/380alpha6a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha8a.php b/lib/classes/patch/380alpha8a.php
index 2b1d9fba10..80b3dd08a5 100644
--- a/lib/classes/patch/380alpha8a.php
+++ b/lib/classes/patch/380alpha8a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/380alpha9a.php b/lib/classes/patch/380alpha9a.php
index a3340876eb..44ec54d194 100644
--- a/lib/classes/patch/380alpha9a.php
+++ b/lib/classes/patch/380alpha9a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/381alpha1b.php b/lib/classes/patch/381alpha1b.php
index 7618950a83..ef714232d0 100644
--- a/lib/classes/patch/381alpha1b.php
+++ b/lib/classes/patch/381alpha1b.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/381alpha2a.php b/lib/classes/patch/381alpha2a.php
index 49b2d8d6ac..9b070ce0a3 100644
--- a/lib/classes/patch/381alpha2a.php
+++ b/lib/classes/patch/381alpha2a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/381alpha3a.php b/lib/classes/patch/381alpha3a.php
index 53a9a285d7..f5ae5bf2f7 100644
--- a/lib/classes/patch/381alpha3a.php
+++ b/lib/classes/patch/381alpha3a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/381alpha4a.php b/lib/classes/patch/381alpha4a.php
index b60a246e52..a9eaf52776 100644
--- a/lib/classes/patch/381alpha4a.php
+++ b/lib/classes/patch/381alpha4a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/383alpha1a.php b/lib/classes/patch/383alpha1a.php
index 2ba4c95475..4f08f0f94e 100644
--- a/lib/classes/patch/383alpha1a.php
+++ b/lib/classes/patch/383alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -70,19 +70,19 @@ class patch_383alpha1a extends patchAbstract
foreach ($rows as $row) {
if (null !== $session = $app['repo.sessions']->find($row['id'])) {
- $app['EM']->remove($session);
+ $app['orm.em']->remove($session);
}
}
// Remove API sessions
- $query = $app['EM']->createQuery('SELECT s FROM Phraseanet:Session s WHERE s.user_agent LIKE :guzzle');
+ $query = $app['orm.em']->createQuery('SELECT s FROM Phraseanet:Session s WHERE s.user_agent LIKE :guzzle');
$query->setParameter(':guzzle', 'Guzzle%');
foreach ($query->getResult() as $session) {
- $app['EM']->remove($session);
+ $app['orm.em']->remove($session);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
return true;
}
@@ -92,7 +92,7 @@ class patch_383alpha1a extends patchAbstract
$rsm = (new ResultSetMapping())->addScalarResult('Name', 'Name');
$ret = false;
- foreach ($app['EM']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
+ foreach ($app['orm.em']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
if ('Session' === $row['Name']) {
$ret = true;
break;
diff --git a/lib/classes/patch/383alpha2a.php b/lib/classes/patch/383alpha2a.php
index ae41104d8d..5f06b0c57a 100644
--- a/lib/classes/patch/383alpha2a.php
+++ b/lib/classes/patch/383alpha2a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -66,17 +66,17 @@ class patch_383alpha2a extends patchAbstract
foreach ($rows as $row) {
try {
- $vsession = $app['EM']->createQuery('SELECT PARTIAL s.{id} FROM Phraseanet:ValidationSession s WHERE s.id = :id')
+ $vsession = $app['orm.em']->createQuery('SELECT PARTIAL s.{id} FROM Phraseanet:ValidationSession s WHERE s.id = :id')
->setParameters(['id' => $row['validation_session_id']])
->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true)
->getSingleResult();
- $app['EM']->remove($vsession);
+ $app['orm.em']->remove($vsession);
} catch (NoResultException $e) {
}
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
return true;
}
diff --git a/lib/classes/patch/383alpha3a.php b/lib/classes/patch/383alpha3a.php
index 74bba60f6c..15f5710660 100644
--- a/lib/classes/patch/383alpha3a.php
+++ b/lib/classes/patch/383alpha3a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/383alpha5a.php b/lib/classes/patch/383alpha5a.php
index b1648e6366..241258050d 100644
--- a/lib/classes/patch/383alpha5a.php
+++ b/lib/classes/patch/383alpha5a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/384alpha1a.php b/lib/classes/patch/384alpha1a.php
index 5166f700b4..b12f3a9945 100644
--- a/lib/classes/patch/384alpha1a.php
+++ b/lib/classes/patch/384alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/384alpha2a.php b/lib/classes/patch/384alpha2a.php
index 54f84e583e..29e750a009 100644
--- a/lib/classes/patch/384alpha2a.php
+++ b/lib/classes/patch/384alpha2a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/384alpha3a.php b/lib/classes/patch/384alpha3a.php
index 40be3cabd0..fbcccc0653 100644
--- a/lib/classes/patch/384alpha3a.php
+++ b/lib/classes/patch/384alpha3a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/384alpha4a.php b/lib/classes/patch/384alpha4a.php
index d5e14c721d..771a1351dc 100644
--- a/lib/classes/patch/384alpha4a.php
+++ b/lib/classes/patch/384alpha4a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/384alpha5a.php b/lib/classes/patch/384alpha5a.php
index 4a94a0379c..767d9dd541 100644
--- a/lib/classes/patch/384alpha5a.php
+++ b/lib/classes/patch/384alpha5a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/386alpha1a.php b/lib/classes/patch/386alpha1a.php
index 333d80ab60..d13ac818d7 100644
--- a/lib/classes/patch/386alpha1a.php
+++ b/lib/classes/patch/386alpha1a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/386alpha2a.php b/lib/classes/patch/386alpha2a.php
index 151c90983a..0ff9cb5c6a 100644
--- a/lib/classes/patch/386alpha2a.php
+++ b/lib/classes/patch/386alpha2a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/386alpha3a.php b/lib/classes/patch/386alpha3a.php
index 11df672f35..1e607f3277 100644
--- a/lib/classes/patch/386alpha3a.php
+++ b/lib/classes/patch/386alpha3a.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patch/386alpha4a.php b/lib/classes/patch/386alpha4a.php
new file mode 100644
index 0000000000..76ed5ea9cd
--- /dev/null
+++ b/lib/classes/patch/386alpha4a.php
@@ -0,0 +1,71 @@
+release;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function require_all_upgrades()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDoctrineMigrations()
+ {
+ return array('user-list');
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function concern()
+ {
+ return $this->concern;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function apply(base $appbox, Application $app)
+ {
+ $repo = $app['orm.em']->getRepository('Phraseanet:UsrList');
+ foreach ($app['orm.em']->getRepository('Phraseanet:User')->findDeleted() as $user) {
+ foreach ($repo->findUserLists($user) as $list) {
+ $app['orm.em']->remove($list);
+ }
+ $app['orm.em']->flush();
+ }
+
+ return true;
+ }
+}
diff --git a/lib/classes/patch/390alpha12a.php b/lib/classes/patch/390alpha12a.php
index 4b2c3965bb..b351f6fe0a 100644
--- a/lib/classes/patch/390alpha12a.php
+++ b/lib/classes/patch/390alpha12a.php
@@ -69,7 +69,7 @@ class patch_390alpha12a extends patchAbstract
$finder = new Finder();
$finder
->depth(0)
- ->in($app['plugins.directory'])
+ ->in($app['plugin.path'])
->directories();
$plugins = [];
diff --git a/lib/classes/patch/390alpha13a.php b/lib/classes/patch/390alpha13a.php
index 011b79361d..cd12d6937b 100644
--- a/lib/classes/patch/390alpha13a.php
+++ b/lib/classes/patch/390alpha13a.php
@@ -60,7 +60,7 @@ class patch_390alpha13a implements patchInterface
*/
public function apply(base $appbox, Application $app)
{
- $em = $app['EM'];
+ $em = $app['orm.em'];
$sql = "SELECT date_modif, usr_id, base_id, en_cours, refuser
FROM demand";
diff --git a/lib/classes/patch/390alpha14a.php b/lib/classes/patch/390alpha14a.php
index d26453d9e2..89fc68449b 100644
--- a/lib/classes/patch/390alpha14a.php
+++ b/lib/classes/patch/390alpha14a.php
@@ -58,7 +58,7 @@ class patch_390alpha14a extends patchAbstract
{
$app['conf']->remove(['main', 'api-timers']);
- if ($this->tableHasField($app['EM'], 'api_logs', 'api_log_ressource')) {
+ if ($this->tableHasField($app['orm.em'], 'api_logs', 'api_log_ressource')) {
$sql = "ALTER TABLE api_logs CHANGE api_log_ressource api_log_resource varchar(64)";
$app['phraseanet.appbox']->get_connection()->executeUpdate($sql);
}
diff --git a/lib/classes/patch/390alpha15a.php b/lib/classes/patch/390alpha15a.php
index 057a13d380..2bf6c69b9f 100644
--- a/lib/classes/patch/390alpha15a.php
+++ b/lib/classes/patch/390alpha15a.php
@@ -56,11 +56,11 @@ class patch_390alpha15a extends patchAbstract
*/
public function apply(base $appbox, Application $app)
{
- if (!$this->tableExists($app['EM'], 'tokens_backup')) {
+ if (!$this->tableExists($app['orm.em'], 'tokens_backup')) {
return true;
}
- $app['EM']->getConnection()->executeUpdate('
+ $app['orm.em']->getConnection()->executeUpdate('
INSERT INTO Tokens
(
`value`, user_id, `type`, `data`,
diff --git a/lib/classes/patch/390alpha16a.php b/lib/classes/patch/390alpha16a.php
index 5e78de9513..f6684c551e 100644
--- a/lib/classes/patch/390alpha16a.php
+++ b/lib/classes/patch/390alpha16a.php
@@ -61,11 +61,11 @@ class patch_390alpha16a extends patchAbstract
$sql = ' SELECT edit_preset_id, creation_date, title, xml, usr_id, sbas_id
FROM edit_presets';
- $em = $app['EM'];
+ $em = $app['orm.em'];
$n = 0;
$em->getEventManager()->removeEventSubscriber(new TimestampableListener());
foreach ($app['phraseanet.appbox']->get_connection()->fetchAll($sql) as $row) {
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
$preset = new Preset();
diff --git a/lib/classes/patch/390alpha17a.php b/lib/classes/patch/390alpha17a.php
index 80264940ee..a41820a2c8 100644
--- a/lib/classes/patch/390alpha17a.php
+++ b/lib/classes/patch/390alpha17a.php
@@ -57,14 +57,14 @@ class patch_390alpha17a extends patchAbstract
*/
public function apply(base $appbox, Application $app)
{
- $this->fillApplicationTable($app['EM']);
- $this->fillAccountTable($app['EM']);
- $this->fillLogTable($app['EM']);
- $this->fillCodeTable($app['EM']);
- $this->fillRefreshTokenTable($app['EM']);
- $this->fillOauthTokenTable($app['EM']);
- $this->setOauthTokenExpiresToNull($app['EM']);
- $this->updateLogsTable($app['EM']);
+ $this->fillApplicationTable($app['orm.em']);
+ $this->fillAccountTable($app['orm.em']);
+ $this->fillLogTable($app['orm.em']);
+ $this->fillCodeTable($app['orm.em']);
+ $this->fillRefreshTokenTable($app['orm.em']);
+ $this->fillOauthTokenTable($app['orm.em']);
+ $this->setOauthTokenExpiresToNull($app['orm.em']);
+ $this->updateLogsTable($app['orm.em']);
}
private function fillApplicationTable(EntityManager $em)
@@ -133,7 +133,7 @@ class patch_390alpha17a extends patchAbstract
(
SELECT
a.api_log_id, a.api_account_id, a.api_log_route, a.api_log_error_message,
- a.api_log_date, a.api_log_status_code, a.api_log_format, a.api_log_ressource,
+ a.api_log_date, a.api_log_status_code, a.api_log_format, a.api_log_resource,
a.api_log_general, a.api_log_aspect, a.api_log_action, a.api_log_error_code
FROM api_logs a
INNER JOIN api_accounts b ON (b.api_account_id = a.api_account_id)
diff --git a/lib/classes/patch/390alpha18a.php b/lib/classes/patch/390alpha18a.php
index 1e49030204..7877deb509 100644
--- a/lib/classes/patch/390alpha18a.php
+++ b/lib/classes/patch/390alpha18a.php
@@ -56,33 +56,33 @@ class patch_390alpha18a extends patchAbstract
*/
public function apply(base $appbox, Application $app)
{
- $app['EM']->getConnection()->executeUpdate('
+ $app['orm.em']->getConnection()->executeUpdate('
DELETE lf FROM LazaretFiles lf
INNER JOIN LazaretSessions ls ON (ls.id = lf.lazaret_session_id)
LEFT JOIN Users u ON (ls.user_id = u.id)
WHERE u.id IS NULL'
);
- $app['EM']->getConnection()->executeUpdate('
+ $app['orm.em']->getConnection()->executeUpdate('
DELETE ls FROM LazaretSessions AS ls
LEFT JOIN Users u ON (ls.user_id = u.id)
WHERE u.id IS NULL'
);
- $app['EM']->getConnection()->executeUpdate('
+ $app['orm.em']->getConnection()->executeUpdate('
DELETE fi FROM FeedItems AS fi
INNER JOIN FeedEntries fe ON (fe.id = fi.entry_id)
LEFT JOIN Users u ON (fe.publisher_id = u.id)
WHERE u.id IS NULL'
);
- $app['EM']->getConnection()->executeUpdate('
+ $app['orm.em']->getConnection()->executeUpdate('
DELETE fe FROM FeedEntries AS fe
LEFT JOIN Users u ON (fe.publisher_id = u.id)
WHERE u.id IS NULL'
);
- $app['EM']->getConnection()->executeUpdate(
+ $app['orm.em']->getConnection()->executeUpdate(
'DELETE se FROM Sessions AS se
LEFT JOIN Users u ON (se.user_id = u.id)
WHERE u.id IS NULL'
diff --git a/lib/classes/patch/390alpha1a.php b/lib/classes/patch/390alpha1a.php
index 7baacc2c1f..117f0eeb67 100644
--- a/lib/classes/patch/390alpha1a.php
+++ b/lib/classes/patch/390alpha1a.php
@@ -79,7 +79,7 @@ class patch_390alpha1a extends patchAbstract
$stmt->closeCursor();
$n = 0;
- $em = $app['EM'];
+ $em = $app['orm.em'];
$em->getEventManager()->removeEventSubscriber(new TimestampableListener());
foreach ($rs as $row) {
@@ -93,12 +93,12 @@ class patch_390alpha1a extends patchAbstract
$todo = $stmt->fetch(\PDO::FETCH_ASSOC);
$stmt->closeCursor();
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
try {
- $basket = $app['EM']->createQuery('SELECT PARTIAL b.{id} FROM Phraseanet:Basket b WHERE b.id = :id')
+ $basket = $app['orm.em']->createQuery('SELECT PARTIAL b.{id} FROM Phraseanet:Basket b WHERE b.id = :id')
->setParameters(['id' => $row['ssel_id']])
->setHint(Query::HINT_FORCE_PARTIAL_LOAD, true)
->getSingleResult();
@@ -127,7 +127,7 @@ class patch_390alpha1a extends patchAbstract
foreach ($elements as $element) {
$orderElement = new OrderElement();
- $user = $this->loadUser($app['EM'], $row['usr_id']);
+ $user = $this->loadUser($app['orm.em'], $row['usr_id']);
$orderElement->setBaseId($element['base_id'])
->setDeny($element['deny'] === null ? null : (Boolean) $element['deny'])
->setOrder($order)
diff --git a/lib/classes/patch/390alpha21a.php b/lib/classes/patch/390alpha21a.php
new file mode 100644
index 0000000000..f530f70307
--- /dev/null
+++ b/lib/classes/patch/390alpha21a.php
@@ -0,0 +1,67 @@
+release;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function require_all_upgrades()
+ {
+ return false;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function concern()
+ {
+ return $this->concern;
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function getDoctrineMigrations()
+ {
+ return [];
+ }
+
+ /**
+ * {@inheritdoc}
+ */
+ public function apply(base $appbox, Application $app)
+ {
+ $main = $app['conf']->get(['main']);
+ if (isset($main['static-file'])) {
+ unset($main['static-file']);
+ }
+ $app['conf']->set(['main'], $main);
+
+ return true;
+ }
+}
diff --git a/lib/classes/patch/390alpha3a.php b/lib/classes/patch/390alpha3a.php
index 0a90796cf8..795dd21ed7 100644
--- a/lib/classes/patch/390alpha3a.php
+++ b/lib/classes/patch/390alpha3a.php
@@ -70,10 +70,10 @@ class patch_390alpha3a extends patchAbstract
$stmt->closeCursor();
$n = 0;
- $em = $app['EM'];
+ $em = $app['orm.em'];
foreach ($rs as $row) {
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
diff --git a/lib/classes/patch/390alpha4a.php b/lib/classes/patch/390alpha4a.php
index 341ae9b9f7..78703a1f85 100644
--- a/lib/classes/patch/390alpha4a.php
+++ b/lib/classes/patch/390alpha4a.php
@@ -70,14 +70,14 @@ class patch_390alpha4a extends patchAbstract
$stmt->closeCursor();
$n = 0;
- $em = $app['EM'];
+ $em = $app['orm.em'];
foreach ($rs as $row) {
if (substr($row['prop'], 0, 13) === "notification_") {
continue;
}
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
diff --git a/lib/classes/patch/390alpha5a.php b/lib/classes/patch/390alpha5a.php
index 85743d89ae..ffa5a19441 100644
--- a/lib/classes/patch/390alpha5a.php
+++ b/lib/classes/patch/390alpha5a.php
@@ -71,10 +71,10 @@ class patch_390alpha5a extends patchAbstract
$stmt->closeCursor();
$n = 0;
- $em = $app['EM'];
+ $em = $app['orm.em'];
foreach ($rs as $row) {
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
diff --git a/lib/classes/patch/390alpha6a.php b/lib/classes/patch/390alpha6a.php
index 86b2e0f57c..86a5ae7ec3 100644
--- a/lib/classes/patch/390alpha6a.php
+++ b/lib/classes/patch/390alpha6a.php
@@ -71,7 +71,7 @@ class patch_390alpha6a extends patchAbstract
$conn = $app['phraseanet.appbox']->get_connection();
- $em = $app['EM'];
+ $em = $app['orm.em'];
$em->getEventManager()->removeEventSubscriber(new TimestampableListener());
$sql = 'SELECT `id`, `crash`, `nbretry`, `mail`, `addr`, `ssl`,
@@ -93,7 +93,7 @@ class patch_390alpha6a extends patchAbstract
$n = 0;
foreach ($rs as $row) {
- if (null === $user = $this->loadUser($app['EM'], $row['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $row['usr_id'])) {
continue;
}
diff --git a/lib/classes/patch/390alpha7a.php b/lib/classes/patch/390alpha7a.php
index 15ca9e2f19..cba8798354 100644
--- a/lib/classes/patch/390alpha7a.php
+++ b/lib/classes/patch/390alpha7a.php
@@ -106,7 +106,7 @@ class patch_390alpha7a extends patchAbstract
$stmt->closeCursor();
$n = 0;
- $em = $app['EM'];
+ $em = $app['orm.em'];
$fpSql = 'SELECT id, usr_id, owner, created_on FROM feed_publishers WHERE feed_id = :feed_id;';
$fpStmt = $conn->prepare($fpSql);
@@ -133,7 +133,7 @@ class patch_390alpha7a extends patchAbstract
$fpRes = $fpStmt->fetchAll(\PDO::FETCH_ASSOC);
foreach ($fpRes as $fpRow) {
- if (null === $user = $this->loadUser($app['EM'], $fpRow['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $fpRow['usr_id'])) {
continue;
}
@@ -154,8 +154,8 @@ class patch_390alpha7a extends patchAbstract
$feedEntry->setPublisher($feedPublisher);
$feedEntry->setTitle($feRow['title']);
$feedEntry->setSubtitle($feRow['description']);
- $feedEntry->setAuthorName($feRow['author_name']);
- $feedEntry->setAuthorEmail($feRow['author_email']);
+ $feedEntry->setAuthorName((string) $feRow['author_name']);
+ $feedEntry->setAuthorEmail((string) $feRow['author_email']);
$feedEntry->setCreatedOn(new \DateTime($feRow['created_on']));
$feedEntry->setUpdatedOn(new \DateTime($feRow['updated_on']));
@@ -181,7 +181,7 @@ class patch_390alpha7a extends patchAbstract
$ftRes = $ftStmt->fetchAll(\PDO::FETCH_ASSOC);
foreach ($ftRes as $ftRow) {
- if (null === $user = $this->loadUser($app['EM'], $ftRow['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $ftRow['usr_id'])) {
continue;
}
@@ -212,7 +212,7 @@ class patch_390alpha7a extends patchAbstract
$faRes = $faStmt->fetchAll(\PDO::FETCH_ASSOC);
foreach ($faRes as $faRow) {
- if (null === $user = $this->loadUser($app['EM'], $faRow['usr_id'])) {
+ if (null === $user = $this->loadUser($app['orm.em'], $faRow['usr_id'])) {
continue;
}
@@ -242,7 +242,7 @@ class patch_390alpha7a extends patchAbstract
$rsm = (new ResultSetMapping())->addScalarResult('Name', 'Name');
$backup = false;
- foreach ($app['EM']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
+ foreach ($app['orm.em']->createNativeQuery('SHOW TABLE STATUS', $rsm)->getResult() as $row) {
if ('feeds_backup' === $row['Name']) {
$backup = true;
break;
diff --git a/lib/classes/patch/390alpha8a.php b/lib/classes/patch/390alpha8a.php
index 307e866ad0..d0e9b903be 100644
--- a/lib/classes/patch/390alpha8a.php
+++ b/lib/classes/patch/390alpha8a.php
@@ -91,9 +91,9 @@ class patch_390alpha8a extends patchAbstract
->setSettings($row['settings'])
->setStatus($row['active'] ? Task::STATUS_STARTED : Task::STATUS_STOPPED);
- $app['EM']->persist($task);
+ $app['orm.em']->persist($task);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
private function createJob(Application $app, $class)
diff --git a/lib/classes/patch/390alpha9a.php b/lib/classes/patch/390alpha9a.php
index d69133fe3e..3c834a6821 100644
--- a/lib/classes/patch/390alpha9a.php
+++ b/lib/classes/patch/390alpha9a.php
@@ -80,14 +80,14 @@ class patch_390alpha9a extends patchAbstract
private function updateDoctrineUsers(Application $app)
{
$dql = 'SELECT u FROM Phraseanet:User u WHERE u.locale IS NOT NULL';
- $users = $app['EM']->createQuery($dql)->getResult();
+ $users = $app['orm.em']->createQuery($dql)->getResult();
foreach ($users as $user) {
$user->setLocale($this->extractLocale($user->getLocale()));
- $app['EM']->persist($user);
+ $app['orm.em']->persist($user);
}
- $app['EM']->flush();
+ $app['orm.em']->flush();
}
private function updateDataboxPrefs(\appbox $appbox)
diff --git a/lib/classes/patchthesaurus/100.php b/lib/classes/patchthesaurus/100.php
index 09934b8b35..b017981886 100644
--- a/lib/classes/patchthesaurus/100.php
+++ b/lib/classes/patchthesaurus/100.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patchthesaurus/200.php b/lib/classes/patchthesaurus/200.php
index ca6b3817b9..a69df152ee 100644
--- a/lib/classes/patchthesaurus/200.php
+++ b/lib/classes/patchthesaurus/200.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patchthesaurus/201.php b/lib/classes/patchthesaurus/201.php
index 95eb641d1d..b2f4006b24 100644
--- a/lib/classes/patchthesaurus/201.php
+++ b/lib/classes/patchthesaurus/201.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patchthesaurus/202.php b/lib/classes/patchthesaurus/202.php
index 50916c81c6..5a46db03ab 100644
--- a/lib/classes/patchthesaurus/202.php
+++ b/lib/classes/patchthesaurus/202.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patchthesaurus/203.php b/lib/classes/patchthesaurus/203.php
index 6d67ce10f2..ecd88defb7 100644
--- a/lib/classes/patchthesaurus/203.php
+++ b/lib/classes/patchthesaurus/203.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/patchthesaurus/204.php b/lib/classes/patchthesaurus/204.php
index b0a6d547f2..881755ff33 100644
--- a/lib/classes/patchthesaurus/204.php
+++ b/lib/classes/patchthesaurus/204.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/phrasea.php b/lib/classes/phrasea.php
index 408d294a04..7384c259d1 100644
--- a/lib/classes/phrasea.php
+++ b/lib/classes/phrasea.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/queries.php b/lib/classes/queries.php
index 5927b1ddd2..84588fd1c9 100644
--- a/lib/classes/queries.php
+++ b/lib/classes/queries.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/random.php b/lib/classes/random.php
index 9b6ea4fa29..19431bf7a4 100644
--- a/lib/classes/random.php
+++ b/lib/classes/random.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/record/adapter.php b/lib/classes/record/adapter.php
index 6ba47873ec..e37dfaf775 100644
--- a/lib/classes/record/adapter.php
+++ b/lib/classes/record/adapter.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -315,6 +315,32 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
return $this;
}
+ public function set_mime($mime)
+ {
+ $old_mime = $this->get_mime();
+
+ // see http://lists.w3.org/Archives/Public/xml-dist-app/2003Jul/0064.html
+ if (!preg_match("/^[a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]+\/[a-zA-Z0-9!#$%^&\*_\-\+{}\|'.`~]+$/", $mime)) {
+ throw new \Exception(sprintf('Unrecognized mime type %s', $mime));
+ }
+
+ $connection = connection::getPDOConnection($this->app, $this->get_sbas_id());
+
+ $sql = 'UPDATE record SET mime = :mime WHERE record_id = :record_id';
+ $stmt = $connection->prepare($sql);
+ $stmt->execute(array(':mime' => $mime, ':record_id' => $this->get_record_id()));
+ $stmt->closeCursor();
+
+ if ($mime !== $old_mime) {
+ $this->rebuild_subdefs();
+ }
+
+ $this->mime = $mime;
+ $this->delete_data_from_cache();
+
+ return $this;
+ }
+
/**
* Return true if the record is a grouping
*
@@ -619,10 +645,6 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
continue;
}
- if ($subdef->is_substituted()) {
- continue;
- }
-
$subdefs[$subdef->get_name()] = $subdef;
}
@@ -911,6 +933,79 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
return $this->get_databox()->get_sbas_id();
}
+ public function substitute_subdef($name, MediaInterface $media, Application $app, $adapt=true)
+ {
+ $newfilename = $this->record_id . '_0_' . $name . '.' . $media->getFile()->getExtension();
+
+ if ($name == 'document') {
+ $baseprefs = $this->get_databox()->get_sxml_structure();
+
+ $pathhd = p4string::addEndSlash((string) ($baseprefs->path));
+
+ $filehd = $this->get_record_id() . "_document." . strtolower($media->getFile()->getExtension());
+ $pathhd = databox::dispatch($app['filesystem'], $pathhd);
+
+ $app['filesystem']->copy($media->getFile()->getRealPath(), $pathhd . $filehd, true);
+
+ $subdefFile = $pathhd . $filehd;
+
+ $meta_writable = true;
+ } else {
+ $type = $this->is_grouping() ? 'image' : $this->get_type();
+
+ $subdef_def = $this->get_databox()->get_subdef_structure()->get_subdef($type, $name);
+
+ if ($this->has_subdef($name) && $this->get_subdef($name)->is_physically_present()) {
+
+ $path_file_dest = $this->get_subdef($name)->get_pathfile();
+ $this->get_subdef($name)->remove_file();
+ $this->clearSubdefCache($name);
+ } else {
+ $path = databox::dispatch($app['filesystem'], $subdef_def->get_path());
+ $app['filesystem']->mkdir($path, 0750);
+ $path_file_dest = $path . $newfilename;
+ }
+
+ if($adapt) {
+ try {
+ $app['media-alchemyst']->turnInto(
+ $media->getFile()->getRealPath(),
+ $path_file_dest,
+ $subdef_def->getSpecs()
+ );
+ } catch (\MediaAlchemyst\Exception\ExceptionInterface $e) {
+ return $this;
+ }
+
+ $subdefFile = $path_file_dest;
+ }
+ else{
+ $app['filesystem']->copy($media->getFile()->getRealPath(), $path_file_dest);
+
+ $subdefFile = $path_file_dest;
+ }
+
+ $meta_writable = $subdef_def->meta_writeable();
+ }
+
+ $app['filesystem']->chmod($subdefFile, 0760);
+ $media = $app['mediavorus']->guess($subdefFile);
+ $subdef = media_subdef::create($app, $this, $name, $media);
+ $subdef->set_substituted(true);
+
+ $this->delete_data_from_cache(self::CACHE_SUBDEFS);
+
+ if ($meta_writable) {
+ $this->write_metas();
+ }
+
+ if ($name == 'document' && $adapt) {
+ $this->rebuild_subdefs();
+ }
+
+ return $this;
+ }
+
/**
*
* @param DOMDocument $dom_doc
@@ -1045,6 +1140,38 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
return $this;
}
+ public function get_missing_subdefs()
+ {
+ $databox = $this->get_databox();
+
+ try {
+ $this->get_hd_file();
+ } catch (\Exception $e) {
+ return array();
+ }
+
+ $subDefDefinitions = $databox->get_subdef_structure()->getSubdefGroup($this->get_type());
+ if (!$subDefDefinitions) {
+ return array();
+ }
+
+ $record = $this;
+ $wanted_subdefs = array_map(function($subDef) {
+ return $subDef->get_name();
+ }, array_filter($subDefDefinitions, function($subDef) use ($record) {
+ return !$record->has_subdef($subDef->get_name());
+ }));
+
+
+ $missing_subdefs = array_map(function($subDef) {
+ return $subDef->get_name();
+ }, array_filter($this->get_subdefs(), function($subdef) {
+ return !$subdef->is_physically_present();
+ }));
+
+ return array_values(array_merge($wanted_subdefs, $missing_subdefs));
+ }
+
/**
*
* @return record_adapter
@@ -1227,7 +1354,6 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
$record->delete_data_from_cache(\record_adapter::CACHE_SUBDEFS);
$record->insertTechnicalDatas($app['mediavorus']);
- $record->rebuild_subdefs();
self::dispatchCreatedEvent($app, $record);
@@ -1390,7 +1516,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
if (!$subdef->is_physically_present())
continue;
- if ($subdef->get_name() === 'thumbnail' && $this->app['phraseanet.static-file-factory']->isStaticFileModeEnabled()) {
+ if ($subdef->get_name() === 'thumbnail') {
$this->app['filesystem']->remove($this->app['phraseanet.thumb-symlinker']->getSymlinkPath($subdef->get_pathfile()));
}
@@ -1467,7 +1593,7 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
/* @var $repository Alchemy\Phrasea\Model\Repositories\OrderElementRepository */
foreach ($orderElementRepository->findBy(['recordId' => $this->get_record_id()]) as $order_element) {
if ($order_element->getSbasId($this->app) == $this->get_sbas_id()) {
- $this->app['EM']->remove($order_element);
+ $this->app['orm.em']->remove($order_element);
}
}
@@ -1475,10 +1601,10 @@ class record_adapter implements RecordInterface, cache_cacheableInterface
/* @var $repository Alchemy\Phrasea\Model\Repositories\BasketElementRepository */
foreach ($basketElementRepository->findElementsByRecord($this) as $basket_element) {
- $this->app['EM']->remove($basket_element);
+ $this->app['orm.em']->remove($basket_element);
}
- $this->app['EM']->flush();
+ $this->app['orm.em']->flush();
$this->app['filesystem']->remove($ftodel);
diff --git a/lib/classes/record/exportElement.php b/lib/classes/record/exportElement.php
index eee4b434dd..b05c270b2a 100644
--- a/lib/classes/record/exportElement.php
+++ b/lib/classes/record/exportElement.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/record/orderElement.php b/lib/classes/record/orderElement.php
index 50293eb1ff..fe65a39ed8 100644
--- a/lib/classes/record/orderElement.php
+++ b/lib/classes/record/orderElement.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/record/preview.php b/lib/classes/record/preview.php
index 9316a2034b..e552b68a23 100644
--- a/lib/classes/record/preview.php
+++ b/lib/classes/record/preview.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/recordutils/image.php b/lib/classes/recordutils/image.php
index 56f259f874..46706b2a0b 100644
--- a/lib/classes/recordutils/image.php
+++ b/lib/classes/recordutils/image.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/set/abstract.php b/lib/classes/set/abstract.php
index 58cdf24dc9..17ab3a0688 100644
--- a/lib/classes/set/abstract.php
+++ b/lib/classes/set/abstract.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/set/export.php b/lib/classes/set/export.php
index 6ba4432a2f..3a258a5857 100644
--- a/lib/classes/set/export.php
+++ b/lib/classes/set/export.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/set/exportftp.php b/lib/classes/set/exportftp.php
index b396955ee6..0539bedf41 100644
--- a/lib/classes/set/exportftp.php
+++ b/lib/classes/set/exportftp.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
@@ -69,7 +69,7 @@ class set_exportftp extends set_export
->setLogin($login)
->setAddr($host);
- $this->app['EM']->persist($export);
+ $this->app['orm.em']->persist($export);
foreach ($this->list['files'] as $file) {
foreach ($file['subdefs'] as $subdef => $properties) {
@@ -86,11 +86,11 @@ class set_exportftp extends set_export
->setSubdef($subdef);
$export->addElement($element);
- $this->app['EM']->persist($element);
+ $this->app['orm.em']->persist($element);
}
}
- $this->app['EM']->flush();
+ $this->app['orm.em']->flush();
return true;
}
diff --git a/lib/classes/set/selection.php b/lib/classes/set/selection.php
index bb8a330f60..1e44a5dfa6 100644
--- a/lib/classes/set/selection.php
+++ b/lib/classes/set/selection.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/setup.php b/lib/classes/setup.php
index 2642e7d01b..0ecd2f933c 100644
--- a/lib/classes/setup.php
+++ b/lib/classes/setup.php
@@ -2,7 +2,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/thesaurus/xpath.php b/lib/classes/thesaurus/xpath.php
index c0cd41a854..1f37d61774 100644
--- a/lib/classes/thesaurus/xpath.php
+++ b/lib/classes/thesaurus/xpath.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/classes/unicode.php b/lib/classes/unicode.php
index 2e5e990f7c..7eb4b19ab6 100644
--- a/lib/classes/unicode.php
+++ b/lib/classes/unicode.php
@@ -3,7 +3,7 @@
/*
* This file is part of Phraseanet
*
- * (c) 2005-2014 Alchemy
+ * (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
diff --git a/lib/conf.d/bases_structure.xml b/lib/conf.d/bases_structure.xml
index d1b9d8f122..f2a36d7f61 100644
--- a/lib/conf.d/bases_structure.xml
+++ b/lib/conf.d/bases_structure.xml
@@ -3817,68 +3817,6 @@
InnoDB
-
-
-
- date
- datetime
-
-
- 0000-00-00 00:00:00
-
-
-
- record_id
- int(11) unsigned
-
-
-
-
-
-
- site_id
- varchar(256)
-
-
-
-
-
-
- counter
- int(11) unsigned
-
-
- 1
-
-
-
-
-
- date
- INDEX
-
- date
-
-
-
- record_id
- INDEX
-
- record_id
-
-
-
- site_id
- INDEX
-
- record_id
-
-
-
- InnoDB
-
-
-
diff --git a/lib/conf.d/configuration.yml b/lib/conf.d/configuration.yml
index 5f9bf40a38..120bd5df31 100644
--- a/lib/conf.d/configuration.yml
+++ b/lib/conf.d/configuration.yml
@@ -206,10 +206,6 @@ session:
idle: 0
# 1 week
lifetime: 604800
-static-file:
- enabled: false
- type: nginx
- symlink-directory: ''
crossdomain:
allow-access-from:
-
diff --git a/lib/conf.d/data_templates/DublinCore.xml b/lib/conf.d/data_templates/DublinCore.xml
new file mode 100644
index 0000000000..5de4f32945
--- /dev/null
+++ b/lib/conf.d/data_templates/DublinCore.xml
@@ -0,0 +1,221 @@
+
+
+ {{datapathnoweb}}{{basename}}/documents
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 1024
+ resample
+ 72
+ no
+ 75
+ yes
+ screen
+ image
+ Prévisualisation
+ Preview
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 240
+ resample
+ 72
+ yes
+ 75
+ no
+ screen
+ image
+ Vignette
+ Thumbnail
+
+
+ 480
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+ Prévisualisation Mobile
+ Mobile Preview
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+ Vignette mobile
+ Mobile Thumbnail
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 240
+ screen
+ image
+ no
+ Vignette
+ Thumbnail
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 240
+ gif
+ 150
+ screen
+ no
+ Animation GIF
+ GIF Animation
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 748
+ video
+ yes
+ libfaac
+ libx264
+ screen
+ 1000
+ 128
+ 48000
+ 25
+ 25
+ Prévisualisation
+ Preview
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 748
+ video
+ screen
+ 1000
+ 128
+ 48000
+ libvorbis
+ 25
+ 25
+ libvpx
+ Prévisualisation WebM
+ WebM Preview
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 240
+ screen
+ no
+ Vignette
+ Thumbnail
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ audio
+ yes
+ 128
+ 48000
+ screen
+ Prévisualisation
+ Preview
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ audio
+ handheld
+ Prévisualisation Mobile
+ Mobile Preview
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ resample
+ 72
+ 240
+ no
+ screen
+ Vignette
+ Thumbnail
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ flexpaper
+ no
+ screen
+ Prévisualisation
+ Preview
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 240
+ no
+ resample
+ 72
+ screen
+ Vignette
+ Thumbnail
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 800
+ no
+ resample
+ 72
+ screen
+ Prévisualisation
+ Preview
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+
+ Nicht gefüllt
+ Caption not filled
+ Média non renseigné
+
+ Gefüllt
+ Caption filled
+ Média renseigné
+
+
+
+
diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml
index 57ec7f9043..a9b2e33460 100644
--- a/lib/conf.d/data_templates/en-simple.xml
+++ b/lib/conf.d/data_templates/en-simple.xml
@@ -5,7 +5,7 @@
{{datapathnoweb}}{{basename}}/subdefs
- 800
+ 1024
resample
72
no
@@ -18,7 +18,7 @@
{{datapathnoweb}}{{basename}}/subdefs
- 200
+ 240
resample
72
yes
@@ -26,7 +26,7 @@
no
screen
image
- Imagette
+ Vignette
Thumbnail
@@ -50,145 +50,82 @@
image
no
handheld
- Imagette mobile
+ Vignette mobile
Mobile Thumbnail
-
+
{{datapathnoweb}}{{basename}}/subdefs
- video
- 300
- 2
- 25
- 480
- 15
- handheld
- libvpx
- libvorbis
- Prévisualisation mobile WebM
- WebM mobile Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
- 300
- 2
- 25
- 480
- 15
- handheld
- libtheora
- libvorbis
- Prévisualisation mobile Ogg
- Ogg mobile Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
- 300
- 2
- 25
- 480
- 15
- handheld
- libfaac
- libx264
- Prévisualisation X264
- X264 Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
+ 240
screen
- 1000
- 1
- libvorbis
- 25
- 800
- 15
- libvpx
- Prévisualisation WebM
- WebM Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
- screen
- 1000
- 1
- libvorbis
- 25
- 800
- 15
- libtheora
- Prévisualisation Ogg
- Ogg Preview
-
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
+ no
+ Vignette
+ Thumbnail
-
+
{{datapathnoweb}}{{basename}}/subdefs
- 800
- video
- yes
- libfaac
- libx264
- screen
- 1000
- 8
- 15
- Prévisualisation
- Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- 200
+ 240
gif
- 500
+ 150
screen
no
Animation GIF
GIF Animation
-
+
{{datapathnoweb}}{{basename}}/subdefs
- 200
+ 748
+ video
+ yes
+ libfaac
+ libx264
screen
- image
- no
- Imagette
- Thumbnail
+ 1000
+ 128
+ 48000
+ 25
+ 25
+ Prévisualisation
+ Preview
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 748
+ video
+ screen
+ 1000
+ 128
+ 48000
+ libvorbis
+ 25
+ 25
+ libvpx
+ Prévisualisation WebM
+ WebM Preview
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 240
+ screen
+ no
+ Vignette
+ Thumbnail
+
{{datapathnoweb}}{{basename}}/subdefs
audio
yes
+ 128
+ 48000
screen
Prévisualisation
Preview
-
- {{datapathnoweb}}{{basename}}/subdefs
- image
- 200
- screen
- no
- Imagette
- Thumbnail
-
{{datapathnoweb}}{{basename}}/subdefs
audio
@@ -196,20 +133,19 @@
Prévisualisation Mobile
Mobile Preview
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
-
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ resample
+ 72
+ 240
+ no
+ screen
+ Vignette
+ Thumbnail
+
{{datapathnoweb}}{{basename}}/subdefs
flexpaper
@@ -218,38 +154,19 @@
Prévisualisation
Preview
+
+
{{datapathnoweb}}{{basename}}/subdefs
image
+ 240
+ no
resample
72
- 200
- no
screen
- Imagette
+ Vignette
Thumbnail
-
- {{datapathnoweb}}{{basename}}/subdefs
- flexpaper
- handheld
- Prévisualisation Mobile
- Mobile Preview
-
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
-
-
-
{{datapathnoweb}}{{basename}}/subdefs
image
@@ -261,41 +178,6 @@
Prévisualisation
Preview
-
- {{datapathnoweb}}{{basename}}/subdefs
- image
- 200
- no
- resample
- 72
- screen
- Imagette
- Thumbnail
-
-
- 480
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Prévisualisation Mobile
- Mobile Preview
-
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
-
diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml
index a53633cff6..550b8adac8 100644
--- a/lib/conf.d/data_templates/fr-simple.xml
+++ b/lib/conf.d/data_templates/fr-simple.xml
@@ -5,7 +5,7 @@
{{datapathnoweb}}{{basename}}/subdefs
- 800
+ 1024
resample
72
no
@@ -18,7 +18,7 @@
{{datapathnoweb}}{{basename}}/subdefs
- 200
+ 240
resample
72
yes
@@ -26,7 +26,7 @@
no
screen
image
- Imagette
+ Vignette
Thumbnail
@@ -50,145 +50,82 @@
image
no
handheld
- Imagette mobile
+ Vignette mobile
Mobile Thumbnail
-
+
{{datapathnoweb}}{{basename}}/subdefs
- video
- 300
- 2
- 25
- 480
- 15
- handheld
- libvpx
- libvorbis
- Prévisualisation mobile WebM
- WebM mobile Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
- 300
- 2
- 25
- 480
- 15
- handheld
- libtheora
- libvorbis
- Prévisualisation mobile Ogg
- Ogg mobile Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
- 300
- 2
- 25
- 480
- 15
- handheld
- libfaac
- libx264
- Prévisualisation X264
- X264 Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
+ 240
screen
- 1000
- 1
- libvorbis
- 25
- 800
- 15
- libvpx
- Prévisualisation WebM
- WebM Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- video
- screen
- 1000
- 1
- libvorbis
- 25
- 800
- 15
- libtheora
- Prévisualisation Ogg
- Ogg Preview
-
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
+ no
+ Vignette
+ Thumbnail
-
+
{{datapathnoweb}}{{basename}}/subdefs
- 800
- video
- yes
- libfaac
- libx264
- screen
- 1000
- 8
- 15
- Prévisualisation
- Preview
-
-
- {{datapathnoweb}}{{basename}}/subdefs
- 200
+ 240
gif
- 500
+ 150
screen
no
Animation GIF
GIF Animation
-
+
{{datapathnoweb}}{{basename}}/subdefs
- 200
+ 748
+ video
+ yes
+ libfaac
+ libx264
screen
- image
- no
- Imagette
- Thumbnail
+ 1000
+ 128
+ 48000
+ 25
+ 25
+ Prévisualisation
+ Preview
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ 748
+ video
+ screen
+ 1000
+ 128
+ 48000
+ libvorbis
+ 25
+ 25
+ libvpx
+ Prévisualisation WebM
+ WebM Preview
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ 240
+ screen
+ no
+ Vignette
+ Thumbnail
+
{{datapathnoweb}}{{basename}}/subdefs
audio
yes
+ 128
+ 48000
screen
Prévisualisation
Preview
-
- {{datapathnoweb}}{{basename}}/subdefs
- image
- 200
- screen
- no
- Imagette
- Thumbnail
-
{{datapathnoweb}}{{basename}}/subdefs
audio
@@ -196,20 +133,19 @@
Prévisualisation Mobile
Mobile Preview
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
-
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ resample
+ 72
+ 240
+ no
+ screen
+ Vignette
+ Thumbnail
+
{{datapathnoweb}}{{basename}}/subdefs
flexpaper
@@ -218,38 +154,19 @@
Prévisualisation
Preview
+
+
{{datapathnoweb}}{{basename}}/subdefs
image
+ 240
+ no
resample
72
- 200
- no
screen
- Imagette
+ Vignette
Thumbnail
-
- {{datapathnoweb}}{{basename}}/subdefs
- flexpaper
- handheld
- Prévisualisation Mobile
- Mobile Preview
-
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
-
-
-
{{datapathnoweb}}{{basename}}/subdefs
image
@@ -261,41 +178,6 @@
Prévisualisation
Preview
-
- {{datapathnoweb}}{{basename}}/subdefs
- image
- 200
- no
- resample
- 72
- screen
- Imagette
- Thumbnail
-
-
- 480
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Prévisualisation Mobile
- Mobile Preview
-
-
- 150
- 72
- yes
- 75
- {{datapathnoweb}}{{basename}}/subdefs
- image
- no
- handheld
- Imagette mobile
- Mobile Thumbnail
-
diff --git a/lib/conf.d/minifyGroupsConfig.php b/lib/conf.d/minifyGroupsConfig.php
index 40f5711ee9..05d1a69a4f 100644
--- a/lib/conf.d/minifyGroupsConfig.php
+++ b/lib/conf.d/minifyGroupsConfig.php
@@ -13,13 +13,14 @@ $groups = [
'//include/jslibs/jquery.contextmenu_scroll.js',
'//assets/jquery.cookie/jquery.cookie.js',
'//include/jquery.common.js',
+ '//assets/requirejs/require.js',
'//skins/account/account.js'
],
'authentication_css' => [
'//assets/normalize-css/normalize.css',
'//assets/build/login.css',
'//assets/font-awesome/css/font-awesome.css',
- '//assets/jquery.ui/themes/base/jquery.ui.autocomplete.css'
+ '//assets/jquery.ui/jquery.ui.autocomplete.css'
],
'authentication' => [
'//assets/modernizr/modernizr.js',
@@ -47,9 +48,7 @@ $groups = [
, '//assets/jquery.treeview/jquery.treeview.js'
, '//assets/jquery.ui/i18n/jquery-ui-i18n.js'
, '//include/jquery.kb-event.js'
- , '//skins/admin/users.js'
, '//skins/admin/template-dialogs.js'
- , '//skins/admin/editusers.js'
, '//include/jquery.common.js'
, '//include/jquery.tooltip.js'
, '//skins/prod/jquery.Dialog.js'
@@ -57,7 +56,7 @@ $groups = [
, '//assets/blueimp-load-image/load-image.js'
, '//assets/jquery-file-upload/jquery.iframe-transport.js'
, '//assets/jquery-file-upload/jquery.fileupload.js'
- , '//assets/autobahnjs/autobahn.js'
+ , '//assets/autobahn/autobahn.js'
],
'report' => [
'//assets/jquery.ui/i18n/jquery-ui-i18n.js'
diff --git a/phpunit.xml.dist b/phpunit.xml.dist
index 2706ce9449..7c9878e721 100644
--- a/phpunit.xml.dist
+++ b/phpunit.xml.dist
@@ -29,10 +29,8 @@
-
+
+
+
diff --git a/resources/vagrant/config/bower/.bowerrc b/resources/vagrant/config/bower/.bowerrc
deleted file mode 100644
index f303864386..0000000000
--- a/resources/vagrant/config/bower/.bowerrc
+++ /dev/null
@@ -1,4 +0,0 @@
-{
- "directory": "www/assets",
- "interactive": false
-}
diff --git a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml
index 4b6d428f25..59c1bb2d78 100644
--- a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml
+++ b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/config.yaml
@@ -5,7 +5,7 @@ vagrantfile-local:
box: puphpet/debian75-x64
box_url: puphpet/debian75-x64
hostname: phraseanet-php54-nginx
- memory: '2048'
+ memory: '4096'
cpus: '2'
chosen_provider: virtualbox
network:
@@ -117,6 +117,8 @@ server:
- libopencore-amrwb-dev
- libxvidcore-dev
- libdc1394-22-dev
+ - memcached
+ - zip
dot_files:
-
bash_aliases: null
diff --git a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup
index a413eae0c5..598dcb2c7d 100644
--- a/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup
+++ b/resources/vagrant/vms/phraseanet-php54-nginx/puphpet/files/exec-once/setup
@@ -5,15 +5,15 @@ sudo sh -c 'echo "Europe/Paris" > /etc/timezone'
sudo dpkg-reconfigure -f noninteractive tzdata
# locales
-sudo sh -c "echo 'LANGUAGE=fr_FR.UTF-8' >> /etc/environment"
-sudo sh -c "echo 'LANG=fr_FR.UTF-8' >> /etc/environment"
-sudo sh -c "echo 'LC_ALL=fr_FR.UTF-8' >> /etc/environment"
+sudo sh -c "echo 'LANGUAGE=en_GB.UTF-8' >> /etc/environment"
+sudo sh -c "echo 'LANG=en_GB.UTF-8' >> /etc/environment"
+sudo sh -c "echo 'LC_ALL=en_GB.UTF-8' >> /etc/environment"
sudo sh -c 'echo "en_GB.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "de_DE.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "es_ES.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "fr_FR.UTF-8 UTF-8" >> /etc/locale.gen'
sudo sh -c 'echo "nl_NL.UTF-8 UTF-8" >> /etc/locale.gen'
-sudo locale-gen en_US en_US.UTF-8 en_GB en_GB.UTF-8 fr_FR fr_FR.UTF-8 de_DE de_DE.UTF-8 nl_NL nl_NL.UTF-8
+sudo locale-gen en_GB en_GB.UTF-8 fr_FR fr_FR.UTF-8 de_DE de_DE.UTF-8 nl_NL nl_NL.UTF-8
sudo dpkg-reconfigure -f noninteractive locales
#ffmpeg
@@ -75,22 +75,6 @@ sudo npm install -g grunt-cli
sudo npm install -g bower
sudo npm install -g uglify-js
-# python tools
-sudo easy_install -U taschenmesser scour boto
-
-# closure compiler
-cd /tmp
-wget –quiet http://dl.google.com/closure-compiler/compiler-latest.zip
-unzip compiler-latest.zip -d closure
-mv /tmp/closure /home/vagrant
-sudo sh -c "echo 'JS_COMPILER=/home/vagrant/closure/compiler.jar' >> /etc/environment"
-export JS_COMPILER=/home/vagrant/closure/compiler.jar
-sudo chown -R vagrant: /home/vagrant/closure
-
-# java
-sudo sh -c "echo 'JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre/' >> /etc/environment"
-export JAVA_HOME=/usr/lib/jvm/java-7-openjdk-amd64/jre/
-
#twig
cd /tmp
git clone https://github.com/fabpot/Twig.git
@@ -161,16 +145,12 @@ then
#copy configuration template
mv /var/www/phraseanet/lib/conf.d/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml.bkp
cp /vagrant/resources/vagrant/config/phraseanet/configuration.yml /var/www/phraseanet/lib/conf.d/configuration.yml
- mv /var/www/phraseanet/.bowerrc /var/www/phraseanet/.bowerrc.bkp
- cp /vagrant/resources/vagrant/config/bower/.bowerrc /var/www/phraseanet/.bowerrc
cd /var/www/phraseanet
sudo -u vagrant composer install -n --prefer-source --dev
sudo -u vagrant npm install
sudo -u vagrant grunt install-assets
sudo -u vagrant bin/developer assets:compile-less
sudo -u vagrant rm -f /var/www/phraseanet/lib/conf.d/configuration.yml
- rm -f /var/www/phraseanet/.bowerrc
- mv /www/phraseanet/.bowerrc.bkp /www/phraseanet/.bowerrc
mv /var/www/phraseanet/lib/conf.d/configuration.yml.bkp /var/www/phraseanet/lib/conf.d/configuration.yml
fi
@@ -183,5 +163,4 @@ sudo service nginx restart
sudo service iptables-persistent stop
# reload bash
-source ~/.bashrc
-
+source ~/.bashrc
\ No newline at end of file
diff --git a/templates/mobile/common/index.html.twig b/templates/mobile/common/index.html.twig
index 834a332023..f8fb149416 100644
--- a/templates/mobile/common/index.html.twig
+++ b/templates/mobile/common/index.html.twig
@@ -6,9 +6,9 @@
{{ app['conf'].get(['registry', 'general', 'title']) }} - {{ module_name }}
-
+
-
+
+
+ {% if step %}
+
+
+ {% endif %}
{% endblock %}
{% block javascript %}
@@ -114,18 +150,32 @@
{% endblock %}
{% block content %}
- {% set search_datas = module_prod.get_search_datas() %}
+
Phraseanet
{{ 'Chargement' | trans }}
-
+ {% if app.flash('client_deprecated') %}
+
+
+
+
{{ 'You have been redirected to production application.'|trans }}
+
+
+
+ {% endif %}
+
{% set ratio = app['settings'].getUserSetting(app['authentication'].getUser(), 'search_window') %}
{% if ratio == 0 %}
{% set ratio = '0.333' %}
@@ -155,12 +205,12 @@
{% endif %}
-
+
-
+
{% import 'prod/WorkZone/Macros.html.twig' as WorkZoneMacros %}
{{WorkZoneMacros.make_bloc(app, WorkZone)}}
@@ -283,24 +333,24 @@
+
-