mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-16 06:23:18 +00:00
Fix CS
This commit is contained in:
@@ -46,14 +46,14 @@ class H264MappingGenerator extends Command
|
|||||||
$factory = new H264Factory($this->container['monolog'], true, $type, $this->computeMapping($paths));
|
$factory = new H264Factory($this->container['monolog'], true, $type, $this->computeMapping($paths));
|
||||||
$mode = $factory->createMode(true);
|
$mode = $factory->createMode(true);
|
||||||
|
|
||||||
$currentConf = isset($this->container['phraseanet.configuration']['h264-pseudo-streaming']) ? $this->container['phraseanet.configuration']['h264-pseudo-streaming'] : array();
|
$currentConf = isset($this->container['phraseanet.configuration']['h264-pseudo-streaming']) ? $this->container['phraseanet.configuration']['h264-pseudo-streaming'] : [];
|
||||||
$currentMapping = (isset($currentConf['mapping']) && is_array($currentConf['mapping'])) ? $currentConf['mapping'] : array();
|
$currentMapping = (isset($currentConf['mapping']) && is_array($currentConf['mapping'])) ? $currentConf['mapping'] : [];
|
||||||
|
|
||||||
$conf = array(
|
$conf = [
|
||||||
'enabled' => $enabled,
|
'enabled' => $enabled,
|
||||||
'type' => $type,
|
'type' => $type,
|
||||||
'mapping' => array_replace_recursive($mode->getMapping(), $currentMapping),
|
'mapping' => array_replace_recursive($mode->getMapping(), $currentMapping),
|
||||||
);
|
];
|
||||||
|
|
||||||
if ($input->getOption('write')) {
|
if ($input->getOption('write')) {
|
||||||
$output->write("Writing configuration ...");
|
$output->write("Writing configuration ...");
|
||||||
@@ -64,7 +64,7 @@ class H264MappingGenerator extends Command
|
|||||||
} else {
|
} else {
|
||||||
$output->writeln("Configuration will <info>not</info> be written, use <info>--write</info> option to write it");
|
$output->writeln("Configuration will <info>not</info> be written, use <info>--write</info> option to write it");
|
||||||
$output->writeln("");
|
$output->writeln("");
|
||||||
$output->writeln(Yaml::dump(array('h264-pseudo-streaming' => $conf), 4));
|
$output->writeln(Yaml::dump(['h264-pseudo-streaming' => $conf], 4));
|
||||||
}
|
}
|
||||||
|
|
||||||
return 0;
|
return 0;
|
||||||
@@ -74,7 +74,7 @@ class H264MappingGenerator extends Command
|
|||||||
{
|
{
|
||||||
$paths = array_unique($paths);
|
$paths = array_unique($paths);
|
||||||
|
|
||||||
$ret = array();
|
$ret = [];
|
||||||
|
|
||||||
foreach ($paths as $path) {
|
foreach ($paths as $path) {
|
||||||
$ret[$path] = $this->pathsToConf($path);
|
$ret[$path] = $this->pathsToConf($path);
|
||||||
@@ -88,12 +88,12 @@ class H264MappingGenerator extends Command
|
|||||||
static $n = 0;
|
static $n = 0;
|
||||||
$n++;
|
$n++;
|
||||||
|
|
||||||
return array('mount-point' => 'mp4-videos-'.$n, 'directory' => $path, 'passphrase' => \random::generatePassword(32));
|
return ['mount-point' => 'mp4-videos-'.$n, 'directory' => $path, 'passphrase' => \random::generatePassword(32)];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function extractPath(\appbox $appbox)
|
private function extractPath(\appbox $appbox)
|
||||||
{
|
{
|
||||||
$paths = array();
|
$paths = [];
|
||||||
|
|
||||||
foreach ($appbox->get_databoxes() as $databox) {
|
foreach ($appbox->get_databoxes() as $databox) {
|
||||||
foreach ($databox->get_subdef_structure() as $group => $subdefs) {
|
foreach ($databox->get_subdef_structure() as $group => $subdefs) {
|
||||||
|
@@ -14,7 +14,6 @@ namespace Alchemy\Phrasea\Controller\Admin;
|
|||||||
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
use Alchemy\Phrasea\Exception\InvalidArgumentException;
|
||||||
use Alchemy\Phrasea\Form\TaskForm;
|
use Alchemy\Phrasea\Form\TaskForm;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Alchemy\Phrasea\TaskManager\TaskManagerStatus;
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
|
@@ -36,7 +36,6 @@ use Alchemy\Phrasea\Model\Entities\FeedItem;
|
|||||||
use Alchemy\Phrasea\Model\Entities\LazaretFile;
|
use Alchemy\Phrasea\Model\Entities\LazaretFile;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Alchemy\Phrasea\Model\Entities\UserQuery;
|
|
||||||
use Alchemy\Phrasea\Model\Entities\ValidationData;
|
use Alchemy\Phrasea\Model\Entities\ValidationData;
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
||||||
@@ -2093,7 +2092,7 @@ class V1 implements ControllerProviderInterface
|
|||||||
break;
|
break;
|
||||||
}
|
}
|
||||||
|
|
||||||
return array(
|
return [
|
||||||
'@entity@' => self::OBJECT_TYPE_USER,
|
'@entity@' => self::OBJECT_TYPE_USER,
|
||||||
'id' => $user->getId(),
|
'id' => $user->getId(),
|
||||||
'email' => $user->getEmail() ?: null,
|
'email' => $user->getEmail() ?: null,
|
||||||
@@ -2116,7 +2115,7 @@ class V1 implements ControllerProviderInterface
|
|||||||
'created_on' => $user->getCreated() ? $user->getCreated()->format(DATE_ATOM) : null,
|
'created_on' => $user->getCreated() ? $user->getCreated()->format(DATE_ATOM) : null,
|
||||||
'updated_on' => $user->getUpdated() ? $user->getUpdated()->format(DATE_ATOM) : null,
|
'updated_on' => $user->getUpdated() ? $user->getUpdated()->format(DATE_ATOM) : null,
|
||||||
'locale' => $user->getLocale() ?: null,
|
'locale' => $user->getLocale() ?: null,
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function logout(Application $app)
|
private function logout(Application $app)
|
||||||
|
@@ -14,7 +14,6 @@ namespace Alchemy\Phrasea\Controller\Client;
|
|||||||
use Alchemy\Phrasea\Feed\Aggregate;
|
use Alchemy\Phrasea\Feed\Aggregate;
|
||||||
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
|
use Alchemy\Phrasea\SearchEngine\SearchEngineOptions;
|
||||||
use Alchemy\Phrasea\Exception\SessionNotFound;
|
use Alchemy\Phrasea\Exception\SessionNotFound;
|
||||||
use Alchemy\Phrasea\Model\Entities\UserQuery;
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\Finder\Finder;
|
use Symfony\Component\Finder\Finder;
|
||||||
|
@@ -20,7 +20,6 @@ use Silex\ControllerProviderInterface;
|
|||||||
use Silex\Application as SilexApplication;
|
use Silex\Application as SilexApplication;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
||||||
|
|
||||||
class Lightbox implements ControllerProviderInterface
|
class Lightbox implements ControllerProviderInterface
|
||||||
{
|
{
|
||||||
|
@@ -17,7 +17,6 @@ use Silex\Application;
|
|||||||
use Silex\ControllerProviderInterface;
|
use Silex\ControllerProviderInterface;
|
||||||
use Symfony\Component\HttpFoundation\Request;
|
use Symfony\Component\HttpFoundation\Request;
|
||||||
use Symfony\Component\HttpFoundation\Response;
|
use Symfony\Component\HttpFoundation\Response;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
||||||
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
|
use Symfony\Component\HttpKernel\Event\PostResponseEvent;
|
||||||
use Symfony\Component\HttpKernel\KernelEvents;
|
use Symfony\Component\HttpKernel\KernelEvents;
|
||||||
|
|
||||||
|
@@ -82,29 +82,29 @@ class Root implements ControllerProviderInterface
|
|||||||
|
|
||||||
$dashboard->execute();
|
$dashboard->execute();
|
||||||
|
|
||||||
return $app->json(array('html' => $app['twig']->render('report/ajax_dashboard_content_child.html.twig', array(
|
return $app->json(['html' => $app['twig']->render('report/ajax_dashboard_content_child.html.twig', [
|
||||||
'dashboard' => $dashboard
|
'dashboard' => $dashboard
|
||||||
))));
|
])]);
|
||||||
}
|
}
|
||||||
|
|
||||||
$granted = array();
|
$granted = [];
|
||||||
|
|
||||||
foreach($app['acl']->get($app['authentication']->getUser())->get_granted_base(array('canreport')) as $collection) {
|
foreach ($app['acl']->get($app['authentication']->getUser())->get_granted_base(['canreport']) as $collection) {
|
||||||
if (!isset($granted[$collection->get_sbas_id()])) {
|
if (!isset($granted[$collection->get_sbas_id()])) {
|
||||||
$granted[$collection->get_sbas_id()] = array(
|
$granted[$collection->get_sbas_id()] = [
|
||||||
'id' => $collection->get_sbas_id(),
|
'id' => $collection->get_sbas_id(),
|
||||||
'name' => $collection->get_databox()->get_viewname(),
|
'name' => $collection->get_databox()->get_viewname(),
|
||||||
'collections' => array()
|
'collections' => []
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
$granted[$collection->get_sbas_id()]['collections'][] = array(
|
$granted[$collection->get_sbas_id()]['collections'][] = [
|
||||||
'id' => $collection->get_coll_id(),
|
'id' => $collection->get_coll_id(),
|
||||||
'base_id' => $collection->get_base_id(),
|
'base_id' => $collection->get_base_id(),
|
||||||
'name' => $collection->get_name()
|
'name' => $collection->get_name()
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
return $app['twig']->render('report/report_layout_child.html.twig', array(
|
return $app['twig']->render('report/report_layout_child.html.twig', [
|
||||||
'ajax_dash' => true,
|
'ajax_dash' => true,
|
||||||
'dashboard' => null,
|
'dashboard' => null,
|
||||||
'granted_bases' => $granted,
|
'granted_bases' => $granted,
|
||||||
@@ -115,7 +115,7 @@ class Root implements ControllerProviderInterface
|
|||||||
'g_anal' => $app['conf']->get(['registry', 'general', 'analytics']),
|
'g_anal' => $app['conf']->get(['registry', 'general', 'analytics']),
|
||||||
'ajax' => false,
|
'ajax' => false,
|
||||||
'ajax_chart' => false
|
'ajax_chart' => false
|
||||||
));
|
]);
|
||||||
}
|
}
|
||||||
|
|
||||||
/**
|
/**
|
||||||
|
@@ -420,6 +420,7 @@ class Xmlhttp implements ControllerProviderInterface
|
|||||||
|
|
||||||
$data[] = $presetData;
|
$data[] = $presetData;
|
||||||
}
|
}
|
||||||
|
|
||||||
return $app['twig']->render('thesaurus/presets.html.twig', ['presets' => $data]);
|
return $app['twig']->render('thesaurus/presets.html.twig', ['presets' => $data]);
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -31,7 +31,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function prepare($prepareString)
|
public function prepare($prepareString)
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -39,7 +39,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function query()
|
public function query()
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -47,7 +47,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function quote($input, $type=\PDO::PARAM_STR)
|
public function quote($input, $type=\PDO::PARAM_STR)
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -55,7 +55,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function exec($statement)
|
public function exec($statement)
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -63,7 +63,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function lastInsertId($name = null)
|
public function lastInsertId($name = null)
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -71,7 +71,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function beginTransaction()
|
public function beginTransaction()
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -79,7 +79,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function commit()
|
public function commit()
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -87,7 +87,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function rollBack()
|
public function rollBack()
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -95,7 +95,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function errorCode()
|
public function errorCode()
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
@@ -103,7 +103,7 @@ class ReconnectableConnection implements ConnectionInterface
|
|||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
*/
|
*/
|
||||||
function errorInfo()
|
public function errorInfo()
|
||||||
{
|
{
|
||||||
return $this->tryMethod(__FUNCTION__, func_get_args());
|
return $this->tryMethod(__FUNCTION__, func_get_args());
|
||||||
}
|
}
|
||||||
|
@@ -23,7 +23,6 @@ use Alchemy\Phrasea\Authentication\Phrasea\NativeAuthentication;
|
|||||||
use Alchemy\Phrasea\Authentication\Phrasea\OldPasswordEncoder;
|
use Alchemy\Phrasea\Authentication\Phrasea\OldPasswordEncoder;
|
||||||
use Alchemy\Phrasea\Authentication\Phrasea\PasswordEncoder;
|
use Alchemy\Phrasea\Authentication\Phrasea\PasswordEncoder;
|
||||||
use Alchemy\Phrasea\Authentication\SuggestionFinder;
|
use Alchemy\Phrasea\Authentication\SuggestionFinder;
|
||||||
use Alchemy\Phrasea\Authentication\Token\TokenValidator;
|
|
||||||
use Silex\Application;
|
use Silex\Application;
|
||||||
use Silex\ServiceProviderInterface;
|
use Silex\ServiceProviderInterface;
|
||||||
use Alchemy\Phrasea\Core\Event\Subscriber\PersistentCookieSubscriber;
|
use Alchemy\Phrasea\Core\Event\Subscriber\PersistentCookieSubscriber;
|
||||||
|
@@ -15,7 +15,6 @@ use Alchemy\Phrasea\Application;
|
|||||||
use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
|
use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
use Symfony\Component\Validator\Constraint;
|
use Symfony\Component\Validator\Constraint;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
||||||
|
|
||||||
class PasswordToken extends Constraint
|
class PasswordToken extends Constraint
|
||||||
{
|
{
|
||||||
|
@@ -24,7 +24,7 @@ class Apache extends AbstractServerMode implements H264Interface
|
|||||||
*/
|
*/
|
||||||
public function setMapping(array $mapping)
|
public function setMapping(array $mapping)
|
||||||
{
|
{
|
||||||
$final = array();
|
$final = [];
|
||||||
|
|
||||||
foreach ($mapping as $key => $entry) {
|
foreach ($mapping as $key => $entry) {
|
||||||
if (!is_array($entry)) {
|
if (!is_array($entry)) {
|
||||||
@@ -47,11 +47,11 @@ class Apache extends AbstractServerMode implements H264Interface
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$final[$key] = array(
|
$final[$key] = [
|
||||||
'directory' => $this->sanitizePath(realpath($entry['directory'])),
|
'directory' => $this->sanitizePath(realpath($entry['directory'])),
|
||||||
'mount-point' => $this->sanitizeMountPoint($entry['mount-point']),
|
'mount-point' => $this->sanitizeMountPoint($entry['mount-point']),
|
||||||
'passphrase' => trim($entry['passphrase']),
|
'passphrase' => trim($entry['passphrase']),
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mapping = $final;
|
$this->mapping = $final;
|
||||||
|
@@ -78,7 +78,7 @@ class H264Factory
|
|||||||
{
|
{
|
||||||
$conf = $app['phraseanet.configuration']['h264-pseudo-streaming'];
|
$conf = $app['phraseanet.configuration']['h264-pseudo-streaming'];
|
||||||
|
|
||||||
$mapping = array();
|
$mapping = [];
|
||||||
|
|
||||||
if (isset($conf['mapping'])) {
|
if (isset($conf['mapping'])) {
|
||||||
$mapping = $conf['mapping'];
|
$mapping = $conf['mapping'];
|
||||||
|
@@ -24,7 +24,7 @@ class Nginx extends AbstractServerMode implements H264Interface
|
|||||||
*/
|
*/
|
||||||
public function setMapping(array $mapping)
|
public function setMapping(array $mapping)
|
||||||
{
|
{
|
||||||
$final = array();
|
$final = [];
|
||||||
|
|
||||||
foreach ($mapping as $key => $entry) {
|
foreach ($mapping as $key => $entry) {
|
||||||
if (!is_array($entry)) {
|
if (!is_array($entry)) {
|
||||||
@@ -47,11 +47,11 @@ class Nginx extends AbstractServerMode implements H264Interface
|
|||||||
continue;
|
continue;
|
||||||
}
|
}
|
||||||
|
|
||||||
$final[$key] = array(
|
$final[$key] = [
|
||||||
'directory' => $this->sanitizePath(realpath($entry['directory'])),
|
'directory' => $this->sanitizePath(realpath($entry['directory'])),
|
||||||
'mount-point' => $this->sanitizeMountPoint($entry['mount-point']),
|
'mount-point' => $this->sanitizeMountPoint($entry['mount-point']),
|
||||||
'passphrase' => trim($entry['passphrase']),
|
'passphrase' => trim($entry['passphrase']),
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
$this->mapping = $final;
|
$this->mapping = $final;
|
||||||
@@ -107,7 +107,7 @@ class Nginx extends AbstractServerMode implements H264Interface
|
|||||||
$path = $entry['mount-point'].substr($pathfile, strlen($entry['directory']));
|
$path = $entry['mount-point'].substr($pathfile, strlen($entry['directory']));
|
||||||
$expire = time() + 3600; // At which point in time the file should expire. time() + x; would be the usual usage.
|
$expire = time() + 3600; // At which point in time the file should expire. time() + x; would be the usual usage.
|
||||||
|
|
||||||
$hash = str_replace(array('+', '/', '='), array('-', '_', ''), base64_encode(md5($expire.$path.' '.$entry['passphrase'], true)));
|
$hash = str_replace(['+', '/', '='], ['-', '_', ''], base64_encode(md5($expire.$path.' '.$entry['passphrase'], true)));
|
||||||
|
|
||||||
return Url::factory($path.'?hash='.$hash.'&expires='.$expire);
|
return Url::factory($path.'?hash='.$hash.'&expires='.$expire);
|
||||||
}
|
}
|
||||||
|
@@ -17,7 +17,6 @@ use Alchemy\Phrasea\Model\Entities\Token;
|
|||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Alchemy\Phrasea\Model\Repositories\TokenRepository;
|
use Alchemy\Phrasea\Model\Repositories\TokenRepository;
|
||||||
use Doctrine\Common\Persistence\ObjectManager;
|
use Doctrine\Common\Persistence\ObjectManager;
|
||||||
use Doctrine\ORM\Query;
|
|
||||||
use RandomLib\Generator;
|
use RandomLib\Generator;
|
||||||
|
|
||||||
class TokenManipulator implements ManipulatorInterface
|
class TokenManipulator implements ManipulatorInterface
|
||||||
|
@@ -4,7 +4,6 @@ namespace Alchemy\Phrasea\Model\Repositories;
|
|||||||
|
|
||||||
use Alchemy\Phrasea\Model\Entities\Basket;
|
use Alchemy\Phrasea\Model\Entities\Basket;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Alchemy\Phrasea\Model\Entities\ValidationParticipant;
|
|
||||||
use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
|
use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
|
||||||
use Doctrine\ORM\EntityRepository;
|
use Doctrine\ORM\EntityRepository;
|
||||||
|
|
||||||
|
@@ -11,7 +11,6 @@
|
|||||||
|
|
||||||
namespace Alchemy\Phrasea\Model\Types;
|
namespace Alchemy\Phrasea\Model\Types;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Exception\RuntimeException;
|
|
||||||
use Doctrine\DBAL\Types\Type;
|
use Doctrine\DBAL\Types\Type;
|
||||||
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
use Doctrine\DBAL\Platforms\AbstractPlatform;
|
||||||
|
|
||||||
|
@@ -12,11 +12,8 @@
|
|||||||
namespace Alchemy\Phrasea\Setup\Version\PreSchemaUpgrade;
|
namespace Alchemy\Phrasea\Setup\Version\PreSchemaUpgrade;
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
|
||||||
use Alchemy\Phrasea\Model\Entities\FtpCredential;
|
|
||||||
use Doctrine\DBAL\Migrations\Configuration\Configuration;
|
use Doctrine\DBAL\Migrations\Configuration\Configuration;
|
||||||
use Doctrine\ORM\EntityManager;
|
use Doctrine\ORM\EntityManager;
|
||||||
use Doctrine\ORM\NoResultException;
|
|
||||||
use Doctrine\ORM\Query;
|
use Doctrine\ORM\Query;
|
||||||
use Doctrine\ORM\Query\ResultSetMapping;
|
use Doctrine\ORM\Query\ResultSetMapping;
|
||||||
|
|
||||||
|
@@ -17,7 +17,7 @@ class patch_384alpha1a implements patchInterface
|
|||||||
private $release = '3.8.4-alpha.1';
|
private $release = '3.8.4-alpha.1';
|
||||||
|
|
||||||
/** @var array */
|
/** @var array */
|
||||||
private $concern = array(base::APPLICATION_BOX);
|
private $concern = [base::APPLICATION_BOX];
|
||||||
|
|
||||||
/**
|
/**
|
||||||
* {@inheritdoc}
|
* {@inheritdoc}
|
||||||
@@ -58,11 +58,11 @@ class patch_384alpha1a implements patchInterface
|
|||||||
{
|
{
|
||||||
$config = $app['phraseanet.configuration']->getConfig();
|
$config = $app['phraseanet.configuration']->getConfig();
|
||||||
|
|
||||||
$config['h264-pseudo-streaming'] = array(
|
$config['h264-pseudo-streaming'] = [
|
||||||
'enabled' => false,
|
'enabled' => false,
|
||||||
'type' => null,
|
'type' => null,
|
||||||
'mapping' => array(),
|
'mapping' => [],
|
||||||
);
|
];
|
||||||
|
|
||||||
$app['phraseanet.configuration']->setConfig($config);
|
$app['phraseanet.configuration']->setConfig($config);
|
||||||
|
|
||||||
|
@@ -10,8 +10,6 @@
|
|||||||
*/
|
*/
|
||||||
|
|
||||||
use Alchemy\Phrasea\Application;
|
use Alchemy\Phrasea\Application;
|
||||||
use Alchemy\Phrasea\Model\Entities\Preset;
|
|
||||||
use Gedmo\Timestampable\TimestampableListener;
|
|
||||||
|
|
||||||
class patch_390alpha18a extends patchAbstract
|
class patch_390alpha18a extends patchAbstract
|
||||||
{
|
{
|
||||||
|
@@ -16,7 +16,6 @@ use Doctrine\ORM\Query;
|
|||||||
use Doctrine\ORM\NoResultException;
|
use Doctrine\ORM\NoResultException;
|
||||||
use Gedmo\Timestampable\TimestampableListener;
|
use Gedmo\Timestampable\TimestampableListener;
|
||||||
|
|
||||||
|
|
||||||
class patch_390alpha1a extends patchAbstract
|
class patch_390alpha1a extends patchAbstract
|
||||||
{
|
{
|
||||||
/** @var string */
|
/** @var string */
|
||||||
|
@@ -25,6 +25,7 @@ class DataboxTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
if (!self::$createdCollections) {
|
if (!self::$createdCollections) {
|
||||||
parent::tearDown();
|
parent::tearDown();
|
||||||
|
|
||||||
return;
|
return;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@@ -8,7 +8,6 @@ use Alchemy\Phrasea\Controller\Api\V1;
|
|||||||
use Alchemy\Phrasea\Core\PhraseaEvents;
|
use Alchemy\Phrasea\Core\PhraseaEvents;
|
||||||
use Alchemy\Phrasea\Authentication\Context;
|
use Alchemy\Phrasea\Authentication\Context;
|
||||||
use Alchemy\Phrasea\Model\Entities\Task;
|
use Alchemy\Phrasea\Model\Entities\Task;
|
||||||
use Alchemy\Phrasea\Model\Entities\LazaretSession;
|
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use Doctrine\Common\Collections\ArrayCollection;
|
use Doctrine\Common\Collections\ArrayCollection;
|
||||||
use Guzzle\Common\Exception\GuzzleException;
|
use Guzzle\Common\Exception\GuzzleException;
|
||||||
@@ -1783,9 +1782,9 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
$route = '/api/v1/me/';
|
$route = '/api/v1/me/';
|
||||||
|
|
||||||
$this->evaluateMethodNotAllowedRoute($route, array('POST', 'PUT', 'DELETE'));
|
$this->evaluateMethodNotAllowedRoute($route, ['POST', 'PUT', 'DELETE']);
|
||||||
|
|
||||||
self::$DI['client']->request('GET', $route, $this->getParameters(), array(), array('HTTP_Accept' => $this->getAcceptMimeType()));
|
self::$DI['client']->request('GET', $route, $this->getParameters(), [], ['HTTP_Accept' => $this->getAcceptMimeType()]);
|
||||||
$content = $this->unserialize(self::$DI['client']->getResponse()->getContent());
|
$content = $this->unserialize(self::$DI['client']->getResponse()->getContent());
|
||||||
|
|
||||||
$this->assertArrayHasKey('user', $content['response']);
|
$this->assertArrayHasKey('user', $content['response']);
|
||||||
@@ -1795,7 +1794,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
|
|
||||||
protected function evaluateGoodUserItem($data, User $user)
|
protected function evaluateGoodUserItem($data, User $user)
|
||||||
{
|
{
|
||||||
foreach (array(
|
foreach ([
|
||||||
'@entity@' => V1::OBJECT_TYPE_USER,
|
'@entity@' => V1::OBJECT_TYPE_USER,
|
||||||
'id' => $user->getId(),
|
'id' => $user->getId(),
|
||||||
'email' => $user->getEmail() ?: null,
|
'email' => $user->getEmail() ?: null,
|
||||||
@@ -1817,7 +1816,7 @@ abstract class ApiTestCase extends \PhraseanetWebTestCase
|
|||||||
'created_on' => $user->getCreated() ? $user->getCreated()->format(DATE_ATOM) : null,
|
'created_on' => $user->getCreated() ? $user->getCreated()->format(DATE_ATOM) : null,
|
||||||
'updated_on' => $user->getUpdated() ? $user->getUpdated()->format(DATE_ATOM) : null,
|
'updated_on' => $user->getUpdated() ? $user->getUpdated()->format(DATE_ATOM) : null,
|
||||||
'locale' => $user->getLocale() ?: null,
|
'locale' => $user->getLocale() ?: null,
|
||||||
) as $key => $value) {
|
] as $key => $value) {
|
||||||
$this->assertArrayHasKey($key, $data, 'Assert key is present '.$key);
|
$this->assertArrayHasKey($key, $data, 'Assert key is present '.$key);
|
||||||
if ($value) {
|
if ($value) {
|
||||||
$this->assertEquals($value, $data[$key], 'Check key '.$key);
|
$this->assertEquals($value, $data[$key], 'Check key '.$key);
|
||||||
|
@@ -28,10 +28,10 @@ class RootTest extends \PhraseanetAuthenticatedWebTestCase
|
|||||||
{
|
{
|
||||||
$this->authenticate(self::$DI['app']);
|
$this->authenticate(self::$DI['app']);
|
||||||
|
|
||||||
$this->XMLHTTPRequest('GET', '/report/dashboard', array(
|
$this->XMLHTTPRequest('GET', '/report/dashboard', [
|
||||||
'dmin' => $this->dmin->format('Y-m-d'),
|
'dmin' => $this->dmin->format('Y-m-d'),
|
||||||
'dmax' => $this->dmin->format('Y-m-d'),
|
'dmax' => $this->dmin->format('Y-m-d'),
|
||||||
));
|
]);
|
||||||
|
|
||||||
$response = self::$DI['client']->getResponse();
|
$response = self::$DI['client']->getResponse();
|
||||||
|
|
||||||
|
@@ -6,7 +6,6 @@ use Alchemy\Phrasea\Application;
|
|||||||
use Alchemy\Phrasea\Model\Entities\Registration;
|
use Alchemy\Phrasea\Model\Entities\Registration;
|
||||||
use Alchemy\Phrasea\Model\Entities\User;
|
use Alchemy\Phrasea\Model\Entities\User;
|
||||||
use RandomLib\Factory;
|
use RandomLib\Factory;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
||||||
|
|
||||||
class AccountTest extends \PhraseanetAuthenticatedWebTestCase
|
class AccountTest extends \PhraseanetAuthenticatedWebTestCase
|
||||||
{
|
{
|
||||||
|
@@ -5,7 +5,6 @@ namespace Alchemy\Tests\Phrasea\Form\Constraint;
|
|||||||
use Alchemy\Phrasea\Form\Constraint\PasswordToken;
|
use Alchemy\Phrasea\Form\Constraint\PasswordToken;
|
||||||
use Alchemy\Phrasea\Model\Entities\Token;
|
use Alchemy\Phrasea\Model\Entities\Token;
|
||||||
use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
|
use Alchemy\Phrasea\Model\Manipulator\TokenManipulator;
|
||||||
use Symfony\Component\HttpKernel\Exception\NotFoundHttpException;
|
|
||||||
|
|
||||||
class PasswordTokenTest extends \PhraseanetTestCase
|
class PasswordTokenTest extends \PhraseanetTestCase
|
||||||
{
|
{
|
||||||
|
@@ -31,16 +31,16 @@ class ApacheTest extends \PhraseanetTestCase
|
|||||||
touch($file);
|
touch($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapping = array(array(
|
$mapping = [[
|
||||||
'directory' => $dir,
|
'directory' => $dir,
|
||||||
'mount-point' => 'mp4-videos',
|
'mount-point' => 'mp4-videos',
|
||||||
'passphrase' => '123456',
|
'passphrase' => '123456',
|
||||||
));
|
]];
|
||||||
|
|
||||||
return array(
|
return [
|
||||||
array(array(), null, '/path/to/file'),
|
[[], null, '/path/to/file'],
|
||||||
array($mapping, null, '/path/to/file'),
|
[$mapping, null, '/path/to/file'],
|
||||||
array($mapping, '/^\/mp4-videos\/[a-zA-Z0-9]+\/[0-9a-f]+\/to\/file$/', $file),
|
[$mapping, '/^\/mp4-videos\/[a-zA-Z0-9]+\/[0-9a-f]+\/to\/file$/', $file],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -66,19 +66,19 @@ class H264FactoryTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
public function provideTypes()
|
public function provideTypes()
|
||||||
{
|
{
|
||||||
return array(
|
return [
|
||||||
array('nginx', $this->getNginxMapping(), 'Alchemy\Phrasea\Http\H264PseudoStreaming\Nginx'),
|
['nginx', $this->getNginxMapping(), 'Alchemy\Phrasea\Http\H264PseudoStreaming\Nginx'],
|
||||||
array('apache', $this->getNginxMapping(), 'Alchemy\Phrasea\Http\H264PseudoStreaming\Apache'),
|
['apache', $this->getNginxMapping(), 'Alchemy\Phrasea\Http\H264PseudoStreaming\Apache'],
|
||||||
array('apache2', $this->getNginxMapping(), 'Alchemy\Phrasea\Http\H264PseudoStreaming\Apache'),
|
['apache2', $this->getNginxMapping(), 'Alchemy\Phrasea\Http\H264PseudoStreaming\Apache'],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
|
|
||||||
private function getNginxMapping()
|
private function getNginxMapping()
|
||||||
{
|
{
|
||||||
return array(array(
|
return [[
|
||||||
'directory' => __DIR__ . '/../../../../files/',
|
'directory' => __DIR__ . '/../../../../files/',
|
||||||
'mount-point' => '/protected/',
|
'mount-point' => '/protected/',
|
||||||
'passphrase' => 'dfdskqhfsfilddsmfmqsdmlfomqs',
|
'passphrase' => 'dfdskqhfsfilddsmfmqsdmlfomqs',
|
||||||
));
|
]];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -31,16 +31,16 @@ class NginxTest extends \PhraseanetTestCase
|
|||||||
touch($file);
|
touch($file);
|
||||||
}
|
}
|
||||||
|
|
||||||
$mapping = array(array(
|
$mapping = [[
|
||||||
'directory' => $dir,
|
'directory' => $dir,
|
||||||
'mount-point' => 'mp4-videos',
|
'mount-point' => 'mp4-videos',
|
||||||
'passphrase' => '123456',
|
'passphrase' => '123456',
|
||||||
));
|
]];
|
||||||
|
|
||||||
return array(
|
return [
|
||||||
array(array(), null, '/path/to/file'),
|
[[], null, '/path/to/file'],
|
||||||
array($mapping, null, '/path/to/file'),
|
[$mapping, null, '/path/to/file'],
|
||||||
array($mapping, '/^\/mp4-videos\/to\/file\?hash=[a-zA-Z0-9-_+]+&expires=[0-9]+/', $file),
|
[$mapping, '/^\/mp4-videos\/to\/file\?hash=[a-zA-Z0-9-_+]+&expires=[0-9]+/', $file],
|
||||||
);
|
];
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
@@ -88,7 +88,7 @@ class TokenManipulatorTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
public function testCreateDownloadToken()
|
public function testCreateDownloadToken()
|
||||||
{
|
{
|
||||||
$data = serialize(array('some' => 'data'));
|
$data = serialize(['some' => 'data']);
|
||||||
$manipulator = new TokenManipulator(self::$DI['app']['EM'], self::$DI['app']['random.low'], self::$DI['app']['repo.tokens']);
|
$manipulator = new TokenManipulator(self::$DI['app']['EM'], self::$DI['app']['random.low'], self::$DI['app']['repo.tokens']);
|
||||||
$token = $manipulator->createDownloadToken(self::$DI['user'], $data);
|
$token = $manipulator->createDownloadToken(self::$DI['user'], $data);
|
||||||
|
|
||||||
@@ -100,7 +100,7 @@ class TokenManipulatorTest extends \PhraseanetTestCase
|
|||||||
|
|
||||||
public function testCreateEmailExportToken()
|
public function testCreateEmailExportToken()
|
||||||
{
|
{
|
||||||
$data = serialize(array('some' => 'data'));
|
$data = serialize(['some' => 'data']);
|
||||||
$manipulator = new TokenManipulator(self::$DI['app']['EM'], self::$DI['app']['random.low'], self::$DI['app']['repo.tokens']);
|
$manipulator = new TokenManipulator(self::$DI['app']['EM'], self::$DI['app']['random.low'], self::$DI['app']['repo.tokens']);
|
||||||
$token = $manipulator->createEmailExportToken($data);
|
$token = $manipulator->createEmailExportToken($data);
|
||||||
|
|
||||||
|
Reference in New Issue
Block a user