mirror of
https://github.com/alchemy-fr/Phraseanet.git
synced 2025-10-15 14:03:27 +00:00
fix recordutils_image::stamp signature
update doc block & fix some issues
This commit is contained in:
@@ -62,7 +62,7 @@ class Database implements ControllerProviderInterface
|
||||
*
|
||||
* name : admin_get_database
|
||||
*
|
||||
* description : Display admin dashboard
|
||||
* description : Get database informations
|
||||
*
|
||||
* method : GET
|
||||
*
|
||||
@@ -312,8 +312,6 @@ class Database implements ControllerProviderInterface
|
||||
->assert('databox_id', '\d+')
|
||||
->bind('admin_delete_database_logo');
|
||||
|
||||
return $controllers;
|
||||
|
||||
/**
|
||||
* Clear databox logs
|
||||
*
|
||||
@@ -544,7 +542,7 @@ class Database implements ControllerProviderInterface
|
||||
$registry = $app['phraseanet.core']['Registry'];
|
||||
|
||||
if ((null === $request->get('new_settings')) && (null !== $dataTemplate = $request->get('new_data_template'))) {
|
||||
try {
|
||||
|
||||
$configuration = Configuration::build();
|
||||
$choosenConnexion = $configuration->getPhraseanet()->get('database');
|
||||
$connexion = $configuration->getConnexion($choosenConnexion);
|
||||
@@ -555,7 +553,13 @@ class Database implements ControllerProviderInterface
|
||||
$password = $connexion->get('password');
|
||||
|
||||
$dataTemplate = new \SplFileInfo($registry->get('GV_RootPath') . 'lib/conf.d/data_templates/' . $dataTemplate . '.xml');
|
||||
|
||||
try {
|
||||
$connbas = new \connection_pdo('databox_creation', $hostname, $port, $user, $password, $dbName, array(), $registry);
|
||||
} catch (\PDOException $e) {
|
||||
|
||||
return $app->redirect('/admin/databases/?error=database-failed');
|
||||
}
|
||||
|
||||
try {
|
||||
$base = \databox::create($appbox, $connbas, $dataTemplate, $registry);
|
||||
@@ -566,10 +570,6 @@ class Database implements ControllerProviderInterface
|
||||
|
||||
return $app->redirect('/admin/databases/?error=base-failed');
|
||||
}
|
||||
} catch (\Exception $e) {
|
||||
|
||||
return $app->redirect('/admin/databases/?error=database-failed');
|
||||
}
|
||||
}
|
||||
|
||||
if (
|
||||
@@ -767,7 +767,7 @@ class Database implements ControllerProviderInterface
|
||||
* @param \Symfony\Component\HttpFoundation\Request $request
|
||||
* @param integer $databox_id
|
||||
*/
|
||||
public function clearLog(Application $app, Request $request, $databox_id)
|
||||
public function clearLogs(Application $app, Request $request, $databox_id)
|
||||
{
|
||||
if ( ! $request->isXmlHttpRequest() || ! array_key_exists($request->getMimeType('json'), array_flip($request->getAcceptableContentTypes()))) {
|
||||
$app->abort(400, _('Bad request format, only JSON is allowed'));
|
||||
@@ -829,7 +829,7 @@ class Database implements ControllerProviderInterface
|
||||
$app->abort(400, _('Bad request format, only JSON is allowed'));
|
||||
}
|
||||
|
||||
$message = _('Base empty successful');
|
||||
$message = _('An error occurred');
|
||||
$success = false;
|
||||
|
||||
try {
|
||||
@@ -838,6 +838,7 @@ class Database implements ControllerProviderInterface
|
||||
foreach ($databox->get_collections() as $collection) {
|
||||
if ($collection->get_record_amount() <= 500) {
|
||||
$collection->empty_collection(500);
|
||||
$message = _('Base empty successful');
|
||||
} else {
|
||||
$settings = "<?xml version=\"1.0\" encoding=\"UTF-8\"?><tasksettings><base_id>" . $collection->get_base_id() . "</base_id></tasksettings>";
|
||||
\task_abstract::create($app['phraseanet.appbox'], 'task_period_emptyColl', $settings);
|
||||
@@ -847,7 +848,7 @@ class Database implements ControllerProviderInterface
|
||||
|
||||
$success = true;
|
||||
} catch (\Exception $e) {
|
||||
$message = _('An error occurred');
|
||||
|
||||
}
|
||||
|
||||
return $app->json(array('success' => $success, 'message' => $message));
|
||||
|
@@ -69,7 +69,7 @@ class recordutils_image extends recordutils
|
||||
* @param boolean $hd
|
||||
* @return string
|
||||
*/
|
||||
public static function stamp(\media_subdef $subdef, $bas, $rec, $hd = false)
|
||||
public static function stamp(\media_subdef $subdef)
|
||||
{
|
||||
$appbox = appbox::get_instance(\bootstrap::getCore());
|
||||
$registry = $appbox->get_registry();
|
||||
@@ -119,7 +119,7 @@ class recordutils_image extends recordutils
|
||||
@unlink($pathOut);
|
||||
break;
|
||||
case 'RECORD_ID':
|
||||
$varval = $rec;
|
||||
$varval = $subdef->get_record()->get_record_id();
|
||||
break;
|
||||
}
|
||||
$n->parentNode->replaceChild($domprefs->createTextNode($varval), $n);
|
||||
|
Reference in New Issue
Block a user