diff --git a/README.md b/README.md
index 13585008df..63c4e3b30c 100644
--- a/README.md
+++ b/README.md
@@ -16,31 +16,27 @@ https://docs.phraseanet.com/3.6/
#Easy Installation
-Get the latests sources here https://github.com/alchemy-fr/Phraseanet/downloads
+Get the latest sources here https://github.com/alchemy-fr/Phraseanet/downloads
**Setup your webserver**
***Nginx***
server {
- listen 80;
- server_name subdeomain.domain.tld;
- root /path/to/Phraseanet/www;
+ listen 80;
+ server_name subdomain.domain.tld;
+ root /path/to/Phraseanet/www;
- index index.php;
+ index index.php;
-
- location /web {
- alias /path/to/Phraseanet/datas/web;
- }
- location /download {
- internal;
- alias /path/to/Phraseanet/tmp/download;
- }
- location /lazaret {
- internal;
- alias /path/to/Phraseanet/tmp/lazaret;
- }
+ location /download {
+ internal;
+ alias /path/to/Phraseanet/tmp/download;
+ }
+ location /lazaret {
+ internal;
+ alias /path/to/Phraseanet/tmp/lazaret;
+ }
}
@@ -52,3 +48,4 @@ Let's go !
Phraseanet is licensed under GPL-v3 license.
[1]: http://developer.phraseanet.com/
+
diff --git a/bin/console b/bin/console
index c4e89926b6..f70653c09e 100755
--- a/bin/console
+++ b/bin/console
@@ -23,7 +23,14 @@ use Symfony\Component\Console\Input\InputOption;
use Symfony\Component\Console\Output\OutputInterface;
use Symfony\Component\Console\Application;
-require_once dirname(__FILE__) . '/../lib/bootstrap.php';
+require_once dirname(__FILE__) . '/../lib/classes/bootstrap.class.php';
+
+bootstrap::register_autoloads();
+
+$configuration = Alchemy\Phrasea\Core\Configuration::build();
+if ($configuration->isInstalled()) {
+ require_once dirname(__FILE__) . '/../lib/bootstrap.php';
+}
try {
$app = new Application("
diff --git a/composer.lock b/composer.lock
index 1f492083c4..23e0c948ee 100644
--- a/composer.lock
+++ b/composer.lock
@@ -24,7 +24,7 @@
{
"package": "data-uri/data-uri",
"version": "dev-master",
- "source-reference": "34f587d4baf0e1127da23e78df0ebff9ff1d37a0"
+ "source-reference": "f92fcef4f8f93c05d8cc86cbe8ef5f9f3fe428c5"
},
{
"package": "doctrine/common",
@@ -85,7 +85,7 @@
{
"package": "php-xpdf/php-xpdf",
"version": "dev-master",
- "source-reference": "34ad2e4830a56f1378bba6e92f9e97795e56aa15"
+ "source-reference": "f5b447a68a1f67a088290326e636494a8bfcbee9"
},
{
"package": "phpexiftool/exiftool",
@@ -108,6 +108,11 @@
"alias-pretty-version": "1.0.x-dev",
"alias-version": "1.0.9999999.9999999-dev"
},
+ {
+ "package": "silex/silex",
+ "version": "dev-master",
+ "source-reference": "410c1ddd14794e332edacbab4037584185529d2e"
+ },
{
"package": "silex/silex",
"version": "dev-master",
@@ -117,7 +122,8 @@
{
"package": "silex/silex",
"version": "dev-master",
- "source-reference": "410c1ddd14794e332edacbab4037584185529d2e"
+ "alias-pretty-version": "1.0.x-dev",
+ "alias-version": "1.0.9999999.9999999-dev"
},
{
"package": "swftools/swftools",
@@ -127,7 +133,8 @@
{
"package": "swiftmailer/swiftmailer",
"version": "dev-master",
- "source-reference": "d33d54cc8a081b0b85734744936ede1ba230dd64"
+ "alias-pretty-version": "4.1.x-dev",
+ "alias-version": "4.1.9999999.9999999-dev"
},
{
"package": "swiftmailer/swiftmailer",
@@ -135,6 +142,17 @@
"alias-pretty-version": "4.1.x-dev",
"alias-version": "4.1.9999999.9999999-dev"
},
+ {
+ "package": "swiftmailer/swiftmailer",
+ "version": "dev-master",
+ "source-reference": "d33d54cc8a081b0b85734744936ede1ba230dd64"
+ },
+ {
+ "package": "symfony/symfony",
+ "version": "dev-master",
+ "alias-pretty-version": "2.1.x-dev",
+ "alias-version": "2.1.9999999.9999999-dev"
+ },
{
"package": "symfony/symfony",
"version": "dev-master",
@@ -162,6 +180,12 @@
"alias-pretty-version": "1.8.x-dev",
"alias-version": "1.8.9999999.9999999-dev"
},
+ {
+ "package": "twig/twig",
+ "version": "dev-master",
+ "alias-pretty-version": "1.8.x-dev",
+ "alias-version": "1.8.9999999.9999999-dev"
+ },
{
"package": "twig/twig",
"version": "dev-master",
diff --git a/config/connexions.sample.yml b/config/connexions.sample.yml
index 6370779763..f9664509e9 100644
--- a/config/connexions.sample.yml
+++ b/config/connexions.sample.yml
@@ -15,5 +15,5 @@ main_connexion:
#Define a connexion to a SQLite database named test_connexion
test_connexion:
driver: pdo_sqlite
- path: /PATH/TO/SQLITE/DATABASE
+ path: :memory:
charset: UTF8
diff --git a/hudson/connexions.yml b/hudson/connexions.yml
index de48b326e4..28876858bb 100755
--- a/hudson/connexions.yml
+++ b/hudson/connexions.yml
@@ -8,5 +8,5 @@ main_connexion:
charset: UTF8
test_connexion:
driver: pdo_sqlite
- path: /tmp/tests.sqlite
+ path: :memory:
charset: UTF8
diff --git a/lib/Alchemy/Phrasea/Core.php b/lib/Alchemy/Phrasea/Core.php
index c13fd5b31c..3c721ad47b 100644
--- a/lib/Alchemy/Phrasea/Core.php
+++ b/lib/Alchemy/Phrasea/Core.php
@@ -488,6 +488,7 @@ class Core extends \Pimple
ini_set('session.auto_start', '0');
ini_set('session.hash_function', '1');
ini_set('session.hash_bits_per_character', '6');
+ ini_set('session.cache_limiter', '');
ini_set('allow_url_fopen', 'on');
return;
diff --git a/lib/Doctrine/Proxies/__CG__EntitiesBasket.php b/lib/Doctrine/Proxies/__CG__EntitiesBasket.php
index 0e30ba640a..a20ad5fd4c 100644
--- a/lib/Doctrine/Proxies/__CG__EntitiesBasket.php
+++ b/lib/Doctrine/Proxies/__CG__EntitiesBasket.php
@@ -41,203 +41,175 @@ class Basket extends \Entities\Basket implements \Doctrine\ORM\Proxy\Proxy
return $this->__isInitialized__;
}
-
+
public function getId()
{
if ($this->__isInitialized__ === false) {
return (int) $this->_identifier["id"];
}
$this->__load();
-
return parent::getId();
}
public function setName($name)
{
$this->__load();
-
return parent::setName($name);
}
public function getName()
{
$this->__load();
-
return parent::getName();
}
public function setDescription($description)
{
$this->__load();
-
return parent::setDescription($description);
}
public function getDescription()
{
$this->__load();
-
return parent::getDescription();
}
public function setUsrId($usrId)
{
$this->__load();
-
return parent::setUsrId($usrId);
}
public function getUsrId()
{
$this->__load();
-
return parent::getUsrId();
}
public function setPusherId($pusherId)
{
$this->__load();
-
return parent::setPusherId($pusherId);
}
public function getPusherId()
{
$this->__load();
-
return parent::getPusherId();
}
public function setArchived($archived)
{
$this->__load();
-
return parent::setArchived($archived);
}
public function getArchived()
{
$this->__load();
-
return parent::getArchived();
}
public function setCreated($created)
{
$this->__load();
-
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
-
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
-
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
-
return parent::getUpdated();
}
public function addBasketElement(\Entities\BasketElement $elements)
{
$this->__load();
-
return parent::addBasketElement($elements);
}
public function getElements()
{
$this->__load();
-
return parent::getElements();
}
public function getElementsByOrder($ordre)
{
$this->__load();
-
return parent::getElementsByOrder($ordre);
}
public function setPusher(\User_Adapter $user)
{
$this->__load();
-
return parent::setPusher($user);
}
public function getPusher()
{
$this->__load();
-
return parent::getPusher();
}
public function setOwner(\User_Adapter $user)
{
$this->__load();
-
return parent::setOwner($user);
}
public function getOwner()
{
$this->__load();
-
return parent::getOwner();
}
public function setValidation(\Entities\ValidationSession $validation)
{
$this->__load();
-
return parent::setValidation($validation);
}
public function getValidation()
{
$this->__load();
-
return parent::getValidation();
}
public function setIsRead($isRead)
{
$this->__load();
-
return parent::setIsRead($isRead);
}
public function getIsRead()
{
$this->__load();
-
return parent::getIsRead();
}
public function hasRecord(\record_adapter $record)
{
$this->__load();
-
return parent::hasRecord($record);
}
public function getSize()
{
$this->__load();
-
return parent::getSize();
}
@@ -261,6 +233,6 @@ class Basket extends \Entities\Basket implements \Doctrine\ORM\Proxy\Proxy
}
unset($this->_entityPersister, $this->_identifier);
}
-
+
}
-}
+}
\ No newline at end of file
diff --git a/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php b/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php
index e387e7e3da..d36d74b586 100644
--- a/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php
+++ b/lib/Doctrine/Proxies/__CG__EntitiesLazaretSession.php
@@ -41,77 +41,67 @@ class LazaretSession extends \Entities\LazaretSession implements \Doctrine\ORM\P
return $this->__isInitialized__;
}
-
+
public function getId()
{
if ($this->__isInitialized__ === false) {
return (int) $this->_identifier["id"];
}
$this->__load();
-
return parent::getId();
}
public function setUsrId($usrId)
{
$this->__load();
-
return parent::setUsrId($usrId);
}
- public function getUsrId()
+ public function getUser()
{
$this->__load();
-
- return parent::getUsrId();
+ return parent::getUser();
}
public function setCreated($created)
{
$this->__load();
-
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
-
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
-
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
-
return parent::getUpdated();
}
public function addLazaretFiles(\Entities\LazaretFile $files)
{
$this->__load();
-
return parent::addLazaretFiles($files);
}
public function getFiles()
{
$this->__load();
-
return parent::getFiles();
}
public function addLazaretFile(\Entities\LazaretFile $files)
{
$this->__load();
-
return parent::addLazaretFile($files);
}
@@ -135,6 +125,6 @@ class LazaretSession extends \Entities\LazaretSession implements \Doctrine\ORM\P
}
unset($this->_entityPersister, $this->_identifier);
}
-
+
}
-}
+}
\ No newline at end of file
diff --git a/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php
index d2cfeed061..d54062e0b8 100644
--- a/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php
+++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrList.php
@@ -41,105 +41,91 @@ class UsrList extends \Entities\UsrList implements \Doctrine\ORM\Proxy\Proxy
return $this->__isInitialized__;
}
-
+
public function getId()
{
if ($this->__isInitialized__ === false) {
return (int) $this->_identifier["id"];
}
$this->__load();
-
return parent::getId();
}
public function setName($name)
{
$this->__load();
-
return parent::setName($name);
}
public function getName()
{
$this->__load();
-
return parent::getName();
}
public function setCreated($created)
{
$this->__load();
-
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
-
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
-
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
-
return parent::getUpdated();
}
public function addUsrListOwner(\Entities\UsrListOwner $owners)
{
$this->__load();
-
return parent::addUsrListOwner($owners);
}
public function getOwners()
{
$this->__load();
-
return parent::getOwners();
}
public function hasAccess(\User_Adapter $user)
{
$this->__load();
-
return parent::hasAccess($user);
}
public function getOwner(\User_Adapter $user)
{
$this->__load();
-
return parent::getOwner($user);
}
public function addUsrListEntry(\Entities\UsrListEntry $entry)
{
$this->__load();
-
return parent::addUsrListEntry($entry);
}
public function getEntries()
{
$this->__load();
-
return parent::getEntries();
}
public function has(\User_Adapter $user)
{
$this->__load();
-
return parent::has($user);
}
@@ -163,6 +149,6 @@ class UsrList extends \Entities\UsrList implements \Doctrine\ORM\Proxy\Proxy
}
unset($this->_entityPersister, $this->_identifier);
}
-
+
}
-}
+}
\ No newline at end of file
diff --git a/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php b/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php
index 526ba94b6f..a3ca49d4e9 100644
--- a/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php
+++ b/lib/Doctrine/Proxies/__CG__EntitiesUsrListOwner.php
@@ -41,98 +41,85 @@ class UsrListOwner extends \Entities\UsrListOwner implements \Doctrine\ORM\Proxy
return $this->__isInitialized__;
}
-
+
public function getId()
{
if ($this->__isInitialized__ === false) {
return (int) $this->_identifier["id"];
}
$this->__load();
-
return parent::getId();
}
public function setUsrId($usrId)
{
$this->__load();
-
return parent::setUsrId($usrId);
}
public function getUsrId()
{
$this->__load();
-
return parent::getUsrId();
}
public function setRole($role)
{
$this->__load();
-
return parent::setRole($role);
}
public function getRole()
{
$this->__load();
-
return parent::getRole();
}
public function setCreated($created)
{
$this->__load();
-
return parent::setCreated($created);
}
public function getCreated()
{
$this->__load();
-
return parent::getCreated();
}
public function setUpdated($updated)
{
$this->__load();
-
return parent::setUpdated($updated);
}
public function getUpdated()
{
$this->__load();
-
return parent::getUpdated();
}
public function setList(\Entities\UsrList $list)
{
$this->__load();
-
return parent::setList($list);
}
public function getList()
{
$this->__load();
-
return parent::getList();
}
public function setUser(\User_Adapter $user)
{
$this->__load();
-
return parent::setUser($user);
}
public function getUser()
{
$this->__load();
-
return parent::getUser();
}
@@ -156,6 +143,6 @@ class UsrListOwner extends \Entities\UsrListOwner implements \Doctrine\ORM\Proxy
}
unset($this->_entityPersister, $this->_identifier);
}
-
+
}
-}
+}
\ No newline at end of file
diff --git a/lib/classes/media/subdef.class.php b/lib/classes/media/subdef.class.php
index 79c9965813..fb3003faa8 100644
--- a/lib/classes/media/subdef.class.php
+++ b/lib/classes/media/subdef.class.php
@@ -177,7 +177,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
return $this;
} catch (Exception $e) {
-
+
}
$connbas = $this->record->get_databox()->get_connection();
@@ -606,59 +606,31 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
$datas = array();
- if (method_exists($media, 'getWidth')) {
- $datas[self::TC_DATA_WIDTH] = $media->getWidth();
- }
- if (method_exists($media, 'getHeight')) {
- $datas[self::TC_DATA_HEIGHT] = $media->getHeight();
- }
- if (method_exists($media, 'getFocalLength')) {
- $datas[self::TC_DATA_FOCALLENGTH] = $media->getFocalLength();
- }
- if (method_exists($media, 'getChannels')) {
- $datas[self::TC_DATA_CHANNELS] = $media->getChannels();
- }
- if (method_exists($media, 'getColorDepth')) {
- $datas[self::TC_DATA_COLORDEPTH] = $media->getColorDepth();
- }
- if (method_exists($media, 'getCameraModel')) {
- $datas[self::TC_DATA_CAMERAMODEL] = $media->getCameraModel();
- }
- if (method_exists($media, 'getFlashFired')) {
- $datas[self::TC_DATA_FLASHFIRED] = $media->getFlashFired();
- }
- if (method_exists($media, 'getAperture')) {
- $datas[self::TC_DATA_APERTURE] = $media->getAperture();
- }
- if (method_exists($media, 'getShutterSpeed')) {
- $datas[self::TC_DATA_SHUTTERSPEED] = $media->getShutterSpeed();
- }
- if (method_exists($media, 'getHyperfocalDistance')) {
- $datas[self::TC_DATA_HYPERFOCALDISTANCE] = $media->getHyperfocalDistance();
- }
- if (method_exists($media, 'getISO')) {
- $datas[self::TC_DATA_ISO] = $media->getISO();
- }
- if (method_exists($media, 'getLightValue')) {
- $datas[self::TC_DATA_LIGHTVALUE] = $media->getLightValue();
- }
- if (method_exists($media, 'getColorSpace')) {
- $datas[self::TC_DATA_COLORSPACE] = $media->getColorSpace();
- }
- if (method_exists($media, 'getDuration')) {
- $datas[self::TC_DATA_DURATION] = $media->getDuration();
- }
- if (method_exists($media, 'getFrameRate')) {
- $datas[self::TC_DATA_FRAMERATE] = $media->getFrameRate();
- }
- if (method_exists($media, 'getAudioSampleRate')) {
- $datas[self::TC_DATA_AUDIOSAMPLERATE] = $media->getAudioSampleRate();
- }
- if (method_exists($media, 'getVideoCodec')) {
- $datas[self::TC_DATA_VIDEOCODEC] = $media->getVideoCodec();
- }
- if (method_exists($media, 'getAudioCodec')) {
- $datas[self::TC_DATA_AUDIOCODEC] = $media->getAudioCodec();
+ $methods = array(
+ self::TC_DATA_WIDTH => 'getWidth',
+ self::TC_DATA_HEIGHT => 'getHeight',
+ self::TC_DATA_FOCALLENGTH => 'getFocalLength',
+ self::TC_DATA_CHANNELS => 'getChannels',
+ self::TC_DATA_COLORDEPTH => 'getColorDepth',
+ self::TC_DATA_CAMERAMODEL => 'getCameraModel',
+ self::TC_DATA_FLASHFIRED => 'getFlashFired',
+ self::TC_DATA_APERTURE => 'getAperture',
+ self::TC_DATA_SHUTTERSPEED => 'getShutterSpeed',
+ self::TC_DATA_HYPERFOCALDISTANCE => 'getHyperfocalDistance',
+ self::TC_DATA_ISO => 'getISO',
+ self::TC_DATA_LIGHTVALUE => 'getLightValue',
+ self::TC_DATA_COLORSPACE => 'getColorSpace',
+ self::TC_DATA_DURATION => 'getDuration',
+ self::TC_DATA_FRAMERATE => 'getFrameRate',
+ self::TC_DATA_AUDIOSAMPLERATE => 'getAudioSampleRate',
+ self::TC_DATA_VIDEOCODEC => 'getVideoCodec',
+ self::TC_DATA_AUDIOCODEC => 'getAudioCodec',
+ );
+
+ foreach ($methods as $tc_name => $method) {
+ if (method_exists($media, $method)) {
+ $datas[$tc_name] = call_user_method($method, $media);
+ }
}
$datas[self::TC_DATA_LONGITUDE] = $media->getLongitude();
@@ -689,8 +661,10 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
':dispatched' => 1,
);
- if (in_array($media->getType(), array(Media::TYPE_IMAGE, Media::TYPE_VIDEO))) {
+ if (method_exists($media, 'getWidth') && null !== $media->getWidth()) {
$params[':width'] = $media->getWidth();
+ }
+ if (method_exists($media, 'getHeight') && null !== $media->getHeight()) {
$params[':height'] = $media->getHeight();
}
diff --git a/lib/classes/module/console/systemConfigCheck.class.php b/lib/classes/module/console/systemConfigCheck.class.php
index 04f96f5fe5..f75897cf22 100644
--- a/lib/classes/module/console/systemConfigCheck.class.php
+++ b/lib/classes/module/console/systemConfigCheck.class.php
@@ -86,7 +86,7 @@ class module_console_systemConfigCheck extends Command
{
$hasError = false;
foreach ($constraints as $constraint) {
- if ( ! $hasError && ! $this->processConstraint($constraint, $output)) {
+ if ( ! $this->processConstraint($constraint, $output)) {
$hasError = true;
}
}
diff --git a/lib/classes/module/console/taskrun.class.php b/lib/classes/module/console/taskrun.class.php
old mode 100755
new mode 100644
index 4f3b7e0cab..81f3803e3f
--- a/lib/classes/module/console/taskrun.class.php
+++ b/lib/classes/module/console/taskrun.class.php
@@ -97,7 +97,9 @@ class module_console_taskrun extends Command
}
}
- $logger = new Logger('Task logger');
+ $core = \bootstrap::getCore();
+
+ $logger = $core['monolog'];
if ($input->getOption('verbose')) {
$handler = new Handler\StreamHandler(fopen('php://stdout', 'a'));
diff --git a/lib/classes/patch/370a6.class.php b/lib/classes/patch/370a6.class.php
index 9b62cc25ac..baf7f8a5c7 100644
--- a/lib/classes/patch/370a6.class.php
+++ b/lib/classes/patch/370a6.class.php
@@ -53,7 +53,23 @@ class patch_370a6 implements patchInterface
public function apply(base &$databox)
{
-
+ $structure = $databox->get_structure();
+
+ $DOM = new DOMDocument();
+ $DOM->loadXML($structure);
+
+ $xpath = new DOMXpath($DOM);
+
+ foreach($xpath->query('/record/subdefs/subdefgroup[@name="video"]/subdef[@name="preview"]/acodec') as $node){
+ $node->nodeValue = 'libfaac';
+ }
+
+ foreach($xpath->query('/record/subdefs/subdefgroup[@name="video"]/subdef[@name="preview"]/vcodec') as $node){
+ $node->nodeValue = 'libx264';
+ }
+
+ $databox->saveStructure($DOM);
+
$subdefgroups = $databox->get_subdef_structure();
foreach ($subdefgroups as $groupname => $subdefs) {
diff --git a/lib/classes/record/adapter.class.php b/lib/classes/record/adapter.class.php
index 49f3f37c34..d62d37d30f 100644
--- a/lib/classes/record/adapter.class.php
+++ b/lib/classes/record/adapter.class.php
@@ -180,7 +180,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
return $this;
} catch (Exception $e) {
-
+
}
$connbas = $this->databox->get_connection();
@@ -504,7 +504,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
try {
return $this->get_subdef('thumbnailGIF');
} catch (Exception $e) {
-
+
}
return null;
@@ -550,7 +550,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
try {
return $this->get_data_from_cache(self::CACHE_STATUS);
} catch (Exception $e) {
-
+
}
$sql = 'SELECT BIN(status) as status FROM record
WHERE record_id = :record_id';
@@ -694,7 +694,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
try {
return $this->get_data_from_cache(self::CACHE_SUBDEFS);
} catch (Exception $e) {
-
+
}
$connbas = $this->get_databox()->get_connection();
@@ -1003,62 +1003,25 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$core['file-system']->chmod($subdefFile->getRealPath(), 0760);
- try {
- $appbox = \appbox::get_instance(\bootstrap::getCore());
- $session = $appbox->get_session();
+ media_subdef::create($this, $name, $media);
- $connbas = connection::getPDOConnection($this->get_sbas_id());
+ $appbox = \appbox::get_instance(\bootstrap::getCore());
+ $session = $appbox->get_session();
- $sql = 'UPDATE subdef
- SET file = :filename,
- width = :width,
- height = :height,
- mime = :mime,
- path = :path,
- size = :size,
- substit = 1
- updated_on = now()
- WHERE name = :name AND record_id = :record_id';
-
- $params = array(
- ':record_id' => $this->record_id,
- ':name' => $name,
- ':filename' => $subdefFile->getFilename(),
- ':mime' => $subdefFile->getMimeType(),
- ':path' => $subdefFile->getPath(),
- ':filesize' => $subdefFile->getSize(),
- );
-
- if (method_exists($media, 'getWidth')) {
- $params[':width'] = $media->getWidth();
- }
- if (method_exists($media, 'getHeight')) {
- $params[':height'] = $media->getHeight();
- }
-
- $stmt = $connbas->prepare($sql);
-
- $stmt->execute($params);
-
- $subdef = $this->get_subdef($name);
- $subdef->delete_data_from_cache();
-
- $this->delete_data_from_cache(self::CACHE_SUBDEFS);
-
- if ($meta_writable) {
- $this->write_metas();
- }
- if ($name == 'document') {
- $this->rebuild_subdefs();
- }
-
- $type = $name == 'document' ? 'HD' : $name;
-
- $session->get_logger($this->get_databox())
- ->log($this, Session_Logger::EVENT_SUBSTITUTE, $type, '');
- } catch (Exception $e) {
+ $this->delete_data_from_cache(self::CACHE_SUBDEFS);
+ if ($meta_writable) {
+ $this->write_metas();
}
+
+ if ($name == 'document') {
+ $this->rebuild_subdefs();
+ }
+
+ $type = $name == 'document' ? 'HD' : $name;
+
+ $session->get_logger($this->get_databox())
+ ->log($this, Session_Logger::EVENT_SUBSTITUTE, $type, '');
return $this;
}
@@ -1267,7 +1230,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$sphinx->update_status(array("metadatas" . $sbas_crc, "metadatas" . $sbas_crc . "_stemmed_en", "metadatas" . $sbas_crc . "_stemmed_fr", "documents" . $sbas_crc), $this->get_sbas_id(), $this->get_record_id(), strrev($status));
}
} catch (Exception $e) {
-
+
}
$this->delete_data_from_cache(self::CACHE_STATUS);
@@ -1380,7 +1343,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
}
$pathhd = databox::dispatch(trim($databox->get_sxml_structure()->path));
- $newname = $record->get_record_id() . "_document." . $file->getFile()->getExtension();
+ $newname = $record->get_record_id() . "_document." . pathinfo($file->getOriginalName(), PATHINFO_EXTENSION);
$core['file-system']->copy($file->getFile()->getRealPath(), $pathhd . $newname, true);
@@ -1657,14 +1620,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
{
$subdefs = $databox->get_subdef_structure()->getSubdefGroup($this->get_type());
- $Core = bootstrap::getCore();
-
- if ( ! $logger) {
- $logger = $Core['monolog'];
- }
-
if ( ! $subdefs) {
- $Core['monolog']->addInfo(sprintf('Nothing to do for %s', $this->get_type()));
+ $logger->addInfo(sprintf('Nothing to do for %s', $this->get_type()));
return;
}
@@ -1680,15 +1637,15 @@ class record_adapter implements record_Interface, cache_cacheableInterface
$pathdest = null;
if ($this->has_subdef($subdefname) && $this->get_subdef($subdefname)->is_physically_present()) {
-
$pathdest = $this->get_subdef($subdefname)->get_pathfile();
$this->get_subdef($subdefname)->remove_file();
-
+ $logger->addInfo(sprintf('Removed old file for %s', $subdefname));
$this->clearSubdefCache($subdefname);
}
$pathdest = $this->generateSubdefPathname($subdef, $pathdest);
+ $logger->addInfo(sprintf('Generating subdef to %s', $pathdest));
$this->generate_subdef($subdef, $pathdest, $logger);
if (file_exists($pathdest)) {
@@ -1732,6 +1689,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
try {
if (null === $this->get_hd_file()) {
+ $logger->addInfo('No HD file found, aborting');
return;
}
@@ -1910,7 +1868,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
try {
$subdef->rotate($angle);
} catch (\Exception $e) {
-
+
}
}
diff --git a/lib/classes/setup.class.php b/lib/classes/setup.class.php
index afa1794d78..4b419171fa 100644
--- a/lib/classes/setup.class.php
+++ b/lib/classes/setup.class.php
@@ -39,6 +39,7 @@ class setup
, "phrasea2"
, "SimpleXML"
, "sockets"
+ , "sqlite3"
, "xml"
, "zip"
, "zlib"
@@ -49,22 +50,23 @@ class setup
);
protected static $PHP_CONF = array(
'output_buffering' => '4096' //INI_ALL
- , 'memory_limit' => '1024M' //INI_ALL
+ , 'memory_limit' => '2048M' //INI_ALL
, 'error_reporting' => '6143' //INI_ALL
, 'default_charset' => 'UTF-8' //INI_ALL
- , 'session.use_cookies' => '1' //INI_ALL
- , 'session.use_only_cookies' => '1' //INI_ALL
- , 'session.auto_start' => '0' //INI_ALL
- , 'session.hash_function' => '1' //INI_ALL
+ , 'session.use_cookies' => 'on' //INI_ALL
+ , 'session.use_only_cookies' => 'on' //INI_ALL
+ , 'session.auto_start' => 'off' //INI_ALL
+ , 'session.hash_function' => 'on' //INI_ALL
, 'session.hash_bits_per_character' => '6' //INI_ALL
, 'allow_url_fopen' => 'on' //INI_ALL
, 'display_errors' => 'off' //INI_ALL
, 'display_startup_errors' => 'off' //INI_ALL
, 'log_errors' => 'off' //INI_ALL
+ , 'session.cache_limiter' => '' //INI_ALL
);
protected static $PHP_REQ = array(
'safe_mode' => 'off'
- , 'file_uploads' => '1'
+ , 'file_uploads' => 'on'
, 'magic_quotes_runtime' => 'off' //INI_ALL
, 'magic_quotes_gpc' => 'off' //INI_PER_DIR -- just for check
);
@@ -191,17 +193,21 @@ class setup
public static function check_binaries(registryInterface $registry)
{
+ $finder = new \Symfony\Component\Process\ExecutableFinder();
+
$binaries = array(
- 'PHP CLI' => $registry->get('GV_cli'),
- 'ImageMagick (convert)' => $registry->get('GV_imagick'),
- 'PDF 2 SWF' => $registry->get('GV_pdf2swf'),
- 'Unoconv' => $registry->get('GV_unoconv'),
- 'SWFextract' => $registry->get('GV_swf_extract'),
- 'SWFrender' => $registry->get('GV_swf_render'),
- 'MP4Box' => $registry->get('GV_mp4box'),
- 'xpdf (pdf2text)' => $registry->get('GV_pdftotext'),
- 'ImageMagick (composite)' => $registry->get('GV_pathcomposite'),
- 'FFmpeg' => $registry->get('GV_ffmpeg'),
+ 'PHP CLI' => $registry->get('GV_cli', $finder->find('php')),
+ 'ImageMagick (convert)' => $registry->get('GV_imagick', $finder->find('convert')),
+ 'PDF 2 SWF' => $registry->get('GV_pdf2swf', $finder->find('pdf2swf')),
+ 'Unoconv' => $registry->get('GV_unoconv', $finder->find('unoconv')),
+ 'SWFextract' => $registry->get('GV_swf_extract', $finder->find('swfextract')),
+ 'SWFrender' => $registry->get('GV_swf_render', $finder->find('swfrender')),
+ 'MP4Box' => $registry->get('GV_mp4box', $finder->find('MP4Box')),
+ 'xpdf (pdf2text)' => $registry->get('GV_pdftotext', $finder->find('pdftotext')),
+ 'ImageMagick (composite)' => $registry->get('GV_pathcomposite', $finder->find('composite')),
+ 'FFmpeg' => $registry->get('GV_ffmpeg', $finder->find('ffmpeg')),
+ 'FFprobe' => $registry->get('GV_ffprobe', $finder->find('ffprobe')),
+ 'phraseanet_indexer' => $finder->find('phraseanet_indexer'),
);
$constraints = array();
@@ -601,21 +607,21 @@ class setup
public static function check_php_configuration()
{
- $nonblockers = array('log_errors', 'display_startup_errors', 'display_errors');
+ $nonblockers = array('log_errors', 'display_startup_errors', 'display_errors', 'output_buffering');
$constraints = array();
foreach (self::$PHP_REQ as $conf => $value) {
- if (($tmp = self::test_php_conf($conf, $value)) === false) {
+ if (($tmp = self::test_php_conf($conf, $value)) !== $value) {
$constraints[] = new Setup_Constraint($conf, false, sprintf(_('setup::Configuration mauvaise : pour la variable %1$s, configuration donnee : %2$s ; attendue : %3$s'), $conf, $tmp, $value), true);
} else {
- $constraints[] = new Setup_Constraint($conf, true, sprintf('%s = %s => OK', $conf, $value), true);
+ $constraints[] = new Setup_Constraint($conf, true, sprintf('%s = `%s` => OK', $conf, $value), true);
}
}
foreach (self::$PHP_CONF as $conf => $value) {
- if (($tmp = self::test_php_conf($conf, $value)) === false) {
- $constraints[] = new Setup_Constraint($conf, false, sprintf('Bad configuration for %1$s var ; %2$s given - %3$s supposed', $conf, $tmp, $value), ! in_array($conf, $nonblockers));
+ if (($tmp = self::test_php_conf($conf, $value)) !== $value) {
+ $constraints[] = new Setup_Constraint($conf, false, sprintf('Bad configuration for %1$s, found `%2$s`, required `%3$s`', $conf, $tmp, $value), ! in_array($conf, $nonblockers));
} else {
- $constraints[] = new Setup_Constraint($conf, true, sprintf('%s = %s => OK', $conf, $value), ! in_array($conf, $nonblockers));
+ $constraints[] = new Setup_Constraint($conf, true, sprintf('%s = `%s` => OK', $conf, $value), ! in_array($conf, $nonblockers));
}
}
@@ -674,7 +680,7 @@ class setup
private static function test_php_conf($conf, $value)
{
$is_flag = false;
- $flags = array('on', 'off', '1', '0', '');
+ $flags = array('on', 'off', '1', '0');
if (in_array(strtolower($value), $flags))
$is_flag = true;
$current = ini_get($conf);
@@ -683,17 +689,16 @@ class setup
if (($current === '' || $current === 'off' || $current === '0') && $is_flag) {
if ($value === 'off' || $value === '0' || $value === '') {
- return $current;
+ return 'off';
}
}
if (($current === '1' || $current === 'on') && $is_flag) {
if ($value === 'on' || $value === '1') {
- return $current;
+ return 'on';
}
}
- if ($current === $value) {
- return $current;
- }
+
+ return $current;
}
public static function rollback(connection_pdo $conn, connection_pdo $connbas = null)
@@ -714,7 +719,7 @@ class setup
$stmt->execute();
$stmt->closeCursor();
} catch (Exception $e) {
-
+
}
}
if ($connbas) {
@@ -725,7 +730,7 @@ class setup
$stmt->execute();
$stmt->closeCursor();
} catch (Exception $e) {
-
+
}
}
}
diff --git a/lib/conf.d/data_templates/en-simple.xml b/lib/conf.d/data_templates/en-simple.xml
index 57b8965731..d96d3ced22 100644
--- a/lib/conf.d/data_templates/en-simple.xml
+++ b/lib/conf.d/data_templates/en-simple.xml
@@ -1,7 +1,6 @@
{{datapathnoweb}}{{basename}}/documents
-
@@ -12,6 +11,7 @@
no
75
yes
+ screen
image
@@ -24,13 +24,119 @@
yes
75
no
+ screen
image
+
+ 480
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
-
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ 300
+ 2
+ 25
+ 480
+ 15
+ handheld
+ libvpx
+ libvorbis
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ 300
+ 2
+ 25
+ 480
+ 15
+ handheld
+ libtheora
+ libvorbis
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ 300
+ 2
+ 25
+ 480
+ 15
+ handheld
+ libfaac
+ libx264
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ screen
+ 1000
+ 1
+ libvorbis
+ 25
+ 800
+ 15
+ libvpx
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ screen
+ 1000
+ 1
+ libvorbis
+ 25
+ 800
+ 15
+ libtheora
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
{{datapathnoweb}}{{basename}}/subdefs
800
@@ -38,6 +144,7 @@
yes
libfaac
libx264
+ screen
1000
8
15
@@ -49,6 +156,7 @@
200
gif
500
+ screen
no
@@ -56,34 +164,57 @@
{{datapathnoweb}}{{basename}}/subdefs
200
+ screen
image
no
-
{{datapathnoweb}}{{basename}}/subdefs
audio
yes
+ screen
{{datapathnoweb}}{{basename}}/subdefs
image
+ 200
+ screen
no
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ audio
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
{{datapathnoweb}}{{basename}}/subdefs
flexpaper
no
+ screen
@@ -94,9 +225,29 @@
72
200
no
+ screen
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ flexpaper
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
@@ -106,6 +257,7 @@
no
resample
72
+ screen
@@ -115,9 +267,34 @@
no
resample
72
+ screen
+
+ 480
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
diff --git a/lib/conf.d/data_templates/fr-simple.xml b/lib/conf.d/data_templates/fr-simple.xml
index 2f565753f8..fc22eff384 100755
--- a/lib/conf.d/data_templates/fr-simple.xml
+++ b/lib/conf.d/data_templates/fr-simple.xml
@@ -11,6 +11,7 @@
no
75
yes
+ screen
image
@@ -23,12 +24,119 @@
yes
75
no
+ screen
image
+
+ 480
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ 300
+ 2
+ 25
+ 480
+ 15
+ handheld
+ libvpx
+ libvorbis
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ 300
+ 2
+ 25
+ 480
+ 15
+ handheld
+ libtheora
+ libvorbis
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ 300
+ 2
+ 25
+ 480
+ 15
+ handheld
+ libfaac
+ libx264
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ screen
+ 1000
+ 1
+ libvorbis
+ 25
+ 800
+ 15
+ libvpx
+
+
+
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ video
+ screen
+ 1000
+ 1
+ libvorbis
+ 25
+ 800
+ 15
+ libtheora
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
{{datapathnoweb}}{{basename}}/subdefs
800
@@ -36,6 +144,7 @@
yes
libfaac
libx264
+ screen
1000
8
15
@@ -47,6 +156,7 @@
200
gif
500
+ screen
no
@@ -54,6 +164,7 @@
{{datapathnoweb}}{{basename}}/subdefs
200
+ screen
image
no
@@ -65,6 +176,7 @@
{{datapathnoweb}}{{basename}}/subdefs
audio
yes
+ screen
@@ -72,16 +184,37 @@
{{datapathnoweb}}{{basename}}/subdefs
image
200
+ screen
no
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ audio
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
{{datapathnoweb}}{{basename}}/subdefs
flexpaper
no
+ screen
@@ -92,9 +225,29 @@
72
200
no
+ screen
+
+ {{datapathnoweb}}{{basename}}/subdefs
+ flexpaper
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
@@ -104,6 +257,7 @@
no
resample
72
+ screen
@@ -113,14 +267,37 @@
no
resample
72
+ screen
+
+ 480
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
+
+ 150
+ 72
+ yes
+ 75
+ {{datapathnoweb}}{{basename}}/subdefs
+ image
+ no
+ handheld
+
+
+
-
-
diff --git a/templates/web/common/HTML5Video.html.twig b/templates/web/common/HTML5Video.html.twig
new file mode 100644
index 0000000000..8c185f80ba
--- /dev/null
+++ b/templates/web/common/HTML5Video.html.twig
@@ -0,0 +1,37 @@
+{% macro format(arraySubdefs, displayWidth, displayHeight, extraclass, session, wrap)%}
+
+ {% set displayWidth = displayWidth %}
+ {% set displayHeight = displayHeight|default(displayWidth) %}
+
+ {% if wrap %}
+
+ {% endif %}
+
+{% endmacro %}
+
+
diff --git a/templates/web/common/preview.html b/templates/web/common/preview.html
index 6adfc8cfa9..9b17de720d 100644
--- a/templates/web/common/preview.html
+++ b/templates/web/common/preview.html
@@ -1,16 +1,34 @@
{% import 'common/thumbnail.html' as thumbnail %}
+{% import 'common/HTML5Video.html.twig' as thumbnailHTML5 %}
{% if not_wrapped is defined and not_wrapped %}
- {% set wrap = false %}
+ {% set wrap = false %}
{% else %}
- {% set wrap = true %}
+ {% set wrap = true %}
{% endif %}
+{% set previewHtml5 = null %}
+
{% if user.ACL().has_access_to_subdef(record, 'preview') %}
- {% set preview_obj = record.get_preview() %}
+
+ {% if record.get_type() == 'video' %}
+ {% set previewHtml5 = record.getSubdfefByDeviceAndMime(constant('\\databox_subdef::DEVICE_SCREEN'), ['video/ogg', 'video/mp4', 'video/webm']) %}
+ {% if previewHtml5|length < 3 %}
+ {% set previewHtml5 = null %}
+ {% endif %}
+ {% endif %}
+
+ {% set preview_obj = record.get_preview() %}
{% else %}
- {% set preview_obj = record.get_thumbnail() %}
+ {% set preview_obj = record.get_thumbnail() %}
{% endif %}
-{{thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', session, wrap)}}
\ No newline at end of file
+{% set width = preview_obj.get_width() %}
+{% set height = preview_obj.get_height() %}
+
+{% if previewHtml5 %}
+ {{ thumbnailHTML5.format(previewHtml5, preview_obj.get_width(), preview_obj.get_height(), '', session, wrap) }}
+{% else %}
+ {{ thumbnail.format(preview_obj, preview_obj.get_width(), preview_obj.get_height(), '', session, wrap) }}
+{% endif %}
diff --git a/templates/web/common/technical_datas.twig b/templates/web/common/technical_datas.twig
index 34ad85f733..04e52110ff 100644
--- a/templates/web/common/technical_datas.twig
+++ b/templates/web/common/technical_datas.twig
@@ -1,14 +1,14 @@
-{% trans 'Record_id' %} : {{record.get_record_id() }}
+{% trans 'Record_id' %} : {{ record.get_record_id() }}
{% if record.is_grouping() == false %}
{% set document = record.get_subdef('document') %}
{% trans 'Nom Original' %} :
- {{record.get_original_name() }}
+ {{ record.get_original_name() }}
- {{record.get_mime() }}
+ {{ record.get_mime() }}
{% if document and document.get_size() %}
- {{document.get_size()|formatoctet}}
@@ -32,27 +32,27 @@
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_CAMERAMODEL')) is not empty %}
{% trans 'Camera Model' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_CAMERAMODEL')) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_CAMERAMODEL')) }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_COLORSPACE')) is not empty %}
{% trans 'Color space' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_COLORSPACE')) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_COLORSPACE')) }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_CHANNELS')) is not empty %}
{% trans 'Channels' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_CHANNELS')) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_CHANNELS')) }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_COLORDEPTH')) is not empty %}
{% trans 'Color Depth' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_COLORDEPTH')) }} bits
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_COLORDEPTH')) }} bits
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_ISO')) is not empty %}
{% trans 'ISO sensibility' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_ISO')) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_ISO')) }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_FLASHFIRED')) is not null %}
@@ -66,53 +66,53 @@
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_SHUTTERSPEED')) is not empty %}
{% trans 'Shutter speed' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_SHUTTERSPEED')) }} s.
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_SHUTTERSPEED')) }} s.
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_APERTURE')) is not empty %}
{% trans 'Aperture' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_APERTURE')) | round(2) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_APERTURE')) | round(2) }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_FOCALLENGTH')) is not empty %}
{% trans 'Focal length' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_FOCALLENGTH')) }} mm
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_FOCALLENGTH')) }} mm
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_HYPERFOCALDISTANCE')) is not empty %}
{% trans 'Hyperfocal distance' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_HYPERFOCALDISTANCE')) | round(2) }} mm
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_HYPERFOCALDISTANCE')) | round(2) }} mm
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_LIGHTVALUE')) is not empty %}
{% trans 'Light Value' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_LIGHTVALUE')) | round(2) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_LIGHTVALUE')) | round(2) }}
{% endif %}
{% if record.get_formated_duration() %}
{% trans 'Duree' %} :
- {{record.get_formated_duration() | round(2) }}
+ {{ record.get_formated_duration() }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_FRAMERATE')) is not empty %}
{% trans 'Images par secondes' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_FRAMERATE')) | round(2) }} ips
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_FRAMERATE')) | round(2) }} ips
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOCODEC')) %}
{% trans 'Codec Audio' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOCODEC')) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOCODEC')) }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_VIDEOCODEC')) %}
{% trans 'Codec Video' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_VIDEOCODEC')) }}
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_VIDEOCODEC')) }}
{% endif %}
{% if record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOSAMPLERATE')) %}
{% trans 'Frequence d\'echantillonage' %} :
- {{record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOSAMPLERATE')) | round(2) }} kHz
+ {{ record.get_technical_infos(constant('media_subdef::TC_DATA_AUDIOSAMPLERATE')) | round(2) }} kHz
{% endif %}
diff --git a/templates/web/prod/actions/Tools/index.html.twig b/templates/web/prod/actions/Tools/index.html.twig
index ba54942f55..74515cd682 100644
--- a/templates/web/prod/actions/Tools/index.html.twig
+++ b/templates/web/prod/actions/Tools/index.html.twig
@@ -121,10 +121,13 @@
+
+
+ {% set previewHtml5 = record.getSubdfefByDeviceAndMime(constant('\\databox_subdef::DEVICE_SCREEN'), ['video/ogg', 'video/mp4', 'video/webm']) %}
diff --git a/tests/Alchemy/Phrasea/Application/OverviewTest.php b/tests/Alchemy/Phrasea/Application/OverviewTest.php
index 2c751b52b0..8021d917d8 100644
--- a/tests/Alchemy/Phrasea/Application/OverviewTest.php
+++ b/tests/Alchemy/Phrasea/Application/OverviewTest.php
@@ -8,6 +8,7 @@ use Symfony\Component\HttpFoundation\Response;
class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
{
+
public function setUp()
{
parent::setUp();
@@ -37,6 +38,45 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
$this->assertEquals(404, $response->getStatusCode());
}
+ function testEtag()
+ {
+ $tmp = tempnam(sys_get_temp_dir(), 'testEtag');
+ copy(__DIR__ . '/../../../testfiles/cestlafete.jpg', $tmp);
+
+ $media = \MediaVorus\MediaVorus::guess(new \SplFileInfo($tmp));
+
+ $file = new Alchemy\Phrasea\Border\File($media, self::$collection);
+ $record = record_adapter::createFromFile($file);
+
+ $crawler = $this->client->request('GET', '/datafiles/' . $record->get_sbas_id() . '/' . $record->get_record_id() . '/preview/');
+ $response = $this->client->getResponse();
+
+ /* @var $response \Symfony\Component\HttpFoundation\Response */
+ $this->assertTrue($response->isOk());
+ $this->assertNull($response->getEtag());
+ $this->assertNull($response->getLastModified());
+ $this->assertNull($response->getMaxAge());
+ $this->assertNull($response->getTtl());
+ $this->assertEquals(0, $response->getAge());
+ $this->assertNull($response->getExpires());
+
+ $record->generate_subdefs($record->get_databox(), self::$core['monolog']);
+
+ $crawler = $this->client->request('GET', '/datafiles/' . $record->get_sbas_id() . '/' . $record->get_record_id() . '/preview/');
+ $response = $this->client->getResponse();
+
+ /* @var $response \Symfony\Component\HttpFoundation\Response */
+ $this->assertTrue($response->isOk());
+ $this->assertNotNull($response->getEtag());
+ $this->assertInstanceOf('DateTime', $response->getLastModified());
+ $this->assertNull($response->getMaxAge());
+ $this->assertNull($response->getTtl());
+ $this->assertGreaterThanOrEqual(0, $response->getAge());
+ $this->assertNull($response->getExpires());
+
+ unlink($tmp);
+ }
+
function testDatafilesRouteNotAuthenticated()
{
$appbox = appbox::get_instance(\bootstrap::getCore());
diff --git a/vendors.php b/vendors.php
index 8d0323d6da..534b152391 100755
--- a/vendors.php
+++ b/vendors.php
@@ -29,7 +29,7 @@ if ( ! is_executable($composer)) {
}
system($composer . ' self-update');
-system($composer . ' update');
+system($composer . ' install');
system('git submodule init');
system('git submodule update');
diff --git a/vendors.win.php b/vendors.win.php
index 02f231f8a5..9112d1c8b7 100755
--- a/vendors.win.php
+++ b/vendors.win.php
@@ -33,7 +33,7 @@ if ( ! file_exists($composer)) {
}
system($phpDir . 'php ' . $composer . ' self-update');
-system($phpDir . 'php ' . $composer . ' update');
+system($phpDir . 'php ' . $composer . ' install');
system($gitDir . 'git submodule init');
system($gitDir . 'git submodule update');
diff --git a/www/include/jquery.tooltip.js b/www/include/jquery.tooltip.js
index 6c643baa79..982aa78798 100644
--- a/www/include/jquery.tooltip.js
+++ b/www/include/jquery.tooltip.js
@@ -228,8 +228,9 @@
var width = 'auto';
var height = 'auto';
var ratio = 1;
- var resizeImgTips = false;
+ var resizeImgTips = resizeVideoTips = false;
var $imgTips = $('#' + settings($.tooltip.current).id + ' .imgTips');
+ var $videoTips = $('#' + settings($.tooltip.current).id + ' .videoTips');
if ($imgTips[0] && $('#' + settings($.tooltip.current).id + ' .noToolTipResize').length === 0) {
resizeImgTips = true;
@@ -238,6 +239,14 @@
ratio = width/height;
$imgTips.css({top:'0px',left:'0px'});
}
+
+ if ($videoTips[0] && $('#' + settings($.tooltip.current).id + ' .noToolTipResize').length === 0) {
+ resizeVideoTips = true;
+ width = parseInt($videoTips.attr('width'));
+ height = parseInt($videoTips.attr('height'));
+ ratio = width/height;
+ $videoTips.css({top:'0px',left:'0px'});
+ }
var v = viewport(),
h = helper.parent;
@@ -415,8 +424,8 @@
height += 20;
helper.parent.css({
- width: width,
- height: height,
+ width: Math.round(width),
+ height: Math.round(height),
left: left,
top: top
});
@@ -424,10 +433,17 @@
if(resizeImgTips)
{
$imgTips.css({
- maxWidth: width,
- maxHeight: height,
- width: '100%',
- height: '100%'
+ maxWidth: Math.round(width - 50),
+ maxHeight: Math.round(height-70)
+ });
+ }
+
+ if(resizeVideoTips)
+ {
+ console.log($videoTips, width, height, Math.round(width - 50), Math.round(height-70));
+ $videoTips.css({
+ width: Math.round(width - 50),
+ height: Math.round(height-70)
});
}
diff --git a/www/include/jslibs/video-js/video-js.css b/www/include/jslibs/video-js/video-js.css
new file mode 100644
index 0000000000..7956aeee28
--- /dev/null
+++ b/www/include/jslibs/video-js/video-js.css
@@ -0,0 +1,499 @@
+/*
+VideoJS Default Styles (http://videojs.com)
+Version 3.2.0
+*/
+
+/*
+REQUIRED STYLES (be careful overriding)
+================================================================================ */
+/* When loading the player, the video tag is replaced with a DIV,
+ that will hold the video tag or object tag for other playback methods.
+ The div contains the video playback element (Flash or HTML5) and controls, and sets the width and height of the video.
+
+ ** If you want to add some kind of border/padding (e.g. a frame), or special positioning, use another containing element.
+ Otherwise you risk messing up control positioning and full window mode. **
+*/
+.video-js {
+ background-color: #000; position: relative; padding: 0;
+
+ /* Start with 10px for base font size so other dimensions can be em based and easily calculable. */
+ font-size: 10px;
+
+ /* Allow poster to be vertially aligned. */
+ vertical-align: middle;
+ /* display: table-cell; */ /*This works in Safari but not Firefox.*/
+}
+
+/* Playback technology elements expand to the width/height of the containing div.