mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-17 23:13:15 +00:00
Merge with 3.7
This commit is contained in:
@@ -142,6 +142,9 @@ Cache:
|
||||
xcache_cache:
|
||||
type: Cache\XcacheCache
|
||||
|
||||
wincache_cache:
|
||||
type: Cache\WinCacheCache
|
||||
|
||||
Border:
|
||||
#Define Border service
|
||||
#The border service handles checks validation constraints against incoming files
|
||||
|
71
lib/Alchemy/Phrasea/Cache/WinCacheCache.php
Normal file
71
lib/Alchemy/Phrasea/Cache/WinCacheCache.php
Normal file
@@ -0,0 +1,71 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Cache;
|
||||
|
||||
use Doctrine\Common\Cache\WincacheCache as DoctrineWinCache;
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class WinCacheCache extends DoctrineWinCache implements Cache
|
||||
{
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function getName()
|
||||
{
|
||||
return 'wincache';
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isServer()
|
||||
{
|
||||
return false;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function isOnline()
|
||||
{
|
||||
return true;
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function get($key)
|
||||
{
|
||||
if ( ! $this->contains($key)) {
|
||||
throw new Exception('Unable to retrieve the value');
|
||||
}
|
||||
|
||||
return $this->fetch($key);
|
||||
}
|
||||
|
||||
/**
|
||||
* {@inheritdoc}
|
||||
*/
|
||||
public function deleteMulti(array $keys)
|
||||
{
|
||||
foreach ($keys as $key) {
|
||||
$this->delete($key);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
}
|
@@ -13,6 +13,7 @@ namespace Alchemy\Phrasea\Command;
|
||||
|
||||
use Monolog\Handler\StreamHandler;
|
||||
use Alchemy\Phrasea\Command\Command;
|
||||
use Symfony\Component\HttpFoundation\File\Exception\FileNotFoundException;
|
||||
use Symfony\Component\Console\Input\InputInterface;
|
||||
use Symfony\Component\Console\Output\OutputInterface;
|
||||
|
||||
@@ -64,7 +65,7 @@ class BuildMissingSubdefs extends Command
|
||||
|
||||
try {
|
||||
$record->get_hd_file();
|
||||
} catch (\Exception_Media_SubdefNotFound $e) {
|
||||
} catch (FileNotFoundException $e) {
|
||||
continue;
|
||||
}
|
||||
|
||||
|
49
lib/Alchemy/Phrasea/Core/Service/Cache/WinCacheCache.php
Normal file
49
lib/Alchemy/Phrasea/Core/Service/Cache/WinCacheCache.php
Normal file
@@ -0,0 +1,49 @@
|
||||
<?php
|
||||
|
||||
/*
|
||||
* This file is part of Phraseanet
|
||||
*
|
||||
* (c) 2005-2012 Alchemy
|
||||
*
|
||||
* For the full copyright and license information, please view the LICENSE
|
||||
* file that was distributed with this source code.
|
||||
*/
|
||||
|
||||
namespace Alchemy\Phrasea\Core\Service\Cache;
|
||||
|
||||
use Alchemy\Phrasea\Core,
|
||||
Alchemy\Phrasea\Core\Service,
|
||||
Alchemy\Phrasea\Core\Service\ServiceAbstract,
|
||||
Alchemy\Phrasea\Core\Service\ServiceInterface,
|
||||
Alchemy\Phrasea\Cache as CacheDriver;
|
||||
|
||||
/**
|
||||
*
|
||||
* @license http://opensource.org/licenses/gpl-3.0 GPLv3
|
||||
* @link www.phraseanet.com
|
||||
*/
|
||||
class WinCacheCache extends ServiceAbstract
|
||||
{
|
||||
protected $cache;
|
||||
|
||||
public function getDriver()
|
||||
{
|
||||
if ( ! extension_loaded('wincache')) {
|
||||
throw new \Exception('The WinCache cache requires the WinCache extension.');
|
||||
}
|
||||
|
||||
if ( ! $this->cache) {
|
||||
$this->cache = new CacheDriver\WinCacheCache();
|
||||
|
||||
$this->cache->setNamespace(md5(realpath(__DIR__ . '/../../../../../../')));
|
||||
}
|
||||
|
||||
return $this->cache;
|
||||
}
|
||||
|
||||
public function getType()
|
||||
{
|
||||
return 'wincache';
|
||||
}
|
||||
}
|
||||
|
@@ -31,7 +31,7 @@ class Video extends Audio
|
||||
parent::__construct();
|
||||
|
||||
$this->registerOption(new OptionType\Range(_('GOP size'), self::OPTION_GOPSIZE, 1, 200, 25));
|
||||
$this->registerOption(new OptionType\Range(_('Dimension'), self::OPTION_SIZE, 100, 2000, 600, 16));
|
||||
$this->registerOption(new OptionType\Range(_('Dimension'), self::OPTION_SIZE, 64, 2000, 600, 16));
|
||||
$this->registerOption(new OptionType\Range(_('Frame Rate'), self::OPTION_FRAMERATE, 1, 200, 20));
|
||||
$this->registerOption(new OptionType\Enum(_('Video Codec'), self::OPTION_VCODEC, array('libx264', 'libvpx', 'libtheora'), 'libx264'));
|
||||
$this->unregisterOption(self::OPTION_ACODEC);
|
||||
|
@@ -1381,7 +1381,11 @@ class ACL implements cache_cacheableInterface
|
||||
|
||||
$this->give_access_to_base(array($base_id_dest));
|
||||
|
||||
$rights = array();
|
||||
$rights = array(
|
||||
'mask_and' => $row['mask_and'],
|
||||
'mask_xor' => $row['mask_xor'],
|
||||
);
|
||||
|
||||
if ($row['canputinalbum'])
|
||||
$rights['canputinalbum'] = true;
|
||||
if ($row['candwnldhd'])
|
||||
@@ -1415,6 +1419,14 @@ class ACL implements cache_cacheableInterface
|
||||
|
||||
$this->update_rights_to_base($base_id_dest, $rights);
|
||||
|
||||
if ($row['time_limited']) {
|
||||
$this->set_limits($base_id_dest, $row['time_limited'], new \DateTime($row['limited_from']), new \DateTime($row['limited_to']));
|
||||
}
|
||||
|
||||
if ($row['restrict_dwnld']) {
|
||||
$this->set_quotas_on_base($base_id_dest, $row['month_dwnld_max'], $row['remain_dwnld']);
|
||||
}
|
||||
|
||||
return $this;
|
||||
}
|
||||
|
||||
|
@@ -775,70 +775,11 @@ class searchEngine_adapter_phrasea_queryParser
|
||||
$this->proposals["BASES"]["b$bid"]["TERMS"][$path]["HTML"] = $prophtml;
|
||||
} else {
|
||||
// le mot n'est pas dans le thesaurus
|
||||
$tree = null;
|
||||
}
|
||||
|
||||
return($ambigus);
|
||||
}
|
||||
/*
|
||||
function dead_setTids(&$tree, &$simple, $bid, &$domthe, $searchsynonyms)
|
||||
{
|
||||
// if($this->debug)
|
||||
print("setTids:\n\$tree=" . var_export($tree, true) . "\n");
|
||||
|
||||
$ambigus = 0;
|
||||
if(is_array($w = $simple["VALUE"]))
|
||||
$t = $w = implode(" ", $w);
|
||||
|
||||
if (isset($tree["CONTEXT"])) {
|
||||
if (!$tree["CONTEXT"]) {
|
||||
$x0 = "@w=\"" . $w ."\" and not(@k)";
|
||||
} else {
|
||||
if ($tree["CONTEXT"]=="*") {
|
||||
$x0 = "@w=\"" . $w ."\"";
|
||||
} else {
|
||||
$x0 = "@w=\"" . $w ."\" and @k=\"" . $tree["CONTEXT"] . "\"";
|
||||
$t .= " (" . $tree["CONTEXT"] . ")";
|
||||
}
|
||||
}
|
||||
} else {
|
||||
$x0 = "@w=\"" . $w ."\"";
|
||||
}
|
||||
|
||||
$x = "/thesaurus//sy[" . $x0 ."]";
|
||||
|
||||
if($this->debug)
|
||||
printf("searching thesaurus with xpath='%s'<br/>\n", $x);
|
||||
|
||||
$dxp = new DOMXPath($domthe);
|
||||
$nodes = $dxp->query($x);
|
||||
|
||||
if(!isset($tree["RB"]["SREF"]["TIDS"]))
|
||||
$tree["RB"]["SREF"]["TIDS"] = array();
|
||||
if ($nodes->length >= 1) {
|
||||
if ($nodes->length == 1) {
|
||||
// on cherche un id simple, on utilisera la syntaxe sql 'like' (l'extension repérera elle méme la syntaxe car la value finira par '%')
|
||||
$this->addtoTIDS($tree["RB"], $bid, $nodes->item(0));
|
||||
// $this->thesaurusDOMNodes[] = $nodes->item(0);
|
||||
} else {
|
||||
// on cherche plusieurs id's, on utilisera la syntaxe 'regexp' (l'extension repérera elle meme la syntaxe car la value finira par '$')
|
||||
$val = "";
|
||||
foreach ($nodes as $node) {
|
||||
if(!isset($tree["CONTEXT"]))
|
||||
$ambigus++;
|
||||
$this->addtoTIDS($tree["RB"], $bid, $node);
|
||||
}
|
||||
}
|
||||
$path = $tree["RB"]["SREF"]["PATH"];
|
||||
$prophtml = "";
|
||||
$this->propAsHTML($domthe->documentElement, $prophtml, $path);
|
||||
$this->proposals["TERMS"][$path]["HTML"] = $prophtml;
|
||||
} else {
|
||||
// le mot n'est pas dans le thesaurus
|
||||
}
|
||||
|
||||
return($ambigus);
|
||||
}
|
||||
*/
|
||||
|
||||
public function containsColonOperator(&$tree)
|
||||
{
|
||||
|
@@ -105,7 +105,7 @@
|
||||
<input type="hidden" name="ssttid" value="{{ssttid}}"/>
|
||||
{% for name, values in download.get_display_download() %}
|
||||
{% if values.available > 0 %}
|
||||
<div style="margin: 10px 0 20px 0; padding: 0 10px;">
|
||||
<div class="well-small">
|
||||
<label for="download_{{name}}" class="checkbox">
|
||||
<input class="{{values.class}}" type="checkbox" id="download_{{name}}" name="obj[]" value="{{name}}" />
|
||||
<input type="hidden" name="download_{{name}}" value="{{values.size}}" />
|
||||
@@ -119,7 +119,7 @@
|
||||
{% endif %}
|
||||
</label>
|
||||
{% if values.refused|length > 0 %}
|
||||
<div style="display:none;" class="undisposable">
|
||||
<div style="display:none;" class="undisposable well-small">
|
||||
<div>{% trans 'Les documents ne peuvent pas etre exportes' %}</div>
|
||||
{% for datas in values.refused%}
|
||||
{{ thumbnail.format(datas, 80, 80,'', true, false) }}
|
||||
@@ -130,7 +130,7 @@
|
||||
{% endif %}
|
||||
{% endfor %}
|
||||
{% if download.has_business_fields_access() %}
|
||||
<div class="businessfields" style="margin-left:20px;display:none;">
|
||||
<div class="businessfields well-small" style="margin-left:20px;display:none;">
|
||||
<label for="business_download" class="checkbox">
|
||||
<input type="checkbox" name="businessfields" id="business_download" value="1" />
|
||||
{% trans 'Include Business-fields in caption' %}
|
||||
@@ -140,7 +140,7 @@
|
||||
{{ _self.choose_title('download', choose_export_title, default_export_title) }}
|
||||
|
||||
{% if registry.get('GV_requireTOUValidationForExport') == true %}
|
||||
<div style="margin:0 20px;">
|
||||
<div class="well-small">
|
||||
<label for="TOU_acceptDL" class="checkbox">
|
||||
<input type="checkbox" name="TOU_accept" id="TOU_acceptDL" value="1" />
|
||||
{% set beginning_link = '<a href="/prod/TOU/" class="TOUview">' %}
|
||||
|
@@ -613,6 +613,7 @@ var p4 = p4 || {};
|
||||
function(){
|
||||
answerSizer();
|
||||
linearize();
|
||||
$('#answers').trigger('resize');
|
||||
});
|
||||
frame.addClass('closed');
|
||||
$('.escamote', frame).hide();
|
||||
|
Reference in New Issue
Block a user