mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 15:33:15 +00:00
Remove baseurl
This commit is contained in:
File diff suppressed because one or more lines are too long
@@ -31,9 +31,6 @@ return call_user_func(
|
|||||||
$deliver_content = function(\Session_Handler $session, \record_adapter $record, $subdef, $watermark, $stamp, $app) {
|
$deliver_content = function(\Session_Handler $session, \record_adapter $record, $subdef, $watermark, $stamp, $app) {
|
||||||
|
|
||||||
$file = $record->get_subdef($subdef);
|
$file = $record->get_subdef($subdef);
|
||||||
if ($file->get_baseurl() !== '') {
|
|
||||||
return $app->redirect($file->get_url());
|
|
||||||
}
|
|
||||||
|
|
||||||
$pathIn = $pathOut = $file->get_pathfile();
|
$pathIn = $pathOut = $file->get_pathfile();
|
||||||
|
|
||||||
|
@@ -92,7 +92,7 @@ class Subdefs implements ControllerProviderInterface
|
|||||||
$class = $request->get($post_sub . '_class');
|
$class = $request->get($post_sub . '_class');
|
||||||
$downloadable = $request->get($post_sub . '_downloadable');
|
$downloadable = $request->get($post_sub . '_downloadable');
|
||||||
|
|
||||||
$defaults = array('path', 'baseurl', 'meta', 'mediatype');
|
$defaults = array('path', 'meta', 'mediatype');
|
||||||
|
|
||||||
foreach ($defaults as $def) {
|
foreach ($defaults as $def) {
|
||||||
$parm_loc = $request->get($post_sub . '_' . $def);
|
$parm_loc = $request->get($post_sub . '_' . $def);
|
||||||
|
@@ -845,7 +845,7 @@ class databox extends base
|
|||||||
return $this;
|
return $this;
|
||||||
}
|
}
|
||||||
|
|
||||||
public function setNewStructure(\SplFileInfo $data_template, $path_web, $path_doc, $baseurl)
|
public function setNewStructure(\SplFileInfo $data_template, $path_web, $path_doc)
|
||||||
{
|
{
|
||||||
if ( ! file_exists($data_template->getPathname())) {
|
if ( ! file_exists($data_template->getPathname())) {
|
||||||
throw new \InvalidArgumentException(sprintf('File %s does not exists'));
|
throw new \InvalidArgumentException(sprintf('File %s does not exists'));
|
||||||
@@ -853,11 +853,9 @@ class databox extends base
|
|||||||
|
|
||||||
$contents = file_get_contents($data_template->getPathname());
|
$contents = file_get_contents($data_template->getPathname());
|
||||||
|
|
||||||
$baseurl = $baseurl ? p4string::addEndSlash($baseurl) : '';
|
|
||||||
|
|
||||||
$contents = str_replace(
|
$contents = str_replace(
|
||||||
array("{{dataurl}}", "{{basename}}", "{{datapathweb}}", "{{datapathnoweb}}")
|
array("{{basename}}", "{{datapathweb}}", "{{datapathnoweb}}")
|
||||||
, array($baseurl, $this->dbname, $path_web, $path_doc)
|
, array($this->dbname, $path_web, $path_doc)
|
||||||
, $contents
|
, $contents
|
||||||
);
|
);
|
||||||
|
|
||||||
|
@@ -35,7 +35,6 @@ class databox_subdef
|
|||||||
protected $name;
|
protected $name;
|
||||||
protected $path;
|
protected $path;
|
||||||
protected $subdef_group;
|
protected $subdef_group;
|
||||||
protected $baseurl;
|
|
||||||
protected $labels = array();
|
protected $labels = array();
|
||||||
protected $write_meta;
|
protected $write_meta;
|
||||||
protected $downloadable;
|
protected $downloadable;
|
||||||
@@ -75,8 +74,6 @@ class databox_subdef
|
|||||||
$this->downloadable = p4field::isyes($sd->attributes()->downloadable);
|
$this->downloadable = p4field::isyes($sd->attributes()->downloadable);
|
||||||
$this->path = trim($sd->path) !== '' ? p4string::addEndSlash(trim($sd->path)) : '';
|
$this->path = trim($sd->path) !== '' ? p4string::addEndSlash(trim($sd->path)) : '';
|
||||||
|
|
||||||
$this->baseurl = trim($sd->baseurl) !== '' ? p4string::addEndSlash(trim($sd->baseurl)) : false;
|
|
||||||
|
|
||||||
$this->write_meta = p4field::isyes((string) $sd->meta);
|
$this->write_meta = p4field::isyes((string) $sd->meta);
|
||||||
|
|
||||||
foreach ($sd->label as $label) {
|
foreach ($sd->label as $label) {
|
||||||
@@ -137,15 +134,6 @@ class databox_subdef
|
|||||||
return $this->devices;
|
return $this->devices;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function get_baseurl()
|
|
||||||
{
|
|
||||||
return $this->baseurl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* The current SubdefType the subdef converts documents
|
* The current SubdefType the subdef converts documents
|
||||||
*
|
*
|
||||||
@@ -363,10 +351,10 @@ class databox_subdef
|
|||||||
if ($sd->size) {
|
if ($sd->size) {
|
||||||
$video->setOptionValue(Video::OPTION_SIZE, (int) $sd->size);
|
$video->setOptionValue(Video::OPTION_SIZE, (int) $sd->size);
|
||||||
}
|
}
|
||||||
if ($sd->a_codec) {
|
if ($sd->acodec) {
|
||||||
$video->setOptionValue(Video::OPTION_ACODEC, (string) $sd->acodec);
|
$video->setOptionValue(Video::OPTION_ACODEC, (string) $sd->acodec);
|
||||||
}
|
}
|
||||||
if ($sd->v_codec) {
|
if ($sd->vcodec) {
|
||||||
$video->setOptionValue(Video::OPTION_VCODEC, (string) $sd->vcodec);
|
$video->setOptionValue(Video::OPTION_VCODEC, (string) $sd->vcodec);
|
||||||
}
|
}
|
||||||
if ($sd->fps) {
|
if ($sd->fps) {
|
||||||
|
@@ -26,12 +26,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
*/
|
*/
|
||||||
protected $mime;
|
protected $mime;
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @var string
|
|
||||||
*/
|
|
||||||
protected $baseurl;
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @var string
|
* @var string
|
||||||
@@ -176,7 +170,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$this->width = $datas['width'];
|
$this->width = $datas['width'];
|
||||||
$this->height = $datas['height'];
|
$this->height = $datas['height'];
|
||||||
$this->etag = $datas['etag'];
|
$this->etag = $datas['etag'];
|
||||||
$this->baseurl = $datas['baseurl'];
|
|
||||||
$this->path = $datas['path'];
|
$this->path = $datas['path'];
|
||||||
$this->file = $datas['file'];
|
$this->file = $datas['file'];
|
||||||
$this->is_physically_present = $datas['physically_present'];
|
$this->is_physically_present = $datas['physically_present'];
|
||||||
@@ -192,7 +185,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
|
|
||||||
$connbas = $this->record->get_databox()->get_connection();
|
$connbas = $this->record->get_databox()->get_connection();
|
||||||
|
|
||||||
$sql = 'SELECT subdef_id, name, baseurl, file, width, height, mime,
|
$sql = 'SELECT subdef_id, name, file, width, height, mime,
|
||||||
path, size, substit, created_on, updated_on, etag
|
path, size, substit, created_on, updated_on, etag
|
||||||
FROM subdef
|
FROM subdef
|
||||||
WHERE name = :name AND record_id = :record_id';
|
WHERE name = :name AND record_id = :record_id';
|
||||||
@@ -212,7 +205,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$this->width = (int) $row['width'];
|
$this->width = (int) $row['width'];
|
||||||
$this->height = (int) $row['height'];
|
$this->height = (int) $row['height'];
|
||||||
$this->mime = $row['mime'];
|
$this->mime = $row['mime'];
|
||||||
$this->baseurl = trim($row['baseurl']);
|
|
||||||
$this->file = $row['file'];
|
$this->file = $row['file'];
|
||||||
$this->etag = $row['etag'];
|
$this->etag = $row['etag'];
|
||||||
$this->path = p4string::addEndSlash($row['path']);
|
$this->path = p4string::addEndSlash($row['path']);
|
||||||
@@ -239,7 +231,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
'mime' => $this->mime
|
'mime' => $this->mime
|
||||||
, 'width' => $this->width
|
, 'width' => $this->width
|
||||||
, 'height' => $this->height
|
, 'height' => $this->height
|
||||||
, 'baseurl' => $this->baseurl
|
|
||||||
, 'etag' => $this->etag
|
, 'etag' => $this->etag
|
||||||
, 'path' => $this->path
|
, 'path' => $this->path
|
||||||
, 'file' => $this->file
|
, 'file' => $this->file
|
||||||
@@ -290,7 +281,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$this->mime = 'image/png';
|
$this->mime = 'image/png';
|
||||||
$this->width = 256;
|
$this->width = 256;
|
||||||
$this->height = 256;
|
$this->height = 256;
|
||||||
$this->baseurl = 'skins/icons/substitution/';
|
|
||||||
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/';
|
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/';
|
||||||
$this->file = 'regroup_thumb.png';
|
$this->file = 'regroup_thumb.png';
|
||||||
$this->is_substituted = true;
|
$this->is_substituted = true;
|
||||||
@@ -301,7 +291,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$this->mime = 'image/png';
|
$this->mime = 'image/png';
|
||||||
$this->width = 256;
|
$this->width = 256;
|
||||||
$this->height = 256;
|
$this->height = 256;
|
||||||
$this->baseurl = 'skins/icons/substitution/';
|
|
||||||
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/';
|
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/';
|
||||||
$this->file = str_replace('+', '%20', $mime) . '.png';
|
$this->file = str_replace('+', '%20', $mime) . '.png';
|
||||||
$this->is_substituted = true;
|
$this->is_substituted = true;
|
||||||
@@ -310,7 +299,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$this->is_physically_present = false;
|
$this->is_physically_present = false;
|
||||||
|
|
||||||
if ( ! file_exists($this->path . $this->file)) {
|
if ( ! file_exists($this->path . $this->file)) {
|
||||||
$this->baseurl = 'skins/icons/';
|
|
||||||
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/';
|
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/';
|
||||||
$this->file = 'substitution.png';
|
$this->file = 'substitution.png';
|
||||||
$this->is_substituted = true;
|
$this->is_substituted = true;
|
||||||
@@ -440,15 +428,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
return $this->path;
|
return $this->path;
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
*
|
|
||||||
* @return string
|
|
||||||
*/
|
|
||||||
public function get_baseurl()
|
|
||||||
{
|
|
||||||
return $this->baseurl;
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
*
|
*
|
||||||
* @return string
|
* @return string
|
||||||
@@ -696,7 +675,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
return $datas;
|
return $datas;
|
||||||
}
|
}
|
||||||
|
|
||||||
public static function create(record_Interface $record, $name, Media $media, $baseurl = '')
|
public static function create(record_Interface $record, $name, Media $media)
|
||||||
{
|
{
|
||||||
$databox = $record->get_databox();
|
$databox = $record->get_databox();
|
||||||
$connbas = $databox->get_connection();
|
$connbas = $databox->get_connection();
|
||||||
@@ -707,7 +686,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$params = array(
|
$params = array(
|
||||||
':path' => $path,
|
':path' => $path,
|
||||||
':file' => $newname,
|
':file' => $newname,
|
||||||
':baseurl' => $baseurl,
|
|
||||||
':width' => 0,
|
':width' => 0,
|
||||||
':height' => 0,
|
':height' => 0,
|
||||||
':mime' => $media->getFile()->getMimeType(),
|
':mime' => $media->getFile()->getMimeType(),
|
||||||
@@ -728,7 +706,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
}
|
}
|
||||||
|
|
||||||
$sql = "UPDATE subdef
|
$sql = "UPDATE subdef
|
||||||
SET path = :path, file = :file, baseurl = :baseurl
|
SET path = :path, file = :file
|
||||||
, width = :width , height = :height, mime = :mime
|
, width = :width , height = :height, mime = :mime
|
||||||
, size = :size, dispatched = :dispatched, updated_on = NOW()
|
, size = :size, dispatched = :dispatched, updated_on = NOW()
|
||||||
WHERE subdef_id = :subdef_id";
|
WHERE subdef_id = :subdef_id";
|
||||||
@@ -736,9 +714,9 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
$params[':subdef_id'] = $subdef->get_subdef_id();
|
$params[':subdef_id'] = $subdef->get_subdef_id();
|
||||||
} catch (\Exception_Media_SubdefNotFound $e) {
|
} catch (\Exception_Media_SubdefNotFound $e) {
|
||||||
$sql = "INSERT INTO subdef
|
$sql = "INSERT INTO subdef
|
||||||
(record_id, name, path, file, baseurl, width
|
(record_id, name, path, file, width
|
||||||
, height, mime, size, dispatched, created_on, updated_on)
|
, height, mime, size, dispatched, created_on, updated_on)
|
||||||
VALUES (:record_id, :name, :path, :file, :baseurl, :width, :height
|
VALUES (:record_id, :name, :path, :file, :width, :height
|
||||||
, :mime, :size, :dispatched, NOW(), NOW())";
|
, :mime, :size, :dispatched, NOW(), NOW())";
|
||||||
|
|
||||||
$params[':record_id'] = $record->get_record_id();
|
$params[':record_id'] = $record->get_record_id();
|
||||||
@@ -767,15 +745,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
|||||||
*/
|
*/
|
||||||
protected function generate_url($random = false)
|
protected function generate_url($random = false)
|
||||||
{
|
{
|
||||||
if ($this->baseurl !== '') {
|
|
||||||
$registry = registry::get_instance();
|
|
||||||
$this->url = $registry->get('GV_STATIC_URL')
|
|
||||||
. '/' . p4string::addEndSlash($this->baseurl)
|
|
||||||
. $this->file . ($random ? '?rand=' . mt_rand(10000, 99999) : '');
|
|
||||||
|
|
||||||
return;
|
|
||||||
}
|
|
||||||
|
|
||||||
if (in_array($this->mime, array('video/mp4'))) {
|
if (in_array($this->mime, array('video/mp4'))) {
|
||||||
$token = p4file::apache_tokenize($this->get_pathfile());
|
$token = p4file::apache_tokenize($this->get_pathfile());
|
||||||
if ($token) {
|
if ($token) {
|
||||||
|
@@ -630,7 +630,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
$searchDevices = array_merge((array) $devices, (array) databox_subdef::DEVICE_ALL);
|
$searchDevices = array_merge((array) $devices, (array) databox_subdef::DEVICE_ALL);
|
||||||
|
|
||||||
foreach ($this->databox->get_subdef_structure() as $databoxSubdefs) {
|
foreach ($this->databox->get_subdef_structure() as $group => $databoxSubdefs) {
|
||||||
|
|
||||||
|
if ($this->get_type() != $group) {
|
||||||
|
continue;
|
||||||
|
}
|
||||||
|
|
||||||
foreach ($databoxSubdefs as $databoxSubdef) {
|
foreach ($databoxSubdefs as $databoxSubdef) {
|
||||||
|
|
||||||
@@ -982,14 +986,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$path_file_dest = $path . $newfilename;
|
$path_file_dest = $path . $newfilename;
|
||||||
}
|
}
|
||||||
|
|
||||||
if (trim($subdef_def->get_baseurl()) !== '') {
|
|
||||||
$base_url = str_replace(
|
|
||||||
array($subdef_def->get_path(), $newfilename)
|
|
||||||
, array($subdef_def->get_baseurl(), '')
|
|
||||||
, $path_file_dest
|
|
||||||
);
|
|
||||||
}
|
|
||||||
|
|
||||||
try {
|
try {
|
||||||
$Core = \bootstrap::getCore();
|
$Core = \bootstrap::getCore();
|
||||||
$Core['media-alchemyst']->open($media->getFile()->getRealPath())
|
$Core['media-alchemyst']->open($media->getFile()->getRealPath())
|
||||||
@@ -1013,8 +1009,7 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$connbas = connection::getPDOConnection($this->get_sbas_id());
|
$connbas = connection::getPDOConnection($this->get_sbas_id());
|
||||||
|
|
||||||
$sql = 'UPDATE subdef
|
$sql = 'UPDATE subdef
|
||||||
SET baseurl = :baseurl,
|
SET file = :filename,
|
||||||
file = :filename,
|
|
||||||
width = :width,
|
width = :width,
|
||||||
height = :height,
|
height = :height,
|
||||||
mime = :mime,
|
mime = :mime,
|
||||||
@@ -1026,7 +1021,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$params = array(
|
$params = array(
|
||||||
':record_id' => $this->record_id,
|
':record_id' => $this->record_id,
|
||||||
':name' => $name,
|
':name' => $name,
|
||||||
':baseurl' => $base_url,
|
|
||||||
':filename' => $subdefFile->getFilename(),
|
':filename' => $subdefFile->getFilename(),
|
||||||
':mime' => $subdefFile->getMimeType(),
|
':mime' => $subdefFile->getMimeType(),
|
||||||
':path' => $subdefFile->getPath(),
|
':path' => $subdefFile->getPath(),
|
||||||
@@ -1691,9 +1685,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
|
|
||||||
if (file_exists($pathdest)) {
|
if (file_exists($pathdest)) {
|
||||||
$media = \MediaVorus\MediaVorus::guess(new \SplFileInfo($pathdest));
|
$media = \MediaVorus\MediaVorus::guess(new \SplFileInfo($pathdest));
|
||||||
$baseurl = $subdef->get_baseurl() ? $subdef->get_baseurl() . substr(dirname($pathdest), strlen($subdef->get_path())) : '';
|
|
||||||
|
|
||||||
media_subdef::create($this, $subdef->get_name(), $media, $baseurl);
|
media_subdef::create($this, $subdef->get_name(), $media);
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->clearSubdefCache($subdefname);
|
$this->clearSubdefCache($subdefname);
|
||||||
@@ -1728,6 +1721,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
|||||||
$Core = \bootstrap::getCore();
|
$Core = \bootstrap::getCore();
|
||||||
|
|
||||||
try {
|
try {
|
||||||
|
if (null === $this->get_hd_file()) {
|
||||||
|
return;
|
||||||
|
}
|
||||||
|
|
||||||
$Core['media-alchemyst']->open($this->get_hd_file()->getPathname());
|
$Core['media-alchemyst']->open($this->get_hd_file()->getPathname());
|
||||||
$Core['media-alchemyst']->turnInto($pathdest, $subdef_class->getSpecs());
|
$Core['media-alchemyst']->turnInto($pathdest, $subdef_class->getSpecs());
|
||||||
$Core['media-alchemyst']->close();
|
$Core['media-alchemyst']->close();
|
||||||
|
@@ -6777,16 +6777,6 @@
|
|||||||
<comment></comment>
|
<comment></comment>
|
||||||
</field>
|
</field>
|
||||||
|
|
||||||
<field>
|
|
||||||
<name>baseurl</name>
|
|
||||||
<type>char(255)</type>
|
|
||||||
<null></null>
|
|
||||||
<extra></extra>
|
|
||||||
|
|
||||||
<default></default>
|
|
||||||
<comment></comment>
|
|
||||||
|
|
||||||
</field>
|
|
||||||
<field>
|
<field>
|
||||||
<name>width</name>
|
<name>width</name>
|
||||||
<type>int(10) unsigned</type>
|
<type>int(10) unsigned</type>
|
||||||
|
@@ -12,7 +12,6 @@
|
|||||||
<strip>no</strip>
|
<strip>no</strip>
|
||||||
<quality>75</quality>
|
<quality>75</quality>
|
||||||
<meta>yes</meta>
|
<meta>yes</meta>
|
||||||
<baseurl></baseurl>
|
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
@@ -26,7 +25,6 @@
|
|||||||
<quality>75</quality>
|
<quality>75</quality>
|
||||||
<meta>no</meta>
|
<meta>no</meta>
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -38,7 +36,6 @@
|
|||||||
<size>800</size>
|
<size>800</size>
|
||||||
<mediatype>video</mediatype>
|
<mediatype>video</mediatype>
|
||||||
<writeDatas>yes</writeDatas>
|
<writeDatas>yes</writeDatas>
|
||||||
<baseurl></baseurl>
|
|
||||||
<acodec>libfaac</acodec>
|
<acodec>libfaac</acodec>
|
||||||
<vcodec>libx264</vcodec>
|
<vcodec>libx264</vcodec>
|
||||||
<bitrate>1000</bitrate>
|
<bitrate>1000</bitrate>
|
||||||
@@ -53,7 +50,6 @@
|
|||||||
<mediatype>gif</mediatype>
|
<mediatype>gif</mediatype>
|
||||||
<delay>500</delay>
|
<delay>500</delay>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Animation GIF</label>
|
<label lang="fr">Animation GIF</label>
|
||||||
<label lang="en">GIF Animation</label>
|
<label lang="en">GIF Animation</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -62,7 +58,6 @@
|
|||||||
<size>200</size>
|
<size>200</size>
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -73,7 +68,6 @@
|
|||||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||||
<mediatype>audio</mediatype>
|
<mediatype>audio</mediatype>
|
||||||
<writeDatas>yes</writeDatas>
|
<writeDatas>yes</writeDatas>
|
||||||
<baseurl></baseurl>
|
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -81,7 +75,6 @@
|
|||||||
<path>{{datapathweb}}{{basename}}/subdefs</path>
|
<path>{{datapathweb}}{{basename}}/subdefs</path>
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -91,7 +84,6 @@
|
|||||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||||
<mediatype>flexpaper</mediatype>
|
<mediatype>flexpaper</mediatype>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl></baseurl>
|
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -102,7 +94,6 @@
|
|||||||
<dpi>72</dpi>
|
<dpi>72</dpi>
|
||||||
<size>200</size>
|
<size>200</size>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -115,7 +106,6 @@
|
|||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<method>resample</method>
|
<method>resample</method>
|
||||||
<dpi>72</dpi>
|
<dpi>72</dpi>
|
||||||
<baseurl></baseurl>
|
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -125,7 +115,6 @@
|
|||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<method>resample</method>
|
<method>resample</method>
|
||||||
<dpi>72</dpi>
|
<dpi>72</dpi>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
<strip>no</strip>
|
<strip>no</strip>
|
||||||
<quality>75</quality>
|
<quality>75</quality>
|
||||||
<meta>yes</meta>
|
<meta>yes</meta>
|
||||||
<baseurl></baseurl>
|
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
@@ -25,7 +24,6 @@
|
|||||||
<quality>75</quality>
|
<quality>75</quality>
|
||||||
<meta>no</meta>
|
<meta>no</meta>
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -36,7 +34,6 @@
|
|||||||
<size>800</size>
|
<size>800</size>
|
||||||
<mediatype>video</mediatype>
|
<mediatype>video</mediatype>
|
||||||
<writeDatas>yes</writeDatas>
|
<writeDatas>yes</writeDatas>
|
||||||
<baseurl></baseurl>
|
|
||||||
<acodec>libfaac</acodec>
|
<acodec>libfaac</acodec>
|
||||||
<vcodec>libx264</vcodec>
|
<vcodec>libx264</vcodec>
|
||||||
<bitrate>1000</bitrate>
|
<bitrate>1000</bitrate>
|
||||||
@@ -51,7 +48,6 @@
|
|||||||
<mediatype>gif</mediatype>
|
<mediatype>gif</mediatype>
|
||||||
<delay>500</delay>
|
<delay>500</delay>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Animation GIF</label>
|
<label lang="fr">Animation GIF</label>
|
||||||
<label lang="en">GIF Animation</label>
|
<label lang="en">GIF Animation</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -60,7 +56,6 @@
|
|||||||
<size>200</size>
|
<size>200</size>
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -70,7 +65,6 @@
|
|||||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||||
<mediatype>audio</mediatype>
|
<mediatype>audio</mediatype>
|
||||||
<writeDatas>yes</writeDatas>
|
<writeDatas>yes</writeDatas>
|
||||||
<baseurl></baseurl>
|
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -79,7 +73,6 @@
|
|||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<size>200</size>
|
<size>200</size>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -89,7 +82,6 @@
|
|||||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||||
<mediatype>flexpaper</mediatype>
|
<mediatype>flexpaper</mediatype>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl></baseurl>
|
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -100,7 +92,6 @@
|
|||||||
<dpi>72</dpi>
|
<dpi>72</dpi>
|
||||||
<size>200</size>
|
<size>200</size>
|
||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -113,7 +104,6 @@
|
|||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<method>resample</method>
|
<method>resample</method>
|
||||||
<dpi>72</dpi>
|
<dpi>72</dpi>
|
||||||
<baseurl></baseurl>
|
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
<label lang="en">Preview</label>
|
<label lang="en">Preview</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
@@ -123,7 +113,6 @@
|
|||||||
<writeDatas>no</writeDatas>
|
<writeDatas>no</writeDatas>
|
||||||
<method>resample</method>
|
<method>resample</method>
|
||||||
<dpi>72</dpi>
|
<dpi>72</dpi>
|
||||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
|
||||||
<label lang="fr">Imagette</label>
|
<label lang="fr">Imagette</label>
|
||||||
<label lang="en">Thumbnail</label>
|
<label lang="en">Thumbnail</label>
|
||||||
</subdef>
|
</subdef>
|
||||||
|
@@ -243,15 +243,6 @@
|
|||||||
</tr>
|
</tr>
|
||||||
<tr>
|
<tr>
|
||||||
<td>
|
<td>
|
||||||
{% trans 'Baseurl' %}
|
|
||||||
</td>
|
|
||||||
<td>
|
|
||||||
<input class="url_testable can_empty same_domain" type="text" value="{{subdef.get_baseurl()}}" name="{{subdefgroup}}_{{subdefname}}_baseurl"/>
|
|
||||||
</td>
|
|
||||||
<td></td>
|
|
||||||
</tr>
|
|
||||||
<tr>
|
|
||||||
<td>
|
|
||||||
{% trans 'Write Metas' %}
|
{% trans 'Write Metas' %}
|
||||||
</td>
|
</td>
|
||||||
<td>
|
<td>
|
||||||
|
@@ -25,19 +25,11 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$crawler = $this->client->request('GET', '/datafiles/' . static::$records['record_1']->get_sbas_id() . '/' . static::$records['record_1']->get_record_id() . '/preview/');
|
$crawler = $this->client->request('GET', '/datafiles/' . static::$records['record_1']->get_sbas_id() . '/' . static::$records['record_1']->get_record_id() . '/preview/');
|
||||||
$response = $this->client->getResponse();
|
$response = $this->client->getResponse();
|
||||||
|
|
||||||
if (static::$records['record_1']->get_preview()->get_baseurl() !== '') {
|
|
||||||
$this->assertEquals(302, $response->getStatusCode());
|
|
||||||
$url = p4string::delEndSlash($registry->get('GV_ServerName')) . $response->headers->get('Location');
|
|
||||||
$headers = http_query::getHttpHeaders($url);
|
|
||||||
$this->assertEquals(static::$records['record_1']->get_preview()->get_mime(), $headers['content_type']);
|
|
||||||
$this->assertEquals(static::$records['record_1']->get_preview()->get_size(), $headers['download_content_length']);
|
|
||||||
} else {
|
|
||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
$content_disposition = explode(';', $response->headers->get('content-disposition'));
|
$content_disposition = explode(';', $response->headers->get('content-disposition'));
|
||||||
$this->assertEquals($content_disposition[0], 'attachment');
|
$this->assertEquals($content_disposition[0], 'attachment');
|
||||||
$this->assertEquals(static::$records['record_1']->get_preview()->get_mime(), $response->headers->get('content-type'));
|
$this->assertEquals(static::$records['record_1']->get_preview()->get_mime(), $response->headers->get('content-type'));
|
||||||
$this->assertEquals(static::$records['record_1']->get_preview()->get_size(), $response->headers->get('content-length'));
|
$this->assertEquals(static::$records['record_1']->get_preview()->get_size(), $response->headers->get('content-length'));
|
||||||
}
|
|
||||||
|
|
||||||
$crawler = $this->client->request('GET', '/datafiles/' . static::$records['record_1']->get_sbas_id() . '/' . static::$records['record_1']->get_record_id() . '/asubdefthatdoesnotexists/');
|
$crawler = $this->client->request('GET', '/datafiles/' . static::$records['record_1']->get_sbas_id() . '/' . static::$records['record_1']->get_record_id() . '/asubdefthatdoesnotexists/');
|
||||||
$response = $this->client->getResponse();
|
$response = $this->client->getResponse();
|
||||||
@@ -81,11 +73,7 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
|||||||
$crawler = $this->client->request('GET', $url);
|
$crawler = $this->client->request('GET', $url);
|
||||||
$response = $this->client->getResponse();
|
$response = $this->client->getResponse();
|
||||||
|
|
||||||
if (static::$records['record_1']->get_preview()->get_baseurl() !== '') {
|
|
||||||
$this->assertEquals(302, $response->getStatusCode());
|
|
||||||
} else {
|
|
||||||
$this->assertEquals(200, $response->getStatusCode());
|
$this->assertEquals(200, $response->getStatusCode());
|
||||||
}
|
|
||||||
|
|
||||||
$url = $url . 'view/';
|
$url = $url . 'view/';
|
||||||
$crawler = $this->client->request('GET', $url);
|
$crawler = $this->client->request('GET', $url);
|
||||||
|
@@ -13,7 +13,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
|||||||
* @covers databox_subdef::get_labels
|
* @covers databox_subdef::get_labels
|
||||||
* @covers databox_subdef::getSubdefGroup
|
* @covers databox_subdef::getSubdefGroup
|
||||||
* @covers databox_subdef::getSubdefType
|
* @covers databox_subdef::getSubdefType
|
||||||
* @covers databox_subdef::get_baseurl
|
|
||||||
* @covers databox_subdef::get_path
|
* @covers databox_subdef::get_path
|
||||||
* @covers databox_subdef::getSpecs
|
* @covers databox_subdef::getSpecs
|
||||||
* @covers databox_subdef::getOptions
|
* @covers databox_subdef::getOptions
|
||||||
@@ -24,7 +23,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
|||||||
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<subdef class="preview" name="preview_api" downloadable="true">
|
<subdef class="preview" name="preview_api" downloadable="true">
|
||||||
<path>/home/datas/noweb/db_alch_phrasea/subdefs/</path>
|
<path>/home/datas/noweb/db_alch_phrasea/subdefs/</path>
|
||||||
<baseurl/>
|
|
||||||
<meta>yes</meta>
|
<meta>yes</meta>
|
||||||
<mediatype>image</mediatype>
|
<mediatype>image</mediatype>
|
||||||
<label lang="fr">Prévisualisation</label>
|
<label lang="fr">Prévisualisation</label>
|
||||||
@@ -40,7 +38,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertEquals(databox_subdef::CLASS_PREVIEW, $object->get_class());
|
$this->assertEquals(databox_subdef::CLASS_PREVIEW, $object->get_class());
|
||||||
$this->assertEquals('/home/datas/noweb/db_alch_phrasea/subdefs/', $object->get_path());
|
$this->assertEquals('/home/datas/noweb/db_alch_phrasea/subdefs/', $object->get_path());
|
||||||
$this->assertEquals('', $object->get_baseurl());
|
|
||||||
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Media\Subdef\\Subdef', $object->getSubdefType());
|
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Media\Subdef\\Subdef', $object->getSubdefType());
|
||||||
$this->assertEquals($type, $object->getSubdefGroup());
|
$this->assertEquals($type, $object->getSubdefGroup());
|
||||||
|
|
||||||
@@ -82,7 +79,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
|||||||
* @covers databox_subdef::get_labels
|
* @covers databox_subdef::get_labels
|
||||||
* @covers databox_subdef::getSubdefGroup
|
* @covers databox_subdef::getSubdefGroup
|
||||||
* @covers databox_subdef::getSubdefType
|
* @covers databox_subdef::getSubdefType
|
||||||
* @covers databox_subdef::get_baseurl
|
|
||||||
* @covers databox_subdef::get_path
|
* @covers databox_subdef::get_path
|
||||||
* @covers databox_subdef::getSpecs
|
* @covers databox_subdef::getSpecs
|
||||||
* @covers databox_subdef::getOptions
|
* @covers databox_subdef::getOptions
|
||||||
@@ -93,7 +89,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
|||||||
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<subdef class="thumbnail" name="video_api" downloadable="false">
|
<subdef class="thumbnail" name="video_api" downloadable="false">
|
||||||
<path>/home/datas/noweb/db_alch_phrasea/video/</path>
|
<path>/home/datas/noweb/db_alch_phrasea/video/</path>
|
||||||
<baseurl>/video/</baseurl>
|
|
||||||
<meta>no</meta>
|
<meta>no</meta>
|
||||||
<mediatype>video</mediatype>
|
<mediatype>video</mediatype>
|
||||||
<size>196</size>
|
<size>196</size>
|
||||||
@@ -112,7 +107,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
|||||||
|
|
||||||
$this->assertEquals(databox_subdef::CLASS_THUMBNAIL, $object->get_class());
|
$this->assertEquals(databox_subdef::CLASS_THUMBNAIL, $object->get_class());
|
||||||
$this->assertEquals('/home/datas/noweb/db_alch_phrasea/video/', $object->get_path());
|
$this->assertEquals('/home/datas/noweb/db_alch_phrasea/video/', $object->get_path());
|
||||||
$this->assertEquals('/video/', $object->get_baseurl());
|
|
||||||
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Media\Subdef\\Subdef', $object->getSubdefType());
|
$this->assertInstanceOf('\\Alchemy\\Phrasea\\Media\Subdef\\Subdef', $object->getSubdefType());
|
||||||
$this->assertEquals($type, $object->getSubdefGroup());
|
$this->assertEquals($type, $object->getSubdefGroup());
|
||||||
|
|
||||||
@@ -152,7 +146,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
|||||||
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
$xml = '<?xml version="1.0" encoding="UTF-8" standalone="yes"?>
|
||||||
<subdef class="thumbnail" name="gifou" downloadable="false">
|
<subdef class="thumbnail" name="gifou" downloadable="false">
|
||||||
<path>/home/datas/noweb/db_alch_phrasea/video/</path>
|
<path>/home/datas/noweb/db_alch_phrasea/video/</path>
|
||||||
<baseurl>web//db_alch_beta/subdefs/</baseurl>
|
|
||||||
<meta>no</meta>
|
<meta>no</meta>
|
||||||
<mediatype>gif</mediatype>
|
<mediatype>gif</mediatype>
|
||||||
<size>200</size>
|
<size>200</size>
|
||||||
|
@@ -144,15 +144,6 @@ class media_subdefTest extends \PhraseanetPHPUnitAbstract
|
|||||||
$this->assertEquals(dirname(self::$objectNotPresent->get_pathfile()) . DIRECTORY_SEPARATOR, self::$objectNotPresent->get_path());
|
$this->assertEquals(dirname(self::$objectNotPresent->get_pathfile()) . DIRECTORY_SEPARATOR, self::$objectNotPresent->get_path());
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
|
||||||
* @covers media_subdef::get_baseurl
|
|
||||||
*/
|
|
||||||
public function testGet_baseurl()
|
|
||||||
{
|
|
||||||
$this->assertInternalType('string', self::$objectPresent->get_baseurl());
|
|
||||||
$this->assertInternalType('string', self::$objectNotPresent->get_baseurl());
|
|
||||||
}
|
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* @covers media_subdef::get_file
|
* @covers media_subdef::get_file
|
||||||
*/
|
*/
|
||||||
|
Reference in New Issue
Block a user