PHRAS-504 #time 8h

fix: prod / cr-lf in metadata is ok for aggregate  filter
cr,lf,crlf are normalized
- getting field values from recordadapter
- during es indexation (direct sql read in metadata...)
- before querying
This commit is contained in:
Jean-Yves Gaulier
2015-07-13 17:08:36 +02:00
parent 85283c1b90
commit d012978508
13 changed files with 254 additions and 179 deletions

211
composer.lock generated
View File

@@ -1,7 +1,7 @@
{ {
"_readme": [ "_readme": [
"This file locks the dependencies of your project to a known state", "This file locks the dependencies of your project to a known state",
"Read more about it at https://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file", "Read more about it at http://getcomposer.org/doc/01-basic-usage.md#composer-lock-the-lock-file",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"hash": "38d3c53332f97c2b8c434b28cd18402f", "hash": "38d3c53332f97c2b8c434b28cd18402f",
@@ -14,6 +14,12 @@
"url": "https://github.com/alchemy-fr/tcpdf-clone.git", "url": "https://github.com/alchemy-fr/tcpdf-clone.git",
"reference": "2ba0248a7187f1626df6c128750650416267f0e7" "reference": "2ba0248a7187f1626df6c128750650416267f0e7"
}, },
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/tcpdf-clone/zipball/2ba0248a7187f1626df6c128750650416267f0e7",
"reference": "2ba0248a7187f1626df6c128750650416267f0e7",
"shasum": ""
},
"require": { "require": {
"php": ">=5.3.0" "php": ">=5.3.0"
}, },
@@ -60,6 +66,10 @@
"qrcode", "qrcode",
"tcpdf" "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" "time": "2013-10-13 16:11:17"
}, },
{ {
@@ -103,7 +113,7 @@
"homepage": "http://www.lickmychip.com/" "homepage": "http://www.lickmychip.com/"
}, },
{ {
"name": "Nicolas Le Goff", "name": "nlegoff",
"email": "legoff.n@gmail.com" "email": "legoff.n@gmail.com"
}, },
{ {
@@ -649,16 +659,16 @@
}, },
{ {
"name": "doctrine/annotations", "name": "doctrine/annotations",
"version": "v1.2.4", "version": "v1.2.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/annotations.git", "url": "https://github.com/doctrine/annotations.git",
"reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e" "reference": "f4a91702ca3cd2e568c3736aa031ed00c3752af4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/annotations/zipball/b5202eb9e83f8db52e0e58867e0a46e63be8332e", "url": "https://api.github.com/repos/doctrine/annotations/zipball/f4a91702ca3cd2e568c3736aa031ed00c3752af4",
"reference": "b5202eb9e83f8db52e0e58867e0a46e63be8332e", "reference": "f4a91702ca3cd2e568c3736aa031ed00c3752af4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -713,7 +723,7 @@
"docblock", "docblock",
"parser" "parser"
], ],
"time": "2014-12-23 22:40:37" "time": "2015-06-17 12:21:22"
}, },
{ {
"name": "doctrine/cache", "name": "doctrine/cache",
@@ -1114,27 +1124,26 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/migrations.git", "url": "https://github.com/doctrine/migrations.git",
"reference": "67f02686c6c779ae50489728b91026bc8199720c" "reference": "78954cce4962a4655ff47c0751eb78021fbaf2cc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/migrations/zipball/70c580174e4e16a79296a02256fb40a34192731c", "url": "https://api.github.com/repos/doctrine/migrations/zipball/78954cce4962a4655ff47c0751eb78021fbaf2cc",
"reference": "67f02686c6c779ae50489728b91026bc8199720c", "reference": "78954cce4962a4655ff47c0751eb78021fbaf2cc",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"doctrine/dbal": "~2.0", "doctrine/dbal": "~2.2",
"php": ">=5.3.2", "php": ">=5.4.0",
"symfony/console": "~2.3", "symfony/console": "~2.3",
"symfony/yaml": "~2.3" "symfony/yaml": "~2.3"
}, },
"conflict": {
"doctrine/orm": "<2.4"
},
"require-dev": { "require-dev": {
"doctrine/coding-standard": "dev-master", "doctrine/coding-standard": "dev-master",
"doctrine/orm": "2.*", "doctrine/orm": "2.*",
"phpunit/phpunit": "~4.0", "johnkary/phpunit-speedtrap": "~1.0@dev",
"mockery/mockery": "^0.9.4",
"phpunit/phpunit": "~4.7",
"satooshi/php-coveralls": "0.6.*" "satooshi/php-coveralls": "0.6.*"
}, },
"suggest": { "suggest": {
@@ -1171,7 +1180,7 @@
"database", "database",
"migrations" "migrations"
], ],
"time": "2015-06-01 21:18:20" "time": "2015-07-05 21:24:36"
}, },
{ {
"name": "doctrine/orm", "name": "doctrine/orm",
@@ -1251,12 +1260,12 @@
"version": "v1.1.0", "version": "v1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/elastic/elasticsearch-php.git", "url": "https://github.com/elasticsearch/elasticsearch-php.git",
"reference": "fd304b1c12778c9eab9b1c1a9e07d791f40bd56d" "reference": "fd304b1c12778c9eab9b1c1a9e07d791f40bd56d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/elastic/elasticsearch-php/zipball/fd304b1c12778c9eab9b1c1a9e07d791f40bd56d", "url": "https://api.github.com/repos/elasticsearch/elasticsearch-php/zipball/fd304b1c12778c9eab9b1c1a9e07d791f40bd56d",
"reference": "fd304b1c12778c9eab9b1c1a9e07d791f40bd56d", "reference": "fd304b1c12778c9eab9b1c1a9e07d791f40bd56d",
"shasum": "" "shasum": ""
}, },
@@ -1309,12 +1318,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/igorw/evenement.git", "url": "https://github.com/igorw/evenement.git",
"reference": "v1.0.0" "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/igorw/evenement/zipball/fa966683e7df3e5dd5929d984a44abfbd6bafe8d", "url": "https://api.github.com/repos/igorw/evenement/zipball/fa966683e7df3e5dd5929d984a44abfbd6bafe8d",
"reference": "v1.0.0", "reference": "fa966683e7df3e5dd5929d984a44abfbd6bafe8d",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1341,7 +1350,7 @@
"keywords": [ "keywords": [
"event-dispatcher" "event-dispatcher"
], ],
"time": "2012-05-30 08:01:08" "time": "2012-05-30 15:01:08"
}, },
{ {
"name": "facebook/php-sdk", "name": "facebook/php-sdk",
@@ -1387,20 +1396,21 @@
"facebook", "facebook",
"sdk" "sdk"
], ],
"abandoned": "facebook/php-sdk-v4",
"time": "2013-11-19 23:11:14" "time": "2013-11-19 23:11:14"
}, },
{ {
"name": "firebase/php-jwt", "name": "firebase/php-jwt",
"version": "v2.1.0", "version": "v2.2.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/firebase/php-jwt.git", "url": "https://github.com/firebase/php-jwt.git",
"reference": "fb219727e199dd80a72d5274ebb5c8b24d58dd9b" "reference": "e0a75bfb6413f22092c99b70f310ccb2cca3efa5"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/firebase/php-jwt/zipball/fb219727e199dd80a72d5274ebb5c8b24d58dd9b", "url": "https://api.github.com/repos/firebase/php-jwt/zipball/e0a75bfb6413f22092c99b70f310ccb2cca3efa5",
"reference": "fb219727e199dd80a72d5274ebb5c8b24d58dd9b", "reference": "e0a75bfb6413f22092c99b70f310ccb2cca3efa5",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1431,7 +1441,7 @@
], ],
"description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.", "description": "A simple library to encode and decode JSON Web Tokens (JWT) in PHP. Should conform to the current spec.",
"homepage": "https://github.com/firebase/php-jwt", "homepage": "https://github.com/firebase/php-jwt",
"time": "2015-05-20 19:16:04" "time": "2015-06-22 23:26:39"
}, },
{ {
"name": "gedmo/doctrine-extensions", "name": "gedmo/doctrine-extensions",
@@ -1517,12 +1527,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/goodby/csv.git", "url": "https://github.com/goodby/csv.git",
"reference": "6760826116c9a9552a6481839c8c40ad134aab98" "reference": "e71217b8d6110f3d1ac3784ef9b8a2383c3398b9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/goodby/csv/zipball/e71217b8d6110f3d1ac3784ef9b8a2383c3398b9", "url": "https://api.github.com/repos/goodby/csv/zipball/e71217b8d6110f3d1ac3784ef9b8a2383c3398b9",
"reference": "6760826116c9a9552a6481839c8c40ad134aab98", "reference": "e71217b8d6110f3d1ac3784ef9b8a2383c3398b9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1566,7 +1576,7 @@
"export", "export",
"import" "import"
], ],
"time": "2015-05-09 07:14:19" "time": "2015-06-29 10:28:19"
}, },
{ {
"name": "guzzle/guzzle", "name": "guzzle/guzzle",
@@ -1817,16 +1827,16 @@
}, },
{ {
"name": "hoa/core", "name": "hoa/core",
"version": "2.15.06.02", "version": "2.15.07.07",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/hoaproject/Core.git", "url": "https://github.com/hoaproject/Core.git",
"reference": "1ebc1c810d59511c215e79a8b6ef33cbd0ec7d91" "reference": "df1f75e6a98d52b879bf36bc1ea8744433458f09"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/hoaproject/Core/zipball/1ebc1c810d59511c215e79a8b6ef33cbd0ec7d91", "url": "https://api.github.com/repos/hoaproject/Core/zipball/df1f75e6a98d52b879bf36bc1ea8744433458f09",
"reference": "1ebc1c810d59511c215e79a8b6ef33cbd0ec7d91", "reference": "df1f75e6a98d52b879bf36bc1ea8744433458f09",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -1885,7 +1895,7 @@
"parameter", "parameter",
"protocol" "protocol"
], ],
"time": "2015-06-02 06:51:41" "time": "2015-07-07 13:18:26"
}, },
{ {
"name": "hoa/dispatcher", "name": "hoa/dispatcher",
@@ -2832,16 +2842,16 @@
}, },
{ {
"name": "justinrainbow/json-schema", "name": "justinrainbow/json-schema",
"version": "1.4.2", "version": "1.4.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/justinrainbow/json-schema.git", "url": "https://github.com/justinrainbow/json-schema.git",
"reference": "7dfe4f1db8a62be3dd35710efce663537d515653" "reference": "44adc6f25592c6990409607c95537f577861f9b1"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/7dfe4f1db8a62be3dd35710efce663537d515653", "url": "https://api.github.com/repos/justinrainbow/json-schema/zipball/44adc6f25592c6990409607c95537f577861f9b1",
"reference": "7dfe4f1db8a62be3dd35710efce663537d515653", "reference": "44adc6f25592c6990409607c95537f577861f9b1",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -2894,7 +2904,7 @@
"json", "json",
"schema" "schema"
], ],
"time": "2015-06-14 20:01:28" "time": "2015-07-13 05:06:53"
}, },
{ {
"name": "media-alchemyst/media-alchemyst", "name": "media-alchemyst/media-alchemyst",
@@ -3027,16 +3037,16 @@
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
"version": "1.13.1", "version": "1.15.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Seldaek/monolog.git", "url": "https://github.com/Seldaek/monolog.git",
"reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac" "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Seldaek/monolog/zipball/c31a2c4e8db5da8b46c74cf275d7f109c0f249ac", "url": "https://api.github.com/repos/Seldaek/monolog/zipball/dc5150cc608f2334c72c3b6a553ec9668a4156b0",
"reference": "c31a2c4e8db5da8b46c74cf275d7f109c0f249ac", "reference": "dc5150cc608f2334c72c3b6a553ec9668a4156b0",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -3047,12 +3057,14 @@
"psr/log-implementation": "1.0.0" "psr/log-implementation": "1.0.0"
}, },
"require-dev": { "require-dev": {
"aws/aws-sdk-php": "~2.4, >2.4.8", "aws/aws-sdk-php": "^2.4.9",
"doctrine/couchdb": "~1.0@dev", "doctrine/couchdb": "~1.0@dev",
"graylog2/gelf-php": "~1.0", "graylog2/gelf-php": "~1.0",
"phpunit/phpunit": "~4.0", "php-console/php-console": "^3.1.3",
"raven/raven": "~0.5", "phpunit/phpunit": "~4.5",
"ruflin/elastica": "0.90.*", "phpunit/phpunit-mock-objects": "2.3.0",
"raven/raven": "~0.8",
"ruflin/elastica": ">=0.90 <3.0",
"swiftmailer/swiftmailer": "~5.3", "swiftmailer/swiftmailer": "~5.3",
"videlalvaro/php-amqplib": "~2.4" "videlalvaro/php-amqplib": "~2.4"
}, },
@@ -3062,6 +3074,7 @@
"ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)", "ext-amqp": "Allow sending log messages to an AMQP server (1.0+ required)",
"ext-mongo": "Allow sending log messages to a MongoDB server", "ext-mongo": "Allow sending log messages to a MongoDB server",
"graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server", "graylog2/gelf-php": "Allow sending log messages to a GrayLog2 server",
"php-console/php-console": "Allow sending log messages to Google Chrome",
"raven/raven": "Allow sending log messages to a Sentry server", "raven/raven": "Allow sending log messages to a Sentry server",
"rollbar/rollbar": "Allow sending log messages to Rollbar", "rollbar/rollbar": "Allow sending log messages to Rollbar",
"ruflin/elastica": "Allow sending log messages to an Elastic Search server", "ruflin/elastica": "Allow sending log messages to an Elastic Search server",
@@ -3070,7 +3083,7 @@
"type": "library", "type": "library",
"extra": { "extra": {
"branch-alias": { "branch-alias": {
"dev-master": "1.13.x-dev" "dev-master": "1.15.x-dev"
} }
}, },
"autoload": { "autoload": {
@@ -3096,7 +3109,7 @@
"logging", "logging",
"psr-3" "psr-3"
], ],
"time": "2015-03-09 09:58:04" "time": "2015-07-12 13:54:09"
}, },
{ {
"name": "mrclay/minify", "name": "mrclay/minify",
@@ -3128,7 +3141,7 @@
], ],
"authors": [ "authors": [
{ {
"name": "Stephen Clay", "name": "Steve Clay",
"email": "steve@mrclay.org", "email": "steve@mrclay.org",
"homepage": "http://www.mrclay.org/", "homepage": "http://www.mrclay.org/",
"role": "Developer" "role": "Developer"
@@ -3314,21 +3327,21 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/romainneutron/Imagine-Silex-Service-Provider.git", "url": "https://github.com/romainneutron/Imagine-Silex-Service-Provider.git",
"reference": "0.1.2" "reference": "a8a7862ae90419f2b23746cd8436c2310e4eb084"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/romainneutron/Imagine-Silex-Service-Provider/zipball/a8a7862ae90419f2b23746cd8436c2310e4eb084", "url": "https://api.github.com/repos/romainneutron/Imagine-Silex-Service-Provider/zipball/a8a7862ae90419f2b23746cd8436c2310e4eb084",
"reference": "0.1.2", "reference": "a8a7862ae90419f2b23746cd8436c2310e4eb084",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
"imagine/imagine": "*", "imagine/imagine": "*",
"php": ">=5.3.3", "php": ">=5.3.3",
"silex/silex": ">=1.0,<2.0" "silex/silex": "~1.0"
}, },
"require-dev": { "require-dev": {
"symfony/browser-kit": ">=2.0,<3.0" "symfony/browser-kit": "~2.0"
}, },
"type": "library", "type": "library",
"autoload": { "autoload": {
@@ -3942,12 +3955,12 @@
"version": "2.8.0", "version": "2.8.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/ramsey/rhumsaa-uuid.git", "url": "https://github.com/ramsey/uuid.git",
"reference": "cca98c652cac412c9c2f109c69e5532f313435fc" "reference": "cca98c652cac412c9c2f109c69e5532f313435fc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/ramsey/rhumsaa-uuid/zipball/cca98c652cac412c9c2f109c69e5532f313435fc", "url": "https://api.github.com/repos/ramsey/uuid/zipball/cca98c652cac412c9c2f109c69e5532f313435fc",
"reference": "cca98c652cac412c9c2f109c69e5532f313435fc", "reference": "cca98c652cac412c9c2f109c69e5532f313435fc",
"shasum": "" "shasum": ""
}, },
@@ -4009,12 +4022,12 @@
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git", "url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "99371b09caff9ba2afd5453f0ba2b5b5ddd95b57" "reference": "4f1925fc351a2f058bb56117203a85c5da8852cc"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/c7be81a763ce05e90ce358b6ec7faea5bf822416", "url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/4f1925fc351a2f058bb56117203a85c5da8852cc",
"reference": "99371b09caff9ba2afd5453f0ba2b5b5ddd95b57", "reference": "4f1925fc351a2f058bb56117203a85c5da8852cc",
"shasum": "" "shasum": ""
}, },
"conflict": { "conflict": {
@@ -4032,6 +4045,8 @@
"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", "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", "monolog/monolog": ">=1.8.0,<1.12.0",
"namshi/jose": "<1.1.2|<2.0.3|<2.2.0", "namshi/jose": "<1.1.2|<2.0.3|<2.2.0",
"oro/crm": ">=1.7.0,<1.7.4",
"oro/platform": ">=1.7.0,<1.7.4",
"pusher/pusher-php-server": "<2.2.1", "pusher/pusher-php-server": "<2.2.1",
"sabre/dav": ">=1.6.0,<1.6.9|>=1.7.0,<1.7.7|>=1.8.0,<1.8.5|>=1.6.0,<1.6.99|>=1.7.0,<1.7.11|>=1.8.0,<1.8.9", "sabre/dav": ">=1.6.0,<1.6.9|>=1.7.0,<1.7.7|>=1.8.0,<1.8.5|>=1.6.0,<1.6.99|>=1.7.0,<1.7.11|>=1.8.0,<1.8.9",
"socalnick/scn-social-auth": "<1.15.2", "socalnick/scn-social-auth": "<1.15.2",
@@ -4055,12 +4070,13 @@
"typo3/neos": ">=1.1.0,<1.1.3|>=1.2.0,<1.2.3", "typo3/neos": ">=1.1.0,<1.1.3|>=1.2.0,<1.2.3",
"willdurand/js-translation-bundle": "<2.1.1", "willdurand/js-translation-bundle": "<2.1.1",
"yiisoft/yii": ">=1.1.14,<1.1.15", "yiisoft/yii": ">=1.1.14,<1.1.15",
"yiisoft/yii2": "<2.0.4", "yiisoft/yii2": "<2.0.4|<2.0.5",
"yiisoft/yii2-bootstrap": "<2.0.4", "yiisoft/yii2-bootstrap": "<2.0.4",
"yiisoft/yii2-dev": "<2.0.4", "yiisoft/yii2-dev": "<2.0.4",
"yiisoft/yii2-gii": "<2.0.4", "yiisoft/yii2-gii": "<2.0.4",
"yiisoft/yii2-jui": "<2.0.4", "yiisoft/yii2-jui": "<2.0.4",
"zendframework/zend-db": ">=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.10|>=2.3.0,<2.3.5", "zendframework/zend-db": ">=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.10|>=2.3.0,<2.3.5",
"zendframework/zend-diactoros": ">=1.0.0,<1.0.4",
"zendframework/zend-form": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1", "zendframework/zend-form": ">=2.0.0,<2.2.7|>=2.3.0,<2.3.1",
"zendframework/zend-http": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.3.0,<2.3.8|>=2.4.0,<2.4.1", "zendframework/zend-http": ">=2.0.0,<2.0.99|>=2.1.0,<2.1.99|>=2.3.0,<2.3.8|>=2.4.0,<2.4.1",
"zendframework/zend-json": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6", "zendframework/zend-json": ">=2.1.0,<2.1.6|>=2.2.0,<2.2.6",
@@ -4090,7 +4106,7 @@
} }
], ],
"description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it", "description": "Prevents installation of composer packages with known security vulnerabilities: no API, simply require it",
"time": "2015-05-28 23:28:08" "time": "2015-07-12 17:29:58"
}, },
{ {
"name": "silex/silex", "name": "silex/silex",
@@ -4303,7 +4319,7 @@
}, },
{ {
"name": "Phraseanet Team", "name": "Phraseanet Team",
"email": "support@alchemy.fr", "email": "info@alchemy.fr",
"homepage": "http://www.phraseanet.com/" "homepage": "http://www.phraseanet.com/"
} }
], ],
@@ -4991,16 +5007,16 @@
}, },
{ {
"name": "phpunit/php-code-coverage", "name": "phpunit/php-code-coverage",
"version": "2.1.5", "version": "2.1.7",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-code-coverage.git", "url": "https://github.com/sebastianbergmann/php-code-coverage.git",
"reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e" "reference": "07e27765596d72c378a6103e80da5d84e802f1e4"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/be2286cb8c7e1773eded49d9719219e6f74f9e3e", "url": "https://api.github.com/repos/sebastianbergmann/php-code-coverage/zipball/07e27765596d72c378a6103e80da5d84e802f1e4",
"reference": "be2286cb8c7e1773eded49d9719219e6f74f9e3e", "reference": "07e27765596d72c378a6103e80da5d84e802f1e4",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5049,7 +5065,7 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2015-06-09 13:05:42" "time": "2015-06-30 06:52:35"
}, },
{ {
"name": "phpunit/php-file-iterator", "name": "phpunit/php-file-iterator",
@@ -5100,16 +5116,16 @@
}, },
{ {
"name": "phpunit/php-text-template", "name": "phpunit/php-text-template",
"version": "1.2.0", "version": "1.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-text-template.git", "url": "https://github.com/sebastianbergmann/php-text-template.git",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a" "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", "url": "https://api.github.com/repos/sebastianbergmann/php-text-template/zipball/31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"reference": "206dfefc0ffe9cebf65c413e3d0e809c82fbf00a", "reference": "31f8b717e51d9a2afca6c9f046f5d69fc27c8686",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5118,20 +5134,17 @@
"type": "library", "type": "library",
"autoload": { "autoload": {
"classmap": [ "classmap": [
"Text/" "src/"
] ]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"include-path": [
""
],
"license": [ "license": [
"BSD-3-Clause" "BSD-3-Clause"
], ],
"authors": [ "authors": [
{ {
"name": "Sebastian Bergmann", "name": "Sebastian Bergmann",
"email": "sb@sebastian-bergmann.de", "email": "sebastian@phpunit.de",
"role": "lead" "role": "lead"
} }
], ],
@@ -5140,7 +5153,7 @@
"keywords": [ "keywords": [
"template" "template"
], ],
"time": "2014-01-30 17:20:04" "time": "2015-06-21 13:50:34"
}, },
{ {
"name": "phpunit/php-timer", "name": "phpunit/php-timer",
@@ -5185,16 +5198,16 @@
}, },
{ {
"name": "phpunit/php-token-stream", "name": "phpunit/php-token-stream",
"version": "1.4.2", "version": "1.4.3",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/php-token-stream.git", "url": "https://github.com/sebastianbergmann/php-token-stream.git",
"reference": "db63be1159c81df649cd0260e30249a586d4129e" "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/db63be1159c81df649cd0260e30249a586d4129e", "url": "https://api.github.com/repos/sebastianbergmann/php-token-stream/zipball/7a9b0969488c3c54fd62b4d504b3ec758fd005d9",
"reference": "db63be1159c81df649cd0260e30249a586d4129e", "reference": "7a9b0969488c3c54fd62b4d504b3ec758fd005d9",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5230,20 +5243,20 @@
"keywords": [ "keywords": [
"tokenizer" "tokenizer"
], ],
"time": "2015-06-12 07:34:24" "time": "2015-06-19 03:43:16"
}, },
{ {
"name": "phpunit/phpunit", "name": "phpunit/phpunit",
"version": "4.7.3", "version": "4.7.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit.git", "url": "https://github.com/sebastianbergmann/phpunit.git",
"reference": "41fea1e84ed84d373f5ac099a1276c4358c90708" "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/41fea1e84ed84d373f5ac099a1276c4358c90708", "url": "https://api.github.com/repos/sebastianbergmann/phpunit/zipball/0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b",
"reference": "41fea1e84ed84d373f5ac099a1276c4358c90708", "reference": "0ebabb4cda7d066be8391dfdbaf57fe70ac9a99b",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5257,7 +5270,7 @@
"phpunit/php-code-coverage": "~2.1", "phpunit/php-code-coverage": "~2.1",
"phpunit/php-file-iterator": "~1.4", "phpunit/php-file-iterator": "~1.4",
"phpunit/php-text-template": "~1.2", "phpunit/php-text-template": "~1.2",
"phpunit/php-timer": "~1.0", "phpunit/php-timer": ">=1.0.6",
"phpunit/phpunit-mock-objects": "~2.3", "phpunit/phpunit-mock-objects": "~2.3",
"sebastian/comparator": "~1.1", "sebastian/comparator": "~1.1",
"sebastian/diff": "~1.2", "sebastian/diff": "~1.2",
@@ -5302,20 +5315,20 @@
"testing", "testing",
"xunit" "xunit"
], ],
"time": "2015-06-11 16:20:25" "time": "2015-06-30 06:53:57"
}, },
{ {
"name": "phpunit/phpunit-mock-objects", "name": "phpunit/phpunit-mock-objects",
"version": "2.3.4", "version": "2.3.5",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git", "url": "https://github.com/sebastianbergmann/phpunit-mock-objects.git",
"reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35" "reference": "1c330b1b6e1ea8fd15f2fbea46770576e366855c"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/92408bb1968a81b3217a6fdf6c1a198da83caa35", "url": "https://api.github.com/repos/sebastianbergmann/phpunit-mock-objects/zipball/1c330b1b6e1ea8fd15f2fbea46770576e366855c",
"reference": "92408bb1968a81b3217a6fdf6c1a198da83caa35", "reference": "1c330b1b6e1ea8fd15f2fbea46770576e366855c",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -5357,7 +5370,7 @@
"mock", "mock",
"xunit" "xunit"
], ],
"time": "2015-06-11 15:55:48" "time": "2015-07-04 05:41:32"
}, },
{ {
"name": "sebastian/comparator", "name": "sebastian/comparator",
@@ -5697,16 +5710,16 @@
}, },
{ {
"name": "sebastian/version", "name": "sebastian/version",
"version": "1.0.5", "version": "1.0.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/sebastianbergmann/version.git", "url": "https://github.com/sebastianbergmann/version.git",
"reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4" "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/sebastianbergmann/version/zipball/ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", "url": "https://api.github.com/repos/sebastianbergmann/version/zipball/58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"reference": "ab931d46cd0d3204a91e1b9a40c4bc13032b58e4", "reference": "58b3a85e7999757d6ad81c787a1fbf5ff6c628c6",
"shasum": "" "shasum": ""
}, },
"type": "library", "type": "library",
@@ -5728,7 +5741,7 @@
], ],
"description": "Library that helps with managing the version number of Git-hosted PHP projects", "description": "Library that helps with managing the version number of Git-hosted PHP projects",
"homepage": "https://github.com/sebastianbergmann/version", "homepage": "https://github.com/sebastianbergmann/version",
"time": "2015-02-24 06:35:25" "time": "2015-06-21 13:59:46"
} }
], ],
"aliases": [ "aliases": [

View File

@@ -15,6 +15,7 @@ use Alchemy\Phrasea\Controller\Controller;
use Alchemy\Phrasea\Core\Configuration\DisplaySettingService; use Alchemy\Phrasea\Core\Configuration\DisplaySettingService;
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions; use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
use Alchemy\Phrasea\SearchEngine\SearchEngineResult; use Alchemy\Phrasea\SearchEngine\SearchEngineResult;
use Alchemy\Phrasea\Utilities\StringHelper;
use Symfony\Component\HttpFoundation\Request; use Symfony\Component\HttpFoundation\Request;
use Symfony\Component\HttpFoundation\Response; use Symfony\Component\HttpFoundation\Response;
@@ -32,6 +33,9 @@ class QueryController extends Controller
{ {
$query = (string) $request->request->get('qry'); $query = (string) $request->request->get('qry');
// since the query comes from a submited form, normalize crlf,cr,lf ...
$query = StringHelper::crlfNormalize($query);
$json = []; $json = [];
$options = SearchEngineOptions::fromRequest($this->app, $request); $options = SearchEngineOptions::fromRequest($this->app, $request);

View File

@@ -13,7 +13,7 @@ namespace Alchemy\Phrasea\Form\Login;
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Form\Constraint\NewEmail; use Alchemy\Phrasea\Form\Constraint\NewEmail;
use Alchemy\Phrasea\Utilities\String\Camelizer; use Alchemy\Phrasea\Utilities\StringHelper;
use Symfony\Component\Form\AbstractType; use Symfony\Component\Form\AbstractType;
use Symfony\Component\Form\FormBuilderInterface; use Symfony\Component\Form\FormBuilderInterface;
use Symfony\Component\Validator\Constraints as Assert; use Symfony\Component\Validator\Constraints as Assert;
@@ -23,14 +23,12 @@ class PhraseaRegisterForm extends AbstractType
{ {
private $available; private $available;
private $params; private $params;
private $camelizer;
public function __construct(Application $app, array $available, array $params = [], Camelizer $camelizer = null) public function __construct(Application $app, array $available, array $params = [])
{ {
$this->app = $app; $this->app = $app;
$this->available = $available; $this->available = $available;
$this->params = $params; $this->params = $params;
$this->camelizer = $camelizer ?: new Camelizer();
} }
public function buildForm(FormBuilderInterface $builder, array $options) public function buildForm(FormBuilderInterface $builder, array $options)
@@ -115,7 +113,7 @@ class PhraseaRegisterForm extends AbstractType
$builder->add( $builder->add(
// angular does not support hyphens // angular does not support hyphens
$this->camelizer->camelize($name, '-'), StringHelper::camelize($name, '-'),
$this->getType($name), $this->getType($name),
$options $options
); );

View File

@@ -15,6 +15,7 @@ use Alchemy\Phrasea\SearchEngine\Elastic\Exception\Exception;
use Alchemy\Phrasea\SearchEngine\Elastic\Mapping; use Alchemy\Phrasea\SearchEngine\Elastic\Mapping;
use Alchemy\Phrasea\SearchEngine\Elastic\RecordHelper; use Alchemy\Phrasea\SearchEngine\Elastic\RecordHelper;
use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Structure; use Alchemy\Phrasea\SearchEngine\Elastic\Structure\Structure;
use Alchemy\Phrasea\Utilities\StringHelper;
use Doctrine\DBAL\Connection; use Doctrine\DBAL\Connection;
use Doctrine\DBAL\Driver\Connection as DriverConnection; use Doctrine\DBAL\Driver\Connection as DriverConnection;
use DomainException; use DomainException;
@@ -74,6 +75,7 @@ SQL;
switch ($metadata['type']) { switch ($metadata['type']) {
case 'caption': case 'caption':
// Sanitize fields // Sanitize fields
$value = StringHelper::crlfNormalize($value);
switch ($this->structure->typeOf($key)) { switch ($this->structure->typeOf($key)) {
case Mapping::TYPE_DATE: case Mapping::TYPE_DATE:
$value = $this->helper->sanitizeDate($value); $value = $this->helper->sanitizeDate($value);

View File

@@ -11,20 +11,10 @@
namespace Alchemy\Phrasea\Twig; namespace Alchemy\Phrasea\Twig;
use Alchemy\Phrasea\Utilities\String\Camelizer; use Alchemy\Phrasea\Utilities\StringHelper;
class Camelize extends \Twig_Extension class Camelize extends \Twig_Extension
{ {
/**
* @var Camelizer
*/
private $camelizer;
public function __construct(Camelizer $camelizer = null)
{
$this->camelizer = $camelizer ?: new Camelizer();
}
/** /**
* *
* @return string * @return string
@@ -47,6 +37,6 @@ class Camelize extends \Twig_Extension
public function toCamelCase($str, $separator = '-', $pascalCase = false) public function toCamelCase($str, $separator = '-', $pascalCase = false)
{ {
return $this->camelizer->camelize($str, $separator, $pascalCase); return StringHelper::camelize($str, $separator, $pascalCase);
} }
} }

View File

@@ -1,22 +0,0 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Utilities\String;
class Camelizer
{
public function camelize($str, $separator = '_', $pascalCase = false)
{
$transformStr = str_replace(' ', '', ucwords(str_replace($separator, ' ', $str)));
return $pascalCase ? $transformStr : lcfirst($transformStr);
}
}

View File

@@ -0,0 +1,42 @@
<?php
/*
* This file is part of Phraseanet
*
* (c) 2005-2015 Alchemy
*
* For the full copyright and license information, please view the LICENSE
* file that was distributed with this source code.
*/
namespace Alchemy\Phrasea\Utilities;
/**
* Class CrLfNormalizer
* @package Alchemy\Phrasea\Utilities\String
*/
class StringHelper
{
/**
* @param string $str
* @return string
*/
public static function crlfNormalize($str)
{
return preg_replace("/\r\n|\r|\n/", "\n", $str);
}
/**
* @param string $str
* @param string $separator
* @param bool $pascalCase
* @return string
*/
public static function camelize($str, $separator = '_', $pascalCase = false)
{
$transformStr = str_replace(' ', '', ucwords(str_replace($separator, ' ', $str)));
return $pascalCase ? $transformStr : lcfirst($transformStr);
}
}

View File

@@ -10,6 +10,7 @@
*/ */
use Alchemy\Phrasea\Application; use Alchemy\Phrasea\Application;
use Alchemy\Phrasea\Utilities\StringHelper;
use Alchemy\Phrasea\Vocabulary; use Alchemy\Phrasea\Vocabulary;
class caption_Field_Value implements cache_cacheableInterface class caption_Field_Value implements cache_cacheableInterface
@@ -87,15 +88,14 @@ class caption_Field_Value implements cache_cacheableInterface
$connbas = $this->databox_field->get_databox()->get_connection(); $connbas = $this->databox_field->get_databox()->get_connection();
$sql = 'SELECT record_id, value, VocabularyType, VocabularyId $sql = 'SELECT record_id, value, VocabularyType, VocabularyId FROM metadatas WHERE id = :id';
FROM metadatas WHERE id = :id';
$stmt = $connbas->prepare($sql); $stmt = $connbas->prepare($sql);
$stmt->execute([':id' => $this->id]); $stmt->execute([':id' => $this->id]);
$row = $stmt->fetch(PDO::FETCH_ASSOC); $row = $stmt->fetch(PDO::FETCH_ASSOC);
$stmt->closeCursor(); $stmt->closeCursor();
$this->value = $row ? $row['value'] : null; $this->value = $row ? StringHelper::crlfNormalize($row['value']) : null;
try { try {
$this->VocabularyType = $row['VocabularyType'] ? Vocabulary\Controller::get($this->app, $row['VocabularyType']) : null; $this->VocabularyType = $row['VocabularyType'] ? Vocabulary\Controller::get($this->app, $row['VocabularyType']) : null;
@@ -204,9 +204,9 @@ class caption_Field_Value implements cache_cacheableInterface
, ':meta_id' => $this->getId() , ':meta_id' => $this->getId()
]; ];
$sql_up = 'UPDATE metadatas $sql_up = 'UPDATE metadatas'
SET VocabularyType = :VocabType, VocabularyId = :VocabularyId . ' SET VocabularyType = :VocabType, VocabularyId = :VocabularyId'
WHERE id = :meta_id'; . ' WHERE id = :meta_id';
$stmt_up = $connbas->prepare($sql_up); $stmt_up = $connbas->prepare($sql_up);
$stmt_up->execute($params); $stmt_up->execute($params);
$stmt_up->closeCursor(); $stmt_up->closeCursor();
@@ -228,9 +228,9 @@ class caption_Field_Value implements cache_cacheableInterface
, ':meta_id' => $this->getId() , ':meta_id' => $this->getId()
]; ];
$sql_up = 'UPDATE metadatas $sql_up = 'UPDATE metadatas'
SET VocabularyType = :VocabType, VocabularyId = :VocabularyId . ' SET VocabularyType = :VocabType, VocabularyId = :VocabularyId'
WHERE id = :meta_id'; . ' WHERE id = :meta_id';
$stmt_up = $connbas->prepare($sql_up); $stmt_up = $connbas->prepare($sql_up);
$stmt_up->execute($params); $stmt_up->execute($params);
$stmt_up->closeCursor(); $stmt_up->closeCursor();
@@ -302,10 +302,8 @@ class caption_Field_Value implements cache_cacheableInterface
} }
} }
$sql_ins = 'INSERT INTO metadatas $sql_ins = 'INSERT INTO metadatas (id, record_id, meta_struct_id, value, VocabularyType, VocabularyId)'
(id, record_id, meta_struct_id, value, VocabularyType, VocabularyId) . ' VALUES (null, :record_id, :field, :value, :VocabType, :VocabId)';
VALUES
(null, :record_id, :field, :value, :VocabType, :VocabId)';
$params = [ $params = [
':record_id' => $record->get_record_id(), ':record_id' => $record->get_record_id(),

View File

@@ -15,17 +15,20 @@ use Doctrine\DBAL\Driver\Statement;
class caption_field implements cache_cacheableInterface class caption_field implements cache_cacheableInterface
{ {
/** /**
*
* @var databox_field * @var databox_field
*/ */
protected $databox_field; protected $databox_field;
/** /**
* @var string *
* @var caption_Field_Value[]
*/ */
protected $values; protected $values;
/** /**
* @var record_adapter *
* @var record
*/ */
protected $record; protected $record;
protected $app; protected $app;
@@ -33,11 +36,12 @@ class caption_field implements cache_cacheableInterface
protected static $localCache = []; protected static $localCache = [];
/** /**
*
* @param Application $app * @param Application $app
* @param databox_field $databox_field * @param databox_field $databox_field
* @param record_adapter $record * @param record_adapter $record
* *
* @return $this * @return caption_field
*/ */
public function __construct(Application $app, databox_field $databox_field, \record_adapter $record) public function __construct(Application $app, databox_field $databox_field, \record_adapter $record)
{ {
@@ -51,11 +55,15 @@ class caption_field implements cache_cacheableInterface
foreach ($rs as $row) { foreach ($rs as $row) {
$this->values[$row['id']] = new caption_Field_Value($this->app, $databox_field, $record, $row['id']); $this->values[$row['id']] = new caption_Field_Value($this->app, $databox_field, $record, $row['id']);
// Inconsistent, should not happen /**
if (! $databox_field->is_multi()) { * Inconsistent, should not happen
*/
if ( ! $databox_field->is_multi()) {
break; break;
} }
} }
return $this;
} }
protected function get_metadatas_ids() protected function get_metadatas_ids()
@@ -71,8 +79,8 @@ class caption_field implements cache_cacheableInterface
$sql = 'SELECT id FROM metadatas WHERE record_id = :record_id AND meta_struct_id = :meta_struct_id'; $sql = 'SELECT id FROM metadatas WHERE record_id = :record_id AND meta_struct_id = :meta_struct_id';
$params = [ $params = [
':record_id' => $this->record->get_record_id(), ':record_id' => $this->record->get_record_id()
':meta_struct_id' => $this->databox_field->get_id(), , ':meta_struct_id' => $this->databox_field->get_id()
]; ];
$stmt = $connbas->prepare($sql); $stmt = $connbas->prepare($sql);
@@ -86,6 +94,7 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @return record_adapter * @return record_adapter
*/ */
public function get_record() public function get_record()
@@ -94,7 +103,8 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
* @return bool *
* @return boolean
*/ */
public function is_required() public function is_required()
{ {
@@ -102,7 +112,8 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
* @return bool *
* @return boolean
*/ */
public function is_multi() public function is_multi()
{ {
@@ -110,7 +121,8 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
* @return bool *
* @return boolean
*/ */
public function is_readonly() public function is_readonly()
{ {
@@ -118,7 +130,8 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
* @return $this *
* @return caption_field
*/ */
public function delete() public function delete()
{ {
@@ -131,6 +144,7 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @param array $values * @param array $values
* @param string $separator * @param string $separator
* @return string * @return string
@@ -158,6 +172,7 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @return \caption_Field_Value[] * @return \caption_Field_Value[]
*/ */
public function get_values() public function get_values()
@@ -166,8 +181,9 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @param int $meta_id * @param int $meta_id
* @return array * @return \caption_Field_Value
*/ */
public function get_value($meta_id) public function get_value($meta_id)
{ {
@@ -175,8 +191,8 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
* @param bool|string $custom_separator * @param String $custom_separator
* @param bool $highlight * @param Boolean $highlightTheso
* *
* @return mixed * @return mixed
*/ */
@@ -204,6 +220,7 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @return string * @return string
*/ */
public function get_name() public function get_name()
@@ -212,6 +229,7 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @return int * @return int
*/ */
public function get_meta_struct_id() public function get_meta_struct_id()
@@ -220,7 +238,8 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
* @return bool *
* @return boolean
*/ */
public function is_indexable() public function is_indexable()
{ {
@@ -228,6 +247,7 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @return databox_field * @return databox_field
*/ */
public function get_databox_field() public function get_databox_field()
@@ -236,6 +256,7 @@ class caption_field implements cache_cacheableInterface
} }
/** /**
*
* @param string $serialized_value * @param string $serialized_value
* @param string $separator * @param string $separator
* @return array * @return array
@@ -389,7 +410,7 @@ class caption_field implements cache_cacheableInterface
* @param mixed $value * @param mixed $value
* @param string $option * @param string $option
* @param int $duration * @param int $duration
* @return $this * @return caption_field
*/ */
public function set_data_to_cache($value, $option = null, $duration = 360000) public function set_data_to_cache($value, $option = null, $duration = 360000)
{ {
@@ -400,7 +421,7 @@ class caption_field implements cache_cacheableInterface
* Part of the cache_cacheableInterface * Part of the cache_cacheableInterface
* *
* @param string $option * @param string $option
* @return $this * @return caption_field
*/ */
public function delete_data_from_cache($option = null) public function delete_data_from_cache($option = null)
{ {

View File

@@ -4,7 +4,6 @@ namespace Alchemy\Tests\Phrasea\Form\Login;
use Alchemy\Phrasea\Form\Login\PhraseaRegisterForm;; use Alchemy\Phrasea\Form\Login\PhraseaRegisterForm;;
use Alchemy\Tests\Phrasea\Form\FormTestCase; use Alchemy\Tests\Phrasea\Form\FormTestCase;
use Alchemy\Phrasea\Utilities\String\Camelizer;
/** /**
* @group functional * @group functional
@@ -27,7 +26,7 @@ class PhraseaRegisterFormTest extends FormTestCase
] ]
]; ];
return new PhraseaRegisterForm(self::$DI['app'], $available, $params, new Camelizer()); return new PhraseaRegisterForm(self::$DI['app'], $available, $params);
} }
public function testFormDoesRegisterValidFields() public function testFormDoesRegisterValidFields()
@@ -63,7 +62,7 @@ class PhraseaRegisterFormTest extends FormTestCase
$expected[] = 'collections'; $expected[] = 'collections';
} }
$form = new PhraseaRegisterForm(self::$DI['app'], $available, $params, new Camelizer()); $form = new PhraseaRegisterForm(self::$DI['app'], $available, $params);
foreach (array_keys(self::$DI['app']->form($form)->createView()->vars['form']->children) as $name) { foreach (array_keys(self::$DI['app']->form($form)->createView()->vars['form']->children) as $name) {
$this->assertContains($name, $expected); $this->assertContains($name, $expected);
@@ -99,7 +98,7 @@ class PhraseaRegisterFormTest extends FormTestCase
$expected[] = 'collections'; $expected[] = 'collections';
} }
$form = new PhraseaRegisterForm(self::$DI['app'], $available, $params, new Camelizer()); $form = new PhraseaRegisterForm(self::$DI['app'], $available, $params);
foreach (array_keys(self::$DI['app']->form($form)->createView()->vars['form']->children) as $name) { foreach (array_keys(self::$DI['app']->form($form)->createView()->vars['form']->children) as $name) {
$this->assertContains($name, $expected); $this->assertContains($name, $expected);

View File

@@ -2,7 +2,7 @@
namespace Alchemy\Tests\Phrasea\Utilities\String; namespace Alchemy\Tests\Phrasea\Utilities\String;
use Alchemy\Phrasea\Utilities\String\Camelizer; use Alchemy\Phrasea\Utilities\StringHelper;
/** /**
* @group functional * @group functional
@@ -12,12 +12,11 @@ class CamelizerTest extends \PhraseanetTestCase
{ {
/** /**
* @dataProvider provideStrings * @dataProvider provideStrings
* @covers Alchemy\Phrasea\Utilities\String\Camelizer::camelize * @covers Alchemy\Phrasea\Utilities\StringHelper::camelize
*/ */
public function testCamelize($string, $separator, $expected, $pascalize) public function testCamelize($string, $separator, $expected, $pascalize)
{ {
$camelizer = new Camelizer(); $result = StringHelper::camelize($string, $separator, $pascalize);
$result = $camelizer->camelize($string, $separator, $pascalize);
$this->assertEquals($expected, $result); $this->assertEquals($expected, $result);
} }

View File

@@ -0,0 +1,33 @@
<?php
namespace Alchemy\Tests\Phrasea\Utilities\String;
use Alchemy\Phrasea\Utilities\StringHelper;
/**
* @group functional
* @group legacy
*/
class CrLfNormalizerTest extends \PhraseanetTestCase
{
/**
* @dataProvider provideStrings
* @covers Alchemy\Phrasea\Utilities\StringHelper::crlfNormalize
*/
public function testCrLfNormalize($string, $expected)
{
$result = StringHelper::crlfNormalize($string);
$this->assertEquals($expected, $result);
}
public function provideStrings()
{
return [
['ABC\rDEF', 'ABC\nDEF'],
['ABC\nDEF', 'ABC\nDEF'],
['ABC\r\nDEF', 'ABC\nDEF'],
['ABC\n\rDEF', 'ABC\n\nDEF'],
];
}
}

View File

@@ -340,7 +340,7 @@ function newSearch(query) {
p4.Results.Selection.empty(); p4.Results.Selection.empty();
clearAnswers(); clearAnswers();
$('#searchForm input[name="qry"]').val(query); $('#SENT_query').val(query);
var histo = $('#history-queries ul'); var histo = $('#history-queries ul');
histo.prepend('<li onclick="doSpecialSearch(\'' + query.replace(/\'/g, "\\'") + '\')">' + query + '</li>'); histo.prepend('<li onclick="doSpecialSearch(\'' + query.replace(/\'/g, "\\'") + '\')">' + query + '</li>');
@@ -612,9 +612,7 @@ function getFacetsTree() {
} }
function facetCombinedSearch() { function facetCombinedSearch() {
var q = $("#EDIT_query").val(); var q = $("#EDIT_query").val();
console.debug(selectedFacetValues);
var q_facet = ""; var q_facet = "";
_.each(_.values(selectedFacetValues), function(facetValue) { _.each(_.values(selectedFacetValues), function(facetValue) {
q_facet += (q_facet ? " AND " : "") + '(' + facetValue.query + ')'; q_facet += (q_facet ? " AND " : "") + '(' + facetValue.query + ')';