Merge branch 'master' of https://github.com/alchemy-fr/Phraseanet into PHRAS-2419_refacto_Icons_actions_under_Thumbnail

This commit is contained in:
Harrys
2019-02-06 15:49:19 +04:00
11 changed files with 131 additions and 61 deletions

View File

@@ -37,7 +37,8 @@ jobs:
- run: git clone https://github.com/alanxz/rabbitmq-c - run: git clone https://github.com/alanxz/rabbitmq-c
- run: cd rabbitmq-c && git checkout 2ca1774489328cde71195f5fa95e17cf3a80cb8a - run: cd rabbitmq-c && git checkout 2ca1774489328cde71195f5fa95e17cf3a80cb8a
- run: cd rabbitmq-c && git submodule init && git submodule update && autoreconf -i && ./configure && make && sudo make install - run: cd rabbitmq-c && git submodule init && git submodule update && autoreconf -i && ./configure && make && sudo make install
- run: pecl channel-update pear.php.net # disabled because pear.php.net is down cause of security failure
#- run: pecl channel-update pear.php.net
- run: yes '' | pecl install amqp-1.9.3 - run: yes '' | pecl install amqp-1.9.3
- run: yes '' | pecl install imagick - run: yes '' | pecl install imagick
- run: sudo apt-get install libzmq-dev - run: sudo apt-get install libzmq-dev

44
AUTHORS
View File

@@ -1,28 +1,40 @@
** Phraseanet is written and maintained by the Phraseanet Developer Team ** ** Phraseanet is written and maintained by the Phraseanet Developer Team **
Benoît Burnichon - Jean-Yves Gaulier
Jean-Yves Gaulier - Milos M
Andrey Kalinovsky - Mike NG
Nicolas Legoff - Xavier Rousset
Romain Neutron - Aina Sitraka
- Filip Vilic
** Proudly Powered by Alchemy ** ** Proudly Powered by Alchemy **
Nicolas Amendola - Aurélie Bachelet
Nathanaël Attar - Laetitia Bianchi
Aurélie Bachelet - Anthony Cabot
Anthony Cabot - Moctar Diouf
Moctar Diouf - Jennifer Guérin
Jennifer Guérin - Félix Noir
Nicolas Honoré - Nicolas Maillat
Nicolas Maillat - Guillaume Maubert
Guillaume Maubert
Jonathan Schneider
** They gave some love to Phraseanet ** ** They gave some love to Phraseanet **
Ysoline Gresille - Nicolas Amendola
- Nathanaël Attar
- Florian Blouet
- Benoît Burnichon
- Thibaud Fabre
- Ysoline Gresille
- Nicolas Honoré
- Andrey Kalinovsky
- Nicolas Legoff
- Romain Neutron
- Jonathan Schneider
Phraseanet c/o Alchemy Phraseanet c/o Alchemy
30 Place Saint Georges 30 Place Saint Georges
75009 Paris - France 75009 Paris - France

View File

@@ -1,3 +1,7 @@
#version 4.0
- Krzysztof Szulski Security
- Ideepix Docker Deploiement
#version 3.7 #version 3.7
- Pieter Demonie (Dutch localization) - Pieter Demonie (Dutch localization)

View File

@@ -50,7 +50,7 @@
"alchemy/embed-bundle": "^0.3.4", "alchemy/embed-bundle": "^0.3.4",
"alchemy/geonames-api-consumer": "~0.1.0", "alchemy/geonames-api-consumer": "~0.1.0",
"alchemy/mediavorus": "^0.4.4", "alchemy/mediavorus": "^0.4.4",
"alchemy/oauth2php": "1.0.0", "alchemy/oauth2php": "1.1.0",
"alchemy/phlickr": "0.2.9", "alchemy/phlickr": "0.2.9",
"alchemy/phpexiftool": "^0.7.0", "alchemy/phpexiftool": "^0.7.0",
"alchemy/rest-bundle": "^0.0.5", "alchemy/rest-bundle": "^0.0.5",

63
composer.lock generated
View File

@@ -1,10 +1,10 @@
{ {
"_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 https://getcomposer.org/doc/01-basic-usage.md#installing-dependencies",
"This file is @generated automatically" "This file is @generated automatically"
], ],
"content-hash": "253990d4c81f9ae5f78c6c1221d6cf29", "content-hash": "adf4074eb26ea80d414430d4f7b61311",
"packages": [ "packages": [
{ {
"name": "alchemy-fr/tcpdf-clone", "name": "alchemy-fr/tcpdf-clone",
@@ -275,16 +275,16 @@
}, },
{ {
"name": "alchemy/mediavorus", "name": "alchemy/mediavorus",
"version": "0.4.8", "version": "0.4.9",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/alchemy-fr/MediaVorus.git", "url": "https://github.com/alchemy-fr/MediaVorus.git",
"reference": "6a50c397211dfdf6da108ea1ebc7527c37419ab7" "reference": "1a96dc4142ff8474c11285cab9eab11df9683255"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/6a50c397211dfdf6da108ea1ebc7527c37419ab7", "url": "https://api.github.com/repos/alchemy-fr/MediaVorus/zipball/1a96dc4142ff8474c11285cab9eab11df9683255",
"reference": "6a50c397211dfdf6da108ea1ebc7527c37419ab7", "reference": "1a96dc4142ff8474c11285cab9eab11df9683255",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -333,20 +333,20 @@
"keywords": [ "keywords": [
"metadata" "metadata"
], ],
"time": "2018-05-03T14:17:10+00:00" "time": "2019-01-22T11:23:34+00:00"
}, },
{ {
"name": "alchemy/oauth2php", "name": "alchemy/oauth2php",
"version": "1.0.0", "version": "1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/alchemy-fr/oauth2-php.git", "url": "https://github.com/alchemy-fr/oauth2-php.git",
"reference": "cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15" "reference": "801510972240555fa182813851efd96659d37a68"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/oauth2-php/zipball/cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15", "url": "https://api.github.com/repos/alchemy-fr/oauth2-php/zipball/801510972240555fa182813851efd96659d37a68",
"reference": "cb4fcb73e30ab54e0fb85a65b4d57147f7a0df15", "reference": "801510972240555fa182813851efd96659d37a68",
"shasum": "" "shasum": ""
}, },
"type": "library", "type": "library",
@@ -356,7 +356,7 @@
] ]
}, },
"notification-url": "https://packagist.org/downloads/", "notification-url": "https://packagist.org/downloads/",
"time": "2013-07-01T09:46:59+00:00" "time": "2019-01-17T14:34:10+00:00"
}, },
{ {
"name": "alchemy/phlickr", "name": "alchemy/phlickr",
@@ -1898,12 +1898,12 @@
"version": "v2.5.6", "version": "v2.5.6",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/doctrine/doctrine2.git", "url": "https://github.com/doctrine/orm.git",
"reference": "e6c434196c8ef058239aaa0724b4aadb0107940b" "reference": "e6c434196c8ef058239aaa0724b4aadb0107940b"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/doctrine/doctrine2/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b", "url": "https://api.github.com/repos/doctrine/orm/zipball/e6c434196c8ef058239aaa0724b4aadb0107940b",
"reference": "e6c434196c8ef058239aaa0724b4aadb0107940b", "reference": "e6c434196c8ef058239aaa0724b4aadb0107940b",
"shasum": "" "shasum": ""
}, },
@@ -2304,12 +2304,12 @@
"version": "v2.2.1", "version": "v2.2.1",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/google/google-api-php-client.git", "url": "https://github.com/googleapis/google-api-php-client.git",
"reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2" "reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/google/google-api-php-client/zipball/b69b8ac4bf6501793c389d4e013a79d09c85c5f2", "url": "https://api.github.com/repos/googleapis/google-api-php-client/zipball/b69b8ac4bf6501793c389d4e013a79d09c85c5f2",
"reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2", "reference": "b69b8ac4bf6501793c389d4e013a79d09c85c5f2",
"shasum": "" "shasum": ""
}, },
@@ -2363,12 +2363,12 @@
"version": "v0.36", "version": "v0.36",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/google/google-api-php-client-services.git", "url": "https://github.com/googleapis/google-api-php-client-services.git",
"reference": "2fd7d2876fbc0174faddba3241956a1393536159" "reference": "2fd7d2876fbc0174faddba3241956a1393536159"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/google/google-api-php-client-services/zipball/2fd7d2876fbc0174faddba3241956a1393536159", "url": "https://api.github.com/repos/googleapis/google-api-php-client-services/zipball/2fd7d2876fbc0174faddba3241956a1393536159",
"reference": "2fd7d2876fbc0174faddba3241956a1393536159", "reference": "2fd7d2876fbc0174faddba3241956a1393536159",
"shasum": "" "shasum": ""
}, },
@@ -2400,12 +2400,12 @@
"version": "v1.1.0", "version": "v1.1.0",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/google/google-auth-library-php.git", "url": "https://github.com/googleapis/google-auth-library-php.git",
"reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd" "reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/google/google-auth-library-php/zipball/548d27d670f0236dc5258fa4cdde6e7b63464cfd", "url": "https://api.github.com/repos/googleapis/google-auth-library-php/zipball/548d27d670f0236dc5258fa4cdde6e7b63464cfd",
"reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd", "reference": "548d27d670f0236dc5258fa4cdde6e7b63464cfd",
"shasum": "" "shasum": ""
}, },
@@ -4334,16 +4334,16 @@
}, },
{ {
"name": "media-alchemyst/media-alchemyst", "name": "media-alchemyst/media-alchemyst",
"version": "0.5.1", "version": "0.5.2",
"source": { "source": {
"type": "git", "type": "git",
"url": "https://github.com/alchemy-fr/Media-Alchemyst.git", "url": "https://github.com/alchemy-fr/Media-Alchemyst.git",
"reference": "b82bb891640cb1ce5d5523235047c34c64194514" "reference": "5d2fe6dd95215804202ecf0466fd9cfaeedd0140"
}, },
"dist": { "dist": {
"type": "zip", "type": "zip",
"url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/b82bb891640cb1ce5d5523235047c34c64194514", "url": "https://api.github.com/repos/alchemy-fr/Media-Alchemyst/zipball/5d2fe6dd95215804202ecf0466fd9cfaeedd0140",
"reference": "b82bb891640cb1ce5d5523235047c34c64194514", "reference": "5d2fe6dd95215804202ecf0466fd9cfaeedd0140",
"shasum": "" "shasum": ""
}, },
"require": { "require": {
@@ -4404,7 +4404,7 @@
"video", "video",
"video processing" "video processing"
], ],
"time": "2016-03-16T13:11:52+00:00" "time": "2019-01-25T12:09:11+00:00"
}, },
{ {
"name": "monolog/monolog", "name": "monolog/monolog",
@@ -5766,17 +5766,6 @@
{ {
"name": "roave/security-advisories", "name": "roave/security-advisories",
"version": "dev-master", "version": "dev-master",
"source": {
"type": "git",
"url": "https://github.com/Roave/SecurityAdvisories.git",
"reference": "3db4b0df21d1f527304650e717c66af48981f1c4"
},
"dist": {
"type": "zip",
"url": "https://api.github.com/repos/Roave/SecurityAdvisories/zipball/3db4b0df21d1f527304650e717c66af48981f1c4",
"reference": "3db4b0df21d1f527304650e717c66af48981f1c4",
"shasum": ""
},
"conflict": { "conflict": {
"adodb/adodb-php": "<5.20.6", "adodb/adodb-php": "<5.20.6",
"amphp/artax": ">=2,<2.0.4|>0.7.1,<1.0.4", "amphp/artax": ">=2,<2.0.4|>0.7.1,<1.0.4",
@@ -6015,6 +6004,7 @@
"keywords": [ "keywords": [
"microframework" "microframework"
], ],
"abandoned": "symfony/flex",
"time": "2016-01-06T14:59:35+00:00" "time": "2016-01-06T14:59:35+00:00"
}, },
{ {
@@ -6060,6 +6050,7 @@
], ],
"description": "A WebProfiler for Silex", "description": "A WebProfiler for Silex",
"homepage": "http://silex.sensiolabs.org/", "homepage": "http://silex.sensiolabs.org/",
"abandoned": true,
"time": "2016-01-10T11:39:13+00:00" "time": "2016-01-10T11:39:13+00:00"
}, },
{ {

View File

@@ -7,6 +7,7 @@ main:
languages: [] languages: []
key: '' key: ''
api_require_ssl: true api_require_ssl: true
api_token_header: false
database: database:
host: 127.0.0.1 host: 127.0.0.1
port: 3306 port: 3306

View File

@@ -145,6 +145,7 @@ class SubdefsController extends Controller
$options[Audio::OPTION_AUDIOBITRATE] = $config["audio"]["definitions"][$preset][Audio::OPTION_AUDIOBITRATE]; $options[Audio::OPTION_AUDIOBITRATE] = $config["audio"]["definitions"][$preset][Audio::OPTION_AUDIOBITRATE];
$options[Audio::OPTION_AUDIOSAMPLERATE] = $config["audio"]["definitions"][$preset][Audio::OPTION_AUDIOSAMPLERATE]; $options[Audio::OPTION_AUDIOSAMPLERATE] = $config["audio"]["definitions"][$preset][Audio::OPTION_AUDIOSAMPLERATE];
$options[Audio::OPTION_ACODEC] = $config["audio"]["definitions"][$preset][Audio::OPTION_ACODEC]; $options[Audio::OPTION_ACODEC] = $config["audio"]["definitions"][$preset][Audio::OPTION_ACODEC];
$options[Audio::OPTION_AUDIOCHANNEL] = $config["audio"]["definitions"][$preset][Audio::OPTION_AUDIOCHANNEL];
foreach ($config["audio"]["definitions"][$preset][Subdef::OPTION_DEVICE] as $devices) { foreach ($config["audio"]["definitions"][$preset][Subdef::OPTION_DEVICE] as $devices) {
$options[Subdef::OPTION_DEVICE][] = $devices; $options[Subdef::OPTION_DEVICE][] = $devices;
} }
@@ -211,7 +212,7 @@ class SubdefsController extends Controller
{ {
$mapping = [ $mapping = [
Type::TYPE_IMAGE => [Subdef::TYPE_IMAGE, Subdef::TYPE_PDF], Type::TYPE_IMAGE => [Subdef::TYPE_IMAGE, Subdef::TYPE_PDF],
Type::TYPE_VIDEO => [Subdef::TYPE_IMAGE, Subdef::TYPE_VIDEO, Subdef::TYPE_ANIMATION], Type::TYPE_VIDEO => [Subdef::TYPE_IMAGE, Subdef::TYPE_VIDEO, Subdef::TYPE_ANIMATION, Subdef::TYPE_AUDIO],
Type::TYPE_AUDIO => [Subdef::TYPE_IMAGE, Subdef::TYPE_AUDIO], Type::TYPE_AUDIO => [Subdef::TYPE_IMAGE, Subdef::TYPE_AUDIO],
Type::TYPE_DOCUMENT => [Subdef::TYPE_IMAGE, Subdef::TYPE_FLEXPAPER, Subdef::TYPE_PDF], Type::TYPE_DOCUMENT => [Subdef::TYPE_IMAGE, Subdef::TYPE_FLEXPAPER, Subdef::TYPE_PDF],
Type::TYPE_FLASH => [Subdef::TYPE_IMAGE] Type::TYPE_FLASH => [Subdef::TYPE_IMAGE]
@@ -525,29 +526,44 @@ class SubdefsController extends Controller
], ],
Subdef::TYPE_AUDIO => [ Subdef::TYPE_AUDIO => [
"definitions" => [ "definitions" => [
"Low AAC 96 kbit/s" => [ "Low MP3 96 kbit/s" => [
Audio::OPTION_AUDIOBITRATE => "100", Audio::OPTION_AUDIOBITRATE => "100",
Audio::OPTION_AUDIOSAMPLERATE => "8000", Audio::OPTION_AUDIOSAMPLERATE => "8000",
Audio::OPTION_ACODEC => "libmp3lame", Audio::OPTION_ACODEC => "libmp3lame",
Subdef::OPTION_DEVICE => ["all"] Subdef::OPTION_DEVICE => ["all"]
], ],
"Normal AAC 128 kbit/s" => [ "Normal MP3 128 kbit/s" => [
Audio::OPTION_AUDIOBITRATE => "180", Audio::OPTION_AUDIOBITRATE => "180",
Audio::OPTION_AUDIOSAMPLERATE => "44100", Audio::OPTION_AUDIOSAMPLERATE => "44100",
Audio::OPTION_ACODEC => "libmp3lame", Audio::OPTION_ACODEC => "libmp3lame",
Subdef::OPTION_DEVICE => ["all"] Subdef::OPTION_DEVICE => ["all"]
], ],
"High AAC 320 kbit/s" => [ "High MP3 320 kbit/s" => [
Audio::OPTION_AUDIOBITRATE => "230", Audio::OPTION_AUDIOBITRATE => "230",
Audio::OPTION_AUDIOSAMPLERATE => "50000", Audio::OPTION_AUDIOSAMPLERATE => "50000",
Audio::OPTION_ACODEC => "libmp3lame", Audio::OPTION_ACODEC => "libmp3lame",
Subdef::OPTION_DEVICE => ["all"] Subdef::OPTION_DEVICE => ["all"]
], ],
"Wave Mono 16 kHz" => [
Audio::OPTION_AUDIOBITRATE => "256",
Audio::OPTION_AUDIOSAMPLERATE => "16000",
Audio::OPTION_ACODEC => "pcm_s16le",
Audio::OPTION_AUDIOCHANNEL => "mono",
Subdef::OPTION_DEVICE => ["all"]
],
"Wave Mono 8 kHz" => [
Audio::OPTION_AUDIOBITRATE => "128",
Audio::OPTION_AUDIOSAMPLERATE => "8000",
Audio::OPTION_ACODEC => "pcm_s16le",
Audio::OPTION_AUDIOCHANNEL => "mono",
Subdef::OPTION_DEVICE => ["all"]
],
], ],
"form" => [ "form" => [
Audio::OPTION_AUDIOBITRATE => "slide", Audio::OPTION_AUDIOBITRATE => "slide",
Audio::OPTION_AUDIOSAMPLERATE => "select", Audio::OPTION_AUDIOSAMPLERATE => "select",
Audio::OPTION_ACODEC => "select", Audio::OPTION_ACODEC => "select",
Audio::OPTION_AUDIOCHANNEL => "select",
Subdef::OPTION_DEVICE => "checkbox", Subdef::OPTION_DEVICE => "checkbox",
], ],
], ],

View File

@@ -201,6 +201,8 @@ class FilesystemService
return 'ogg'; return 'ogg';
case 'libmp3lame': case 'libmp3lame':
return 'mp3'; return 'mp3';
case 'pcm_s16le':
return 'wav';
} }
return null; return null;

View File

@@ -19,6 +19,7 @@ class Audio extends Provider
const OPTION_THREADS = 'threads'; const OPTION_THREADS = 'threads';
const OPTION_ACODEC = 'acodec'; const OPTION_ACODEC = 'acodec';
const OPTION_AUDIOSAMPLERATE = 'audiosamplerate'; const OPTION_AUDIOSAMPLERATE = 'audiosamplerate';
const OPTION_AUDIOCHANNEL = 'audiochannel';
public function __construct(TranslatorInterface $translator) public function __construct(TranslatorInterface $translator)
{ {
@@ -29,9 +30,12 @@ class Audio extends Provider
47250, 48000, 50000, 50400, 88200, 96000 47250, 48000, 50000, 50400, 88200, 96000
]; ];
$audioChannel = ['mono', 'stereo'];
$this->registerOption(new OptionType\Range($this->translator->trans('Audio Birate'), self::OPTION_AUDIOBITRATE, 32, 320, 128, 32)); $this->registerOption(new OptionType\Range($this->translator->trans('Audio Birate'), self::OPTION_AUDIOBITRATE, 32, 320, 128, 32));
$this->registerOption(new OptionType\Enum($this->translator->trans('AudioSamplerate'), self::OPTION_AUDIOSAMPLERATE, $AVaudiosamplerate)); $this->registerOption(new OptionType\Enum($this->translator->trans('AudioSamplerate'), self::OPTION_AUDIOSAMPLERATE, $AVaudiosamplerate));
$this->registerOption(new OptionType\Enum($this->translator->trans('Audio Codec'), self::OPTION_ACODEC, ['libmp3lame', 'flac'], 'libmp3lame')); $this->registerOption(new OptionType\Enum($this->translator->trans('Audio Codec'), self::OPTION_ACODEC, ['libmp3lame', 'flac', 'pcm_s16le'], 'libmp3lame'));
$this->registerOption(new OptionType\Enum($this->translator->trans('Audio channel'), self::OPTION_AUDIOCHANNEL, $audioChannel));
} }
public function getType() public function getType()
@@ -53,7 +57,21 @@ class Audio extends Provider
$this->spec->setAudioCodec($this->getOption(self::OPTION_ACODEC)->getValue()); $this->spec->setAudioCodec($this->getOption(self::OPTION_ACODEC)->getValue());
$this->spec->setAudioSampleRate($this->getOption(self::OPTION_AUDIOSAMPLERATE)->getValue()); $this->spec->setAudioSampleRate($this->getOption(self::OPTION_AUDIOSAMPLERATE)->getValue());
$this->spec->setAudioKiloBitrate($this->getOption(self::OPTION_AUDIOBITRATE)->getValue()); $this->spec->setAudioKiloBitrate($this->getOption(self::OPTION_AUDIOBITRATE)->getValue());
$this->spec->setAudioChannels($this->getChannelNumber($this->getOption(self::OPTION_AUDIOCHANNEL)->getValue()));
return $this->spec; return $this->spec;
} }
private function getChannelNumber($audioChannel)
{
switch($audioChannel)
{
case 'mono':
return 1;
case 'stereo':
return 2;
default:
return null;
}
}
} }

View File

@@ -537,7 +537,11 @@ class API_OAuth2_Adapter extends OAuth2
public function verifyAccessToken($scope = null, $exit_not_present = true, $exit_invalid = true, $exit_expired = true, $exit_scope = true, $realm = null) public function verifyAccessToken($scope = null, $exit_not_present = true, $exit_invalid = true, $exit_expired = true, $exit_scope = true, $realm = null)
{ {
$token_param = $this->getAccessTokenParams(); $apiTokenHeader = $this->app['conf']->get(['main', 'api_token_header']);
$useTokenHeader = $this->useTokenHeaderChoice($apiTokenHeader);
$token_param = $this->getAccessTokenParams($useTokenHeader);
// Access token was not provided // Access token was not provided
if ($token_param === false) { if ($token_param === false) {
@@ -808,4 +812,21 @@ class API_OAuth2_Adapter extends OAuth2
return false; return false;
} }
} }
/**
* Get the correct constante to call on Oauth2
*
* @param $apiTokenHeader
* @return string
*/
private function useTokenHeaderChoice($apiTokenHeader)
{
if ($apiTokenHeader === true) {
return Oauth2::TOKEN_ONLY_IN_HEADER;
} elseif ($apiTokenHeader === false) {
return Oauth2::TOKEN_ONLY_IN_GETPOST;
} else {
return Oauth2::TOKEN_AUTO_FIND;
}
}
} }

View File

@@ -44,7 +44,7 @@ class databox_subdef
SubdefType::TYPE_DOCUMENT => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_FLEXPAPER, SubdefSpecs::TYPE_PDF], SubdefType::TYPE_DOCUMENT => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_FLEXPAPER, SubdefSpecs::TYPE_PDF],
SubdefType::TYPE_FLASH => [SubdefSpecs::TYPE_IMAGE], SubdefType::TYPE_FLASH => [SubdefSpecs::TYPE_IMAGE],
SubdefType::TYPE_IMAGE => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_PDF], SubdefType::TYPE_IMAGE => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_PDF],
SubdefType::TYPE_VIDEO => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_VIDEO, SubdefSpecs::TYPE_ANIMATION], SubdefType::TYPE_VIDEO => [SubdefSpecs::TYPE_IMAGE, SubdefSpecs::TYPE_VIDEO, SubdefSpecs::TYPE_ANIMATION, SubdefSpecs::TYPE_AUDIO],
SubdefType::TYPE_UNKNOWN => [SubdefSpecs::TYPE_IMAGE], SubdefType::TYPE_UNKNOWN => [SubdefSpecs::TYPE_IMAGE],
]; ];
const CLASS_THUMBNAIL = 'thumbnail'; const CLASS_THUMBNAIL = 'thumbnail';
@@ -156,6 +156,10 @@ class databox_subdef
if ($sd->audiosamplerate) { if ($sd->audiosamplerate) {
$audio->setOptionValue(Audio::OPTION_AUDIOSAMPLERATE, (int) $sd->audiosamplerate); $audio->setOptionValue(Audio::OPTION_AUDIOSAMPLERATE, (int) $sd->audiosamplerate);
} }
if ($sd->audiochannel) {
$audio->setOptionValue(Audio::OPTION_AUDIOCHANNEL, (string) $sd->audiochannel);
}
return $audio; return $audio;
} }
/** /**