mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-18 07:23:13 +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) {
|
||||
|
||||
$file = $record->get_subdef($subdef);
|
||||
if ($file->get_baseurl() !== '') {
|
||||
return $app->redirect($file->get_url());
|
||||
}
|
||||
|
||||
$pathIn = $pathOut = $file->get_pathfile();
|
||||
|
||||
|
@@ -92,7 +92,7 @@ class Subdefs implements ControllerProviderInterface
|
||||
$class = $request->get($post_sub . '_class');
|
||||
$downloadable = $request->get($post_sub . '_downloadable');
|
||||
|
||||
$defaults = array('path', 'baseurl', 'meta', 'mediatype');
|
||||
$defaults = array('path', 'meta', 'mediatype');
|
||||
|
||||
foreach ($defaults as $def) {
|
||||
$parm_loc = $request->get($post_sub . '_' . $def);
|
||||
|
@@ -845,7 +845,7 @@ class databox extends base
|
||||
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())) {
|
||||
throw new \InvalidArgumentException(sprintf('File %s does not exists'));
|
||||
@@ -853,11 +853,9 @@ class databox extends base
|
||||
|
||||
$contents = file_get_contents($data_template->getPathname());
|
||||
|
||||
$baseurl = $baseurl ? p4string::addEndSlash($baseurl) : '';
|
||||
|
||||
$contents = str_replace(
|
||||
array("{{dataurl}}", "{{basename}}", "{{datapathweb}}", "{{datapathnoweb}}")
|
||||
, array($baseurl, $this->dbname, $path_web, $path_doc)
|
||||
array("{{basename}}", "{{datapathweb}}", "{{datapathnoweb}}")
|
||||
, array($this->dbname, $path_web, $path_doc)
|
||||
, $contents
|
||||
);
|
||||
|
||||
|
@@ -35,7 +35,6 @@ class databox_subdef
|
||||
protected $name;
|
||||
protected $path;
|
||||
protected $subdef_group;
|
||||
protected $baseurl;
|
||||
protected $labels = array();
|
||||
protected $write_meta;
|
||||
protected $downloadable;
|
||||
@@ -75,8 +74,6 @@ class databox_subdef
|
||||
$this->downloadable = p4field::isyes($sd->attributes()->downloadable);
|
||||
$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);
|
||||
|
||||
foreach ($sd->label as $label) {
|
||||
@@ -137,15 +134,6 @@ class databox_subdef
|
||||
return $this->devices;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_baseurl()
|
||||
{
|
||||
return $this->baseurl;
|
||||
}
|
||||
|
||||
/**
|
||||
* The current SubdefType the subdef converts documents
|
||||
*
|
||||
@@ -363,10 +351,10 @@ class databox_subdef
|
||||
if ($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);
|
||||
}
|
||||
if ($sd->v_codec) {
|
||||
if ($sd->vcodec) {
|
||||
$video->setOptionValue(Video::OPTION_VCODEC, (string) $sd->vcodec);
|
||||
}
|
||||
if ($sd->fps) {
|
||||
|
@@ -26,12 +26,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
*/
|
||||
protected $mime;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
*/
|
||||
protected $baseurl;
|
||||
|
||||
/**
|
||||
*
|
||||
* @var string
|
||||
@@ -176,7 +170,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
$this->width = $datas['width'];
|
||||
$this->height = $datas['height'];
|
||||
$this->etag = $datas['etag'];
|
||||
$this->baseurl = $datas['baseurl'];
|
||||
$this->path = $datas['path'];
|
||||
$this->file = $datas['file'];
|
||||
$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();
|
||||
|
||||
$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
|
||||
FROM subdef
|
||||
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->height = (int) $row['height'];
|
||||
$this->mime = $row['mime'];
|
||||
$this->baseurl = trim($row['baseurl']);
|
||||
$this->file = $row['file'];
|
||||
$this->etag = $row['etag'];
|
||||
$this->path = p4string::addEndSlash($row['path']);
|
||||
@@ -239,7 +231,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
'mime' => $this->mime
|
||||
, 'width' => $this->width
|
||||
, 'height' => $this->height
|
||||
, 'baseurl' => $this->baseurl
|
||||
, 'etag' => $this->etag
|
||||
, 'path' => $this->path
|
||||
, 'file' => $this->file
|
||||
@@ -290,7 +281,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
$this->mime = 'image/png';
|
||||
$this->width = 256;
|
||||
$this->height = 256;
|
||||
$this->baseurl = 'skins/icons/substitution/';
|
||||
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/';
|
||||
$this->file = 'regroup_thumb.png';
|
||||
$this->is_substituted = true;
|
||||
@@ -301,7 +291,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
$this->mime = 'image/png';
|
||||
$this->width = 256;
|
||||
$this->height = 256;
|
||||
$this->baseurl = 'skins/icons/substitution/';
|
||||
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/substitution/';
|
||||
$this->file = str_replace('+', '%20', $mime) . '.png';
|
||||
$this->is_substituted = true;
|
||||
@@ -310,7 +299,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
$this->is_physically_present = false;
|
||||
|
||||
if ( ! file_exists($this->path . $this->file)) {
|
||||
$this->baseurl = 'skins/icons/';
|
||||
$this->path = $registry->get('GV_RootPath') . 'www/skins/icons/';
|
||||
$this->file = 'substitution.png';
|
||||
$this->is_substituted = true;
|
||||
@@ -440,15 +428,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
return $this->path;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
*/
|
||||
public function get_baseurl()
|
||||
{
|
||||
return $this->baseurl;
|
||||
}
|
||||
|
||||
/**
|
||||
*
|
||||
* @return string
|
||||
@@ -696,7 +675,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
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();
|
||||
$connbas = $databox->get_connection();
|
||||
@@ -707,7 +686,6 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
$params = array(
|
||||
':path' => $path,
|
||||
':file' => $newname,
|
||||
':baseurl' => $baseurl,
|
||||
':width' => 0,
|
||||
':height' => 0,
|
||||
':mime' => $media->getFile()->getMimeType(),
|
||||
@@ -728,7 +706,7 @@ class media_subdef extends media_abstract implements cache_cacheableInterface
|
||||
}
|
||||
|
||||
$sql = "UPDATE subdef
|
||||
SET path = :path, file = :file, baseurl = :baseurl
|
||||
SET path = :path, file = :file
|
||||
, width = :width , height = :height, mime = :mime
|
||||
, size = :size, dispatched = :dispatched, updated_on = NOW()
|
||||
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();
|
||||
} catch (\Exception_Media_SubdefNotFound $e) {
|
||||
$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)
|
||||
VALUES (:record_id, :name, :path, :file, :baseurl, :width, :height
|
||||
VALUES (:record_id, :name, :path, :file, :width, :height
|
||||
, :mime, :size, :dispatched, NOW(), NOW())";
|
||||
|
||||
$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)
|
||||
{
|
||||
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'))) {
|
||||
$token = p4file::apache_tokenize($this->get_pathfile());
|
||||
if ($token) {
|
||||
|
@@ -630,7 +630,11 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
|
||||
$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) {
|
||||
|
||||
@@ -982,14 +986,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
$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 {
|
||||
$Core = \bootstrap::getCore();
|
||||
$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());
|
||||
|
||||
$sql = 'UPDATE subdef
|
||||
SET baseurl = :baseurl,
|
||||
file = :filename,
|
||||
SET file = :filename,
|
||||
width = :width,
|
||||
height = :height,
|
||||
mime = :mime,
|
||||
@@ -1026,7 +1021,6 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
$params = array(
|
||||
':record_id' => $this->record_id,
|
||||
':name' => $name,
|
||||
':baseurl' => $base_url,
|
||||
':filename' => $subdefFile->getFilename(),
|
||||
':mime' => $subdefFile->getMimeType(),
|
||||
':path' => $subdefFile->getPath(),
|
||||
@@ -1691,9 +1685,8 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
|
||||
if (file_exists($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);
|
||||
@@ -1728,6 +1721,10 @@ class record_adapter implements record_Interface, cache_cacheableInterface
|
||||
$Core = \bootstrap::getCore();
|
||||
|
||||
try {
|
||||
if (null === $this->get_hd_file()) {
|
||||
return;
|
||||
}
|
||||
|
||||
$Core['media-alchemyst']->open($this->get_hd_file()->getPathname());
|
||||
$Core['media-alchemyst']->turnInto($pathdest, $subdef_class->getSpecs());
|
||||
$Core['media-alchemyst']->close();
|
||||
|
@@ -6777,16 +6777,6 @@
|
||||
<comment></comment>
|
||||
</field>
|
||||
|
||||
<field>
|
||||
<name>baseurl</name>
|
||||
<type>char(255)</type>
|
||||
<null></null>
|
||||
<extra></extra>
|
||||
|
||||
<default></default>
|
||||
<comment></comment>
|
||||
|
||||
</field>
|
||||
<field>
|
||||
<name>width</name>
|
||||
<type>int(10) unsigned</type>
|
||||
|
@@ -12,7 +12,6 @@
|
||||
<strip>no</strip>
|
||||
<quality>75</quality>
|
||||
<meta>yes</meta>
|
||||
<baseurl></baseurl>
|
||||
<mediatype>image</mediatype>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
@@ -26,7 +25,6 @@
|
||||
<quality>75</quality>
|
||||
<meta>no</meta>
|
||||
<mediatype>image</mediatype>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -38,7 +36,6 @@
|
||||
<size>800</size>
|
||||
<mediatype>video</mediatype>
|
||||
<writeDatas>yes</writeDatas>
|
||||
<baseurl></baseurl>
|
||||
<acodec>libfaac</acodec>
|
||||
<vcodec>libx264</vcodec>
|
||||
<bitrate>1000</bitrate>
|
||||
@@ -53,7 +50,6 @@
|
||||
<mediatype>gif</mediatype>
|
||||
<delay>500</delay>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Animation GIF</label>
|
||||
<label lang="en">GIF Animation</label>
|
||||
</subdef>
|
||||
@@ -62,7 +58,6 @@
|
||||
<size>200</size>
|
||||
<mediatype>image</mediatype>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -73,7 +68,6 @@
|
||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||
<mediatype>audio</mediatype>
|
||||
<writeDatas>yes</writeDatas>
|
||||
<baseurl></baseurl>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
</subdef>
|
||||
@@ -81,7 +75,6 @@
|
||||
<path>{{datapathweb}}{{basename}}/subdefs</path>
|
||||
<mediatype>image</mediatype>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -91,7 +84,6 @@
|
||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||
<mediatype>flexpaper</mediatype>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl></baseurl>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
</subdef>
|
||||
@@ -102,7 +94,6 @@
|
||||
<dpi>72</dpi>
|
||||
<size>200</size>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -115,7 +106,6 @@
|
||||
<writeDatas>no</writeDatas>
|
||||
<method>resample</method>
|
||||
<dpi>72</dpi>
|
||||
<baseurl></baseurl>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
</subdef>
|
||||
@@ -125,7 +115,6 @@
|
||||
<writeDatas>no</writeDatas>
|
||||
<method>resample</method>
|
||||
<dpi>72</dpi>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
|
@@ -11,7 +11,6 @@
|
||||
<strip>no</strip>
|
||||
<quality>75</quality>
|
||||
<meta>yes</meta>
|
||||
<baseurl></baseurl>
|
||||
<mediatype>image</mediatype>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
@@ -25,7 +24,6 @@
|
||||
<quality>75</quality>
|
||||
<meta>no</meta>
|
||||
<mediatype>image</mediatype>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -36,7 +34,6 @@
|
||||
<size>800</size>
|
||||
<mediatype>video</mediatype>
|
||||
<writeDatas>yes</writeDatas>
|
||||
<baseurl></baseurl>
|
||||
<acodec>libfaac</acodec>
|
||||
<vcodec>libx264</vcodec>
|
||||
<bitrate>1000</bitrate>
|
||||
@@ -51,7 +48,6 @@
|
||||
<mediatype>gif</mediatype>
|
||||
<delay>500</delay>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Animation GIF</label>
|
||||
<label lang="en">GIF Animation</label>
|
||||
</subdef>
|
||||
@@ -60,7 +56,6 @@
|
||||
<size>200</size>
|
||||
<mediatype>image</mediatype>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -70,7 +65,6 @@
|
||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||
<mediatype>audio</mediatype>
|
||||
<writeDatas>yes</writeDatas>
|
||||
<baseurl></baseurl>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
</subdef>
|
||||
@@ -79,7 +73,6 @@
|
||||
<mediatype>image</mediatype>
|
||||
<size>200</size>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -89,7 +82,6 @@
|
||||
<path>{{datapathnoweb}}{{basename}}/subdefs</path>
|
||||
<mediatype>flexpaper</mediatype>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl></baseurl>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
</subdef>
|
||||
@@ -100,7 +92,6 @@
|
||||
<dpi>72</dpi>
|
||||
<size>200</size>
|
||||
<writeDatas>no</writeDatas>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
@@ -113,7 +104,6 @@
|
||||
<writeDatas>no</writeDatas>
|
||||
<method>resample</method>
|
||||
<dpi>72</dpi>
|
||||
<baseurl></baseurl>
|
||||
<label lang="fr">Prévisualisation</label>
|
||||
<label lang="en">Preview</label>
|
||||
</subdef>
|
||||
@@ -123,7 +113,6 @@
|
||||
<writeDatas>no</writeDatas>
|
||||
<method>resample</method>
|
||||
<dpi>72</dpi>
|
||||
<baseurl>{{dataurl}}/{{basename}}/subdefs</baseurl>
|
||||
<label lang="fr">Imagette</label>
|
||||
<label lang="en">Thumbnail</label>
|
||||
</subdef>
|
||||
|
@@ -243,15 +243,6 @@
|
||||
</tr>
|
||||
<tr>
|
||||
<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' %}
|
||||
</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/');
|
||||
$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());
|
||||
$content_disposition = explode(';', $response->headers->get('content-disposition'));
|
||||
$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_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/');
|
||||
$response = $this->client->getResponse();
|
||||
@@ -81,11 +73,7 @@ class ApplicationOverviewTest extends PhraseanetWebTestCaseAuthenticatedAbstract
|
||||
$crawler = $this->client->request('GET', $url);
|
||||
$response = $this->client->getResponse();
|
||||
|
||||
if (static::$records['record_1']->get_preview()->get_baseurl() !== '') {
|
||||
$this->assertEquals(302, $response->getStatusCode());
|
||||
} else {
|
||||
$this->assertEquals(200, $response->getStatusCode());
|
||||
}
|
||||
|
||||
$url = $url . 'view/';
|
||||
$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::getSubdefGroup
|
||||
* @covers databox_subdef::getSubdefType
|
||||
* @covers databox_subdef::get_baseurl
|
||||
* @covers databox_subdef::get_path
|
||||
* @covers databox_subdef::getSpecs
|
||||
* @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"?>
|
||||
<subdef class="preview" name="preview_api" downloadable="true">
|
||||
<path>/home/datas/noweb/db_alch_phrasea/subdefs/</path>
|
||||
<baseurl/>
|
||||
<meta>yes</meta>
|
||||
<mediatype>image</mediatype>
|
||||
<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('/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->assertEquals($type, $object->getSubdefGroup());
|
||||
|
||||
@@ -82,7 +79,6 @@ class databox_subdefTest extends PHPUnit_Framework_TestCase
|
||||
* @covers databox_subdef::get_labels
|
||||
* @covers databox_subdef::getSubdefGroup
|
||||
* @covers databox_subdef::getSubdefType
|
||||
* @covers databox_subdef::get_baseurl
|
||||
* @covers databox_subdef::get_path
|
||||
* @covers databox_subdef::getSpecs
|
||||
* @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"?>
|
||||
<subdef class="thumbnail" name="video_api" downloadable="false">
|
||||
<path>/home/datas/noweb/db_alch_phrasea/video/</path>
|
||||
<baseurl>/video/</baseurl>
|
||||
<meta>no</meta>
|
||||
<mediatype>video</mediatype>
|
||||
<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('/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->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"?>
|
||||
<subdef class="thumbnail" name="gifou" downloadable="false">
|
||||
<path>/home/datas/noweb/db_alch_phrasea/video/</path>
|
||||
<baseurl>web//db_alch_beta/subdefs/</baseurl>
|
||||
<meta>no</meta>
|
||||
<mediatype>gif</mediatype>
|
||||
<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());
|
||||
}
|
||||
|
||||
/**
|
||||
* @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
|
||||
*/
|
||||
|
Reference in New Issue
Block a user